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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7be1382a89587af29b3332d2ac194f029c49105
| 98
|
py
|
Python
|
src/Utils/__init__.py
|
LukasHaas/cs329s-covid-prediction
|
bd73935e1141e72f005389013ba2fa772657b53f
|
[
"MIT"
] | 8
|
2021-06-09T04:56:53.000Z
|
2022-03-10T17:13:17.000Z
|
src/Utils/__init__.py
|
LukasHaas/cs329s-covid-prediction
|
bd73935e1141e72f005389013ba2fa772657b53f
|
[
"MIT"
] | null | null | null |
src/Utils/__init__.py
|
LukasHaas/cs329s-covid-prediction
|
bd73935e1141e72f005389013ba2fa772657b53f
|
[
"MIT"
] | 3
|
2021-05-28T01:10:07.000Z
|
2021-11-20T13:47:44.000Z
|
from .Utils import upload_blob
from .Utils import segment_cough
from .Utils import normalize_audio
| 32.666667
| 34
| 0.857143
| 15
| 98
| 5.4
| 0.6
| 0.333333
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112245
| 98
| 3
| 34
| 32.666667
| 0.931034
| 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
|
e7c0680f5c4a0ad223ac2cd4e2b199792afda1d0
| 74
|
py
|
Python
|
project/__init__.py
|
dilettacal/nmt_seq2seq_evo
|
1de7647fb50445d17aa0eab8f300fdcbe6b8145e
|
[
"MIT"
] | null | null | null |
project/__init__.py
|
dilettacal/nmt_seq2seq_evo
|
1de7647fb50445d17aa0eab8f300fdcbe6b8145e
|
[
"MIT"
] | null | null | null |
project/__init__.py
|
dilettacal/nmt_seq2seq_evo
|
1de7647fb50445d17aa0eab8f300fdcbe6b8145e
|
[
"MIT"
] | null | null | null |
from .model import *
from .utils import *
from .utils.external import *
| 12.333333
| 29
| 0.716216
| 10
| 74
| 5.3
| 0.5
| 0.377358
| 0.566038
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189189
| 74
| 5
| 30
| 14.8
| 0.883333
| 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
|
99db6c98b1d15c074ce87f2324f7a378f226fa11
| 3,498
|
py
|
Python
|
download_model.py
|
WiNE-iNEFF/ruGPT-TEST
|
68bb22cb3415035a133f9162f766eb7cb4122f40
|
[
"MIT"
] | null | null | null |
download_model.py
|
WiNE-iNEFF/ruGPT-TEST
|
68bb22cb3415035a133f9162f766eb7cb4122f40
|
[
"MIT"
] | null | null | null |
download_model.py
|
WiNE-iNEFF/ruGPT-TEST
|
68bb22cb3415035a133f9162f766eb7cb4122f40
|
[
"MIT"
] | null | null | null |
import os
import sys
import requests
import wget
from tqdm import tqdm
if len(sys.argv) != 2:
print('You must enter the model name as a parameter, e.g.: download_model.py 117M')
sys.exit(1)
if sys.argv[1] == '117M':
model = sys.argv[1]
subdir = os.path.join('models', model)
if not os.path.exists(subdir):
os.makedirs(subdir)
os.chdir(subdir)
# wget.download('https://docs.google.com/uc?export=download&id=16xNiQZenM-rhVVPox9oepthwreIEW2Lm') #hparams.json
# wget.download('https://docs.google.com/uc?export=download&id=12zx_JHlY6UeBOQahOxwBnLVXcmZWOXFZ') #model-62000.index
# wget.download('https://docs.google.com/uc?export=download&id=1VvXSt77MWV-BikB59BvcRHynNNCsHeRj') #model-62000.meta
# wget.download('https://docs.google.com/uc?export=download&id=1Lj5gAxD2HHf0VxlHY9Q0q532VNFpQ6XK') #sp.vocap
# wget.download('https://docs.google.com/uc?export=download&id=1bOtPl_GqX4Es9jBZYTPS9ytxq2KGJQE-') #sp.model
elif sys.argv[1] == '1250M':
model = sys.argv[1]
subdir = os.path.join('models', model)
if not os.path.exists(subdir):
os.makedirs(subdir)
os.chdir(subdir)
wget.download('https://docs.google.com/uc?export=download&id=16xNiQZenM-rhVVPox9oepthwreIEW2Lm') #hparams.json
wget.download('https://docs.google.com/uc?export=download&id=12zx_JHlY6UeBOQahOxwBnLVXcmZWOXFZ') #model-62000.index
wget.download('https://docs.google.com/uc?export=download&id=1VvXSt77MWV-BikB59BvcRHynNNCsHeRj') #model-62000.meta
wget.download('https://docs.google.com/uc?export=download&id=1Lj5gAxD2HHf0VxlHY9Q0q532VNFpQ6XK') #sp.vocap
wget.download('https://docs.google.com/uc?export=download&id=1bOtPl_GqX4Es9jBZYTPS9ytxq2KGJQE-') #sp.model
elif sys.argv[1] == '1250M-143':
model = '1250M'
subdir = os.path.join('models', model)
if not os.path.exists(subdir):
os.makedirs(subdir)
os.chdir(subdir)
# wget.download('https://docs.google.com/uc?export=download&id=16xNiQZenM-rhVVPox9oepthwreIEW2Lm') #hparams.json
# wget.download('https://docs.google.com/uc?export=download&id=12zx_JHlY6UeBOQahOxwBnLVXcmZWOXFZ') #model-62000.index
# wget.download('https://docs.google.com/uc?export=download&id=1VvXSt77MWV-BikB59BvcRHynNNCsHeRj') #model-62000.meta
# wget.download('https://docs.google.com/uc?export=download&id=1Lj5gAxD2HHf0VxlHY9Q0q532VNFpQ6XK') #sp.vocap
# wget.download('https://docs.google.com/uc?export=download&id=1bOtPl_GqX4Es9jBZYTPS9ytxq2KGJQE-') #sp.model
elif sys.argv[1] == '1250M-282':
model = '1250M'
subdir = os.path.join('models', model)
if not os.path.exists(subdir):
os.makedirs(subdir)
os.chdir(subdir)
# wget.download('https://docs.google.com/uc?export=download&id=16xNiQZenM-rhVVPox9oepthwreIEW2Lm') #hparams.json
# wget.download('https://docs.google.com/uc?export=download&id=12zx_JHlY6UeBOQahOxwBnLVXcmZWOXFZ') #model-62000.index
# wget.download('https://docs.google.com/uc?export=download&id=1VvXSt77MWV-BikB59BvcRHynNNCsHeRj') #model-62000.meta
# wget.download('https://docs.google.com/uc?export=download&id=1Lj5gAxD2HHf0VxlHY9Q0q532VNFpQ6XK') #sp.vocap
# wget.download('https://docs.google.com/uc?export=download&id=1bOtPl_GqX4Es9jBZYTPS9ytxq2KGJQE-') #sp.model
else:
print('такой модели нет')
#subdir = subdir.replace('\\','/') # needed for Windows
print(subdir)
| 58.3
| 125
| 0.705832
| 439
| 3,498
| 5.603645
| 0.161731
| 0.097561
| 0.138211
| 0.170732
| 0.906098
| 0.906098
| 0.906098
| 0.906098
| 0.906098
| 0.906098
| 0
| 0.062521
| 0.140366
| 3,498
| 59
| 126
| 59.288136
| 0.75557
| 0.532876
| 0
| 0.5
| 0
| 0
| 0.356863
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.125
| 0
| 0.125
| 0.075
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
822b23d57478e89b93013cf580678fc91f5d233e
| 111
|
py
|
Python
|
utils/loss/__init__.py
|
bhklab/ptl-oar-segmentation
|
354c3ee7f042a025f74e210a7b8462beac9b727d
|
[
"Apache-2.0"
] | 3
|
2022-01-18T19:25:46.000Z
|
2022-02-05T18:53:24.000Z
|
utils/loss/__init__.py
|
bhklab/ptl-oar-segmentation
|
354c3ee7f042a025f74e210a7b8462beac9b727d
|
[
"Apache-2.0"
] | null | null | null |
utils/loss/__init__.py
|
bhklab/ptl-oar-segmentation
|
354c3ee7f042a025f74e210a7b8462beac9b727d
|
[
"Apache-2.0"
] | null | null | null |
from .boundary_loss import *
from .focal_loss import *
from .dice_loss import *
from .ND_Crossentropy import *
| 22.2
| 30
| 0.783784
| 16
| 111
| 5.1875
| 0.5
| 0.361446
| 0.506024
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144144
| 111
| 4
| 31
| 27.75
| 0.873684
| 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
|
41a60cbee12aae20357361ac482db38ddf2ec9d6
| 25,560
|
py
|
Python
|
router/day_visit_cost_calculator_test.py
|
awesome-archive/city_visit_planner
|
20befca3d70db61bc83356eedd490a298b27f96f
|
[
"MIT"
] | 1
|
2019-11-14T22:08:59.000Z
|
2019-11-14T22:08:59.000Z
|
router/day_visit_cost_calculator_test.py
|
sandoche/city_visit_planner
|
20befca3d70db61bc83356eedd490a298b27f96f
|
[
"MIT"
] | null | null | null |
router/day_visit_cost_calculator_test.py
|
sandoche/city_visit_planner
|
20befca3d70db61bc83356eedd490a298b27f96f
|
[
"MIT"
] | null | null | null |
import datetime
import unittest
from data import city_visit
from router import cost_accumulator
from router import point_fit as point_fit_
from router import day_visit_cost_calculator as day_visit_cost_calculator_
from router import test_util
class DayVisitCostCalculatorTest(unittest.TestCase):
@staticmethod
def GetDayVisitParameters(start_datetime, end_datetime, lunch_start_datetime):
return city_visit.DayVisitParameters(
start_datetime=start_datetime,
end_datetime=end_datetime,
lunch_start_datetime=lunch_start_datetime,
lunch_hours=1.,
start_coordinates=test_util.MockCoordinates('Hotel'),
end_coordinates=test_util.MockCoordinates('Restaurant'))
def setUp(self):
self.no_point_visit_factor = 0.
self.no_point_visit_const = 1000.
self.unused_time_factor = 0.01
self.points = test_util.MockPoints()
move_calculator = test_util.MockMoveCalculator()
point_fit = point_fit_.SimplePointFit()
cost_accumulator_generator=cost_accumulator.FactorCostAccumulatorGenerator(
no_point_visit_factor=self.no_point_visit_factor,
no_point_visit_const=self.no_point_visit_const,
unused_time_factor=self.unused_time_factor)
self.day_visit_cost_calculator_generator = day_visit_cost_calculator_.DayVisitCostCalculatorGenerator(
move_calculator=move_calculator,
point_fit=point_fit,
cost_accumulator_generator=cost_accumulator_generator)
super(DayVisitCostCalculatorTest, self).setUp()
def testCannotAddPoint(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 15, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 14, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Ferry Building.
# Move: 9:00 - 10:00.
# Point: 10:00 - 11:00.
self.assertTrue(
day_visit_cost_calculator.PushPoint(self.points['Ferry Building']))
self.assertEqual(datetime.datetime(2014, 9, 1, 11, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Ferry Building'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(2, day_visit_cost_calculator.CurrentCost())
self.assertEqual(8.95, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
# Pier 39.
# Move: 11:00 - 12:00.
# Point: 12:00 - 15:00.
# Lunch: 15:00 - 16:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.75, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Ferry Building from 09:00:00 to 10:00:00
Visiting point "Ferry Building" from 10:00:00 to 11:00:00
Walking from Ferry Building to Pier 39 from 11:00:00 to 12:00:00
Visiting point "Pier 39" from 12:00:00 to 15:00:00
Having lunch from 15:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.75
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
# Twin Peaks.
# Move: 16:00 - 21:00.
# Cannot push point.
# State should not have been changed, but cost should have been increased.
self.assertFalse(
day_visit_cost_calculator.PushPoint(self.points['Twin Peaks']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7 + self.no_point_visit_const,
day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.75 + self.no_point_visit_const,
day_visit_cost_calculator.FinalizedCost())
self.assertEqual([self.points['Twin Peaks']],
day_visit_cost_calculator.GetPointsLeft())
def testCannotAddMove(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 20, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 11, 45, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Ferry Building.
# Move: 9:00 - 10:00.
# Point: 10:00 - 11:00.
self.assertTrue(
day_visit_cost_calculator.PushPoint(self.points['Ferry Building']))
self.assertEqual(datetime.datetime(2014, 9, 1, 11, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Ferry Building'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(2, day_visit_cost_calculator.CurrentCost())
self.assertEqual(8.6, day_visit_cost_calculator.FinalizedCost()) # Lunch.
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
# Pier 39.
# Move: 11:00 - 12:00.
# Lunch: 12:00 - 13:00.
# Point: 13:00 - 16:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Ferry Building from 09:00:00 to 10:00:00
Visiting point "Ferry Building" from 10:00:00 to 11:00:00
Walking from Ferry Building to Pier 39 from 11:00:00 to 12:00:00
Having lunch from 12:00:00 to 13:00:00
Visiting point "Pier 39" from 13:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.00
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
# Twin Peaks.
# Cannot push move.
# State should not have been changed, but cost should have been increased.
self.assertFalse(
day_visit_cost_calculator.PushPoint(self.points['Twin Peaks']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7 + self.no_point_visit_const,
day_visit_cost_calculator.CurrentCost())
self.assertEqual(11 + self.no_point_visit_const,
day_visit_cost_calculator.FinalizedCost())
self.assertEqual([self.points['Twin Peaks']],
day_visit_cost_calculator.GetPointsLeft())
def testPointDoesNotFit(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 10, 30, 0),
end_datetime=datetime.datetime(2014, 9, 1, 22, 30, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 9, 30, 0)) # out of time range.
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 10:30 - 13:30.
# Point: 13:30 - 16:30.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Pier 39 from 10:30:00 to 13:30:00
Visiting point "Pier 39" from 13:30:00 to 16:30:00
Walking from Pier 39 to Restaurant from 16:30:00 to 20:30:00
Cost: 11.20
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
# Ferry Building.
# Move: 16:30 - 17:30.
# Point does not fit.
# State should not have been changed, but cost should have been increased.
self.assertFalse(
day_visit_cost_calculator.PushPoint(self.points['Ferry Building']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6 + self.no_point_visit_const,
day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2 + self.no_point_visit_const,
day_visit_cost_calculator.FinalizedCost())
self.assertEqual([self.points['Ferry Building']],
day_visit_cost_calculator.GetPointsLeft())
def testCannotFinalize(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 18, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 12, 30, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Ferry Building.
# Move: 9:00 - 10:00.
# Point: 10:00 - 11:00.
self.assertTrue(
day_visit_cost_calculator.PushPoint(self.points['Ferry Building']))
self.assertEqual(datetime.datetime(2014, 9, 1, 11, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Ferry Building'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(2, day_visit_cost_calculator.CurrentCost())
self.assertEqual(7.4, day_visit_cost_calculator.FinalizedCost()) # Lunch.
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Ferry Building from 09:00:00 to 10:00:00
Visiting point "Ferry Building" from 10:00:00 to 11:00:00
Walking from Ferry Building to Restaurant from 11:00:00 to 13:00:00
Having lunch from 13:00:00 to 14:00:00
Cost: 7.40
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
# Pier 39.
# Move: 11:00 - 12:00.
# Point: 12:00 - 15:00.
# Lunch: 15:00 - 16:00.
# Cannot finalize.
# State should not have been changed, but cost should have been increased.
self.assertFalse(
day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 11, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Ferry Building'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(2 + self.no_point_visit_const,
day_visit_cost_calculator.CurrentCost())
self.assertEqual(7.4 + self.no_point_visit_const,
day_visit_cost_calculator.FinalizedCost())
self.assertEqual([self.points['Pier 39']],
day_visit_cost_calculator.GetPointsLeft())
def testLunchBeforeMove(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 10, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Lunch: 09:00 - 10:00.
# Move: 10:00 - 13:00.
# Point: 13:00 - 16:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.6, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Having lunch from 09:00:00 to 10:00:00
Walking from Hotel to Pier 39 from 10:00:00 to 13:00:00
Visiting point "Pier 39" from 13:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.60
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
def testLunchAfterMove(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 11, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 09:00 - 12:00.
# Lunch: 12:00 - 13:00.
# Point: 13:00 - 16:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.6, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Pier 39 from 09:00:00 to 12:00:00
Having lunch from 12:00:00 to 13:00:00
Visiting point "Pier 39" from 13:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.60
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
def testLunchBeforePoint(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 13, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 09:00 - 12:00.
# Lunch: 12:00 - 13:00.
# Point: 13:00 - 16:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.6, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Pier 39 from 09:00:00 to 12:00:00
Having lunch from 12:00:00 to 13:00:00
Visiting point "Pier 39" from 13:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.60
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
def testLunchAfterPoint(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 14, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 09:00 - 12:00.
# Point: 12:00 - 15:00.
# Lunch: 15:00 - 16:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(7, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.6, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Pier 39 from 09:00:00 to 12:00:00
Visiting point "Pier 39" from 12:00:00 to 15:00:00
Having lunch from 15:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.60
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
def testLunchBeforeFinalization(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 16, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 09:00 - 12:00.
# Point: 12:00 - 15:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 15, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.6, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Pier 39 from 09:00:00 to 12:00:00
Visiting point "Pier 39" from 12:00:00 to 15:00:00
Having lunch from 15:00:00 to 16:00:00
Walking from Pier 39 to Restaurant from 16:00:00 to 20:00:00
Cost: 11.60
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
def testLunchAfterFinalization(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 9, 0, 0),
end_datetime=datetime.datetime(2014, 9, 1, 21, 0, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 18, 0, 0))
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 09:00 - 12:00.
# Point: 12:00 - 15:00.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 15, 0, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.6, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
day_visit_str_expected = """Date: 2014-09-01
Walking from Hotel to Pier 39 from 09:00:00 to 12:00:00
Visiting point "Pier 39" from 12:00:00 to 15:00:00
Walking from Pier 39 to Restaurant from 15:00:00 to 19:00:00
Having lunch from 19:00:00 to 20:00:00
Cost: 11.60
Price: 0.00"""
self.assertEqual(day_visit_str_expected,
str(day_visit_cost_calculator.FinalizedDayVisit()))
def testCannotPushPointAfterFail(self):
day_visit_parameters = DayVisitCostCalculatorTest.GetDayVisitParameters(
start_datetime=datetime.datetime(2014, 9, 1, 10, 30, 0),
end_datetime=datetime.datetime(2014, 9, 1, 22, 30, 0),
lunch_start_datetime=datetime.datetime(2014, 9, 1, 9, 30, 0)) # out of time range.
# Test that Union Square can be pushed by time.
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 10:30 - 13:30.
# Point: 13:30 - 16:30.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
# Union Square.
# Move: 16:30 - 18:30
# Point: 18:30 - 19:30
self.assertTrue(
day_visit_cost_calculator.PushPoint(self.points['Union Square']))
self.assertEqual(datetime.datetime(2014, 9, 1, 19, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Union Square'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(9, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
# Test that Union Square can be pushed by time, but should not be since
# previous step failed.
day_visit_cost_calculator = (
self.day_visit_cost_calculator_generator.Generate(
day_visit_parameters))
# Pier 39.
# Move: 10:30 - 13:30.
# Point: 13:30 - 16:30.
self.assertTrue(day_visit_cost_calculator.PushPoint(self.points['Pier 39']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6, day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2, day_visit_cost_calculator.FinalizedCost())
self.assertEqual([], day_visit_cost_calculator.GetPointsLeft())
# Ferry Building.
# Move: 16:30 - 17:30.
# Point does not fit.
# State should not have been changed, but cost should have been increased.
self.assertFalse(
day_visit_cost_calculator.PushPoint(self.points['Ferry Building']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6 + self.no_point_visit_const,
day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2 + self.no_point_visit_const,
day_visit_cost_calculator.FinalizedCost())
self.assertEqual([self.points['Ferry Building']],
day_visit_cost_calculator.GetPointsLeft())
# Union Square.
# Point can be pushed by time, but should not be since previous step
# failed.
# State should not have been changed, but cost should have been increased.
self.assertFalse(
day_visit_cost_calculator.PushPoint(self.points['Union Square']))
self.assertEqual(datetime.datetime(2014, 9, 1, 16, 30, 0),
day_visit_cost_calculator.CurrentTime())
self.assertEqual(test_util.MockCoordinates('Pier 39'),
day_visit_cost_calculator.CurrentCoordinates())
self.assertEqual(6 + self.no_point_visit_const * 2,
day_visit_cost_calculator.CurrentCost())
self.assertEqual(11.2 + self.no_point_visit_const * 2,
day_visit_cost_calculator.FinalizedCost())
self.assertEqual([self.points['Ferry Building'], self.points['Union Square']],
day_visit_cost_calculator.GetPointsLeft())
if __name__ == '__main__':
unittest.main()
| 46.727605
| 106
| 0.698905
| 3,368
| 25,560
| 5.070368
| 0.043646
| 0.096973
| 0.115243
| 0.211278
| 0.924284
| 0.909059
| 0.896469
| 0.890379
| 0.887334
| 0.879311
| 0
| 0.086113
| 0.195383
| 25,560
| 546
| 107
| 46.813187
| 0.744238
| 0.075743
| 0
| 0.792771
| 0
| 0
| 0.135641
| 0
| 0
| 0
| 0
| 0
| 0.327711
| 1
| 0.031325
| false
| 0
| 0.016867
| 0.00241
| 0.053012
| 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
|
68b8657ba21492033cb924c0219a7e6500260772
| 126
|
py
|
Python
|
platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_aox.py
|
SiliconLabs/Gecko_SDK
|
991121c706578c9a2135b6f75cc88856e8c64bdc
|
[
"Zlib"
] | 82
|
2016-06-29T17:24:43.000Z
|
2021-04-16T06:49:17.000Z
|
platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_aox.py
|
SiliconLabs/Gecko_SDK
|
991121c706578c9a2135b6f75cc88856e8c64bdc
|
[
"Zlib"
] | 2
|
2017-02-13T10:07:17.000Z
|
2017-03-22T21:28:26.000Z
|
platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_aox.py
|
SiliconLabs/Gecko_SDK
|
991121c706578c9a2135b6f75cc88856e8c64bdc
|
[
"Zlib"
] | 56
|
2016-08-02T10:50:50.000Z
|
2021-07-19T08:57:34.000Z
|
from pyradioconfig.parts.bobcat.calculators.calc_aox import Calc_AoX_Bobcat
class calc_aox_viper(Calc_AoX_Bobcat):
pass
| 21
| 75
| 0.84127
| 19
| 126
| 5.210526
| 0.578947
| 0.282828
| 0.262626
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103175
| 126
| 5
| 76
| 25.2
| 0.876106
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 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
| 1
| 1
| 0
| 1
| 0
|
0
| 8
|
68c17083e03434a92cc22daf487180c136412df7
| 98
|
py
|
Python
|
Tests/config.py
|
ShavImigne/PlayChess
|
1eb0dcaf1d58b02bdc880f8e51857a87696ee461
|
[
"MIT"
] | 12
|
2018-05-02T13:13:41.000Z
|
2022-03-13T15:37:29.000Z
|
Tests/config.py
|
ShavImigne/PlayChess
|
1eb0dcaf1d58b02bdc880f8e51857a87696ee461
|
[
"MIT"
] | 24
|
2018-05-03T13:06:56.000Z
|
2019-08-13T14:49:03.000Z
|
Tests/config.py
|
ShavImigne/PlayChess
|
1eb0dcaf1d58b02bdc880f8e51857a87696ee461
|
[
"MIT"
] | 17
|
2018-05-03T13:46:40.000Z
|
2021-06-26T13:57:05.000Z
|
import os
db_user = os.environ.get('TEST_USER', None)
db_pass = os.environ.get('TEST_PASS', None)
| 24.5
| 43
| 0.734694
| 18
| 98
| 3.777778
| 0.5
| 0.264706
| 0.352941
| 0.470588
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102041
| 98
| 4
| 44
| 24.5
| 0.772727
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.333333
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 7
|
68c56bedc4b8f5a7e8fb87578983bfd9f353e80b
| 192
|
py
|
Python
|
migrations/20130702003237-unique-image-tag.py
|
AndrewLorente/catsnap
|
57427b8f61ef5185a41e49d55ffd7dd328777834
|
[
"MIT"
] | 5
|
2015-11-23T18:40:00.000Z
|
2019-03-22T06:54:04.000Z
|
migrations/20130702003237-unique-image-tag.py
|
AndrewLorente/catsnap
|
57427b8f61ef5185a41e49d55ffd7dd328777834
|
[
"MIT"
] | 5
|
2016-04-07T15:35:53.000Z
|
2019-02-10T23:00:32.000Z
|
migrations/20130702003237-unique-image-tag.py
|
AndrewLorente/catsnap
|
57427b8f61ef5185a41e49d55ffd7dd328777834
|
[
"MIT"
] | 2
|
2015-12-02T16:44:05.000Z
|
2017-09-29T23:17:33.000Z
|
step(
"""
create unique index unq_image_tag_image_id_tag_id
on image_tag (image_id, tag_id)
""",
"""
drop index unq_image_tag_image_id_tag_id
"""
)
| 19.2
| 57
| 0.588542
| 27
| 192
| 3.62963
| 0.37037
| 0.244898
| 0.397959
| 0.459184
| 0.77551
| 0.77551
| 0.571429
| 0.571429
| 0
| 0
| 0
| 0
| 0.317708
| 192
| 9
| 58
| 21.333333
| 0.748092
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
68c8fffe49659ae4697c560697ec3e3bcb643ad7
| 5,497
|
py
|
Python
|
ddb_ngsflow/variation/haplotypecaller.py
|
dgaston/ddbio-ngsflow
|
b5a0f65b92f4de5706ae22b1c710c080761a4634
|
[
"BSD-2-Clause"
] | 1
|
2016-03-24T18:03:13.000Z
|
2016-03-24T18:03:13.000Z
|
ddb_ngsflow/variation/haplotypecaller.py
|
dgaston/ddbio-ngsflow
|
b5a0f65b92f4de5706ae22b1c710c080761a4634
|
[
"BSD-2-Clause"
] | null | null | null |
ddb_ngsflow/variation/haplotypecaller.py
|
dgaston/ddbio-ngsflow
|
b5a0f65b92f4de5706ae22b1c710c080761a4634
|
[
"BSD-2-Clause"
] | null | null | null |
"""
.. module:: haplotypecaller
:platform: Unix, OSX
:synopsis: A wrapper module for calling MuTect.
.. moduleauthor:: Daniel Gaston <daniel.gaston@dal.ca>
"""
from ddb_ngsflow import pipeline
def haplotypecaller_single(job, config, name, samples, input_bam):
"""Generate gVCF files for a sample using the HaplotypeCaller
:param config: The configuration dictionary.
:type config: dict.
:param name: sample name.
:type name: str.
:param samples: samples configuration dictionary
:type samples: dict
:param input_bam: The input_bam file name to process.
:type input_bam: str.
:returns: str -- The output vcf file name.
"""
gvcf = "{}.haplotypecaller.g.vcf".format(name)
logfile = "{}.haplotypecaller_gvcf.log".format(name)
command = ["{}".format(config['gatk-haplotypecaller']['bin']),
"-T",
"HaplotypeCaller",
"-R",
"{}".format(config['reference']),
"--dbsnp",
"{}".format(config['dbsnp']),
"-I",
"{}".format(input_bam),
"-L",
"{}".format(samples[name]['regions']),
"--emitRefConfidence GVCF",
"--variant_index_type LINEAR",
"--variant_index_parameter 128000",
"-o",
"{}".format(gvcf)]
job.fileStore.logToMaster("HaplotypeCaller Command: {}\n".format(command))
pipeline.run_and_log_command(" ".join(command), logfile)
return gvcf
def joint_variant_calling(job, config, name, samples):
"""Create a cohort VCF file based on joint calling from gVCF files
:param config: The configuration dictionary.
:type config: dict.
:param sample: sample name.
:type sample: str.
:param samples: samples configuration dictionary
:type samples: dict
:param input_bam: The input_bam file name to process.
:type input_bam: str.
:returns: str -- The output vcf file name.
"""
vcf = "{}.haplotypecaller.vcf".format(name)
logfile = "{}.haplotypecaller_gvcf.log".format(name)
gvcfs = list()
for sample in samples:
gvcfs.append("--variant {}.haplotypecaller.g.vcf".format(sample))
gvcf_string = " ".join(gvcfs)
command = ["{}".format(config['gatk-jointgenotyper']['bin']),
"-T",
"GenotypeGVCFs",
"-R",
"{}".format(config['reference']),
"{}".format(gvcf_string),
"-nt",
"{}".format(config['gatk-jointgenotyper']['num_cores']),
"-o",
"{}".format(vcf)]
job.fileStore.logToMaster("GenotypeVCFs Command: {}\n".format(command))
pipeline.run_and_log_command(" ".join(command), logfile)
return vcf
def haplotypecaller_amplicon(job, config, name, samples, input_bam):
"""Generate gVCF files for a sample using the HaplotypeCaller
:param config: The configuration dictionary.
:type config: dict.
:param name: sample name.
:type name: str.
:param samples: samples configuration dictionary
:type samples: dict
:param input_bam: The input_bam file name to process.
:type input_bam: str.
:returns: str -- The output vcf file name.
"""
gvcf = "{}.haplotypecaller.g.vcf".format(name)
logfile = "{}.haplotypecaller_gvcf.log".format(name)
command = ["{}".format(config['gatk-haplotypecaller']['bin']),
"-T",
"HaplotypeCaller",
"-R",
"{}".format(config['reference']),
"--dbsnp",
"{}".format(config['dbsnp']),
"-I",
"{}".format(input_bam),
"-L",
"{}".format(samples[name]['regions']),
"-drf DuplicateRead",
"--emitRefConfidence GVCF",
"--variant_index_type LINEAR",
"--variant_index_parameter 128000",
"-o",
"{}".format(gvcf)]
job.fileStore.logToMaster("HaplotypeCaller Command: {}\n".format(command))
pipeline.run_and_log_command(" ".join(command), logfile)
return gvcf
def joint_variant_calling_amplicon(job, config, name, samples):
"""Create a cohort VCF file based on joint calling from gVCF files
:param config: The configuration dictionary.
:type config: dict.
:param sample: sample name.
:type sample: str.
:param samples: samples configuration dictionary
:type samples: dict
:param input_bam: The input_bam file name to process.
:type input_bam: str.
:returns: str -- The output vcf file name.
"""
vcf = "{}.haplotypecaller.vcf".format(name)
logfile = "{}.haplotypecaller_gvcf.log".format(name)
gvcfs = list()
for sample in samples:
gvcfs.append("--variant {}.haplotypecaller.g.vcf".format(sample))
gvcf_string = " ".join(gvcfs)
command = ["{}".format(config['gatk-jointgenotyper']['bin']),
"-T",
"GenotypeGVCFs",
"-R",
"{}".format(config['reference']),
"{}".format(gvcf_string),
"-nt",
"{}".format(config['gatk-jointgenotyper']['num_cores']),
"-drf DuplicateRead",
"-o",
"{}".format(vcf)]
job.fileStore.logToMaster("GenotypeVCFs Command: {}\n".format(command))
pipeline.run_and_log_command(" ".join(command), logfile)
return vcf
| 32.526627
| 78
| 0.577224
| 561
| 5,497
| 5.559715
| 0.167558
| 0.041039
| 0.069253
| 0.025649
| 0.930426
| 0.925297
| 0.925297
| 0.925297
| 0.925297
| 0.925297
| 0
| 0.003014
| 0.275605
| 5,497
| 168
| 79
| 32.720238
| 0.780261
| 0.291068
| 0
| 0.942529
| 0
| 0
| 0.25486
| 0.080454
| 0
| 0
| 0
| 0
| 0
| 1
| 0.045977
| false
| 0
| 0.011494
| 0
| 0.103448
| 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
|
68cbe4a76450a7c74bdd21db93ed75edbf00e857
| 307
|
py
|
Python
|
nox_tools/__init__.py
|
AliGhahraei/nox-tools
|
5d1582633b7d03100aa7cc505315820cda9c85b2
|
[
"MIT"
] | null | null | null |
nox_tools/__init__.py
|
AliGhahraei/nox-tools
|
5d1582633b7d03100aa7cc505315820cda9c85b2
|
[
"MIT"
] | null | null | null |
nox_tools/__init__.py
|
AliGhahraei/nox-tools
|
5d1582633b7d03100aa7cc505315820cda9c85b2
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
from nox_tools.sessions import (
config, install_current_package, install_requirements,
install_test_packages, linting, tests, typing,
)
__all__ = [
'config', 'install_current_package', 'install_requirements',
'install_test_packages', 'linting', 'tests', 'typing',
]
| 27.909091
| 64
| 0.736156
| 34
| 307
| 6.205882
| 0.588235
| 0.123223
| 0.189573
| 0.255924
| 0.78673
| 0.78673
| 0.78673
| 0.78673
| 0.78673
| 0.78673
| 0
| 0.003774
| 0.136808
| 307
| 10
| 65
| 30.7
| 0.792453
| 0.068404
| 0
| 0
| 0
| 0
| 0.308772
| 0.154386
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.125
| 0
| 0.125
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
ec499712284cd332daef0cb9c0cf0f5ffc26cb2a
| 14,335
|
py
|
Python
|
thecut/menus/south_migrations/0001_initial.py
|
exemplarysoftware/thecut-menus
|
36682610ea975c350158ceb4cb3515c661812413
|
[
"Apache-2.0"
] | null | null | null |
thecut/menus/south_migrations/0001_initial.py
|
exemplarysoftware/thecut-menus
|
36682610ea975c350158ceb4cb3515c661812413
|
[
"Apache-2.0"
] | null | null | null |
thecut/menus/south_migrations/0001_initial.py
|
exemplarysoftware/thecut-menus
|
36682610ea975c350158ceb4cb3515c661812413
|
[
"Apache-2.0"
] | null | null | null |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from thecut.authorship.settings import AUTH_USER_MODEL
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Menu'
db.create_table('menus_menu', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('is_enabled', self.gf('django.db.models.fields.BooleanField')(default=True)),
('is_featured', self.gf('django.db.models.fields.BooleanField')(default=False)),
('publish_at', self.gf('django.db.models.fields.DateTimeField')()),
('publish_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='menu_publish_by_user', null=True, to=orm[AUTH_USER_MODEL])),
('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='menu_created_by_user', to=orm[AUTH_USER_MODEL])),
('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='menu_updated_by_user', to=orm[AUTH_USER_MODEL])),
('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50, db_index=True)),
))
db.send_create_signal('menus', ['Menu'])
# Adding model 'MenuItem'
db.create_table('menus_menuitem', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('is_enabled', self.gf('django.db.models.fields.BooleanField')(default=True)),
('is_featured', self.gf('django.db.models.fields.BooleanField')(default=False)),
('publish_at', self.gf('django.db.models.fields.DateTimeField')()),
('publish_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='menuitem_publish_by_user', null=True, to=orm[AUTH_USER_MODEL])),
('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='menuitem_created_by_user', to=orm[AUTH_USER_MODEL])),
('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='menuitem_updated_by_user', to=orm[AUTH_USER_MODEL])),
('name', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)),
('order', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
('menu', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['menus.Menu'])),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
('object_id', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal('menus', ['MenuItem'])
# Adding model 'ViewLink'
db.create_table('menus_viewlink', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('is_enabled', self.gf('django.db.models.fields.BooleanField')(default=True)),
('is_featured', self.gf('django.db.models.fields.BooleanField')(default=False)),
('publish_at', self.gf('django.db.models.fields.DateTimeField')()),
('publish_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='viewlink_publish_by_user', null=True, to=orm[AUTH_USER_MODEL])),
('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='viewlink_created_by_user', to=orm[AUTH_USER_MODEL])),
('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='viewlink_updated_by_user', to=orm[AUTH_USER_MODEL])),
('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
('view', self.gf('django.db.models.fields.CharField')(max_length=100)),
))
db.send_create_signal('menus', ['ViewLink'])
# Adding model 'WebLink'
db.create_table('menus_weblink', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('is_enabled', self.gf('django.db.models.fields.BooleanField')(default=True)),
('is_featured', self.gf('django.db.models.fields.BooleanField')(default=False)),
('publish_at', self.gf('django.db.models.fields.DateTimeField')()),
('publish_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='weblink_publish_by_user', null=True, to=orm[AUTH_USER_MODEL])),
('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='weblink_created_by_user', to=orm[AUTH_USER_MODEL])),
('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='weblink_updated_by_user', to=orm[AUTH_USER_MODEL])),
('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
))
db.send_create_signal('menus', ['WebLink'])
def backwards(self, orm):
# Deleting model 'Menu'
db.delete_table('menus_menu')
# Deleting model 'MenuItem'
db.delete_table('menus_menuitem')
# Deleting model 'ViewLink'
db.delete_table('menus_viewlink')
# Deleting model 'WebLink'
db.delete_table('menus_weblink')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
AUTH_USER_MODEL: {
'Meta': {'object_name': AUTH_USER_MODEL.split('.')[-1]},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'menus.menu': {
'Meta': {'ordering': "['-created_at']", 'object_name': 'Menu'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'menu_created_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'publish_at': ('django.db.models.fields.DateTimeField', [], {}),
'publish_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'menu_publish_by_user'", 'null': 'True', 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'updated_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'menu_updated_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)})
},
'menus.menuitem': {
'Meta': {'ordering': "['order']", 'object_name': 'MenuItem'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'menuitem_created_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'menu': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['menus.Menu']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'object_id': ('django.db.models.fields.IntegerField', [], {}),
'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'publish_at': ('django.db.models.fields.DateTimeField', [], {}),
'publish_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'menuitem_publish_by_user'", 'null': 'True', 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'updated_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'menuitem_updated_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)})
},
'menus.viewlink': {
'Meta': {'ordering': "['-created_at']", 'object_name': 'ViewLink'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'viewlink_created_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'publish_at': ('django.db.models.fields.DateTimeField', [], {}),
'publish_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'viewlink_publish_by_user'", 'null': 'True', 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'updated_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'viewlink_updated_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'view': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'menus.weblink': {
'Meta': {'ordering': "['-created_at']", 'object_name': 'WebLink'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'weblink_created_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'publish_at': ('django.db.models.fields.DateTimeField', [], {}),
'publish_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'weblink_publish_by_user'", 'null': 'True', 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'updated_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'weblink_updated_by_user'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
}
}
complete_apps = ['menus']
| 77.907609
| 202
| 0.613254
| 1,667
| 14,335
| 5.075585
| 0.062987
| 0.103061
| 0.178702
| 0.255289
| 0.859709
| 0.840208
| 0.827089
| 0.812434
| 0.787377
| 0.764212
| 0
| 0.006624
| 0.16798
| 14,335
| 183
| 203
| 78.333333
| 0.702775
| 0.014301
| 0
| 0.396226
| 0
| 0
| 0.518484
| 0.334348
| 0
| 0
| 0
| 0
| 0
| 1
| 0.012579
| false
| 0
| 0.031447
| 0
| 0.062893
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
6b76347e2d9e50ac57727f08619a4a9dcfd06b52
| 100
|
py
|
Python
|
test-crates/pyo3-mixed/test_pyo3_mixed.py
|
thedrow/maturin
|
53dd4c2a2b548e8e9a1a390dccf161f61ee6137e
|
[
"Apache-2.0",
"MIT"
] | 854
|
2019-09-01T13:08:28.000Z
|
2022-03-30T11:52:48.000Z
|
test-crates/pyo3-mixed/test_pyo3_mixed.py
|
thedrow/maturin
|
53dd4c2a2b548e8e9a1a390dccf161f61ee6137e
|
[
"Apache-2.0",
"MIT"
] | 546
|
2019-08-30T18:13:18.000Z
|
2022-03-31T16:00:19.000Z
|
test-crates/pyo3-mixed/test_pyo3_mixed.py
|
pombredanne/pyo3-pack
|
b556ed1d3a1eab65f180e5da5c00648173e77f1d
|
[
"Apache-2.0",
"MIT"
] | 92
|
2019-09-06T07:34:38.000Z
|
2022-03-30T22:03:49.000Z
|
#!/usr/bin/env python3
import pyo3_mixed
def test_get_42():
assert pyo3_mixed.get_42() == 42
| 12.5
| 36
| 0.7
| 17
| 100
| 3.823529
| 0.705882
| 0.276923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 0.17
| 100
| 7
| 37
| 14.285714
| 0.674699
| 0.21
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
6bbd68d4a5f5fe27a342575f588ca009e0ac8423
| 1,184
|
py
|
Python
|
tests/test_provider_pmorillon_grid5000.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 507
|
2017-07-26T02:58:38.000Z
|
2022-01-21T12:35:13.000Z
|
tests/test_provider_pmorillon_grid5000.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 135
|
2017-07-20T12:01:59.000Z
|
2021-10-04T22:25:40.000Z
|
tests/test_provider_pmorillon_grid5000.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 81
|
2018-02-20T17:55:28.000Z
|
2022-01-31T07:08:40.000Z
|
# tests/test_provider_pmorillon_grid5000.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:17:36 UTC)
def test_provider_import():
import terrascript.provider.pmorillon.grid5000
def test_resource_import():
from terrascript.resource.pmorillon.grid5000 import grid5000_ceph_pool
from terrascript.resource.pmorillon.grid5000 import grid5000_deployment
from terrascript.resource.pmorillon.grid5000 import grid5000_job
def test_datasource_import():
from terrascript.data.pmorillon.grid5000 import grid5000_ceph_auth
from terrascript.data.pmorillon.grid5000 import grid5000_node
from terrascript.data.pmorillon.grid5000 import grid5000_site
from terrascript.data.pmorillon.grid5000 import grid5000_vlan_nodelist
# 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.pmorillon.grid5000
#
# t = terrascript.provider.pmorillon.grid5000.grid5000()
# s = str(t)
#
# assert 'https://github.com/pmorillon/terraform-provider-grid5000' in s
# assert '0.0.7' in s
| 30.358974
| 80
| 0.783784
| 150
| 1,184
| 6.04
| 0.44
| 0.206402
| 0.177704
| 0.239514
| 0.501104
| 0.399559
| 0.399559
| 0
| 0
| 0
| 0
| 0.09332
| 0.140203
| 1,184
| 38
| 81
| 31.157895
| 0.79666
| 0.429054
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026316
| 0
| 1
| 0.272727
| true
| 0
| 1
| 0
| 1.272727
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
6bd9fd8a14cd033df798908808112cb264eb75c6
| 11,879
|
py
|
Python
|
eips_code/eip-3670.py
|
ipsilon/eof
|
5c7e7fd5638f7476707c097e2b8fdcfb41a254d6
|
[
"Apache-2.0"
] | null | null | null |
eips_code/eip-3670.py
|
ipsilon/eof
|
5c7e7fd5638f7476707c097e2b8fdcfb41a254d6
|
[
"Apache-2.0"
] | null | null | null |
eips_code/eip-3670.py
|
ipsilon/eof
|
5c7e7fd5638f7476707c097e2b8fdcfb41a254d6
|
[
"Apache-2.0"
] | null | null | null |
# The ranges below are as specified in the Yellow Paper.
# Note: range(s, e) excludes e, hence the +1
valid_opcodes = [
*range(0x00, 0x0b + 1),
*range(0x10, 0x1d + 1),
0x20,
*range(0x30, 0x3f + 1),
*range(0x40, 0x48 + 1),
*range(0x50, 0x5b + 1),
*range(0x60, 0x6f + 1),
*range(0x70, 0x7f + 1),
*range(0x80, 0x8f + 1),
*range(0x90, 0x9f + 1),
*range(0xa0, 0xa4 + 1),
# Note: 0xfe is considered assigned.
*range(0xf0, 0xf5 + 1), 0xfa, 0xfd, 0xfe, 0xff
]
# STOP, RETURN, REVERT, INVALID, SELFDESTRUCT
terminating_opcodes = [ 0x00, 0xf3, 0xfd, 0xfe, 0xff ]
# Only for PUSH1..PUSH32
immediate_sizes = 256 * [0]
for opcode in range(0x60, 0x7f + 1): # PUSH1..PUSH32
immediate_sizes[opcode] = opcode - 0x60 + 1
# Fails with assertion on invalid code
def validate_code(code: bytes):
# Note that EOF1 already asserts this with the code section requirements
assert len(code) > 0
opcode = 0
pos = 0
while pos < len(code):
# Ensure the opcode is valid
opcode = code[pos]
pos += 1
assert opcode in valid_opcodes
# Skip immediates
pos += immediate_sizes[opcode]
# Ensure last opcode's immediate doesn't go over code end
assert pos == len(code)
# opcode is the *last opcode*
assert opcode in terminating_opcodes
def test_validate_code(code: bytes) -> bool:
try:
validate_code(code)
return True
except:
return False
# Some valid opcodes
assert test_validate_code(b'\x30\x00') == True
assert test_validate_code(b'\x50\x00') == True
assert test_validate_code(b'\xfe\x00') == True
assert test_validate_code(b'\xff\x00') == True
# PUSHes with valid immediates
assert test_validate_code(b'\x60\x00\x00') == True
assert test_validate_code(b'\x61' + b'\x00' * 2 + b'\x00') == True
assert test_validate_code(b'\x62' + b'\x00' * 3 + b'\x00') == True
assert test_validate_code(b'\x63' + b'\x00' * 4 + b'\x00') == True
assert test_validate_code(b'\x64' + b'\x00' * 5 + b'\x00') == True
assert test_validate_code(b'\x65' + b'\x00' * 6 + b'\x00') == True
assert test_validate_code(b'\x66' + b'\x00' * 7 + b'\x00') == True
assert test_validate_code(b'\x67' + b'\x00' * 8 + b'\x00') == True
assert test_validate_code(b'\x68' + b'\x00' * 9 + b'\x00') == True
assert test_validate_code(b'\x69' + b'\x00' * 10 + b'\x00') == True
assert test_validate_code(b'\x6a' + b'\x00' * 11 + b'\x00') == True
assert test_validate_code(b'\x6b' + b'\x00' * 12 + b'\x00') == True
assert test_validate_code(b'\x6c' + b'\x00' * 13 + b'\x00') == True
assert test_validate_code(b'\x6d' + b'\x00' * 14 + b'\x00') == True
assert test_validate_code(b'\x6e' + b'\x00' * 15 + b'\x00') == True
assert test_validate_code(b'\x6f' + b'\x00' * 16 + b'\x00') == True
assert test_validate_code(b'\x70' + b'\x00' * 17 + b'\x00') == True
assert test_validate_code(b'\x71' + b'\x00' * 18 + b'\x00') == True
assert test_validate_code(b'\x72' + b'\x00' * 19 + b'\x00') == True
assert test_validate_code(b'\x73' + b'\x00' * 20 + b'\x00') == True
assert test_validate_code(b'\x74' + b'\x00' * 21 + b'\x00') == True
assert test_validate_code(b'\x75' + b'\x00' * 22 + b'\x00') == True
assert test_validate_code(b'\x76' + b'\x00' * 23 + b'\x00') == True
assert test_validate_code(b'\x77' + b'\x00' * 24 + b'\x00') == True
assert test_validate_code(b'\x78' + b'\x00' * 25 + b'\x00') == True
assert test_validate_code(b'\x79' + b'\x00' * 26 + b'\x00') == True
assert test_validate_code(b'\x7a' + b'\x00' * 27 + b'\x00') == True
assert test_validate_code(b'\x7b' + b'\x00' * 28 + b'\x00') == True
assert test_validate_code(b'\x7c' + b'\x00' * 29 + b'\x00') == True
assert test_validate_code(b'\x7d' + b'\x00' * 30 + b'\x00') == True
assert test_validate_code(b'\x7e' + b'\x00' * 31 + b'\x00') == True
assert test_validate_code(b'\x7f' + b'\x00' * 32 + b'\x00') == True
# Valid code terminators
assert test_validate_code(b'\x00') == True
assert test_validate_code(b'\xf3') == True
assert test_validate_code(b'\xfd') == True
assert test_validate_code(b'\xfe') == True
# Empty code
assert test_validate_code(b'') == False
# Valid opcode, but invalid as terminator
assert test_validate_code(b'\x5b') == False
# Invalid opcodes
assert test_validate_code(b'\x0c\x00') == False
assert test_validate_code(b'\x0d\x00') == False
assert test_validate_code(b'\x0e\x00') == False
assert test_validate_code(b'\x0f\x00') == False
assert test_validate_code(b'\x1e\x00') == False
assert test_validate_code(b'\x1f\x00') == False
assert test_validate_code(b'\x21\x00') == False
assert test_validate_code(b'\x22\x00') == False
assert test_validate_code(b'\x23\x00') == False
assert test_validate_code(b'\x24\x00') == False
assert test_validate_code(b'\x25\x00') == False
assert test_validate_code(b'\x26\x00') == False
assert test_validate_code(b'\x27\x00') == False
assert test_validate_code(b'\x28\x00') == False
assert test_validate_code(b'\x29\x00') == False
assert test_validate_code(b'\x2a\x00') == False
assert test_validate_code(b'\x2b\x00') == False
assert test_validate_code(b'\x2c\x00') == False
assert test_validate_code(b'\x2d\x00') == False
assert test_validate_code(b'\x2e\x00') == False
assert test_validate_code(b'\x2f\x00') == False
assert test_validate_code(b'\x49\x00') == False
assert test_validate_code(b'\x4a\x00') == False
assert test_validate_code(b'\x4b\x00') == False
assert test_validate_code(b'\x4c\x00') == False
assert test_validate_code(b'\x4d\x00') == False
assert test_validate_code(b'\x4e\x00') == False
assert test_validate_code(b'\x4f\x00') == False
assert test_validate_code(b'\x5c\x00') == False
assert test_validate_code(b'\x5d\x00') == False
assert test_validate_code(b'\x5e\x00') == False
assert test_validate_code(b'\x5f\x00') == False
assert test_validate_code(b'\xa5\x00') == False
assert test_validate_code(b'\xa6\x00') == False
assert test_validate_code(b'\xa7\x00') == False
assert test_validate_code(b'\xa8\x00') == False
assert test_validate_code(b'\xa9\x00') == False
assert test_validate_code(b'\xaa\x00') == False
assert test_validate_code(b'\xab\x00') == False
assert test_validate_code(b'\xac\x00') == False
assert test_validate_code(b'\xad\x00') == False
assert test_validate_code(b'\xae\x00') == False
assert test_validate_code(b'\xaf\x00') == False
assert test_validate_code(b'\xb0\x00') == False
assert test_validate_code(b'\xb1\x00') == False
assert test_validate_code(b'\xb2\x00') == False
assert test_validate_code(b'\xb3\x00') == False
assert test_validate_code(b'\xb4\x00') == False
assert test_validate_code(b'\xb5\x00') == False
assert test_validate_code(b'\xb6\x00') == False
assert test_validate_code(b'\xb7\x00') == False
assert test_validate_code(b'\xb8\x00') == False
assert test_validate_code(b'\xb9\x00') == False
assert test_validate_code(b'\xba\x00') == False
assert test_validate_code(b'\xbb\x00') == False
assert test_validate_code(b'\xbc\x00') == False
assert test_validate_code(b'\xbd\x00') == False
assert test_validate_code(b'\xbe\x00') == False
assert test_validate_code(b'\xbf\x00') == False
assert test_validate_code(b'\xc0\x00') == False
assert test_validate_code(b'\xc1\x00') == False
assert test_validate_code(b'\xc2\x00') == False
assert test_validate_code(b'\xc3\x00') == False
assert test_validate_code(b'\xc4\x00') == False
assert test_validate_code(b'\xc5\x00') == False
assert test_validate_code(b'\xc6\x00') == False
assert test_validate_code(b'\xc7\x00') == False
assert test_validate_code(b'\xc8\x00') == False
assert test_validate_code(b'\xc9\x00') == False
assert test_validate_code(b'\xca\x00') == False
assert test_validate_code(b'\xcb\x00') == False
assert test_validate_code(b'\xcc\x00') == False
assert test_validate_code(b'\xcd\x00') == False
assert test_validate_code(b'\xce\x00') == False
assert test_validate_code(b'\xcf\x00') == False
assert test_validate_code(b'\xd0\x00') == False
assert test_validate_code(b'\xd1\x00') == False
assert test_validate_code(b'\xd2\x00') == False
assert test_validate_code(b'\xd3\x00') == False
assert test_validate_code(b'\xd4\x00') == False
assert test_validate_code(b'\xd5\x00') == False
assert test_validate_code(b'\xd6\x00') == False
assert test_validate_code(b'\xd7\x00') == False
assert test_validate_code(b'\xd8\x00') == False
assert test_validate_code(b'\xd9\x00') == False
assert test_validate_code(b'\xda\x00') == False
assert test_validate_code(b'\xdb\x00') == False
assert test_validate_code(b'\xdc\x00') == False
assert test_validate_code(b'\xdd\x00') == False
assert test_validate_code(b'\xde\x00') == False
assert test_validate_code(b'\xdf\x00') == False
assert test_validate_code(b'\xe0\x00') == False
assert test_validate_code(b'\xe1\x00') == False
assert test_validate_code(b'\xe2\x00') == False
assert test_validate_code(b'\xe3\x00') == False
assert test_validate_code(b'\xe4\x00') == False
assert test_validate_code(b'\xe5\x00') == False
assert test_validate_code(b'\xe6\x00') == False
assert test_validate_code(b'\xe7\x00') == False
assert test_validate_code(b'\xe8\x00') == False
assert test_validate_code(b'\xe9\x00') == False
assert test_validate_code(b'\xea\x00') == False
assert test_validate_code(b'\xeb\x00') == False
assert test_validate_code(b'\xec\x00') == False
assert test_validate_code(b'\xed\x00') == False
assert test_validate_code(b'\xee\x00') == False
assert test_validate_code(b'\xef\x00') == False
assert test_validate_code(b'\xf6\x00') == False
assert test_validate_code(b'\xf7\x00') == False
assert test_validate_code(b'\xf8\x00') == False
assert test_validate_code(b'\xf9\x00') == False
assert test_validate_code(b'\xfb\x00') == False
assert test_validate_code(b'\xfc\x00') == False
# PUSHes with truncated immediates
assert test_validate_code(b'\x60\x00') == False
assert test_validate_code(b'\x61' + b'\x00' * 1 + b'\x00') == False
assert test_validate_code(b'\x62' + b'\x00' * 2 + b'\x00') == False
assert test_validate_code(b'\x63' + b'\x00' * 3 + b'\x00') == False
assert test_validate_code(b'\x64' + b'\x00' * 4 + b'\x00') == False
assert test_validate_code(b'\x65' + b'\x00' * 5 + b'\x00') == False
assert test_validate_code(b'\x66' + b'\x00' * 6 + b'\x00') == False
assert test_validate_code(b'\x67' + b'\x00' * 7 + b'\x00') == False
assert test_validate_code(b'\x68' + b'\x00' * 8 + b'\x00') == False
assert test_validate_code(b'\x69' + b'\x00' * 9 + b'\x00') == False
assert test_validate_code(b'\x6a' + b'\x00' * 10 + b'\x00') == False
assert test_validate_code(b'\x6b' + b'\x00' * 11 + b'\x00') == False
assert test_validate_code(b'\x6c' + b'\x00' * 12 + b'\x00') == False
assert test_validate_code(b'\x6d' + b'\x00' * 13 + b'\x00') == False
assert test_validate_code(b'\x6e' + b'\x00' * 14 + b'\x00') == False
assert test_validate_code(b'\x6f' + b'\x00' * 15 + b'\x00') == False
assert test_validate_code(b'\x70' + b'\x00' * 16 + b'\x00') == False
assert test_validate_code(b'\x71' + b'\x00' * 17 + b'\x00') == False
assert test_validate_code(b'\x72' + b'\x00' * 18 + b'\x00') == False
assert test_validate_code(b'\x73' + b'\x00' * 19 + b'\x00') == False
assert test_validate_code(b'\x74' + b'\x00' * 20 + b'\x00') == False
assert test_validate_code(b'\x75' + b'\x00' * 21 + b'\x00') == False
assert test_validate_code(b'\x76' + b'\x00' * 22 + b'\x00') == False
assert test_validate_code(b'\x77' + b'\x00' * 23 + b'\x00') == False
assert test_validate_code(b'\x78' + b'\x00' * 24 + b'\x00') == False
assert test_validate_code(b'\x79' + b'\x00' * 25 + b'\x00') == False
assert test_validate_code(b'\x7a' + b'\x00' * 26 + b'\x00') == False
assert test_validate_code(b'\x7b' + b'\x00' * 27 + b'\x00') == False
assert test_validate_code(b'\x7c' + b'\x00' * 28 + b'\x00') == False
assert test_validate_code(b'\x7d' + b'\x00' * 29 + b'\x00') == False
assert test_validate_code(b'\x7e' + b'\x00' * 30 + b'\x00') == False
assert test_validate_code(b'\x7f' + b'\x00' * 31 + b'\x00') == False
| 44.657895
| 76
| 0.686927
| 1,968
| 11,879
| 3.950711
| 0.147358
| 0.293248
| 0.386881
| 0.529132
| 0.816592
| 0.793955
| 0.782765
| 0.318842
| 0
| 0
| 0
| 0.087719
| 0.131493
| 11,879
| 265
| 77
| 44.826415
| 0.665891
| 0.052109
| 0
| 0
| 0
| 0
| 0.153025
| 0
| 0
| 0
| 0.012456
| 0
| 0.86036
| 1
| 0.009009
| false
| 0
| 0
| 0
| 0.018018
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
2e44796c72307a9344762bf57ea05588bb5300c1
| 17,747
|
py
|
Python
|
model.py
|
alexcdot/gen-MA-BC
|
ef0cb71f461ed7241fd2961c3605a91caa13d07b
|
[
"MIT"
] | null | null | null |
model.py
|
alexcdot/gen-MA-BC
|
ef0cb71f461ed7241fd2961c3605a91caa13d07b
|
[
"MIT"
] | null | null | null |
model.py
|
alexcdot/gen-MA-BC
|
ef0cb71f461ed7241fd2961c3605a91caa13d07b
|
[
"MIT"
] | null | null | null |
import numpy as np
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from model_utils import *
def process_input_data(input_type, data, macro, params):
if input_type == 'y':
return data
elif input_type == 'xy':
# Get the trained offense and defense for x
n_agents = params['n_agents']
n_trained_off = max(params['n_trained_off'], n_agents)
n_gt_off = params['n_gt_off']
n_trained_def = params['n_trained_def']
n_offense = n_trained_off + n_gt_off
trained_indices = [i for i in range(2 * n_trained_off)] + \
[i for i in range(2 * n_offense, 2 * (n_offense + n_trained_def))]
n_trained_players = n_trained_off + n_trained_def
x = data[1:,:, trained_indices].clone()
x = x.view(x.size(0), x.size(1), n_trained_players, -1).transpose(1,2)
y = data
return x, y
elif input_type == 'xym':
# Get the trained offense and defense for x
n_agents = params['n_agents']
n_trained_off = max(params['n_trained_off'], n_agents)
n_gt_off = params['n_gt_off']
n_trained_def = params['n_trained_def']
n_offense = n_trained_off + n_gt_off
trained_indices = [i for i in range(2 * n_trained_off)] + \
[i for i in range(2 * n_offense, 2 * (n_offense + n_trained_def))]
n_trained_players = n_trained_off + n_trained_def
x = data[1:,:, trained_indices].clone()
x = x.view(x.size(0), x.size(1), n_trained_players, -1).transpose(1,2)
y = data
macro_ohe = torch.zeros(data.size(0), n_trained_players, data.size(1), 90)
for i in range(n_trained_players):
macro_ohe[:,i,:,:] = one_hot_encode(macro[:,:,i].data, 90)
macro_ohe = Variable(macro_ohe).cuda() if macro.is_cuda else Variable(macro_ohe)
return x, y, macro_ohe
else:
return data, macro
def num_trainable_params(model):
total = 0
for p in model.parameters():
count = 1
for s in p.size():
count *= s
total += count
return total
def cudafy_list(states):
for i in range(len(states)):
states[i] = states[i].cuda()
return states
# 104
class MACRO_VRNN(nn.Module):
def __init__(self, params):
super(MACRO_VRNN, self).__init__()
self.input_type = 'xym'
self.params = params
x_dim = params['x_dim']
y_dim = params['y_dim']
z_dim = params['z_dim']
h_dim = params['h_dim']
m_dim = params['m_dim']
rnn_micro_dim = params['rnn_micro_dim']
rnn_macro_dim = params['rnn_macro_dim']
n_layers = params['n_layers']
n_agents = params['n_agents']
n_trained_off = max(params['n_trained_off'], n_agents)
n_trained_def = params['n_trained_def']
n_trained_players = n_trained_def + n_trained_off
# takes the y, rnn_macro, and outputs m
self.dec_macro = nn.ModuleList([nn.Sequential(
nn.Linear(y_dim+rnn_macro_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, m_dim),
nn.LogSoftmax()) for i in range(n_trained_players)])
# takes the x, m, rnn_micro, and outputs h
self.enc = nn.ModuleList([nn.Sequential(
nn.Linear(x_dim+m_dim+rnn_micro_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU()) for i in range(n_trained_players)])
# Takes h, outputs z
self.enc_mean = nn.ModuleList([nn.Linear(h_dim, z_dim) for i in range(n_trained_players)])
# Takes h, outputs z
self.enc_std = nn.ModuleList([nn.Sequential(
nn.Linear(h_dim, z_dim),
nn.Softplus()) for i in range(n_trained_players)])
# Takes m_dim, and rnn_micro (no x_dim), outputs h
# Otherwise, dims are same as enc
self.prior = nn.ModuleList([nn.Sequential(
nn.Linear(m_dim+rnn_micro_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU()) for i in range(n_trained_players)])
self.prior_mean = nn.ModuleList([nn.Linear(h_dim, z_dim) for i in range(n_trained_players)])
self.prior_std = nn.ModuleList([nn.Sequential(
nn.Linear(h_dim, z_dim),
nn.Softplus()) for i in range(n_trained_players)])
# takes y, m, z, rnn_micro, outputs h_dim
self.dec = nn.ModuleList([nn.Sequential(
nn.Linear(y_dim+m_dim+z_dim+rnn_micro_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU()) for i in range(n_trained_players)])
# takes h, outputs x
self.dec_mean = nn.ModuleList([nn.Linear(h_dim, x_dim) for i in range(n_trained_players)])
self.dec_std = nn.ModuleList([nn.Sequential(
nn.Linear(h_dim, x_dim),
nn.Softplus()) for i in range(n_trained_players)])
# takes x and z, outputs rnn_micro
self.gru_micro = nn.ModuleList([nn.GRU(x_dim+z_dim, rnn_micro_dim, n_layers)
for i in range(n_trained_players)])
# takes m * n, outputs rnn_macro
self.gru_macro = nn.GRU(m_dim*n_trained_players, rnn_macro_dim, n_layers)
def forward(self, data, macro=None, hp=None):
x, y, m = process_input_data(self.input_type, data, macro, self.params)
out = {}
out['recon_loss'] = 0
if not hp['pretrain']:
out['kl_loss'] = 0
n_agents = self.params['n_agents']
n_trained_off = max(self.params['n_trained_off'], n_agents)
n_trained_def = self.params['n_trained_def']
n_trained_players = n_trained_def + n_trained_off
h_micro = [Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_micro_dim']))
for i in range(n_trained_players)]
h_macro = Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_macro_dim']))
if self.params['cuda']:
h_macro = h_macro.cuda()
h_micro = cudafy_list(h_micro)
for t in range(y.size(0)-1):
x_t = x[t].clone()
y_t = y[t].clone()
m_t = m[t].clone()
if hp['pretrain']:
for i in range(n_trained_players):
dec_macro_t = self.dec_macro[i](torch.cat([y_t, h_macro[-1]], 1))
out['recon_loss'] -= torch.sum(m_t[i]*dec_macro_t)
m_t_concat = m_t.transpose(0,1).contiguous().view(y.size(1), -1).clone()
_, h_macro = self.gru_macro(torch.cat([m_t_concat], 1).unsqueeze(0), h_macro)
else:
for i in range(n_trained_players):
enc_t = self.enc[i](torch.cat([x_t[i], m_t[i], h_micro[i][-1]], 1))
enc_mean_t = self.enc_mean[i](enc_t)
enc_std_t = self.enc_std[i](enc_t)
prior_t = self.prior[i](torch.cat([m_t[i], h_micro[i][-1]], 1))
prior_mean_t = self.prior_mean[i](prior_t)
prior_std_t = self.prior_std[i](prior_t)
z_t = sample_gauss(enc_mean_t, enc_std_t)
dec_t = self.dec[i](torch.cat([y_t, m_t[i], z_t, h_micro[i][-1]], 1))
dec_mean_t = self.dec_mean[i](dec_t)
dec_std_t = self.dec_std[i](dec_t)
_, h_micro[i] = self.gru_micro[i](torch.cat([x_t[i], z_t], 1).unsqueeze(0), h_micro[i])
out['kl_loss'] += kld_gauss(enc_mean_t, enc_std_t, prior_mean_t, prior_std_t)
out['recon_loss'] += nll_gauss(dec_mean_t, dec_std_t, x_t[i])
return out
def sample(self, data, macro, seq_len=0, burn_in=0, fix_m=[], seqs_per_sample=1):
x, y, m = process_input_data(self.input_type, data, macro, self.params)
n_agents = self.params['n_agents']
n_trained_off = max(self.params['n_trained_off'], n_agents)
n_trained_def = self.params['n_trained_def']
n_trained_players = n_trained_def + n_trained_off
if seq_len == 0:
seq_len = y.size(0)-1
if len(fix_m) == 0:
fix_m = [-1]*n_trained_players
h_micro = [Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_micro_dim']))
for i in range(n_trained_players)]
h_macro = Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_macro_dim']))
macro_goals = Variable(torch.zeros(seq_len+1, y.size(1), n_trained_players))
if self.params['cuda']:
h_macro, macro_goals = h_macro.cuda(), macro_goals.cuda()
h_micro = cudafy_list(h_micro)
all_rets = []
all_macro_goals = []
for _ in range(seqs_per_sample):
ret = y.clone()
for t in range(seq_len):
y_t = ret[t].clone()
m_t = m[t].clone()
# Since i is looping over the first n agents, when train_def is
# turned on, and n_agents = 5,
# the defense is not affected by the sampling procedure.
for i in range(n_trained_players):
dec_macro_t = self.dec_macro[i](torch.cat([y_t, h_macro[-1]], 1))
m_t[i] = sample_multinomial(torch.exp(dec_macro_t))
macro_goals[t] = torch.max(m_t, 2)[1].transpose(0,1)
m_t_concat = m_t.transpose(0,1).contiguous().view(y.size(1), -1)
_, h_macro = self.gru_macro(torch.cat([m_t_concat], 1).unsqueeze(0), h_macro)
for i in range(n_trained_players):
prior_t = self.prior[i](torch.cat([m_t[i], h_micro[i][-1]], 1))
prior_mean_t = self.prior_mean[i](prior_t)
prior_std_t = self.prior_std[i](prior_t)
z_t = sample_gauss(prior_mean_t, prior_std_t)
dec_t = self.dec[i](torch.cat([y_t, m_t[i], z_t, h_micro[i][-1]], 1))
dec_mean_t = self.dec_mean[i](dec_t)
dec_std_t = self.dec_std[i](dec_t)
# ret[t+1,:,2*i:2*i+2] = y[t+1,:,2*i:2*i+2] if t < burn_in or i > 0 else sample_gauss(dec_mean_t, dec_std_t)
ret[t+1,:,2*i:2*i+2] = y[t+1,:,2*i:2*i+2] if t < burn_in else sample_gauss(dec_mean_t, dec_std_t)
_, h_micro[i] = self.gru_micro[i](torch.cat([ret[t+1,:,2*i:2*i+2], z_t], 1).unsqueeze(0), h_micro[i])
print(macro_goals.shape, macro_goals.data.cpu().numpy().shape)
macro_goals.data[-1] = macro_goals.data[-2]
all_rets.append(ret.data.cpu().numpy())
all_macro_goals.append(macro_goals.data.cpu().numpy())
print(np.array(all_rets).shape, np.array(all_macro_goals).shape)
return np.array(all_rets), np.array(all_macro_goals)
# 103
class VRNN_INDEP(nn.Module):
def __init__(self, params):
super(VRNN_INDEP, self).__init__()
self.input_type = 'y'
self.params = params
x_dim = params['x_dim']
y_dim = params['y_dim']
z_dim = params['z_dim']
h_dim = params['h_dim']
rnn_dim = params['rnn_dim']
n_layers = params['n_layers']
n_agents = params['n_agents']
self.enc = nn.ModuleList([nn.Sequential(
nn.Linear(x_dim+y_dim+rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU()) for i in range(n_agents)])
self.enc_mean = nn.ModuleList([nn.Linear(h_dim, z_dim) for i in range(n_agents)])
self.enc_std = nn.ModuleList([nn.Sequential(
nn.Linear(h_dim, z_dim),
nn.Softplus()) for i in range(n_agents)])
self.prior = nn.ModuleList([nn.Sequential(
nn.Linear(y_dim+rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU()) for i in range(n_agents)])
self.prior_mean = nn.ModuleList([nn.Linear(h_dim, z_dim) for i in range(n_agents)])
self.prior_std = nn.ModuleList([nn.Sequential(
nn.Linear(h_dim, z_dim),
nn.Softplus()) for i in range(n_agents)])
self.dec = nn.ModuleList([nn.Sequential(
nn.Linear(y_dim+z_dim+rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU()) for i in range(n_agents)])
self.dec_mean = nn.ModuleList([nn.Linear(h_dim, x_dim) for i in range(n_agents)])
self.dec_std = nn.ModuleList([nn.Sequential(
nn.Linear(h_dim, x_dim),
nn.Softplus()) for i in range(n_agents)])
self.rnn = nn.ModuleList([nn.GRU(x_dim+z_dim, rnn_dim, n_layers) for i in range(n_agents)])
def forward(self, data, macro=None, hp=None):
y = process_input_data(self.input_type, data, macro, self.params)
out = {}
out['kl_loss'] = 0
out['recon_loss'] = 0
n_agents = int(self.params['y_dim']/self.params['x_dim'])
h = [Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_dim'])) for i in range(n_agents)]
if self.params['cuda']:
h = cudafy_list(h)
for t in range(y.size(0)-1):
y_t = y[t].clone()
for i in range(n_agents):
x_t = y[t+1][:,2*i:2*i+2].clone()
enc_t = self.enc[i](torch.cat([x_t, y_t, h[i][-1]], 1))
enc_mean_t = self.enc_mean[i](enc_t)
enc_std_t = self.enc_std[i](enc_t)
prior_t = self.prior[i](torch.cat([y_t, h[i][-1]], 1))
prior_mean_t = self.prior_mean[i](prior_t)
prior_std_t = self.prior_std[i](prior_t)
z_t = sample_gauss(enc_mean_t, enc_std_t)
dec_t = self.dec[i](torch.cat([y_t, z_t, h[i][-1]], 1))
dec_mean_t = self.dec_mean[i](dec_t)
dec_std_t = self.dec_std[i](dec_t)
_, h[i] = self.rnn[i](torch.cat([x_t, z_t], 1).unsqueeze(0), h[i])
out['kl_loss'] += kld_gauss(enc_mean_t, enc_std_t, prior_mean_t, prior_std_t)
out['recon_loss'] += nll_gauss(dec_mean_t, dec_std_t, x_t)
return out
def sample(self, data, macro, seq_len=0, burn_in=0):
y = process_input_data(self.input_type, data, macro, self.params)
if seq_len == 0:
seq_len = y.size(0)-1
n_agents = int(self.params['y_dim']/self.params['x_dim'])
h = [Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_dim'])) for i in range(n_agents)]
if self.params['cuda']:
h = cudafy_list(h)
ret = y.clone()
for t in range(seq_len):
y_t = ret[t].clone()
for i in range(n_agents):
prior_t = self.prior[i](torch.cat([y_t, h[i][-1]], 1))
prior_mean_t = self.prior_mean[i](prior_t)
prior_std_t = self.prior_std[i](prior_t)
z_t = sample_gauss(prior_mean_t, prior_std_t)
dec_t = self.dec[i](torch.cat([y_t, z_t, h[i][-1]], 1))
dec_mean_t = self.dec_mean[i](dec_t)
dec_std_t = self.dec_std[i](dec_t)
if t >= burn_in:
ret[t+1,:,2*i:2*i+2] = sample_gauss(dec_mean_t, dec_std_t)
_, h[i] = self.rnn[i](torch.cat([ret[t+1,:,2*i:2*i+2], z_t], 1).unsqueeze(0), h[i])
return ret
# 102
class VRNN_SINGLE(nn.Module):
def __init__(self, params):
super(VRNN_SINGLE, self).__init__()
self.input_type = 'y'
self.params = params
y_dim = params['y_dim']
z_dim = params['z_dim']
h_dim = params['h_dim']
rnn_dim = params['rnn_dim']
n_layers = params['n_layers']
self.enc = nn.Sequential(
nn.Linear(y_dim+y_dim+rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU())
self.enc_mean = nn.Linear(h_dim, z_dim)
self.enc_std = nn.Sequential(
nn.Linear(h_dim, z_dim),
nn.Softplus())
self.prior = nn.Sequential(
nn.Linear(y_dim+rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU())
self.prior_mean = nn.Linear(h_dim, z_dim)
self.prior_std = nn.Sequential(
nn.Linear(h_dim, z_dim),
nn.Softplus())
self.dec = nn.Sequential(
nn.Linear(y_dim+z_dim+rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU())
self.dec_mean = nn.Linear(h_dim, y_dim)
self.dec_std = nn.Sequential(
nn.Linear(h_dim, y_dim),
nn.Softplus())
self.rnn = nn.GRU(y_dim+z_dim, rnn_dim, n_layers)
def forward(self, data, macro=None, hp=None):
y = process_input_data(self.input_type, data, macro, self.params)
out = {}
out['kl_loss'] = 0
out['recon_loss'] = 0
h = Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_dim']))
if self.params['cuda']:
h = h.cuda()
for t in range(y.size(0)-1):
y_t = y[t].clone()
x_t = y[t+1].clone()
enc_t = self.enc(torch.cat([x_t, y_t, h[-1]], 1))
enc_mean_t = self.enc_mean(enc_t)
enc_std_t = self.enc_std(enc_t)
prior_t = self.prior(torch.cat([y_t, h[-1]], 1))
prior_mean_t = self.prior_mean(prior_t)
prior_std_t = self.prior_std(prior_t)
z_t = sample_gauss(enc_mean_t, enc_std_t)
dec_t = self.dec(torch.cat([y_t, z_t, h[-1]], 1))
dec_mean_t = self.dec_mean(dec_t)
dec_std_t = self.dec_std(dec_t)
_, h = self.rnn(torch.cat([x_t, z_t], 1).unsqueeze(0), h)
out['kl_loss'] += kld_gauss(enc_mean_t, enc_std_t, prior_mean_t, prior_std_t)
out['recon_loss'] += nll_gauss(dec_mean_t, dec_std_t, x_t)
return out
def sample(self, data, macro, seq_len=0, burn_in=0):
y = process_input_data(self.input_type, data, macro, self.params)
if seq_len == 0:
seq_len = y.size(0)-1
h = Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_dim']))
if self.params['cuda']:
h = h.cuda()
for t in range(seq_len):
y_t = y[t].clone()
prior_t = self.prior(torch.cat([y_t, h[-1]], 1))
prior_mean_t = self.prior_mean(prior_t)
prior_std_t = self.prior_std(prior_t)
z_t = sample_gauss(prior_mean_t, prior_std_t)
dec_t = self.dec(torch.cat([y_t, z_t, h[-1]], 1))
dec_mean_t = self.dec_mean(dec_t)
dec_std_t = self.dec_std(dec_t)
if t >= burn_in:
y[t+1] = sample_gauss(dec_mean_t, dec_std_t)
_, h = self.rnn(torch.cat([y[t+1], z_t], 1).unsqueeze(0), h)
return y
# 101
class RNN_GAUSS(nn.Module):
def __init__(self, params):
super(RNN_GAUSS, self).__init__()
self.input_type = 'y'
self.params = params
x_dim = params['x_dim']
y_dim = params['y_dim']
h_dim = params['h_dim']
rnn_dim = params['rnn_dim']
n_layers = params['n_layers']
self.dec = nn.Sequential(
nn.Linear(rnn_dim, h_dim),
nn.ReLU(),
nn.Linear(h_dim, h_dim),
nn.ReLU())
self.dec_mean = nn.Linear(h_dim, y_dim)
self.dec_std = nn.Sequential(
nn.Linear(h_dim, y_dim),
nn.Softplus())
self.rnn = nn.GRU(y_dim, rnn_dim, n_layers)
def forward(self, data, macro=None, hp=None):
y = process_input_data(self.input_type, data, macro, self.params)
out = {}
out['nll'] = 0
h = Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_dim']))
if self.params['cuda']:
h = h.cuda()
for t in range(y.size(0)):
y_t = y[t].clone()
dec_t = self.dec(torch.cat([h[-1]], 1))
dec_mean_t = self.dec_mean(dec_t)
dec_std_t = self.dec_std(dec_t)
_, h = self.rnn(y_t.unsqueeze(0), h)
out['nll'] += nll_gauss(dec_mean_t, dec_std_t, y_t)
return out
def sample(self, data, macro, seq_len=0, burn_in=0):
y = process_input_data(self.input_type, data, macro, self.params)
if seq_len == 0:
seq_len = y.size(0)
h = Variable(torch.zeros(self.params['n_layers'], y.size(1), self.params['rnn_dim']))
if self.params['cuda']:
h = h.cuda()
for t in range(seq_len):
dec_t = self.dec(torch.cat([h[-1]], 1))
dec_mean_t = self.dec_mean(dec_t)
dec_std_t = self.dec_std(dec_t)
if t >= burn_in:
y[t] = sample_gauss(dec_mean_t, dec_std_t)
_, h = self.rnn(y[t].unsqueeze(0), h)
return y
| 30.598276
| 114
| 0.666253
| 3,349
| 17,747
| 3.243058
| 0.047775
| 0.047878
| 0.02044
| 0.037474
| 0.850842
| 0.830863
| 0.817512
| 0.796151
| 0.757389
| 0.722217
| 0
| 0.013042
| 0.166169
| 17,747
| 580
| 115
| 30.598276
| 0.720908
| 0.037922
| 0
| 0.717026
| 0
| 0
| 0.042219
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.035971
| false
| 0
| 0.016787
| 0
| 0.095923
| 0.004796
| 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
|
2e7ef23a81781a685346f2393963041e063e2a06
| 13,629
|
py
|
Python
|
dataviva/api/hedu/services.py
|
joelvisroman/dataviva-site
|
b4219558457746fd5c6b8f4b65b04c738c656fbd
|
[
"MIT"
] | 126
|
2015-03-24T12:30:43.000Z
|
2022-01-06T03:29:54.000Z
|
dataviva/api/hedu/services.py
|
joelvisroman/dataviva-site
|
b4219558457746fd5c6b8f4b65b04c738c656fbd
|
[
"MIT"
] | 694
|
2015-01-14T11:55:28.000Z
|
2021-02-08T20:23:11.000Z
|
dataviva/api/hedu/services.py
|
joelvisroman/dataviva-site
|
b4219558457746fd5c6b8f4b65b04c738c656fbd
|
[
"MIT"
] | 52
|
2015-06-19T01:54:56.000Z
|
2019-09-23T13:10:46.000Z
|
from dataviva.api.hedu.models import Ybu, Ybc_hedu, Yu, Yuc, Yc_hedu, Ybuc
from dataviva.api.attrs.models import University as uni, Course_hedu, Bra
from dataviva import db
from sqlalchemy.sql.expression import func, desc, not_
class University:
def __init__(self, university_id):
self._hedu = None
self._hedu_sorted_by_enrolled = None
self._hedu_sorted_by_entrants = None
self._hedu_sorted_by_graduates = None
self.university_id = university_id
if university_id is None:
self.max_year_query = db.session.query(func.max(Yu.year))
self.hedu_query = Yu.query.filter(Yu.year == self.max_year_query)
else:
self.max_year_query = db.session.query(
func.max(Yu.year)).filter_by(university_id=university_id)
self.hedu_query = Yu.query.filter(
Yu.university_id == self.university_id,
Yu.year == self.max_year_query)
def __hedu__(self):
if not self._hedu:
hedu_data = self.hedu_query.first_or_404()
self._hedu = hedu_data
return self._hedu
def __hedu_list__(self):
if not self._hedu:
hedu_data = self.hedu_query.all()
self._hedu = hedu_data
return self._hedu
def __hedu_sorted_by_enrolled__(self):
if not self._hedu_sorted_by_enrolled:
self._hedu_sorted_by_enrolled = self.__hedu_list__()
self._hedu_sorted_by_enrolled.sort(
key=lambda hedu: hedu.enrolled, reverse=True)
return self._hedu_sorted_by_enrolled
def __hedu_sorted_by_entrants__(self):
if not self._hedu_sorted_by_entrants:
self._hedu_sorted_by_entrants = self.__hedu_list__()
self._hedu_sorted_by_entrants.sort(
key=lambda hedu: hedu.entrants, reverse=True)
return self._hedu_sorted_by_entrants
def __hedu_sorted_by_graduates__(self):
if not self._hedu_sorted_by_graduates:
self._hedu_sorted_by_graduates = self.__hedu_list__()
self._hedu_sorted_by_graduates.sort(
key=lambda hedu: hedu.graduates, reverse=True)
return self._hedu_sorted_by_graduates
def name(self):
return self.__hedu__().university.name()
def university_type(self):
return self.__hedu__().university.school_type()
def enrolled(self):
return self.__hedu__().enrolled
def entrants(self):
return self.__hedu__().entrants
def graduates(self):
return self.__hedu__().graduates
def profile(self):
return self.__hedu__().university.desc_pt
def year(self):
return self.max_year_query.first()[0]
def highest_enrolled_number(self):
hedu = self.__hedu_sorted_by_enrolled__()[0]
return hedu.enrolled
def highest_entrants_number(self):
hedu = self.__hedu_sorted_by_entrants__()[0]
return hedu.entrants
def highest_graduates_number(self):
hedu = self.__hedu_sorted_by_graduates__()[0]
return hedu.graduates
def highest_enrolled_by_university(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.enrolled
else:
return None
def highest_enrolled_by_university_name(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.university.name()
else:
return None
class UniversityMajors(University):
def __init__(self, university_id):
University.__init__(self, university_id)
self.max_year_query = db.session.query(func.max(Yuc.year))
self.hedu_query = Yuc.query.filter(
Yuc.university_id == self.university_id,
Yuc.year == self.max_year_query,
func.length(Yuc.course_hedu_id) == 6)
def major_with_more_enrollments(self):
hedu = self.__hedu_sorted_by_enrolled__()[0]
return hedu.course_hedu.name()
def major_with_more_entrants(self):
hedu = self.__hedu_sorted_by_entrants__()[0]
return hedu.course_hedu.name()
def major_with_more_graduates(self):
hedu = self.__hedu_sorted_by_graduates__()[0]
return hedu.course_hedu.name()
class Major:
def __init__(self, course_hedu_id, bra_id):
self._hedu = None
self._hedu_sorted_by_enrolled = None
self._hedu_sorted_by_entrants = None
self._hedu_sorted_by_graduates = None
self._hedu_major_rank = None
self.course_hedu_id = course_hedu_id
self.bra_id = bra_id
if course_hedu_id is None and bra_id is None:
self.max_year_query = db.session.query(func.max(Yc_hedu.year))
self.hedu_query = Ybc_hedu.query.filter(Ybc_hedu.year == self.max_year_query)
else:
self.max_year_query = db.session.query(
func.max(Yc_hedu.year)).filter_by(course_hedu_id=course_hedu_id)
if bra_id != '':
self.hedu_query = Ybc_hedu.query.filter(
Ybc_hedu.course_hedu_id == self.course_hedu_id,
Ybc_hedu.bra_id == self.bra_id,
Ybc_hedu.year == self.max_year_query)
else:
self.hedu_query = Yc_hedu.query.filter(
Yc_hedu.course_hedu_id == self.course_hedu_id,
Yc_hedu.year == self.max_year_query)
def __hedu__(self):
if not self._hedu:
hedu_data = self.hedu_query.first_or_404()
self._hedu = hedu_data
return self._hedu
def __hedu_list__(self):
if not self._hedu:
hedu_data = self.hedu_query.all()
self._hedu = hedu_data
return self._hedu
def __hedu_sorted_by_enrolled__(self):
if not self._hedu_sorted_by_enrolled:
self._hedu_sorted_by_enrolled = self.__hedu_list__()
self._hedu_sorted_by_enrolled.sort(
key=lambda hedu: hedu.enrolled, reverse=True)
return self._hedu_sorted_by_enrolled
def __hedu_sorted_by_entrants__(self):
if not self._hedu_sorted_by_entrants:
self._hedu_sorted_by_entrants = self.__hedu_list__()
self._hedu_sorted_by_entrants.sort(
key=lambda hedu: hedu.entrants, reverse=True)
return self._hedu_sorted_by_entrants
def __hedu_sorted_by_graduates__(self):
if not self._hedu_sorted_by_graduates:
self._hedu_sorted_by_graduates = self.__hedu_list__()
self._hedu_sorted_by_graduates.sort(
key=lambda hedu: hedu.graduates, reverse=True)
return self._hedu_sorted_by_graduates
def name(self):
return self.__hedu__().course_hedu.name()
def enrolled(self):
return self.__hedu__().enrolled
def entrants(self):
return self.__hedu__().entrants
def graduates(self):
return self.__hedu__().graduates
def profile(self):
return self.__hedu__().course_hedu.desc_pt
def year(self):
return self.__hedu__().year
def highest_enrolled_number(self):
hedu = self.__hedu_sorted_by_enrolled__()[0]
return hedu.enrolled
def highest_entrants_number(self):
hedu = self.__hedu_sorted_by_entrants__()[0]
return hedu.entrants
def highest_graduates_number(self):
hedu = self.__hedu_sorted_by_graduates__()[0]
return hedu.graduates
def location_name(self):
return Bra.query.filter(Bra.id == self.bra_id).first().name()
def highest_enrolled_by_major(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.enrolled
else:
return None
def highest_enrolled_by_major_name(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.course_hedu.name()
else:
return None
class MajorUniversities(Major):
def __init__(self, course_hedu_id, bra_id):
Major.__init__(self, course_hedu_id, bra_id)
self.course_hedu_id = course_hedu_id
self.max_year_query = db.session.query(
func.max(Yuc.year)).filter_by(course_hedu_id=course_hedu_id)
if bra_id == '':
self.hedu_query = Yuc.query.filter(
Yuc.course_hedu_id == self.course_hedu_id,
Yuc.year == self.max_year_query)
else:
self.hedu_query = Ybuc.query.filter(
Ybuc.course_hedu_id == self.course_hedu_id,
Ybuc.bra_id == self.bra_id,
Ybuc.year == self.max_year_query)
def university_with_more_enrolled(self):
hedu = self.__hedu_sorted_by_enrolled__()[0]
return hedu.university.name()
def university_with_more_entrants(self):
hedu = self.__hedu_sorted_by_entrants__()[0]
return hedu.university.name()
def university_with_more_graduates(self):
hedu = self.__hedu_sorted_by_graduates__()[0]
return hedu.university.name()
class MajorMunicipalities(Major):
def __init__(self, course_hedu_id, bra_id):
Major.__init__(self, course_hedu_id, bra_id)
self.course_hedu_id = course_hedu_id
self.max_year_query = db.session.query(
func.max(Ybc_hedu.year)).filter_by(course_hedu_id=course_hedu_id)
if bra_id == '':
self.hedu_query = Ybc_hedu.query.filter(
Ybc_hedu.course_hedu_id == self.course_hedu_id,
Ybc_hedu.year == self.max_year_query,
not_(Ybc_hedu.bra_id.like('0xx%')),
func.length(Ybc_hedu.bra_id) == 9)
else:
self.hedu_query = Ybc_hedu.query.filter(
Ybc_hedu.course_hedu_id == self.course_hedu_id,
Ybc_hedu.year == self.max_year_query,
Ybc_hedu.bra_id.like(self.bra_id+'%'),
not_(Ybc_hedu.bra_id.like('0xx%')),
func.length(Ybc_hedu.bra_id) == 9)
def municipality_with_more_enrolled(self):
hedu = self.__hedu_sorted_by_enrolled__()[0]
return hedu.bra.name()
def municipality_with_more_enrolled_state(self):
hedu = self.__hedu_sorted_by_enrolled__()[0]
return hedu.bra.abbreviation
def municipality_with_more_entrants(self):
hedu = self.__hedu_sorted_by_entrants__()[0]
return hedu.bra.name()
def municipality_with_more_entrants_state(self):
hedu = self.__hedu_sorted_by_entrants__()[0]
return hedu.bra.abbreviation
def municipality_with_more_graduates(self):
hedu = self.__hedu_sorted_by_graduates__()[0]
return hedu.bra.name()
def municipality_with_more_graduates_state(self):
hedu = self.__hedu_sorted_by_graduates__()[0]
return hedu.bra.abbreviation
class LocationUniversity:
def __init__(self, bra_id):
self._hedu_sorted_by_enrolled = None
self._hedu = None
self.bra_id = bra_id
self.max_year_query = db.session.query(
func.max(Ybu.year)).filter_by(bra_id=bra_id)
self.hedu_query = Ybu.query.join(uni).filter(
Ybu.bra_id == self.bra_id,
Ybu.year == self.max_year_query)
def __hedu__(self):
if not self._hedu:
hedu_data = self.hedu_query.one()
self._hedu = hedu_data
return self._hedu
def __hedu_list__(self):
if not self._hedu:
hedu_data = self.hedu_query.all()
self._hedu = hedu_data
return self._hedu
def __hedu_sorted_by_enrolled__(self):
if not self._hedu_sorted_by_enrolled:
self._hedu_sorted_by_enrolled = self.__hedu_list__()
self._hedu_sorted_by_enrolled.sort(
key=lambda hedu: hedu.enrolled, reverse=True)
return self._hedu_sorted_by_enrolled
def year(self):
return self.max_year_query.first()[0]
def highest_enrolled_by_university(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.enrolled
else:
return None
def highest_enrolled_by_university_name(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.university.name()
else:
return None
class LocationMajor(LocationUniversity):
def __init__(self, bra_id):
LocationUniversity.__init__(self, bra_id)
self._hedu = None
self.bra_id = bra_id
self.max_year_query = db.session.query(
func.max(Ybc_hedu.year)).filter_by(bra_id=bra_id)
self.hedu_query = Ybc_hedu.query.join(Course_hedu).filter(
Ybc_hedu.bra_id == self.bra_id,
Ybc_hedu.course_hedu_id_len == 6,
Ybc_hedu.year == self.max_year_query)
def highest_enrolled_by_major(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.enrolled
else:
return None
def highest_enrolled_by_major_name(self):
hedu_list = self.__hedu_sorted_by_enrolled__()
if len(hedu_list) != 0:
hedu = hedu_list[0]
return hedu.course_hedu.name()
else:
return None
| 33.818859
| 88
| 0.640399
| 1,773
| 13,629
| 4.415116
| 0.049069
| 0.15023
| 0.104241
| 0.124681
| 0.916709
| 0.879407
| 0.853347
| 0.819366
| 0.806081
| 0.757409
| 0
| 0.004834
| 0.271407
| 13,629
| 402
| 89
| 33.902985
| 0.783484
| 0
| 0
| 0.774295
| 0
| 0
| 0.00066
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.191223
| false
| 0
| 0.012539
| 0.047022
| 0.420063
| 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
|
cf006fc10424bad7603a46d59ea1e4cdfcf4fcb1
| 155
|
py
|
Python
|
newrelic/common/constants.py
|
holyachon/newrelic-python-agent
|
242c51a869b506d4235c8fedf024002251ac502c
|
[
"Apache-2.0"
] | null | null | null |
newrelic/common/constants.py
|
holyachon/newrelic-python-agent
|
242c51a869b506d4235c8fedf024002251ac502c
|
[
"Apache-2.0"
] | null | null | null |
newrelic/common/constants.py
|
holyachon/newrelic-python-agent
|
242c51a869b506d4235c8fedf024002251ac502c
|
[
"Apache-2.0"
] | null | null | null |
LOCALHOST_EQUIVALENTS = frozenset((
'localhost',
'127.0.0.1',
'0.0.0.0',
'0:0:0:0:0:0:0:0',
'0:0:0:0:0:0:0:1',
'::1',
'::',
))
| 15.5
| 35
| 0.425806
| 29
| 155
| 2.241379
| 0.206897
| 0.584615
| 0.784615
| 0.984615
| 0.292308
| 0.292308
| 0.292308
| 0.292308
| 0.292308
| 0.292308
| 0
| 0.232759
| 0.251613
| 155
| 9
| 36
| 17.222222
| 0.327586
| 0
| 0
| 0
| 0
| 0
| 0.387097
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
cf186bd99af761fe0deb32fb9f80f9f86dc6c68e
| 69
|
py
|
Python
|
multilingual_t5/r_baseline_ta/__init__.py
|
sumanthd17/mt5
|
c99b4e3ad1c69908c852c730a1323ccb52d48f58
|
[
"Apache-2.0"
] | null | null | null |
multilingual_t5/r_baseline_ta/__init__.py
|
sumanthd17/mt5
|
c99b4e3ad1c69908c852c730a1323ccb52d48f58
|
[
"Apache-2.0"
] | null | null | null |
multilingual_t5/r_baseline_ta/__init__.py
|
sumanthd17/mt5
|
c99b4e3ad1c69908c852c730a1323ccb52d48f58
|
[
"Apache-2.0"
] | null | null | null |
"""r_baseline_ta dataset."""
from .r_baseline_ta import RBaselineTa
| 17.25
| 38
| 0.782609
| 10
| 69
| 5
| 0.7
| 0.36
| 0.44
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101449
| 69
| 3
| 39
| 23
| 0.806452
| 0.318841
| 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
|
cf43b76c9742142ab6dcd09ee5ee6ba7b415b219
| 1,814
|
py
|
Python
|
models/gradientCompression/SignSGD.py
|
codecaution/leaf
|
3239b84a17ba9489d5da529e2f1273774840d31f
|
[
"BSD-2-Clause"
] | 1
|
2019-12-10T04:26:51.000Z
|
2019-12-10T04:26:51.000Z
|
models/gradientCompression/SignSGD.py
|
codecaution/leaf
|
3239b84a17ba9489d5da529e2f1273774840d31f
|
[
"BSD-2-Clause"
] | null | null | null |
models/gradientCompression/SignSGD.py
|
codecaution/leaf
|
3239b84a17ba9489d5da529e2f1273774840d31f
|
[
"BSD-2-Clause"
] | 1
|
2019-12-10T11:22:31.000Z
|
2019-12-10T11:22:31.000Z
|
import numpy as np
# gradient_list: type list
# gradient_list[0]: type numpy.ndarray
class SignUpdate:
def GradientCompress(self, gradient_list):
compressed_gradient_list = []
element_num = 0
for gradient in gradient_list:
element_num += np.size(gradient)
compressed_gradient_list.append(np.sign(gradient))
return compressed_gradient_list, element_num * 32, element_num
def MajorityVote(self, gradient_list):
compressed_gradient_list = []
for gradient in gradient_list:
compressed_gradient_list.append(np.sign(gradient))
return compressed_gradient_list
class SigumUpdate:
def __init__(self, belta):
self.momentum = None
self.belta = belta
def GradientCompress(self, gradient_list):
compressed_gradient_list = []
element_num = 0
if self.momentum is None:
for i, gradient in enumerate(gradient_list):
element_num += np.size(gradient)
self.momentum[i] = (1 - self.belta) * gradient
compressed_gradient_list.append(np.sign(self.momentum[i]))
else:
for i, gradient in enumerate(gradient_list):
element_num += np.size(gradient)
self.momentum[i] = self.belta * self.momentum + (1 - self.belta) * gradient
compressed_gradient_list.append(np.sign(self.momentum[i]))
return compressed_gradient_list, element_num * 32, element_num
def MajorityVote(self, gradient_list):
compressed_gradient_list = []
for gradient in gradient_list:
compressed_gradient_list.append(np.sign(gradient))
return compressed_gradient_list
SignSGDUpdate = SignUpdate()
SigumSGDUpdate = SigumUpdate(0.9)
| 32.981818
| 91
| 0.65215
| 205
| 1,814
| 5.526829
| 0.190244
| 0.254192
| 0.252427
| 0.135922
| 0.791703
| 0.780229
| 0.780229
| 0.748455
| 0.748455
| 0.748455
| 0
| 0.008271
| 0.266814
| 1,814
| 54
| 92
| 33.592593
| 0.843609
| 0.03473
| 0
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.128205
| false
| 0
| 0.025641
| 0
| 0.307692
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
d88eed95ecec58a383f4a495e99910170cd2e819
| 9,658
|
py
|
Python
|
Protheus_WebApp/Modules/SIGACTB/CTBA211TESTCASE.py
|
98llm/tir-script-samples
|
0bff8393b79356aa562e9e6512c11ee6e039b177
|
[
"MIT"
] | 17
|
2018-09-24T17:27:08.000Z
|
2021-09-16T19:09:46.000Z
|
Protheus_WebApp/Modules/SIGACTB/CTBA211TESTCASE.py
|
98llm/tir-script-samples
|
0bff8393b79356aa562e9e6512c11ee6e039b177
|
[
"MIT"
] | 4
|
2018-09-24T17:30:32.000Z
|
2022-01-03T11:39:30.000Z
|
Protheus_WebApp/Modules/SIGACTB/CTBA211TESTCASE.py
|
98llm/tir-script-samples
|
0bff8393b79356aa562e9e6512c11ee6e039b177
|
[
"MIT"
] | 18
|
2019-06-07T17:41:34.000Z
|
2022-01-31T18:17:31.000Z
|
from tir import Webapp
import unittest
class CTBA211(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup("SIGACTB", "30/06/2015", "T1", "M PR 02 ", "34")
inst.oHelper.Program("CTBA211")
###########################################################################################
# Caso de teste 001 - Incluir Rateio #
# 29/08/2019 #
###########################################################################################
def test_CTBA211_001(self):
self.oHelper.ClickTree("Apuracao de Lucros / Perdas > Perguntas")
#Perguntes
self.oHelper.SetValue("mv_par01", "01062015")
self.oHelper.SetValue("mv_par02", "30062015")
self.oHelper.SetValue("mv_par03", "APUR15")
self.oHelper.SetValue("mv_par04", "001")
self.oHelper.SetValue("mv_par05", "000001")
self.oHelper.SetValue("mv_par06", "001")
self.oHelper.SetValue("mv_par07", "CTB211ELC")
self.oHelper.SetValue("mv_par08", "CTB211ELD")
self.oHelper.SetValue("Moedas ?", "Todas") #Todas / Específica
self.oHelper.SetValue("mv_par10", "01")
self.oHelper.SetValue("Considera Ent.Ponte ?", "Sim")
self.oHelper.SetValue("mv_par12", "1")
self.oHelper.SetValue("Considera Entidades ?", "Rotina de Apur.")
self.oHelper.SetValue("mv_par14", "CTB211CP")
self.oHelper.SetValue("mv_par15", "CTB211CA")
self.oHelper.SetValue("mv_par16", "")
self.oHelper.SetValue("mv_par17", "")
self.oHelper.SetValue("mv_par18", "")
self.oHelper.SetValue("mv_par19", "")
self.oHelper.SetValue("mv_par20", "")
self.oHelper.SetValue("mv_par21", "")
self.oHelper.SetValue("mv_par22", "")
self.oHelper.SetValue("mv_par23", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par24", "")
self.oHelper.SetValue("mv_par25", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par26", "")
self.oHelper.SetValue("mv_par27", "ZZZZZZZZZ")
self.oHelper.SetValue("Reproces. Saldos ?", "Sim")#
self.oHelper.SetValue("Seleciona Filiais ?", "Sim")#
self.oHelper.SetValue("mv_par30", "M PR 02")
self.oHelper.SetValue("mv_par31", "M PR 02")
self.oHelper.ClickIcon("Iniciar Execução")
self.oHelper.SetButton("Sim")
self.oHelper.SetButton("Sim")
self.oHelper.SetButton("Sim")
self.oHelper.Program("CTBA211")
self.oHelper.AssertTrue()
def test_CTBA211_002(self):
self.oHelper.ClickTree("Apuracao de Lucros / Perdas > Perguntas")
#Perguntes
self.oHelper.SetValue("mv_par01", "01052014")
self.oHelper.SetValue("mv_par02", "31052014")
self.oHelper.SetValue("mv_par03", "")
self.oHelper.SetValue("mv_par04", "")
self.oHelper.SetValue("mv_par05", "")
self.oHelper.SetValue("mv_par06", "006")
self.oHelper.SetValue("mv_par07", "")
self.oHelper.SetValue("mv_par08", "")
self.oHelper.SetValue("Moedas ?", "Todas") #Todas / Específica
self.oHelper.SetValue("mv_par10", "")
self.oHelper.SetValue("Considera Ent.Ponte ?", "Sim")
self.oHelper.SetValue("mv_par12", "")
self.oHelper.SetValue("Considera Entidades ?", "Rotina de Apur.")
self.oHelper.SetValue("mv_par14", "")
self.oHelper.SetValue("mv_par15", "")
self.oHelper.SetValue("mv_par16", "")
self.oHelper.SetValue("mv_par17", "")
self.oHelper.SetValue("mv_par18", "")
self.oHelper.SetValue("mv_par19", "")
self.oHelper.SetValue("mv_par20", "")
self.oHelper.SetValue("mv_par21", "")
self.oHelper.SetValue("mv_par22", "")
self.oHelper.SetValue("mv_par23", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par24", "")
self.oHelper.SetValue("mv_par25", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par26", "")
self.oHelper.SetValue("mv_par27", "ZZZZZZZZZ")
self.oHelper.SetValue("Reproces. Saldos ?", "Sim")#
self.oHelper.SetValue("Seleciona Filiais ?", "Sim")#
self.oHelper.SetValue("mv_par30", "M PR 02")
self.oHelper.SetValue("mv_par31", "M PR 02")
self.oHelper.ClickIcon("Iniciar Execução")
self.oHelper.CheckHelp(text_help="CT210NOHP", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCT210LOT", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCTSUBLOT", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCT210DOC", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCT210CT", button="Fechar")
self.oHelper.CheckHelp(text_help="NO210TPSLD", button="Fechar")
self.oHelper.SetButton("Fechar")
self.oHelper.Program("CTBA211")
self.oHelper.AssertTrue()
def test_CTBA211_003(self):
self.oHelper.ClickTree("Apuracao de Lucros / Perdas > Perguntas")
#Perguntes
self.oHelper.SetValue("mv_par01", "")
self.oHelper.SetValue("mv_par02", "31052014")
self.oHelper.SetValue("mv_par03", "")
self.oHelper.SetValue("mv_par04", "")
self.oHelper.SetValue("mv_par05", "")
self.oHelper.SetValue("mv_par06", "")
self.oHelper.SetValue("mv_par07", "")
self.oHelper.SetValue("mv_par08", "")
self.oHelper.SetValue("Moedas ?", "Específica") #Todas / Específica
self.oHelper.SetValue("mv_par10", "01")
self.oHelper.SetValue("Considera Ent.Ponte ?", "Não")
self.oHelper.SetValue("mv_par12", "")
self.oHelper.SetValue("Considera Entidades ?", "Rotina de Apur.") #Cadastros
self.oHelper.SetValue("mv_par14", "")
self.oHelper.SetValue("mv_par15", "")
self.oHelper.SetValue("mv_par16", "")
self.oHelper.SetValue("mv_par17", "")
self.oHelper.SetValue("mv_par18", "")
self.oHelper.SetValue("mv_par19", "")
self.oHelper.SetValue("mv_par20", "")
self.oHelper.SetValue("mv_par21", "")
self.oHelper.SetValue("mv_par22", "")
self.oHelper.SetValue("mv_par23", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par24", "")
self.oHelper.SetValue("mv_par25", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par26", "")
self.oHelper.SetValue("mv_par27", "ZZZZZZZZZ")
self.oHelper.SetValue("Reproces. Saldos ?", "Sim")#
self.oHelper.SetValue("Seleciona Filiais ?", "Sim")#
self.oHelper.SetValue("mv_par30", "M PR 02")
self.oHelper.SetValue("mv_par31", "M PR 02")
self.oHelper.ClickIcon("Iniciar Execução")
self.oHelper.CheckHelp(text_help="CTHPVAZIO", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCT210LOT", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCTSUBLOT", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCT210DOC", button="Fechar")
self.oHelper.CheckHelp(text_help="NOCT210CT", button="Fechar")
self.oHelper.CheckHelp(text_help="NO210TPSLD", button="Fechar")
self.oHelper.SetButton("Fechar")
self.oHelper.Program("CTBA211")
self.oHelper.AssertTrue()
def test_CTBA211_004(self):
self.oHelper.ClickTree("Apuracao de Lucros / Perdas > Perguntas")
#Perguntes
self.oHelper.SetValue("mv_par01", "01052014")
self.oHelper.SetValue("mv_par02", "31052014")
self.oHelper.SetValue("mv_par03", "")
self.oHelper.SetValue("mv_par04", "")
self.oHelper.SetValue("mv_par05", "")
self.oHelper.SetValue("mv_par06", "")
self.oHelper.SetValue("mv_par07", "")
self.oHelper.SetValue("mv_par08", "")
self.oHelper.SetValue("Moedas ?", "Específica") #Todas / Específica
self.oHelper.SetValue("mv_par10", "")
self.oHelper.SetValue("Considera Ent.Ponte ?", "Não")
self.oHelper.SetValue("mv_par12", "")
self.oHelper.SetValue("Considera Entidades ?", "Rotina de Apur.") #Cadastros
self.oHelper.SetValue("mv_par14", "")
self.oHelper.SetValue("mv_par15", "")
self.oHelper.SetValue("mv_par16", "")
self.oHelper.SetValue("mv_par17", "")
self.oHelper.SetValue("mv_par18", "")
self.oHelper.SetValue("mv_par19", "")
self.oHelper.SetValue("mv_par20", "")
self.oHelper.SetValue("mv_par21", "")
self.oHelper.SetValue("mv_par22", "")
self.oHelper.SetValue("mv_par23", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par24", "")
self.oHelper.SetValue("mv_par25", "ZZZZZZZZZ")
self.oHelper.SetValue("mv_par26", "")
self.oHelper.SetValue("mv_par27", "ZZZZZZZZZ")
self.oHelper.SetValue("Reproces. Saldos ?", "Sim")#
self.oHelper.SetValue("Seleciona Filiais ?", "Sim")#
self.oHelper.SetValue("mv_par30", "M PR 02")
self.oHelper.SetValue("mv_par31", "M PR 02")
self.oHelper.ClickIcon("Iniciar Execução")
self.oHelper.AssertTrue()
self.oHelper.WaitShow("NOMOEDA")
# self.oHelper.SetButton("Fechar")
self.oHelper.CheckHelp(text_help="NOMOEDA",button="Fechar")
# self.oHelper.CheckHelp(text_problem="Moeda não preenchida e/ou não existente.",button="Fechar")
self.oHelper.WaitShow("TOTVS")
self.oHelper.AssertTrue()
@classmethod
def tearDownClass(inst):
inst.oHelper.TearDown()
if __name__ == '__main__':
unittest.main()
| 41.273504
| 105
| 0.600124
| 1,020
| 9,658
| 5.55098
| 0.130392
| 0.31473
| 0.416107
| 0.385729
| 0.906747
| 0.868951
| 0.853055
| 0.853055
| 0.853055
| 0.853055
| 0
| 0.053716
| 0.221267
| 9,658
| 233
| 106
| 41.450644
| 0.699109
| 0.04504
| 0
| 0.813559
| 0
| 0
| 0.233474
| 0
| 0
| 0
| 0
| 0
| 0.028249
| 1
| 0.033898
| false
| 0
| 0.011299
| 0
| 0.050847
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
2b204a0bbe87d56c395337e8f01e8a0e22373556
| 5,300
|
py
|
Python
|
graphpy/vertex.py
|
tscizzle/pygraph
|
b6fe9e21bd30ae4249d02a1818b49351575fa98e
|
[
"MIT"
] | 1
|
2017-04-09T21:58:28.000Z
|
2017-04-09T21:58:28.000Z
|
graphpy/vertex.py
|
tscizzle/graphpy
|
b6fe9e21bd30ae4249d02a1818b49351575fa98e
|
[
"MIT"
] | null | null | null |
graphpy/vertex.py
|
tscizzle/graphpy
|
b6fe9e21bd30ae4249d02a1818b49351575fa98e
|
[
"MIT"
] | null | null | null |
"""
Implementation of a vertex, as used in graphs
"""
################################################################################
# #
# Undirected #
# #
################################################################################
class UndirectedVertex(object):
def __init__(self, val=None, attrs=None):
self._val = val or id(self)
self._attrs = attrs or {}
self._edges = set()
self._has_self_edge = False
def __repr__(self):
display = (self.val, id(self))
return "Vertex(val=%s, id=%s)" % display
def __str__(self):
return "V(%s)" % self.val
def __contains__(self, e):
return e in self._edges
@property
def val(self):
return self._val
@property
def attrs(self):
return self._attrs
@property
def edges(self):
return iter(self._edges)
@property
def has_self_edge(self):
return self._has_self_edge
@property
def neighbors(self):
""" Iterator over vertices adjacent to this vertex """
return iter(set(v for e in self._edges for v in e.vertices
if v != self) |
(set([self]) if self._has_self_edge else set()))
@property
def degree(self):
""" Number of neighbors this vertex has (+1 if it has a self edge) """
return sum(1 for _ in self._edges) + (1 if self._has_self_edge else 0)
def add_edge(self, e):
""" Adds an edge to this vertex """
if self not in e.vertices:
raise ValueError(str(self) + " is not part of " + str(e) + ".")
if e in self:
raise ValueError(str(self) + " already has " + str(e) + ".")
self._edges.add(e)
if e.is_self_edge:
self._has_self_edge = True
def remove_edge(self, e):
""" Removes an edge from this vertex """
self._edges.discard(e)
if e.is_self_edge:
self._has_self_edge = False
def get(self, attr):
""" Get an attribute """
return self._attrs.get(attr)
def set(self, attr, value):
""" Set an attribute """
self._attrs[attr] = value
def has_attr(self, attr):
""" Check if an attribute exists """
return attr in self._attrs
def del_attr(self, attr):
""" Delete an attribute """
del self._attrs[attr]
################################################################################
# #
# Directed #
# #
################################################################################
class DirectedVertex(object):
def __init__(self, val=None, attrs=None):
self._val = val or id(self)
self._attrs = attrs or {}
self._edges = set()
def __repr__(self):
display = (self.val, id(self))
return "Vertex(val=%s, id=%s)" % display
def __str__(self):
return "V(%s)" % self.val
def __contains__(self, e):
return e in self._edges
@property
def val(self):
return self._val
@property
def attrs(self):
return self._attrs
@property
def edges(self):
return iter(self._edges)
@property
def outs(self):
""" Iterator over vertices into which this vertex has an edge """
return iter(set(e.v_to for e in self._edges if e.v_from == self))
@property
def ins(self):
""" Iterator over vertices which have an edge into this vertex """
return iter(set(e.v_from for e in self._edges if e.v_to == self))
@property
def out_degree(self):
""" Number of vertices into which this vertex has an edge """
return sum(1 for e in self._edges if e.v_from == self)
@property
def in_degree(self):
""" Number of vertices which have an edge into this vertex """
return sum(1 for e in self._edges if e.v_to == self)
@property
def degree(self):
""" Sum of out degree and in degree """
return self.out_degree + self.in_degree
def add_edge(self, e):
""" Adds an edge to this vertex """
if self != e.v_from and self != e.v_to:
raise ValueError(str(self) + " is not part of " + str(e) + ".")
if e in self:
raise ValueError(str(self) + " already has " + str(e) + ".")
self._edges.add(e)
def remove_edge(self, e):
""" Removes an edge from this vertex """
self._edges.discard(e)
def get(self, attr):
""" Get an attribute """
return self._attrs.get(attr)
def set(self, attr, value):
""" Set an attribute """
self._attrs[attr] = value
def has_attr(self, attr):
""" Check if an attribute exists """
return attr in self._attrs
def del_attr(self, attr):
""" Delete an attribute """
del self._attrs[attr]
| 28.804348
| 80
| 0.483962
| 625
| 5,300
| 3.9296
| 0.1312
| 0.058632
| 0.025651
| 0.034202
| 0.818404
| 0.774023
| 0.746743
| 0.746743
| 0.746743
| 0.68241
| 0
| 0.001751
| 0.353396
| 5,300
| 183
| 81
| 28.961749
| 0.714911
| 0.203019
| 0
| 0.8
| 0
| 0
| 0.031165
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.32381
| false
| 0
| 0
| 0.104762
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 10
|
990cf19e1eb842f6b1e5bbc49d16e5c9466a08a1
| 1,150
|
py
|
Python
|
permabots/serializers/__init__.py
|
eafanasev/permabots
|
24de0376e8c482800f4214c021c133d81b9de69f
|
[
"BSD-3-Clause"
] | 81
|
2016-05-18T02:34:10.000Z
|
2021-08-28T17:25:13.000Z
|
permabots/serializers/__init__.py
|
eafanasev/permabots
|
24de0376e8c482800f4214c021c133d81b9de69f
|
[
"BSD-3-Clause"
] | 15
|
2016-05-27T08:51:46.000Z
|
2021-03-19T21:42:21.000Z
|
permabots/serializers/__init__.py
|
eafanasev/permabots
|
24de0376e8c482800f4214c021c133d81b9de69f
|
[
"BSD-3-Clause"
] | 34
|
2016-05-29T14:37:01.000Z
|
2022-03-24T17:16:53.000Z
|
from permabots.serializers.telegram_api import UserSerializer, ChatSerializer, MessageSerializer, UpdateSerializer, UserAPISerializer # noqa
from permabots.serializers.kik_api import KikMessageSerializer # noqa
from permabots.serializers.response import ResponseSerializer, ResponseUpdateSerializer # noqa
from permabots.serializers.bot import BotSerializer, BotUpdateSerializer, TelegramBotSerializer, TelegramBotUpdateSerializer, KikBotSerializer, KikBotUpdateSerializer, MessengerBotSerializer, MessengerBotUpdateSerializer # noqa
from permabots.serializers.state import StateSerializer, TelegramChatStateSerializer, TelegramChatStateUpdateSerializer, KikChatStateSerializer, KikChatStateUpdateSerializer, MessengerChatStateSerializer, MessengerChatStateUpdateSerializer # noqa
from permabots.serializers.handler import HandlerSerializer, HandlerUpdateSerializer, AbsParamSerializer # noqa
from permabots.serializers.hook import HookSerializer, HookUpdateSerializer, TelegramRecipientSerializer, KikRecipientSerializer, MessengerRecipientSerializer # noqa
from permabots.serializers.environment_vars import EnvironmentVarSerializer # noqa
| 127.777778
| 247
| 0.888696
| 83
| 1,150
| 12.277108
| 0.566265
| 0.102061
| 0.18842
| 0.192345
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069565
| 1,150
| 8
| 248
| 143.75
| 0.952336
| 0.033913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
994db77007230e7a16c3850b85d6a7cd96e0b9d7
| 255
|
py
|
Python
|
revolver/log.py
|
michaelcontento/revolver
|
bbae82df0804ff2708a82fd0016b776664ee2deb
|
[
"Apache-2.0"
] | 1
|
2015-05-16T17:55:26.000Z
|
2015-05-16T17:55:26.000Z
|
revolver/log.py
|
michaelcontento/revolver
|
bbae82df0804ff2708a82fd0016b776664ee2deb
|
[
"Apache-2.0"
] | null | null | null |
revolver/log.py
|
michaelcontento/revolver
|
bbae82df0804ff2708a82fd0016b776664ee2deb
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, with_statement
from fabric.contrib.console import confirm
from fabric.utils import abort, warn
from fabric.utils import fastprint as put_fast
from fabric.utils import puts as put
| 28.333333
| 64
| 0.8
| 38
| 255
| 5.184211
| 0.578947
| 0.203046
| 0.228426
| 0.319797
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004525
| 0.133333
| 255
| 8
| 65
| 31.875
| 0.886878
| 0.082353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.2
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
995c03864c44eb5f6e261dd1c772dcf2e1b176c7
| 334
|
py
|
Python
|
naturalnets/optimizers/__init__.py
|
bjuergens/NaturalNets
|
fd67f1b3c443761270adaf9877ed2a6358d830f0
|
[
"MIT"
] | null | null | null |
naturalnets/optimizers/__init__.py
|
bjuergens/NaturalNets
|
fd67f1b3c443761270adaf9877ed2a6358d830f0
|
[
"MIT"
] | 2
|
2021-04-13T11:47:01.000Z
|
2021-04-30T11:44:46.000Z
|
naturalnets/optimizers/__init__.py
|
bjuergens/NaturalNets
|
fd67f1b3c443761270adaf9877ed2a6358d830f0
|
[
"MIT"
] | 1
|
2021-11-03T09:36:40.000Z
|
2021-11-03T09:36:40.000Z
|
from naturalnets.optimizers.canonical_es import OptimizerCanonicalEs
from naturalnets.optimizers.cma_es_deap import OptimizerCmaEsDeap
from naturalnets.optimizers.cma_es_pycma import OptimizerCmaEsPycma
from naturalnets.optimizers.openai_es import OptimizerOpenAIES
from naturalnets.optimizers.mu_lambda_deap import OptimizerMuLambda
| 55.666667
| 68
| 0.91018
| 38
| 334
| 7.789474
| 0.447368
| 0.253378
| 0.422297
| 0.189189
| 0.202703
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05988
| 334
| 5
| 69
| 66.8
| 0.942675
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
999e9c3a75e1ede482c7e7bdee6b4157aa9eba20
| 517
|
py
|
Python
|
travel.py
|
brightmaraba/crash-course
|
7f02b48b4e89d3022bc11e9314a8ef0485938ede
|
[
"MIT"
] | null | null | null |
travel.py
|
brightmaraba/crash-course
|
7f02b48b4e89d3022bc11e9314a8ef0485938ede
|
[
"MIT"
] | null | null | null |
travel.py
|
brightmaraba/crash-course
|
7f02b48b4e89d3022bc11e9314a8ef0485938ede
|
[
"MIT"
] | null | null | null |
world_cities = ['Dubai', 'New Orleans', 'Santorini', 'Gaza', 'Seoul']
print('***********')
print(world_cities)
print('***********')
print(sorted(world_cities))
print('***********')
print(world_cities)
print('***********')
print(sorted(world_cities, reverse=True))
print('***********')
print(world_cities)
print('***********')
world_cities.reverse()
print('***********')
print(world_cities)
world_cities.reverse()
print('***********')
print(world_cities)
print('***********')
world_cities.sort()
print(world_cities)
| 21.541667
| 69
| 0.586074
| 54
| 517
| 5.388889
| 0.240741
| 0.453608
| 0.439863
| 0.360825
| 0.742268
| 0.742268
| 0.742268
| 0.329897
| 0.329897
| 0
| 0
| 0
| 0.059961
| 517
| 23
| 70
| 22.478261
| 0.598765
| 0
| 0
| 0.809524
| 0
| 0
| 0.258252
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.809524
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
5100de0ed5e74e4f91fe6bcbef397f5aa009134a
| 5,303
|
py
|
Python
|
python/tests/generated/api/section/test_all_elements_required.py
|
eno-lang/enolib
|
4175f7c1e8246493b6758c29bddc80d20eaf15f7
|
[
"MIT"
] | 17
|
2019-04-15T21:03:37.000Z
|
2022-01-24T11:03:34.000Z
|
python/tests/generated/api/section/test_all_elements_required.py
|
eno-lang/enolib
|
4175f7c1e8246493b6758c29bddc80d20eaf15f7
|
[
"MIT"
] | 20
|
2019-03-13T23:23:40.000Z
|
2022-03-29T13:40:57.000Z
|
python/tests/generated/api/section/test_all_elements_required.py
|
eno-lang/enolib
|
4175f7c1e8246493b6758c29bddc80d20eaf15f7
|
[
"MIT"
] | 4
|
2019-04-15T21:18:03.000Z
|
2019-09-21T16:18:10.000Z
|
import enolib
def test_querying_a_missing_field_on_the_document_when_all_elements_are_required_raises_the_expected_validationerror():
error = None
input = ("")
try:
document = enolib.parse(input)
document.all_elements_required()
document.field('field')
except enolib.ValidationError as _error:
if isinstance(_error, enolib.ValidationError):
error = _error
else:
raise _error
assert type(error) is enolib.ValidationError
text = ("The field 'field' is missing - in case it has been specified look for typos and also check for correct capitalization.")
assert error.text == text
def test_querying_a_missing_fieldset_on_the_document_when_all_elements_are_required_raises_the_expected_validationerror():
error = None
input = ("")
try:
document = enolib.parse(input)
document.all_elements_required()
document.fieldset('fieldset')
except enolib.ValidationError as _error:
if isinstance(_error, enolib.ValidationError):
error = _error
else:
raise _error
assert type(error) is enolib.ValidationError
text = ("The fieldset 'fieldset' is missing - in case it has been specified look for typos and also check for correct capitalization.")
assert error.text == text
def test_querying_a_missing_list_on_the_document_when_all_elements_are_required_raises_the_expected_validationerror():
error = None
input = ("")
try:
document = enolib.parse(input)
document.all_elements_required()
document.list('list')
except enolib.ValidationError as _error:
if isinstance(_error, enolib.ValidationError):
error = _error
else:
raise _error
assert type(error) is enolib.ValidationError
text = ("The list 'list' is missing - in case it has been specified look for typos and also check for correct capitalization.")
assert error.text == text
def test_querying_a_missing_section_on_the_document_when_all_elements_are_required_raises_the_expected_validationerror():
error = None
input = ("")
try:
document = enolib.parse(input)
document.all_elements_required()
document.section('section')
except enolib.ValidationError as _error:
if isinstance(_error, enolib.ValidationError):
error = _error
else:
raise _error
assert type(error) is enolib.ValidationError
text = ("The section 'section' is missing - in case it has been specified look for typos and also check for correct capitalization.")
assert error.text == text
def test_querying_a_missing_field_on_the_document_when_requiring_all_elements_is_explicitly_disabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required(False)
document.field('field')
assert bool('it passes') is True
def test_querying_a_missing_field_on_the_document_when_requiring_all_elements_is_enabled_and_disabled_again_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required(True)
document.all_elements_required(False)
document.field('field')
assert bool('it passes') is True
def test_querying_a_missing_but_explicitly_optional_element_on_the_document_when_requiring_all_elements_is_enabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required()
document.optional_element('element')
assert bool('it passes') is True
def test_querying_a_missing_but_explicitly_optional_empty_on_the_document_when_requiring_all_elements_is_enabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required()
document.optional_empty('empty')
assert bool('it passes') is True
def test_querying_a_missing_but_explicitly_optional_field_on_the_document_when_requiring_all_elements_is_enabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required()
document.optional_field('field')
assert bool('it passes') is True
def test_querying_a_missing_but_explicitly_optional_fieldset_on_the_document_when_requiring_all_elements_is_enabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required()
document.optional_fieldset('fieldset')
assert bool('it passes') is True
def test_querying_a_missing_but_explicitly_optional_list_on_the_document_when_requiring_all_elements_is_enabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required()
document.optional_list('list')
assert bool('it passes') is True
def test_querying_a_missing_but_explicitly_optional_section_on_the_document_when_requiring_all_elements_is_enabled_produces_the_expected_result():
input = ("")
document = enolib.parse(input)
document.all_elements_required()
document.optional_section('section')
assert bool('it passes') is True
| 31.194118
| 147
| 0.732038
| 649
| 5,303
| 5.565485
| 0.101695
| 0.076135
| 0.068383
| 0.097176
| 0.939092
| 0.928571
| 0.921927
| 0.921927
| 0.921927
| 0.921927
| 0
| 0
| 0.196493
| 5,303
| 170
| 148
| 31.194118
| 0.847688
| 0
| 0
| 0.754545
| 0
| 0.036364
| 0.11727
| 0
| 0
| 0
| 0
| 0
| 0.145455
| 1
| 0.109091
| false
| 0.072727
| 0.009091
| 0
| 0.118182
| 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
|
5147fad306d93edbc67f0ff25124296f7a44e206
| 141
|
py
|
Python
|
data/obverter/__init__.py
|
gautierdag/cultural-evolution-engine
|
54ea8d374ff4345c05f03eccfb2e93161e16a050
|
[
"MIT"
] | 4
|
2019-03-20T15:31:44.000Z
|
2020-11-28T13:40:13.000Z
|
data/obverter/__init__.py
|
gautierdag/cultural-evolution-engine
|
54ea8d374ff4345c05f03eccfb2e93161e16a050
|
[
"MIT"
] | null | null | null |
data/obverter/__init__.py
|
gautierdag/cultural-evolution-engine
|
54ea8d374ff4345c05f03eccfb2e93161e16a050
|
[
"MIT"
] | 1
|
2021-11-06T01:15:28.000Z
|
2021-11-06T01:15:28.000Z
|
from .get_obverter_dataloader import get_obverter_dataloader, get_obverter_features
from .get_obverter_metadata import get_obverter_metadata
| 47
| 83
| 0.914894
| 19
| 141
| 6.263158
| 0.368421
| 0.462185
| 0.252101
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.06383
| 141
| 2
| 84
| 70.5
| 0.901515
| 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
|
5a947a23fd33395a7204ca63effa32e0984a1997
| 568
|
py
|
Python
|
src/testcase/GN_APP/input_case/GN_APP_Device_Page.py
|
maiyajj/AutoTest_script-Appium_Connect
|
f9c2c42c281a9e2f984acb4a72dda0694b053f22
|
[
"Apache-2.0"
] | 28
|
2017-11-10T00:19:16.000Z
|
2022-02-19T16:42:05.000Z
|
src/testcase/GN_APP/input_case/GN_APP_Device_Page.py
|
maiyajj/AutoTest_script-Appium_Connect
|
f9c2c42c281a9e2f984acb4a72dda0694b053f22
|
[
"Apache-2.0"
] | null | null | null |
src/testcase/GN_APP/input_case/GN_APP_Device_Page.py
|
maiyajj/AutoTest_script-Appium_Connect
|
f9c2c42c281a9e2f984acb4a72dda0694b053f22
|
[
"Apache-2.0"
] | 23
|
2017-08-22T06:12:19.000Z
|
2021-09-18T05:45:41.000Z
|
# coding=utf-8
try:
from src.testcase.GN_APP.case.GN_APP_DEVICE_PAGE.GN_APP_DEVICE_PAGE_001 import *
from src.testcase.GN_APP.case.GN_APP_DEVICE_PAGE.GN_APP_DEVICE_PAGE_002 import *
from src.testcase.GN_APP.case.GN_APP_DEVICE_PAGE.GN_APP_DEVICE_PAGE_003 import *
from src.testcase.GN_APP.case.GN_APP_DEVICE_PAGE.GN_APP_DEVICE_PAGE_004 import *
from src.testcase.GN_APP.case.GN_APP_DEVICE_PAGE.GN_APP_DEVICE_PAGE_005 import *
from src.testcase.GN_APP.case.GN_APP_DEVICE_PAGE.GN_APP_DEVICE_PAGE_006 import *
except ImportError as e:
print(e)
| 51.636364
| 84
| 0.818662
| 106
| 568
| 3.933962
| 0.226415
| 0.215827
| 0.316547
| 0.431655
| 0.848921
| 0.848921
| 0.848921
| 0.848921
| 0.848921
| 0.848921
| 0
| 0.037402
| 0.105634
| 568
| 10
| 85
| 56.8
| 0.783465
| 0.021127
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.777778
| 0
| 0.777778
| 0.111111
| 0
| 0
| 0
| null | 1
| 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
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 12
|
5ad696dfac675ecd1e39576cb66e493c814c945b
| 72,184
|
py
|
Python
|
sdk/python/pulumi_alicloud/cs/serverless_kubernetes.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/cs/serverless_kubernetes.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/cs/serverless_kubernetes.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
from . import outputs
from ._inputs import *
__all__ = ['ServerlessKubernetesArgs', 'ServerlessKubernetes']
@pulumi.input_type
class ServerlessKubernetesArgs:
def __init__(__self__, *,
vpc_id: pulumi.Input[str],
addons: Optional[pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]]] = None,
client_cert: Optional[pulumi.Input[str]] = None,
client_key: Optional[pulumi.Input[str]] = None,
cluster_ca_cert: Optional[pulumi.Input[str]] = None,
deletion_protection: Optional[pulumi.Input[bool]] = None,
endpoint_public_access_enabled: Optional[pulumi.Input[bool]] = None,
force_update: Optional[pulumi.Input[bool]] = None,
kube_config: Optional[pulumi.Input[str]] = None,
load_balancer_spec: Optional[pulumi.Input[str]] = None,
logging_type: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
name_prefix: Optional[pulumi.Input[str]] = None,
new_nat_gateway: Optional[pulumi.Input[bool]] = None,
private_zone: Optional[pulumi.Input[bool]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
security_group_id: Optional[pulumi.Input[str]] = None,
service_cidr: Optional[pulumi.Input[str]] = None,
service_discovery_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
sls_project_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
time_zone: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
vswitch_id: Optional[pulumi.Input[str]] = None,
vswitch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a ServerlessKubernetes resource.
:param pulumi.Input[str] vpc_id: The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
:param pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]] addons: ) You can specific network plugin,log component,ingress component and so on.Detailed below.
:param pulumi.Input[str] client_cert: The path of client certificate, like `~/.kube/client-cert.pem`.
:param pulumi.Input[str] client_key: The path of client key, like `~/.kube/client-key.pem`.
:param pulumi.Input[str] cluster_ca_cert: The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
:param pulumi.Input[bool] deletion_protection: Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
:param pulumi.Input[bool] endpoint_public_access_enabled: Whether to create internet eip for API Server. Default to false.
:param pulumi.Input[bool] force_update: Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
:param pulumi.Input[str] kube_config: The path of kube config, like `~/.kube/config`.
:param pulumi.Input[str] load_balancer_spec: The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
:param pulumi.Input[str] logging_type: Enable log service, Valid value `SLS`.
:param pulumi.Input[str] name: Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
:param pulumi.Input[bool] new_nat_gateway: Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
:param pulumi.Input[bool] private_zone: (Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
:param pulumi.Input[str] resource_group_id: The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
:param pulumi.Input[str] security_group_id: The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
:param pulumi.Input[str] service_cidr: CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] service_discovery_types: Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
:param pulumi.Input[str] sls_project_name: If you use an existing SLS project, you must specify `sls_project_name`.
:param pulumi.Input[Mapping[str, Any]] tags: Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
:param pulumi.Input[str] time_zone: The time zone of the cluster.
:param pulumi.Input[str] version: Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
:param pulumi.Input[str] vswitch_id: (Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
:param pulumi.Input[Sequence[pulumi.Input[str]]] vswitch_ids: The vswitches where new kubernetes cluster will be located.
:param pulumi.Input[str] zone_id: When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
pulumi.set(__self__, "vpc_id", vpc_id)
if addons is not None:
pulumi.set(__self__, "addons", addons)
if client_cert is not None:
pulumi.set(__self__, "client_cert", client_cert)
if client_key is not None:
pulumi.set(__self__, "client_key", client_key)
if cluster_ca_cert is not None:
pulumi.set(__self__, "cluster_ca_cert", cluster_ca_cert)
if deletion_protection is not None:
pulumi.set(__self__, "deletion_protection", deletion_protection)
if endpoint_public_access_enabled is not None:
pulumi.set(__self__, "endpoint_public_access_enabled", endpoint_public_access_enabled)
if force_update is not None:
pulumi.set(__self__, "force_update", force_update)
if kube_config is not None:
pulumi.set(__self__, "kube_config", kube_config)
if load_balancer_spec is not None:
pulumi.set(__self__, "load_balancer_spec", load_balancer_spec)
if logging_type is not None:
pulumi.set(__self__, "logging_type", logging_type)
if name is not None:
pulumi.set(__self__, "name", name)
if name_prefix is not None:
pulumi.set(__self__, "name_prefix", name_prefix)
if new_nat_gateway is not None:
pulumi.set(__self__, "new_nat_gateway", new_nat_gateway)
if private_zone is not None:
warnings.warn("""Field 'private_zone' has been deprecated from provider version 1.123.1. New field 'service_discovery_types' replace it.""", DeprecationWarning)
pulumi.log.warn("""private_zone is deprecated: Field 'private_zone' has been deprecated from provider version 1.123.1. New field 'service_discovery_types' replace it.""")
if private_zone is not None:
pulumi.set(__self__, "private_zone", private_zone)
if resource_group_id is not None:
pulumi.set(__self__, "resource_group_id", resource_group_id)
if security_group_id is not None:
pulumi.set(__self__, "security_group_id", security_group_id)
if service_cidr is not None:
pulumi.set(__self__, "service_cidr", service_cidr)
if service_discovery_types is not None:
pulumi.set(__self__, "service_discovery_types", service_discovery_types)
if sls_project_name is not None:
pulumi.set(__self__, "sls_project_name", sls_project_name)
if tags is not None:
pulumi.set(__self__, "tags", tags)
if time_zone is not None:
pulumi.set(__self__, "time_zone", time_zone)
if version is not None:
pulumi.set(__self__, "version", version)
if vswitch_id is not None:
warnings.warn("""Field 'vswitch_id' has been deprecated from provider version 1.91.0. New field 'vswitch_ids' replace it.""", DeprecationWarning)
pulumi.log.warn("""vswitch_id is deprecated: Field 'vswitch_id' has been deprecated from provider version 1.91.0. New field 'vswitch_ids' replace it.""")
if vswitch_id is not None:
pulumi.set(__self__, "vswitch_id", vswitch_id)
if vswitch_ids is not None:
pulumi.set(__self__, "vswitch_ids", vswitch_ids)
if zone_id is not None:
pulumi.set(__self__, "zone_id", zone_id)
@property
@pulumi.getter(name="vpcId")
def vpc_id(self) -> pulumi.Input[str]:
"""
The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
"""
return pulumi.get(self, "vpc_id")
@vpc_id.setter
def vpc_id(self, value: pulumi.Input[str]):
pulumi.set(self, "vpc_id", value)
@property
@pulumi.getter
def addons(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]]]:
"""
) You can specific network plugin,log component,ingress component and so on.Detailed below.
"""
return pulumi.get(self, "addons")
@addons.setter
def addons(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]]]):
pulumi.set(self, "addons", value)
@property
@pulumi.getter(name="clientCert")
def client_cert(self) -> Optional[pulumi.Input[str]]:
"""
The path of client certificate, like `~/.kube/client-cert.pem`.
"""
return pulumi.get(self, "client_cert")
@client_cert.setter
def client_cert(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_cert", value)
@property
@pulumi.getter(name="clientKey")
def client_key(self) -> Optional[pulumi.Input[str]]:
"""
The path of client key, like `~/.kube/client-key.pem`.
"""
return pulumi.get(self, "client_key")
@client_key.setter
def client_key(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_key", value)
@property
@pulumi.getter(name="clusterCaCert")
def cluster_ca_cert(self) -> Optional[pulumi.Input[str]]:
"""
The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
"""
return pulumi.get(self, "cluster_ca_cert")
@cluster_ca_cert.setter
def cluster_ca_cert(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "cluster_ca_cert", value)
@property
@pulumi.getter(name="deletionProtection")
def deletion_protection(self) -> Optional[pulumi.Input[bool]]:
"""
Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
"""
return pulumi.get(self, "deletion_protection")
@deletion_protection.setter
def deletion_protection(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "deletion_protection", value)
@property
@pulumi.getter(name="endpointPublicAccessEnabled")
def endpoint_public_access_enabled(self) -> Optional[pulumi.Input[bool]]:
"""
Whether to create internet eip for API Server. Default to false.
"""
return pulumi.get(self, "endpoint_public_access_enabled")
@endpoint_public_access_enabled.setter
def endpoint_public_access_enabled(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "endpoint_public_access_enabled", value)
@property
@pulumi.getter(name="forceUpdate")
def force_update(self) -> Optional[pulumi.Input[bool]]:
"""
Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
"""
return pulumi.get(self, "force_update")
@force_update.setter
def force_update(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "force_update", value)
@property
@pulumi.getter(name="kubeConfig")
def kube_config(self) -> Optional[pulumi.Input[str]]:
"""
The path of kube config, like `~/.kube/config`.
"""
return pulumi.get(self, "kube_config")
@kube_config.setter
def kube_config(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "kube_config", value)
@property
@pulumi.getter(name="loadBalancerSpec")
def load_balancer_spec(self) -> Optional[pulumi.Input[str]]:
"""
The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
"""
return pulumi.get(self, "load_balancer_spec")
@load_balancer_spec.setter
def load_balancer_spec(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "load_balancer_spec", value)
@property
@pulumi.getter(name="loggingType")
def logging_type(self) -> Optional[pulumi.Input[str]]:
"""
Enable log service, Valid value `SLS`.
"""
return pulumi.get(self, "logging_type")
@logging_type.setter
def logging_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "logging_type", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter(name="namePrefix")
def name_prefix(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name_prefix")
@name_prefix.setter
def name_prefix(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name_prefix", value)
@property
@pulumi.getter(name="newNatGateway")
def new_nat_gateway(self) -> Optional[pulumi.Input[bool]]:
"""
Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
"""
return pulumi.get(self, "new_nat_gateway")
@new_nat_gateway.setter
def new_nat_gateway(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "new_nat_gateway", value)
@property
@pulumi.getter(name="privateZone")
def private_zone(self) -> Optional[pulumi.Input[bool]]:
"""
(Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
"""
return pulumi.get(self, "private_zone")
@private_zone.setter
def private_zone(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "private_zone", value)
@property
@pulumi.getter(name="resourceGroupId")
def resource_group_id(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
"""
return pulumi.get(self, "resource_group_id")
@resource_group_id.setter
def resource_group_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "resource_group_id", value)
@property
@pulumi.getter(name="securityGroupId")
def security_group_id(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
"""
return pulumi.get(self, "security_group_id")
@security_group_id.setter
def security_group_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "security_group_id", value)
@property
@pulumi.getter(name="serviceCidr")
def service_cidr(self) -> Optional[pulumi.Input[str]]:
"""
CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
"""
return pulumi.get(self, "service_cidr")
@service_cidr.setter
def service_cidr(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "service_cidr", value)
@property
@pulumi.getter(name="serviceDiscoveryTypes")
def service_discovery_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
"""
return pulumi.get(self, "service_discovery_types")
@service_discovery_types.setter
def service_discovery_types(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "service_discovery_types", value)
@property
@pulumi.getter(name="slsProjectName")
def sls_project_name(self) -> Optional[pulumi.Input[str]]:
"""
If you use an existing SLS project, you must specify `sls_project_name`.
"""
return pulumi.get(self, "sls_project_name")
@sls_project_name.setter
def sls_project_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sls_project_name", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "tags", value)
@property
@pulumi.getter(name="timeZone")
def time_zone(self) -> Optional[pulumi.Input[str]]:
"""
The time zone of the cluster.
"""
return pulumi.get(self, "time_zone")
@time_zone.setter
def time_zone(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "time_zone", value)
@property
@pulumi.getter
def version(self) -> Optional[pulumi.Input[str]]:
"""
Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
"""
return pulumi.get(self, "version")
@version.setter
def version(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "version", value)
@property
@pulumi.getter(name="vswitchId")
def vswitch_id(self) -> Optional[pulumi.Input[str]]:
"""
(Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
"""
return pulumi.get(self, "vswitch_id")
@vswitch_id.setter
def vswitch_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "vswitch_id", value)
@property
@pulumi.getter(name="vswitchIds")
def vswitch_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The vswitches where new kubernetes cluster will be located.
"""
return pulumi.get(self, "vswitch_ids")
@vswitch_ids.setter
def vswitch_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "vswitch_ids", value)
@property
@pulumi.getter(name="zoneId")
def zone_id(self) -> Optional[pulumi.Input[str]]:
"""
When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
return pulumi.get(self, "zone_id")
@zone_id.setter
def zone_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "zone_id", value)
@pulumi.input_type
class _ServerlessKubernetesState:
def __init__(__self__, *,
addons: Optional[pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]]] = None,
client_cert: Optional[pulumi.Input[str]] = None,
client_key: Optional[pulumi.Input[str]] = None,
cluster_ca_cert: Optional[pulumi.Input[str]] = None,
deletion_protection: Optional[pulumi.Input[bool]] = None,
endpoint_public_access_enabled: Optional[pulumi.Input[bool]] = None,
force_update: Optional[pulumi.Input[bool]] = None,
kube_config: Optional[pulumi.Input[str]] = None,
load_balancer_spec: Optional[pulumi.Input[str]] = None,
logging_type: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
name_prefix: Optional[pulumi.Input[str]] = None,
new_nat_gateway: Optional[pulumi.Input[bool]] = None,
private_zone: Optional[pulumi.Input[bool]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
security_group_id: Optional[pulumi.Input[str]] = None,
service_cidr: Optional[pulumi.Input[str]] = None,
service_discovery_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
sls_project_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
time_zone: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
vswitch_id: Optional[pulumi.Input[str]] = None,
vswitch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering ServerlessKubernetes resources.
:param pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]] addons: ) You can specific network plugin,log component,ingress component and so on.Detailed below.
:param pulumi.Input[str] client_cert: The path of client certificate, like `~/.kube/client-cert.pem`.
:param pulumi.Input[str] client_key: The path of client key, like `~/.kube/client-key.pem`.
:param pulumi.Input[str] cluster_ca_cert: The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
:param pulumi.Input[bool] deletion_protection: Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
:param pulumi.Input[bool] endpoint_public_access_enabled: Whether to create internet eip for API Server. Default to false.
:param pulumi.Input[bool] force_update: Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
:param pulumi.Input[str] kube_config: The path of kube config, like `~/.kube/config`.
:param pulumi.Input[str] load_balancer_spec: The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
:param pulumi.Input[str] logging_type: Enable log service, Valid value `SLS`.
:param pulumi.Input[str] name: Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
:param pulumi.Input[bool] new_nat_gateway: Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
:param pulumi.Input[bool] private_zone: (Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
:param pulumi.Input[str] resource_group_id: The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
:param pulumi.Input[str] security_group_id: The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
:param pulumi.Input[str] service_cidr: CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] service_discovery_types: Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
:param pulumi.Input[str] sls_project_name: If you use an existing SLS project, you must specify `sls_project_name`.
:param pulumi.Input[Mapping[str, Any]] tags: Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
:param pulumi.Input[str] time_zone: The time zone of the cluster.
:param pulumi.Input[str] version: Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
:param pulumi.Input[str] vpc_id: The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
:param pulumi.Input[str] vswitch_id: (Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
:param pulumi.Input[Sequence[pulumi.Input[str]]] vswitch_ids: The vswitches where new kubernetes cluster will be located.
:param pulumi.Input[str] zone_id: When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
if addons is not None:
pulumi.set(__self__, "addons", addons)
if client_cert is not None:
pulumi.set(__self__, "client_cert", client_cert)
if client_key is not None:
pulumi.set(__self__, "client_key", client_key)
if cluster_ca_cert is not None:
pulumi.set(__self__, "cluster_ca_cert", cluster_ca_cert)
if deletion_protection is not None:
pulumi.set(__self__, "deletion_protection", deletion_protection)
if endpoint_public_access_enabled is not None:
pulumi.set(__self__, "endpoint_public_access_enabled", endpoint_public_access_enabled)
if force_update is not None:
pulumi.set(__self__, "force_update", force_update)
if kube_config is not None:
pulumi.set(__self__, "kube_config", kube_config)
if load_balancer_spec is not None:
pulumi.set(__self__, "load_balancer_spec", load_balancer_spec)
if logging_type is not None:
pulumi.set(__self__, "logging_type", logging_type)
if name is not None:
pulumi.set(__self__, "name", name)
if name_prefix is not None:
pulumi.set(__self__, "name_prefix", name_prefix)
if new_nat_gateway is not None:
pulumi.set(__self__, "new_nat_gateway", new_nat_gateway)
if private_zone is not None:
warnings.warn("""Field 'private_zone' has been deprecated from provider version 1.123.1. New field 'service_discovery_types' replace it.""", DeprecationWarning)
pulumi.log.warn("""private_zone is deprecated: Field 'private_zone' has been deprecated from provider version 1.123.1. New field 'service_discovery_types' replace it.""")
if private_zone is not None:
pulumi.set(__self__, "private_zone", private_zone)
if resource_group_id is not None:
pulumi.set(__self__, "resource_group_id", resource_group_id)
if security_group_id is not None:
pulumi.set(__self__, "security_group_id", security_group_id)
if service_cidr is not None:
pulumi.set(__self__, "service_cidr", service_cidr)
if service_discovery_types is not None:
pulumi.set(__self__, "service_discovery_types", service_discovery_types)
if sls_project_name is not None:
pulumi.set(__self__, "sls_project_name", sls_project_name)
if tags is not None:
pulumi.set(__self__, "tags", tags)
if time_zone is not None:
pulumi.set(__self__, "time_zone", time_zone)
if version is not None:
pulumi.set(__self__, "version", version)
if vpc_id is not None:
pulumi.set(__self__, "vpc_id", vpc_id)
if vswitch_id is not None:
warnings.warn("""Field 'vswitch_id' has been deprecated from provider version 1.91.0. New field 'vswitch_ids' replace it.""", DeprecationWarning)
pulumi.log.warn("""vswitch_id is deprecated: Field 'vswitch_id' has been deprecated from provider version 1.91.0. New field 'vswitch_ids' replace it.""")
if vswitch_id is not None:
pulumi.set(__self__, "vswitch_id", vswitch_id)
if vswitch_ids is not None:
pulumi.set(__self__, "vswitch_ids", vswitch_ids)
if zone_id is not None:
pulumi.set(__self__, "zone_id", zone_id)
@property
@pulumi.getter
def addons(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]]]:
"""
) You can specific network plugin,log component,ingress component and so on.Detailed below.
"""
return pulumi.get(self, "addons")
@addons.setter
def addons(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ServerlessKubernetesAddonArgs']]]]):
pulumi.set(self, "addons", value)
@property
@pulumi.getter(name="clientCert")
def client_cert(self) -> Optional[pulumi.Input[str]]:
"""
The path of client certificate, like `~/.kube/client-cert.pem`.
"""
return pulumi.get(self, "client_cert")
@client_cert.setter
def client_cert(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_cert", value)
@property
@pulumi.getter(name="clientKey")
def client_key(self) -> Optional[pulumi.Input[str]]:
"""
The path of client key, like `~/.kube/client-key.pem`.
"""
return pulumi.get(self, "client_key")
@client_key.setter
def client_key(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_key", value)
@property
@pulumi.getter(name="clusterCaCert")
def cluster_ca_cert(self) -> Optional[pulumi.Input[str]]:
"""
The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
"""
return pulumi.get(self, "cluster_ca_cert")
@cluster_ca_cert.setter
def cluster_ca_cert(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "cluster_ca_cert", value)
@property
@pulumi.getter(name="deletionProtection")
def deletion_protection(self) -> Optional[pulumi.Input[bool]]:
"""
Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
"""
return pulumi.get(self, "deletion_protection")
@deletion_protection.setter
def deletion_protection(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "deletion_protection", value)
@property
@pulumi.getter(name="endpointPublicAccessEnabled")
def endpoint_public_access_enabled(self) -> Optional[pulumi.Input[bool]]:
"""
Whether to create internet eip for API Server. Default to false.
"""
return pulumi.get(self, "endpoint_public_access_enabled")
@endpoint_public_access_enabled.setter
def endpoint_public_access_enabled(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "endpoint_public_access_enabled", value)
@property
@pulumi.getter(name="forceUpdate")
def force_update(self) -> Optional[pulumi.Input[bool]]:
"""
Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
"""
return pulumi.get(self, "force_update")
@force_update.setter
def force_update(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "force_update", value)
@property
@pulumi.getter(name="kubeConfig")
def kube_config(self) -> Optional[pulumi.Input[str]]:
"""
The path of kube config, like `~/.kube/config`.
"""
return pulumi.get(self, "kube_config")
@kube_config.setter
def kube_config(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "kube_config", value)
@property
@pulumi.getter(name="loadBalancerSpec")
def load_balancer_spec(self) -> Optional[pulumi.Input[str]]:
"""
The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
"""
return pulumi.get(self, "load_balancer_spec")
@load_balancer_spec.setter
def load_balancer_spec(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "load_balancer_spec", value)
@property
@pulumi.getter(name="loggingType")
def logging_type(self) -> Optional[pulumi.Input[str]]:
"""
Enable log service, Valid value `SLS`.
"""
return pulumi.get(self, "logging_type")
@logging_type.setter
def logging_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "logging_type", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter(name="namePrefix")
def name_prefix(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name_prefix")
@name_prefix.setter
def name_prefix(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name_prefix", value)
@property
@pulumi.getter(name="newNatGateway")
def new_nat_gateway(self) -> Optional[pulumi.Input[bool]]:
"""
Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
"""
return pulumi.get(self, "new_nat_gateway")
@new_nat_gateway.setter
def new_nat_gateway(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "new_nat_gateway", value)
@property
@pulumi.getter(name="privateZone")
def private_zone(self) -> Optional[pulumi.Input[bool]]:
"""
(Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
"""
return pulumi.get(self, "private_zone")
@private_zone.setter
def private_zone(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "private_zone", value)
@property
@pulumi.getter(name="resourceGroupId")
def resource_group_id(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
"""
return pulumi.get(self, "resource_group_id")
@resource_group_id.setter
def resource_group_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "resource_group_id", value)
@property
@pulumi.getter(name="securityGroupId")
def security_group_id(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
"""
return pulumi.get(self, "security_group_id")
@security_group_id.setter
def security_group_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "security_group_id", value)
@property
@pulumi.getter(name="serviceCidr")
def service_cidr(self) -> Optional[pulumi.Input[str]]:
"""
CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
"""
return pulumi.get(self, "service_cidr")
@service_cidr.setter
def service_cidr(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "service_cidr", value)
@property
@pulumi.getter(name="serviceDiscoveryTypes")
def service_discovery_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
"""
return pulumi.get(self, "service_discovery_types")
@service_discovery_types.setter
def service_discovery_types(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "service_discovery_types", value)
@property
@pulumi.getter(name="slsProjectName")
def sls_project_name(self) -> Optional[pulumi.Input[str]]:
"""
If you use an existing SLS project, you must specify `sls_project_name`.
"""
return pulumi.get(self, "sls_project_name")
@sls_project_name.setter
def sls_project_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sls_project_name", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "tags", value)
@property
@pulumi.getter(name="timeZone")
def time_zone(self) -> Optional[pulumi.Input[str]]:
"""
The time zone of the cluster.
"""
return pulumi.get(self, "time_zone")
@time_zone.setter
def time_zone(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "time_zone", value)
@property
@pulumi.getter
def version(self) -> Optional[pulumi.Input[str]]:
"""
Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
"""
return pulumi.get(self, "version")
@version.setter
def version(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "version", value)
@property
@pulumi.getter(name="vpcId")
def vpc_id(self) -> Optional[pulumi.Input[str]]:
"""
The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
"""
return pulumi.get(self, "vpc_id")
@vpc_id.setter
def vpc_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "vpc_id", value)
@property
@pulumi.getter(name="vswitchId")
def vswitch_id(self) -> Optional[pulumi.Input[str]]:
"""
(Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
"""
return pulumi.get(self, "vswitch_id")
@vswitch_id.setter
def vswitch_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "vswitch_id", value)
@property
@pulumi.getter(name="vswitchIds")
def vswitch_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The vswitches where new kubernetes cluster will be located.
"""
return pulumi.get(self, "vswitch_ids")
@vswitch_ids.setter
def vswitch_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "vswitch_ids", value)
@property
@pulumi.getter(name="zoneId")
def zone_id(self) -> Optional[pulumi.Input[str]]:
"""
When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
return pulumi.get(self, "zone_id")
@zone_id.setter
def zone_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "zone_id", value)
class ServerlessKubernetes(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
addons: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerlessKubernetesAddonArgs']]]]] = None,
client_cert: Optional[pulumi.Input[str]] = None,
client_key: Optional[pulumi.Input[str]] = None,
cluster_ca_cert: Optional[pulumi.Input[str]] = None,
deletion_protection: Optional[pulumi.Input[bool]] = None,
endpoint_public_access_enabled: Optional[pulumi.Input[bool]] = None,
force_update: Optional[pulumi.Input[bool]] = None,
kube_config: Optional[pulumi.Input[str]] = None,
load_balancer_spec: Optional[pulumi.Input[str]] = None,
logging_type: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
name_prefix: Optional[pulumi.Input[str]] = None,
new_nat_gateway: Optional[pulumi.Input[bool]] = None,
private_zone: Optional[pulumi.Input[bool]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
security_group_id: Optional[pulumi.Input[str]] = None,
service_cidr: Optional[pulumi.Input[str]] = None,
service_discovery_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
sls_project_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
time_zone: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
vswitch_id: Optional[pulumi.Input[str]] = None,
vswitch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
## Import
Serverless Kubernetes cluster can be imported using the id, e.g.
```sh
$ pulumi import alicloud:cs/serverlessKubernetes:ServerlessKubernetes main ce4273f9156874b46bb
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerlessKubernetesAddonArgs']]]] addons: ) You can specific network plugin,log component,ingress component and so on.Detailed below.
:param pulumi.Input[str] client_cert: The path of client certificate, like `~/.kube/client-cert.pem`.
:param pulumi.Input[str] client_key: The path of client key, like `~/.kube/client-key.pem`.
:param pulumi.Input[str] cluster_ca_cert: The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
:param pulumi.Input[bool] deletion_protection: Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
:param pulumi.Input[bool] endpoint_public_access_enabled: Whether to create internet eip for API Server. Default to false.
:param pulumi.Input[bool] force_update: Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
:param pulumi.Input[str] kube_config: The path of kube config, like `~/.kube/config`.
:param pulumi.Input[str] load_balancer_spec: The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
:param pulumi.Input[str] logging_type: Enable log service, Valid value `SLS`.
:param pulumi.Input[str] name: Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
:param pulumi.Input[bool] new_nat_gateway: Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
:param pulumi.Input[bool] private_zone: (Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
:param pulumi.Input[str] resource_group_id: The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
:param pulumi.Input[str] security_group_id: The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
:param pulumi.Input[str] service_cidr: CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] service_discovery_types: Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
:param pulumi.Input[str] sls_project_name: If you use an existing SLS project, you must specify `sls_project_name`.
:param pulumi.Input[Mapping[str, Any]] tags: Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
:param pulumi.Input[str] time_zone: The time zone of the cluster.
:param pulumi.Input[str] version: Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
:param pulumi.Input[str] vpc_id: The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
:param pulumi.Input[str] vswitch_id: (Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
:param pulumi.Input[Sequence[pulumi.Input[str]]] vswitch_ids: The vswitches where new kubernetes cluster will be located.
:param pulumi.Input[str] zone_id: When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: ServerlessKubernetesArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
## Import
Serverless Kubernetes cluster can be imported using the id, e.g.
```sh
$ pulumi import alicloud:cs/serverlessKubernetes:ServerlessKubernetes main ce4273f9156874b46bb
```
:param str resource_name: The name of the resource.
:param ServerlessKubernetesArgs 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(ServerlessKubernetesArgs, 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,
addons: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerlessKubernetesAddonArgs']]]]] = None,
client_cert: Optional[pulumi.Input[str]] = None,
client_key: Optional[pulumi.Input[str]] = None,
cluster_ca_cert: Optional[pulumi.Input[str]] = None,
deletion_protection: Optional[pulumi.Input[bool]] = None,
endpoint_public_access_enabled: Optional[pulumi.Input[bool]] = None,
force_update: Optional[pulumi.Input[bool]] = None,
kube_config: Optional[pulumi.Input[str]] = None,
load_balancer_spec: Optional[pulumi.Input[str]] = None,
logging_type: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
name_prefix: Optional[pulumi.Input[str]] = None,
new_nat_gateway: Optional[pulumi.Input[bool]] = None,
private_zone: Optional[pulumi.Input[bool]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
security_group_id: Optional[pulumi.Input[str]] = None,
service_cidr: Optional[pulumi.Input[str]] = None,
service_discovery_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
sls_project_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
time_zone: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
vswitch_id: Optional[pulumi.Input[str]] = None,
vswitch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ServerlessKubernetesArgs.__new__(ServerlessKubernetesArgs)
__props__.__dict__["addons"] = addons
__props__.__dict__["client_cert"] = client_cert
__props__.__dict__["client_key"] = client_key
__props__.__dict__["cluster_ca_cert"] = cluster_ca_cert
__props__.__dict__["deletion_protection"] = deletion_protection
__props__.__dict__["endpoint_public_access_enabled"] = endpoint_public_access_enabled
__props__.__dict__["force_update"] = force_update
__props__.__dict__["kube_config"] = kube_config
__props__.__dict__["load_balancer_spec"] = load_balancer_spec
__props__.__dict__["logging_type"] = logging_type
__props__.__dict__["name"] = name
__props__.__dict__["name_prefix"] = name_prefix
__props__.__dict__["new_nat_gateway"] = new_nat_gateway
if private_zone is not None and not opts.urn:
warnings.warn("""Field 'private_zone' has been deprecated from provider version 1.123.1. New field 'service_discovery_types' replace it.""", DeprecationWarning)
pulumi.log.warn("""private_zone is deprecated: Field 'private_zone' has been deprecated from provider version 1.123.1. New field 'service_discovery_types' replace it.""")
__props__.__dict__["private_zone"] = private_zone
__props__.__dict__["resource_group_id"] = resource_group_id
__props__.__dict__["security_group_id"] = security_group_id
__props__.__dict__["service_cidr"] = service_cidr
__props__.__dict__["service_discovery_types"] = service_discovery_types
__props__.__dict__["sls_project_name"] = sls_project_name
__props__.__dict__["tags"] = tags
__props__.__dict__["time_zone"] = time_zone
__props__.__dict__["version"] = version
if vpc_id is None and not opts.urn:
raise TypeError("Missing required property 'vpc_id'")
__props__.__dict__["vpc_id"] = vpc_id
if vswitch_id is not None and not opts.urn:
warnings.warn("""Field 'vswitch_id' has been deprecated from provider version 1.91.0. New field 'vswitch_ids' replace it.""", DeprecationWarning)
pulumi.log.warn("""vswitch_id is deprecated: Field 'vswitch_id' has been deprecated from provider version 1.91.0. New field 'vswitch_ids' replace it.""")
__props__.__dict__["vswitch_id"] = vswitch_id
__props__.__dict__["vswitch_ids"] = vswitch_ids
__props__.__dict__["zone_id"] = zone_id
super(ServerlessKubernetes, __self__).__init__(
'alicloud:cs/serverlessKubernetes:ServerlessKubernetes',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
addons: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ServerlessKubernetesAddonArgs']]]]] = None,
client_cert: Optional[pulumi.Input[str]] = None,
client_key: Optional[pulumi.Input[str]] = None,
cluster_ca_cert: Optional[pulumi.Input[str]] = None,
deletion_protection: Optional[pulumi.Input[bool]] = None,
endpoint_public_access_enabled: Optional[pulumi.Input[bool]] = None,
force_update: Optional[pulumi.Input[bool]] = None,
kube_config: Optional[pulumi.Input[str]] = None,
load_balancer_spec: Optional[pulumi.Input[str]] = None,
logging_type: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
name_prefix: Optional[pulumi.Input[str]] = None,
new_nat_gateway: Optional[pulumi.Input[bool]] = None,
private_zone: Optional[pulumi.Input[bool]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
security_group_id: Optional[pulumi.Input[str]] = None,
service_cidr: Optional[pulumi.Input[str]] = None,
service_discovery_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
sls_project_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
time_zone: Optional[pulumi.Input[str]] = None,
version: Optional[pulumi.Input[str]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
vswitch_id: Optional[pulumi.Input[str]] = None,
vswitch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None) -> 'ServerlessKubernetes':
"""
Get an existing ServerlessKubernetes 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[Sequence[pulumi.Input[pulumi.InputType['ServerlessKubernetesAddonArgs']]]] addons: ) You can specific network plugin,log component,ingress component and so on.Detailed below.
:param pulumi.Input[str] client_cert: The path of client certificate, like `~/.kube/client-cert.pem`.
:param pulumi.Input[str] client_key: The path of client key, like `~/.kube/client-key.pem`.
:param pulumi.Input[str] cluster_ca_cert: The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
:param pulumi.Input[bool] deletion_protection: Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
:param pulumi.Input[bool] endpoint_public_access_enabled: Whether to create internet eip for API Server. Default to false.
:param pulumi.Input[bool] force_update: Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
:param pulumi.Input[str] kube_config: The path of kube config, like `~/.kube/config`.
:param pulumi.Input[str] load_balancer_spec: The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
:param pulumi.Input[str] logging_type: Enable log service, Valid value `SLS`.
:param pulumi.Input[str] name: Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
:param pulumi.Input[bool] new_nat_gateway: Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
:param pulumi.Input[bool] private_zone: (Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
:param pulumi.Input[str] resource_group_id: The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
:param pulumi.Input[str] security_group_id: The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
:param pulumi.Input[str] service_cidr: CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] service_discovery_types: Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
:param pulumi.Input[str] sls_project_name: If you use an existing SLS project, you must specify `sls_project_name`.
:param pulumi.Input[Mapping[str, Any]] tags: Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
:param pulumi.Input[str] time_zone: The time zone of the cluster.
:param pulumi.Input[str] version: Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
:param pulumi.Input[str] vpc_id: The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
:param pulumi.Input[str] vswitch_id: (Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
:param pulumi.Input[Sequence[pulumi.Input[str]]] vswitch_ids: The vswitches where new kubernetes cluster will be located.
:param pulumi.Input[str] zone_id: When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _ServerlessKubernetesState.__new__(_ServerlessKubernetesState)
__props__.__dict__["addons"] = addons
__props__.__dict__["client_cert"] = client_cert
__props__.__dict__["client_key"] = client_key
__props__.__dict__["cluster_ca_cert"] = cluster_ca_cert
__props__.__dict__["deletion_protection"] = deletion_protection
__props__.__dict__["endpoint_public_access_enabled"] = endpoint_public_access_enabled
__props__.__dict__["force_update"] = force_update
__props__.__dict__["kube_config"] = kube_config
__props__.__dict__["load_balancer_spec"] = load_balancer_spec
__props__.__dict__["logging_type"] = logging_type
__props__.__dict__["name"] = name
__props__.__dict__["name_prefix"] = name_prefix
__props__.__dict__["new_nat_gateway"] = new_nat_gateway
__props__.__dict__["private_zone"] = private_zone
__props__.__dict__["resource_group_id"] = resource_group_id
__props__.__dict__["security_group_id"] = security_group_id
__props__.__dict__["service_cidr"] = service_cidr
__props__.__dict__["service_discovery_types"] = service_discovery_types
__props__.__dict__["sls_project_name"] = sls_project_name
__props__.__dict__["tags"] = tags
__props__.__dict__["time_zone"] = time_zone
__props__.__dict__["version"] = version
__props__.__dict__["vpc_id"] = vpc_id
__props__.__dict__["vswitch_id"] = vswitch_id
__props__.__dict__["vswitch_ids"] = vswitch_ids
__props__.__dict__["zone_id"] = zone_id
return ServerlessKubernetes(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def addons(self) -> pulumi.Output[Sequence['outputs.ServerlessKubernetesAddon']]:
"""
) You can specific network plugin,log component,ingress component and so on.Detailed below.
"""
return pulumi.get(self, "addons")
@property
@pulumi.getter(name="clientCert")
def client_cert(self) -> pulumi.Output[Optional[str]]:
"""
The path of client certificate, like `~/.kube/client-cert.pem`.
"""
return pulumi.get(self, "client_cert")
@property
@pulumi.getter(name="clientKey")
def client_key(self) -> pulumi.Output[Optional[str]]:
"""
The path of client key, like `~/.kube/client-key.pem`.
"""
return pulumi.get(self, "client_key")
@property
@pulumi.getter(name="clusterCaCert")
def cluster_ca_cert(self) -> pulumi.Output[Optional[str]]:
"""
The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
"""
return pulumi.get(self, "cluster_ca_cert")
@property
@pulumi.getter(name="deletionProtection")
def deletion_protection(self) -> pulumi.Output[Optional[bool]]:
"""
Whether enable the deletion protection or not.
- true: Enable deletion protection.
- false: Disable deletion protection.
"""
return pulumi.get(self, "deletion_protection")
@property
@pulumi.getter(name="endpointPublicAccessEnabled")
def endpoint_public_access_enabled(self) -> pulumi.Output[Optional[bool]]:
"""
Whether to create internet eip for API Server. Default to false.
"""
return pulumi.get(self, "endpoint_public_access_enabled")
@property
@pulumi.getter(name="forceUpdate")
def force_update(self) -> pulumi.Output[Optional[bool]]:
"""
Default false, when you want to change `vpc_id` and `vswitch_id`, you have to set this field to true, then the cluster will be recreated.
"""
return pulumi.get(self, "force_update")
@property
@pulumi.getter(name="kubeConfig")
def kube_config(self) -> pulumi.Output[Optional[str]]:
"""
The path of kube config, like `~/.kube/config`.
"""
return pulumi.get(self, "kube_config")
@property
@pulumi.getter(name="loadBalancerSpec")
def load_balancer_spec(self) -> pulumi.Output[Optional[str]]:
"""
The cluster api server load balance instance specification, default `slb.s1.small`. For more information on how to select a LB instance specification, see [SLB instance overview](https://help.aliyun.com/document_detail/85931.html).
"""
return pulumi.get(self, "load_balancer_spec")
@property
@pulumi.getter(name="loggingType")
def logging_type(self) -> pulumi.Output[Optional[str]]:
"""
Enable log service, Valid value `SLS`.
"""
return pulumi.get(self, "logging_type")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
Name of the ACK add-on. The name must match one of the names returned by [DescribeAddons](https://help.aliyun.com/document_detail/171524.html).
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="namePrefix")
def name_prefix(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "name_prefix")
@property
@pulumi.getter(name="newNatGateway")
def new_nat_gateway(self) -> pulumi.Output[Optional[bool]]:
"""
Whether to create a new nat gateway while creating kubernetes cluster. SNAT must be configured when a new VPC is automatically created. Default is `true`.
"""
return pulumi.get(self, "new_nat_gateway")
@property
@pulumi.getter(name="privateZone")
def private_zone(self) -> pulumi.Output[Optional[bool]]:
"""
(Optional, ForceNew) Has been deprecated from provider version 1.123.1. `PrivateZone` is used as the enumeration value of `service_discovery_types`.
"""
return pulumi.get(self, "private_zone")
@property
@pulumi.getter(name="resourceGroupId")
def resource_group_id(self) -> pulumi.Output[str]:
"""
The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.
"""
return pulumi.get(self, "resource_group_id")
@property
@pulumi.getter(name="securityGroupId")
def security_group_id(self) -> pulumi.Output[str]:
"""
The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.
"""
return pulumi.get(self, "security_group_id")
@property
@pulumi.getter(name="serviceCidr")
def service_cidr(self) -> pulumi.Output[Optional[str]]:
"""
CIDR block of the service network. The specified CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. The CIDR block cannot be modified after the cluster is created.
"""
return pulumi.get(self, "service_cidr")
@property
@pulumi.getter(name="serviceDiscoveryTypes")
def service_discovery_types(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
Service discovery type. If the value is empty, it means that service discovery is not enabled. Valid values are `CoreDNS` and `PrivateZone`.
"""
return pulumi.get(self, "service_discovery_types")
@property
@pulumi.getter(name="slsProjectName")
def sls_project_name(self) -> pulumi.Output[str]:
"""
If you use an existing SLS project, you must specify `sls_project_name`.
"""
return pulumi.get(self, "sls_project_name")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
"""
Default nil, A map of tags assigned to the kubernetes cluster and work nodes.
"""
return pulumi.get(self, "tags")
@property
@pulumi.getter(name="timeZone")
def time_zone(self) -> pulumi.Output[str]:
"""
The time zone of the cluster.
"""
return pulumi.get(self, "time_zone")
@property
@pulumi.getter
def version(self) -> pulumi.Output[str]:
"""
Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used.
"""
return pulumi.get(self, "version")
@property
@pulumi.getter(name="vpcId")
def vpc_id(self) -> pulumi.Output[str]:
"""
The vpc where new kubernetes cluster will be located. Specify one vpc's id, if it is not specified, a new VPC will be built.
"""
return pulumi.get(self, "vpc_id")
@property
@pulumi.getter(name="vswitchId")
def vswitch_id(self) -> pulumi.Output[Optional[str]]:
"""
(Required, ForceNew) The vswitch where new kubernetes cluster will be located. Specify one vswitch's id, if it is not specified, a new VPC and VSwicth will be built. It must be in the zone which `availability_zone` specified.
"""
return pulumi.get(self, "vswitch_id")
@property
@pulumi.getter(name="vswitchIds")
def vswitch_ids(self) -> pulumi.Output[Sequence[str]]:
"""
The vswitches where new kubernetes cluster will be located.
"""
return pulumi.get(self, "vswitch_ids")
@property
@pulumi.getter(name="zoneId")
def zone_id(self) -> pulumi.Output[Optional[str]]:
"""
When creating a cluster using automatic VPC creation, you need to specify the zone where the VPC is located.
"""
return pulumi.get(self, "zone_id")
| 53.19381
| 284
| 0.67188
| 9,268
| 72,184
| 5.035175
| 0.034635
| 0.088866
| 0.073501
| 0.070715
| 0.957871
| 0.951442
| 0.945978
| 0.943192
| 0.940042
| 0.924013
| 0
| 0.003573
| 0.224634
| 72,184
| 1,356
| 285
| 53.233038
| 0.83021
| 0.354511
| 0
| 0.90625
| 1
| 0.014423
| 0.13377
| 0.026132
| 0
| 0
| 0
| 0
| 0
| 1
| 0.164663
| false
| 0.001202
| 0.008413
| 0.003606
| 0.271635
| 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
|
5183884ec60ecbef7ae25334d17102ec20a24f8e
| 139
|
py
|
Python
|
faraday_spectra/__init__.py
|
MatthewJA/faraday-spectra
|
36cf20041da73ffca20331600e850f7cd442e9a0
|
[
"BSD-3-Clause"
] | 1
|
2020-09-30T06:53:26.000Z
|
2020-09-30T06:53:26.000Z
|
faraday_spectra/__init__.py
|
MatthewJA/faraday-spectra
|
36cf20041da73ffca20331600e850f7cd442e9a0
|
[
"BSD-3-Clause"
] | null | null | null |
faraday_spectra/__init__.py
|
MatthewJA/faraday-spectra
|
36cf20041da73ffca20331600e850f7cd442e9a0
|
[
"BSD-3-Clause"
] | null | null | null |
"""Generate simulated Faraday spectra."""
from .generate_spectra import generate_spectra as generate
from .__version__ import __version__
| 27.8
| 58
| 0.827338
| 16
| 139
| 6.5625
| 0.5
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107914
| 139
| 4
| 59
| 34.75
| 0.846774
| 0.251799
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
51e17ca8393da7b587463a87e01b0fd2d3af30d4
| 45,886
|
py
|
Python
|
test/test_app_helpers.py
|
clach04/PyWebScrapBook
|
310e8f20cc5337336875679246b9269265b4476a
|
[
"MIT"
] | 39
|
2019-04-10T18:07:40.000Z
|
2022-02-07T07:11:30.000Z
|
test/test_app_helpers.py
|
clach04/PyWebScrapBook
|
310e8f20cc5337336875679246b9269265b4476a
|
[
"MIT"
] | 56
|
2019-05-07T23:29:14.000Z
|
2022-02-24T10:33:43.000Z
|
test/test_app_helpers.py
|
clach04/PyWebScrapBook
|
310e8f20cc5337336875679246b9269265b4476a
|
[
"MIT"
] | 15
|
2019-06-12T05:16:43.000Z
|
2022-01-16T13:24:11.000Z
|
from unittest import mock
import unittest
import sys
import os
import shutil
import io
import zipfile
import time
from flask import current_app, request
import webscrapbook
from webscrapbook import WSB_DIR, WSB_CONFIG
from webscrapbook import app as wsbapp
root_dir = os.path.abspath(os.path.dirname(__file__))
server_root = os.path.join(root_dir, 'test_app_helpers')
def setUpModule():
# mock out user config
global mockings
mockings = [
mock.patch('webscrapbook.WSB_USER_DIR', server_root, 'wsb'),
mock.patch('webscrapbook.WSB_USER_CONFIG', server_root),
]
for mocking in mockings:
mocking.start()
def tearDownModule():
# stop mock
for mocking in mockings:
mocking.stop()
class TestFunctions(unittest.TestCase):
def test_is_local_access(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
# host is localhost
with app.test_request_context('/',
base_url='http://127.0.0.1',
environ_base={'REMOTE_ADDR': '192.168.0.100'}):
self.assertTrue(wsbapp.is_local_access())
# host (with port) is localhost
with app.test_request_context('/',
base_url='http://127.0.0.1:8000',
environ_base={'REMOTE_ADDR': '192.168.0.100'}):
self.assertTrue(wsbapp.is_local_access())
# remote is localhost
with app.test_request_context('/',
base_url='http://192.168.0.1',
environ_base={'REMOTE_ADDR': '127.0.0.1'}):
self.assertTrue(wsbapp.is_local_access())
# host = remote
with app.test_request_context('/',
base_url='http://example.com',
environ_base={'REMOTE_ADDR': 'example.com'}):
self.assertTrue(wsbapp.is_local_access())
# host (with port) = remote
with app.test_request_context('/',
base_url='http://example.com:8000',
environ_base={'REMOTE_ADDR': 'example.com'}):
self.assertTrue(wsbapp.is_local_access())
# otherwise non-local
with app.test_request_context('/',
base_url='http://example.com',
environ_base={'REMOTE_ADDR': '192.168.0.100'}):
self.assertFalse(wsbapp.is_local_access())
def test_get_archive_path1(self):
"""Basic logit for a sub-archive path."""
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
with app.app_context():
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
pass
self.assertEqual(wsbapp.get_archive_path('/entry.zip'), ['/entry.zip'])
self.assertEqual(wsbapp.get_archive_path('/entry.zip!'), ['/entry.zip!'])
self.assertEqual(wsbapp.get_archive_path('/entry.zip!/'), ['/entry.zip', ''])
self.assertEqual(wsbapp.get_archive_path('/entry.zip!/subdir'), ['/entry.zip', 'subdir'])
self.assertEqual(wsbapp.get_archive_path('/entry.zip!/subdir/'), ['/entry.zip', 'subdir'])
self.assertEqual(wsbapp.get_archive_path('/entry.zip!/index.html'), ['/entry.zip', 'index.html'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
def test_get_archive_path2(self):
"""Handle conflicting file or directory."""
# entry.zip!/entry1.zip!/ = entry.zip!/entry1.zip! >
# entry.zip!/entry1.zip >
# entry.zip!/ = entry.zip! >
# entry.zip
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
with app.app_context():
# entry.zip!/entry1.zip!/ > entry.zip!/entry1.zip
try:
os.makedirs(os.path.join(root, 'entry.zip!', 'entry1.zip!'), exist_ok=True)
with zipfile.ZipFile(os.path.join(root, 'entry.zip!', 'entry1.zip'), 'w') as zip:
pass
with zipfile.ZipFile(os.path.join(root, 'entry.zip'), 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip!/entry1.zip!'])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
# entry.zip!/entry1.zip! > entry.zip!/entry1.zip
try:
os.makedirs(os.path.join(root, 'entry.zip!'), exist_ok=True)
with open(os.path.join(root, 'entry.zip!', 'entry1.zip!'), 'w') as f:
pass
with zipfile.ZipFile(os.path.join(root, 'entry.zip!', 'entry1.zip'), 'w') as zip:
pass
with zipfile.ZipFile(os.path.join(root, 'entry.zip'), 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip!/entry1.zip!'])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
# entry.zip!/entry1.zip > entry.zip!/
try:
os.makedirs(os.path.join(root, 'entry.zip!'), exist_ok=True)
with zipfile.ZipFile(os.path.join(root, 'entry.zip!', 'entry1.zip'), 'w') as zip:
pass
with zipfile.ZipFile(os.path.join(root, 'entry.zip'), 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip!/entry1.zip', ''])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
# entry.zip!/ > entry.zip
try:
os.makedirs(os.path.join(root, 'entry.zip!'), exist_ok=True)
with zipfile.ZipFile(os.path.join(root, 'entry.zip'), 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip!/entry1.zip!'])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
# entry.zip! > entry.zip
try:
with open(os.path.join(root, 'entry.zip!'), 'w') as f:
pass
with zipfile.ZipFile(os.path.join(root, 'entry.zip'), 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip!/entry1.zip!'])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
# entry.zip
try:
with zipfile.ZipFile(os.path.join(root, 'entry.zip'), 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip', 'entry1.zip!'])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
# other
try:
with open(os.path.join(root, 'entry.zip'), 'w') as f:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/'),
['/entry.zip!/entry1.zip!'])
finally:
try:
shutil.rmtree(os.path.join(root, 'entry.zip!'))
except NotADirectoryError:
os.remove(os.path.join(root, 'entry.zip!'))
except FileNotFoundError:
pass
try:
os.remove(os.path.join(root, 'entry.zip'))
except FileNotFoundError:
pass
def test_get_archive_path3(self):
"""Handle recursive sub-archive path."""
# entry1.zip!/entry2.zip!/ >
# entry1.zip!/entry2.zip >
# entry1.zip!/ >
# entry1.zip entry2.zip!/ >
# entry1.zip entry2.zip >
# entry1.zip >
# other
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
with app.app_context():
# entry1.zip!/entry2.zip!/ > entry1.zip!/entry2.zip
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
zip.writestr('entry1.zip!/entry2.zip!/', '')
buf2 = io.BytesIO()
with zipfile.ZipFile(buf2, 'w') as zip2:
pass
zip.writestr('entry1.zip!/entry2.zip', buf2.getvalue())
zip.writestr('entry1.zip!/', '')
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip!/entry2.zip!/ > entry1.zip!/entry2.zip
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
zip.writestr('entry1.zip!/entry2.zip!/.gitkeep', '')
buf2 = io.BytesIO()
with zipfile.ZipFile(buf2, 'w') as zip2:
pass
zip.writestr('entry1.zip!/entry2.zip', buf2.getvalue())
zip.writestr('entry1.zip!/', '')
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip!/entry2.zip > entry1.zip!/
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf2 = io.BytesIO()
with zipfile.ZipFile(buf2, 'w') as zip2:
pass
zip.writestr('entry1.zip!/entry2.zip', buf2.getvalue())
zip.writestr('entry1.zip!/', '')
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip', ''])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip!/ > entry1.zip entry2.zip!/
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
zip.writestr('entry1.zip!/entry2.zip', 'non-zip')
zip.writestr('entry1.zip!/', '')
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip!/ > entry1.zip entry2.zip!/
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
zip.writestr('entry1.zip!/', '')
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip!/ > entry1.zip entry2.zip!/
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
zip.writestr('entry1.zip!/.gitkeep', '')
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip entry2.zip!/ > entry1.zip entry2.zip
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!/', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip', 'entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip entry2.zip!/ > entry1.zip entry2.zip
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip!/.gitkeep', '')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip', 'entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip entry2.zip > entry1.zip
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w'):
pass
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip', 'entry2.zip', ''])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# entry1.zip
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
with zipfile.ZipFile(buf1, 'w') as zip1:
zip1.writestr('entry2.zip', 'non-zip')
zip.writestr('entry1.zip', buf1.getvalue())
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip', 'entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# other
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
zip.writestr('entry1.zip', 'non-zip')
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# other
tempfile = os.path.join(root, 'entry.zip')
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
pass
self.assertEqual(
wsbapp.get_archive_path('/entry.zip!/entry1.zip!/entry2.zip!/'),
['/entry.zip', 'entry1.zip!/entry2.zip!'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
def test_open_archive_path_read(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
tempfile = os.path.join(root, 'entry.zip')
app = wsbapp.make_app(root)
with app.app_context():
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
buf11 = io.BytesIO()
with zipfile.ZipFile(buf11, 'w') as zip2:
zip2.writestr('subdir/index.html', 'Hello World!')
zip1.writestr('entry2.zip', buf11.getvalue())
zip.writestr('entry1.zip', buf1.getvalue())
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'entry2.zip', 'subdir/index.html']) as zip:
self.assertEqual(zip.read('subdir/index.html').decode('UTF-8'), 'Hello World!')
with self.assertRaises(ValueError):
with wsbapp.open_archive_path([tempfile]) as zip:
pass
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
def test_open_archive_path_write(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
tempfile = os.path.join(root, 'entry.zip')
app = wsbapp.make_app(root)
with app.app_context():
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
zip1.writestr('subdir/index.html', 'Hello World!')
zip.writestr('entry1.zip', buf1.getvalue())
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html'], 'w') as zip:
# existed
zip.writestr('subdir/index.html', 'rewritten 測試')
# new
zip.writestr('newdir/test.txt', 'new file 測試')
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html']) as zip:
# existed
self.assertEqual(zip.read('subdir/index.html').decode('UTF-8'), 'rewritten 測試')
# new
self.assertEqual(zip.read('newdir/test.txt').decode('UTF-8'), 'new file 測試')
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
def test_open_archive_path_delete(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
tempfile = os.path.join(root, 'entry.zip')
app = wsbapp.make_app(root)
with app.app_context():
# file
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
zip1.writestr('subdir/', '')
zip1.writestr('subdir/index.html', 'Hello World!')
zip1.writestr('subdir2/test.txt', 'dummy')
zip.writestr('entry1.zip', buf1.getvalue())
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html'], 'w', ['subdir/index.html']) as zip:
pass
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html']) as zip:
self.assertEqual(zip.namelist(), ['subdir/', 'subdir2/test.txt'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# explicit directory
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
zip1.writestr('subdir/', '')
zip1.writestr('subdir/index.html', 'Hello World!')
zip1.writestr('subdir2/test.txt', 'dummy')
zip.writestr('entry1.zip', buf1.getvalue())
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html'], 'w', ['subdir']) as zip:
pass
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html']) as zip:
self.assertEqual(zip.namelist(), ['subdir2/test.txt'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# implicit directory
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
zip1.writestr('subdir/', '')
zip1.writestr('subdir/index.html', 'Hello World!')
zip1.writestr('subdir2/test.txt', 'dummy')
zip.writestr('entry1.zip', buf1.getvalue())
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html'], 'w', ['subdir2']) as zip:
pass
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html']) as zip:
self.assertEqual(zip.namelist(), ['subdir/', 'subdir/index.html'])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
# multiple
try:
with zipfile.ZipFile(tempfile, 'w') as zip:
buf1 = io.BytesIO()
with zipfile.ZipFile(buf1, 'w') as zip1:
zip1.writestr('subdir/', '')
zip1.writestr('subdir/index.html', 'Hello World!')
zip1.writestr('subdir2/test.txt', 'dummy')
zip.writestr('entry1.zip', buf1.getvalue())
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html'], 'w', ['subdir', 'subdir2']) as zip:
pass
with wsbapp.open_archive_path([tempfile, 'entry1.zip', 'subdir/index.html']) as zip:
self.assertEqual(zip.namelist(), [])
finally:
try:
os.remove(tempfile)
except FileNotFoundError:
pass
@mock.patch('webscrapbook.util.encrypt', side_effect=webscrapbook.util.encrypt)
def test_get_permission1(self, mock_encrypt):
"""Return corresponding permission for the matched user and '' for unmatched."""
root = os.path.join(root_dir, 'test_app_helpers', 'get_permission1')
app = wsbapp.make_app(root)
auth_config = app.config['WEBSCRAPBOOK_HOST'].config['auth']
with app.app_context():
# util.encrypt should be called with the inputting password
# and the salt and method for the matched user
mock_encrypt.reset_mock()
self.assertEqual(wsbapp.get_permission({'username': 'user1', 'password': 'pass1'}, auth_config), '')
mock_encrypt.assert_called_with('pass1', '', 'plain')
self.assertEqual(wsbapp.get_permission({'username': 'user2', 'password': 'pass2'}, auth_config), 'view')
mock_encrypt.assert_called_with('pass2', 'salt', 'plain')
self.assertEqual(wsbapp.get_permission({'username': 'user3', 'password': 'pass3'}, auth_config), 'read')
mock_encrypt.assert_called_with('pass3', '', 'sha1')
self.assertEqual(wsbapp.get_permission({'username': 'user4', 'password': 'pass4'}, auth_config), 'all')
mock_encrypt.assert_called_with('pass4', 'salt4', 'sha256')
# Password check should be handled by util.encrypt properly.
# Here are just some quick fail tests for certain cases:
# - empty input should not work
# - inputting password + salt should not work
# - inputting hashed value should not work
mock_encrypt.reset_mock()
self.assertEqual(wsbapp.get_permission({'username': 'user4', 'password': ''}, auth_config), '')
mock_encrypt.assert_called_with('', 'salt4', 'sha256')
self.assertEqual(wsbapp.get_permission({'username': 'user4', 'password': 'salt4'}, auth_config), '')
mock_encrypt.assert_called_with('salt4', 'salt4', 'sha256')
self.assertEqual(wsbapp.get_permission({'username': 'user4', 'password': '49d1445a2989c509c5b5b1f78e092e3f30f05b1d219fd975ac77ff645ea68d53'}, auth_config), '')
mock_encrypt.assert_called_with('49d1445a2989c509c5b5b1f78e092e3f30f05b1d219fd975ac77ff645ea68d53', 'salt4', 'sha256')
# util.encrypt should NOT be called for an unmatched user
mock_encrypt.reset_mock()
self.assertEqual(wsbapp.get_permission(None, auth_config), '')
mock_encrypt.assert_not_called()
self.assertEqual(wsbapp.get_permission({'username': '', 'password': ''}, auth_config), '')
mock_encrypt.assert_not_called()
self.assertEqual(wsbapp.get_permission({'username': '', 'password': 'pass'}, auth_config), '')
mock_encrypt.assert_not_called()
self.assertEqual(wsbapp.get_permission({'username': 'userx', 'password': ''}, auth_config), '')
mock_encrypt.assert_not_called()
self.assertEqual(wsbapp.get_permission({'username': 'userx', 'password': 'pass'}, auth_config), '')
mock_encrypt.assert_not_called()
@mock.patch('webscrapbook.util.encrypt', side_effect=webscrapbook.util.encrypt)
def test_get_permission2(self, mock_encrypt):
"""Use empty user and password if not provided."""
root = os.path.join(root_dir, 'test_app_helpers', 'get_permission2')
app = wsbapp.make_app(root)
auth_config = app.config['WEBSCRAPBOOK_HOST'].config['auth']
with app.app_context():
self.assertEqual(wsbapp.get_permission(None, auth_config), 'view')
mock_encrypt.assert_called_with('', 'salt', 'plain')
self.assertEqual(wsbapp.get_permission({'username': '', 'password': ''}, auth_config), 'view')
mock_encrypt.assert_called_with('', 'salt', 'plain')
@mock.patch('webscrapbook.util.encrypt', side_effect=webscrapbook.util.encrypt)
def test_get_permission3(self, mock_encrypt):
"""Use permission for the first matched user and password."""
root = os.path.join(root_dir, 'test_app_helpers', 'get_permission3')
app = wsbapp.make_app(root)
auth_config = app.config['WEBSCRAPBOOK_HOST'].config['auth']
with app.app_context():
mock_encrypt.reset_mock()
self.assertEqual(wsbapp.get_permission({'username': '', 'password': ''}, auth_config), 'view')
mock_encrypt.assert_called_once_with('', 'salt', 'plain')
mock_encrypt.reset_mock()
self.assertEqual(wsbapp.get_permission({'username': 'user1', 'password': 'pass1'}, auth_config), 'read')
self.assertEqual(mock_encrypt.call_args_list[0][0], ('pass1', 'salt', 'plain'))
self.assertEqual(mock_encrypt.call_args_list[1][0], ('pass1', 'salt', 'plain'))
def test_verify_authorization(self):
for action in {'view', 'info', 'source', 'download', 'static'}:
with self.subTest(action=action):
self.assertFalse(wsbapp.verify_authorization('', action))
self.assertTrue(wsbapp.verify_authorization('view', action))
self.assertTrue(wsbapp.verify_authorization('read', action))
self.assertTrue(wsbapp.verify_authorization('all', action))
for action in {'list', 'edit', 'editx', 'exec', 'browse', 'config', 'unknown'}:
with self.subTest(action=action):
self.assertFalse(wsbapp.verify_authorization('', action))
self.assertFalse(wsbapp.verify_authorization('view', action))
self.assertTrue(wsbapp.verify_authorization('read', action))
self.assertTrue(wsbapp.verify_authorization('all', action))
for action in {'token', 'lock', 'unlock', 'mkdir', 'mkzip', 'save', 'delete', 'move', 'copy', 'backup', 'unbackup', 'cache', 'check'}:
with self.subTest(action=action):
self.assertFalse(wsbapp.verify_authorization('', action))
self.assertFalse(wsbapp.verify_authorization('view', action))
self.assertFalse(wsbapp.verify_authorization('read', action))
self.assertTrue(wsbapp.verify_authorization('all', action))
def test_make_app1(self):
# pass root
root = os.path.join(root_dir, 'test_app_helpers', 'make_app1')
app = wsbapp.make_app(root)
with app.app_context():
self.assertEqual(current_app.config['WEBSCRAPBOOK_HOST'].config['app']['name'], 'mywsb1')
def test_make_app2(self):
# pass root, config
root = os.path.join(root_dir, 'test_app_helpers', 'make_app1')
config_dir = os.path.join(root_dir, 'test_app_helpers', 'make_app2')
config = webscrapbook.Config()
config.load(config_dir)
app = wsbapp.make_app(root, config)
with app.app_context():
self.assertEqual(current_app.config['WEBSCRAPBOOK_HOST'].config['app']['name'], 'mywsb2')
class TestRequest(unittest.TestCase):
def test_action(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
with app.test_client() as c:
r = c.get('/index.html')
self.assertEqual(request.action, 'view')
r = c.get('/index.html', query_string={'action': 'source'})
self.assertEqual(request.action, 'source')
r = c.get('/index.html', query_string={'a': 'source'})
self.assertEqual(request.action, 'source')
r = c.get('/index.html', query_string={'a': 'source', 'action': 'static'})
self.assertEqual(request.action, 'static')
def test_format(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
with app.test_client() as c:
r = c.get('/index.html')
self.assertEqual(request.format, None)
r = c.get('/index.html', query_string={'format': 'json'})
self.assertEqual(request.format, 'json')
r = c.get('/index.html', query_string={'f': 'json'})
self.assertEqual(request.format, 'json')
r = c.get('/index.html', query_string={'f': 'json', 'format': 'sse'})
self.assertEqual(request.format, 'sse')
class TestHandlers(unittest.TestCase):
def test_handle_error(self):
root = os.path.join(root_dir, 'test_app_helpers', 'general')
app = wsbapp.make_app(root)
# json
with app.test_client() as c:
r = c.get('/nonexist', query_string={'a': 'list', 'f': 'json'})
self.assertEqual(r.status_code, 404)
self.assertEqual(r.headers['Content-Type'], 'application/json')
self.assertEqual(r.json, {
'error': {
'status': 404,
'message': 'Directory does not exist.'
}
})
# other
with app.test_client() as c:
r = c.get('/nonexist')
self.assertEqual(r.status_code, 404)
html = r.data.decode('UTF-8')
self.assertIn('<h1>Not Found</h1>', html)
class TestWebHost(unittest.TestCase):
def setUp(self):
self.test_dir = os.path.join(root_dir, 'test_app_helpers', 'general')
self.token_dir = os.path.join(root_dir, 'test_app_helpers', 'general', WSB_DIR, 'server', 'tokens')
os.makedirs(self.token_dir, exist_ok=True)
def tearDown(self):
try:
shutil.rmtree(self.token_dir)
except NotADirectoryError:
os.remove(self.token_dir)
except FileNotFoundError:
pass
@mock.patch('webscrapbook.app.WebHost.token_check_delete_expire')
@mock.patch('webscrapbook.app.WebHost.TOKEN_DEFAULT_EXPIRY', 10)
def test_token_acquire1(self, mock_check):
now = time.time()
expected_expire_time = int(now) + 10
handler = wsbapp.WebHost(self.test_dir)
token = handler.token_acquire()
token_file = os.path.join(self.token_dir, token)
self.assertTrue(os.path.isfile(token_file))
with open(token_file, 'r', encoding='UTF-8') as f:
self.assertAlmostEqual(int(f.read()), expected_expire_time, delta=1)
self.assertAlmostEqual(mock_check.call_args[0][0], now, delta=1)
@mock.patch('webscrapbook.app.WebHost.token_check_delete_expire')
@mock.patch('webscrapbook.app.WebHost.TOKEN_DEFAULT_EXPIRY', 30)
def test_token_acquire2(self, mock_check):
now = 30000
expected_expire_time = int(now) + 30
handler = wsbapp.WebHost(self.test_dir)
token = handler.token_acquire(now)
token_file = os.path.join(self.token_dir, token)
self.assertTrue(os.path.isfile(token_file))
with open(token_file, 'r', encoding='UTF-8') as f:
self.assertEqual(int(f.read()), expected_expire_time)
self.assertEqual(mock_check.call_args[0][0], now)
def test_token_validate1(self):
token = 'sampleToken'
token_time = int(time.time()) + 3
token_file = os.path.join(self.token_dir, token)
with open(token_file, 'w', encoding='UTF-8') as f:
f.write(str(token_time))
handler = wsbapp.WebHost(self.test_dir)
self.assertTrue(handler.token_validate(token))
def test_token_validate2(self):
token = 'sampleToken'
token_time = int(time.time()) - 3
token_file = os.path.join(self.token_dir, token)
with open(token_file, 'w', encoding='UTF-8') as f:
f.write(str(token_time))
handler = wsbapp.WebHost(self.test_dir)
self.assertFalse(handler.token_validate(token))
def test_token_validate3(self):
token = 'sampleToken'
now = 30000
token_time = 30001
token_file = os.path.join(self.token_dir, token)
with open(token_file, 'w', encoding='UTF-8') as f:
f.write(str(token_time))
handler = wsbapp.WebHost(self.test_dir)
self.assertTrue(handler.token_validate(token, now))
def test_token_validate4(self):
token = 'sampleToken'
now = 30000
token_time = 29999
token_file = os.path.join(self.token_dir, token)
with open(token_file, 'w', encoding='UTF-8') as f:
f.write(str(token_time))
handler = wsbapp.WebHost(self.test_dir)
self.assertFalse(handler.token_validate(token, now))
def test_token_delete(self):
token = 'sampleToken'
token_file = os.path.join(self.token_dir, token)
with open(token_file, 'w', encoding='UTF-8') as f:
f.write(str(32768))
handler = wsbapp.WebHost(self.test_dir)
handler.token_delete(token)
self.assertFalse(os.path.exists(token_file))
def test_token_delete_expire1(self):
now = int(time.time())
with open(os.path.join(self.token_dir, 'sampleToken1'), 'w', encoding='UTF-8') as f:
f.write(str(now - 100))
with open(os.path.join(self.token_dir, 'sampleToken2'), 'w', encoding='UTF-8') as f:
f.write(str(now - 10))
with open(os.path.join(self.token_dir, 'sampleToken3'), 'w', encoding='UTF-8') as f:
f.write(str(now + 10))
with open(os.path.join(self.token_dir, 'sampleToken4'), 'w', encoding='UTF-8') as f:
f.write(str(now + 100))
handler = wsbapp.WebHost(self.test_dir)
handler.token_delete_expire()
self.assertFalse(os.path.exists(os.path.join(self.token_dir, 'sampleToken1')))
self.assertFalse(os.path.exists(os.path.join(self.token_dir, 'sampleToken2')))
self.assertTrue(os.path.exists(os.path.join(self.token_dir, 'sampleToken3')))
self.assertTrue(os.path.exists(os.path.join(self.token_dir, 'sampleToken4')))
def test_token_delete_expire2(self):
now = 30000
with open(os.path.join(self.token_dir, 'sampleToken1'), 'w', encoding='UTF-8') as f:
f.write(str(29000))
with open(os.path.join(self.token_dir, 'sampleToken2'), 'w', encoding='UTF-8') as f:
f.write(str(29100))
with open(os.path.join(self.token_dir, 'sampleToken3'), 'w', encoding='UTF-8') as f:
f.write(str(30100))
with open(os.path.join(self.token_dir, 'sampleToken4'), 'w', encoding='UTF-8') as f:
f.write(str(30500))
handler = wsbapp.WebHost(self.test_dir)
handler.token_delete_expire(now)
self.assertFalse(os.path.exists(os.path.join(self.token_dir, 'sampleToken1')))
self.assertFalse(os.path.exists(os.path.join(self.token_dir, 'sampleToken2')))
self.assertTrue(os.path.exists(os.path.join(self.token_dir, 'sampleToken3')))
self.assertTrue(os.path.exists(os.path.join(self.token_dir, 'sampleToken4')))
@mock.patch('webscrapbook.app.WebHost.token_delete_expire')
def test_token_check_delete_expire1(self, mock_delete):
now = int(time.time())
handler = wsbapp.WebHost(self.test_dir)
self.assertEqual(handler.token_last_purge, 0)
handler.token_check_delete_expire()
self.assertAlmostEqual(mock_delete.call_args[0][0], now, delta=1)
self.assertAlmostEqual(handler.token_last_purge, now, delta=1)
@mock.patch('webscrapbook.app.WebHost.token_delete_expire')
@mock.patch('webscrapbook.app.WebHost.TOKEN_PURGE_INTERVAL', 1000)
def test_token_check_delete_expire2(self, mock_delete):
now = int(time.time())
handler = wsbapp.WebHost(self.test_dir)
handler.token_last_purge = now - 1100
handler.token_check_delete_expire()
self.assertAlmostEqual(mock_delete.call_args[0][0], now, delta=1)
self.assertAlmostEqual(handler.token_last_purge, now, delta=1)
@mock.patch('webscrapbook.app.WebHost.token_delete_expire')
@mock.patch('webscrapbook.app.WebHost.TOKEN_PURGE_INTERVAL', 1000)
def test_token_check_delete_expire3(self, mock_delete):
now = int(time.time())
handler = wsbapp.WebHost(self.test_dir)
handler.token_last_purge = now - 900
handler.token_check_delete_expire()
mock_delete.assert_not_called()
self.assertEqual(handler.token_last_purge, now - 900)
@mock.patch('webscrapbook.app.WebHost.token_delete_expire')
@mock.patch('webscrapbook.app.WebHost.TOKEN_PURGE_INTERVAL', 1000)
def test_token_check_delete_expire4(self, mock_delete):
now = 40000
handler = wsbapp.WebHost(self.test_dir)
handler.token_last_purge = now - 1100
handler.token_check_delete_expire(now)
self.assertAlmostEqual(mock_delete.call_args[0][0], now, delta=1)
self.assertAlmostEqual(handler.token_last_purge, now, delta=1)
@mock.patch('webscrapbook.app.WebHost.token_delete_expire')
@mock.patch('webscrapbook.app.WebHost.TOKEN_PURGE_INTERVAL', 1000)
def test_token_check_delete_expire5(self, mock_delete):
now = 40000
handler = wsbapp.WebHost(self.test_dir)
handler.token_last_purge = now - 900
handler.token_check_delete_expire(now)
mock_delete.assert_not_called()
self.assertEqual(handler.token_last_purge, now - 900)
if __name__ == '__main__':
unittest.main()
| 42.408503
| 171
| 0.534411
| 4,872
| 45,886
| 4.905378
| 0.066708
| 0.040169
| 0.039751
| 0.042178
| 0.867568
| 0.854387
| 0.843717
| 0.824511
| 0.805306
| 0.792
| 0
| 0.025002
| 0.333174
| 45,886
| 1,081
| 172
| 42.447734
| 0.756062
| 0.039184
| 0
| 0.758539
| 0
| 0
| 0.145727
| 0.043909
| 0
| 0
| 0
| 0
| 0.151943
| 1
| 0.040047
| false
| 0.100118
| 0.014134
| 0
| 0.058893
| 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
|
51fc64053880e8508ac06b6453dea98f4e8a3ecc
| 607
|
py
|
Python
|
nighres/registration/__init__.py
|
ahleighton/nighres
|
bc01463241a03a88569b3ba56e195127788b5639
|
[
"Apache-2.0"
] | 41
|
2017-08-15T12:23:31.000Z
|
2022-02-28T15:12:22.000Z
|
nighres/registration/__init__.py
|
ahleighton/nighres
|
bc01463241a03a88569b3ba56e195127788b5639
|
[
"Apache-2.0"
] | 130
|
2017-07-27T11:09:09.000Z
|
2022-03-31T10:05:07.000Z
|
nighres/registration/__init__.py
|
ahleighton/nighres
|
bc01463241a03a88569b3ba56e195127788b5639
|
[
"Apache-2.0"
] | 35
|
2017-08-17T17:05:41.000Z
|
2022-03-28T12:22:14.000Z
|
from nighres.registration.apply_coordinate_mappings import apply_coordinate_mappings
from nighres.registration.apply_coordinate_mappings import apply_coordinate_mappings_2d
from nighres.registration.embedded_antsreg import embedded_antsreg
from nighres.registration.embedded_antsreg import embedded_antsreg_2d
from nighres.registration.embedded_antsreg import embedded_antsreg_multi
from nighres.registration.embedded_antsreg import embedded_antsreg_2d_multi
from nighres.registration.generate_coordinate_mapping import generate_coordinate_mapping
from nighres.registration.simple_align import simple_align
| 67.444444
| 88
| 0.920923
| 75
| 607
| 7.093333
| 0.2
| 0.165414
| 0.345865
| 0.233083
| 0.736842
| 0.736842
| 0.736842
| 0.736842
| 0.736842
| 0.281955
| 0
| 0.005217
| 0.052718
| 607
| 8
| 89
| 75.875
| 0.92
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 9
|
cfc44946654a85d9887f4559dc81f7558dfc486a
| 1,405
|
py
|
Python
|
test/MessageFormatterTests.py
|
Monofraps/Mocca
|
0f4a1f5690fad457aaf4ea26d3d0271b34c6e187
|
[
"MIT"
] | null | null | null |
test/MessageFormatterTests.py
|
Monofraps/Mocca
|
0f4a1f5690fad457aaf4ea26d3d0271b34c6e187
|
[
"MIT"
] | 4
|
2015-01-09T18:02:51.000Z
|
2015-01-10T01:06:58.000Z
|
test/MessageFormatterTests.py
|
Monofraps/Mocca
|
0f4a1f5690fad457aaf4ea26d3d0271b34c6e187
|
[
"MIT"
] | null | null | null |
import unittest
import lib.MessageFormatter as MessageFormatter
class MoccaMessageFormatterTests(unittest.TestCase):
def test_can_set_verbosity_level(self):
MessageFormatter.set_verbosity(MessageFormatter.V_INFO)
self.assertEqual(MessageFormatter.verbosity, MessageFormatter.V_INFO)
MessageFormatter.set_verbosity(MessageFormatter.V_ERROR)
self.assertEqual(MessageFormatter.verbosity, MessageFormatter.V_ERROR)
def test_should_log_method(self):
MessageFormatter.set_verbosity(MessageFormatter.V_ERROR)
self.assertTrue(MessageFormatter._should_log(MessageFormatter.V_ERROR))
self.assertFalse(MessageFormatter._should_log(MessageFormatter.V_INFO))
self.assertFalse(MessageFormatter._should_log(MessageFormatter.V_DEBUG))
MessageFormatter.set_verbosity(MessageFormatter.V_INFO)
self.assertTrue(MessageFormatter._should_log(MessageFormatter.V_ERROR))
self.assertTrue(MessageFormatter._should_log(MessageFormatter.V_INFO))
self.assertFalse(MessageFormatter._should_log(MessageFormatter.V_DEBUG))
MessageFormatter.set_verbosity(MessageFormatter.V_DEBUG)
self.assertTrue(MessageFormatter._should_log(MessageFormatter.V_ERROR))
self.assertTrue(MessageFormatter._should_log(MessageFormatter.V_INFO))
self.assertTrue(MessageFormatter._should_log(MessageFormatter.V_DEBUG))
| 50.178571
| 80
| 0.802135
| 140
| 1,405
| 7.721429
| 0.178571
| 0.251619
| 0.208141
| 0.341351
| 0.845513
| 0.845513
| 0.73543
| 0.60037
| 0.60037
| 0.592044
| 0
| 0
| 0.12242
| 1,405
| 27
| 81
| 52.037037
| 0.876723
| 0
| 0
| 0.52381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.52381
| 1
| 0.095238
| false
| 0
| 0.095238
| 0
| 0.238095
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
cfe42daeeded78bfa937ea444128eaec538b953b
| 102
|
py
|
Python
|
app/auth/__init__.py
|
MelvinOmega/watchlist
|
519bc636f5c6d8224a4191cf94e91b458d81ea55
|
[
"MIT"
] | null | null | null |
app/auth/__init__.py
|
MelvinOmega/watchlist
|
519bc636f5c6d8224a4191cf94e91b458d81ea55
|
[
"MIT"
] | null | null | null |
app/auth/__init__.py
|
MelvinOmega/watchlist
|
519bc636f5c6d8224a4191cf94e91b458d81ea55
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
from . import views
from flask import Blueprint
from . import views,forms
| 20.4
| 27
| 0.813725
| 15
| 102
| 5.533333
| 0.4
| 0.216867
| 0.361446
| 0.578313
| 0.939759
| 0.939759
| 0.939759
| 0
| 0
| 0
| 0
| 0
| 0.156863
| 102
| 5
| 28
| 20.4
| 0.965116
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.5
| 1
| 0
| 0
| null | 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
|
0
| 12
|
cff015849c2a503547e8aa1703cb2892c1eabd81
| 119
|
py
|
Python
|
Server/django-utils-master/djutils/dashboard/__init__.py
|
TheInventorMan/IntelligentTrafficManagement
|
d72c0e3aede9e3cc258d9b30017ddfac5489541a
|
[
"Intel",
"Unlicense"
] | 3
|
2016-01-10T16:00:10.000Z
|
2018-03-13T09:21:33.000Z
|
Server/django-utils-master/djutils/dashboard/__init__.py
|
TheInventorMan/IntelligentTrafficManagement
|
d72c0e3aede9e3cc258d9b30017ddfac5489541a
|
[
"Intel",
"Unlicense"
] | 10
|
2019-12-26T17:31:31.000Z
|
2022-03-21T22:17:33.000Z
|
Server/django-utils-master/djutils/dashboard/__init__.py
|
TheInventorMan/IntelligentTrafficManagement
|
d72c0e3aede9e3cc258d9b30017ddfac5489541a
|
[
"Intel",
"Unlicense"
] | null | null | null |
from djutils.utils.helpers import generic_autodiscover
def autodiscover():
return generic_autodiscover('panels')
| 19.833333
| 54
| 0.806723
| 13
| 119
| 7.230769
| 0.769231
| 0.404255
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 119
| 5
| 55
| 23.8
| 0.895238
| 0
| 0
| 0
| 0
| 0
| 0.05042
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 8
|
320a73fccbb06cef88c60250fc9687e6ddebe23f
| 8,460
|
py
|
Python
|
tests/test_data.py
|
giangbui/fence
|
5a28b77c30ce7fb11fd05b09a023d0aec1e57e16
|
[
"Apache-2.0"
] | null | null | null |
tests/test_data.py
|
giangbui/fence
|
5a28b77c30ce7fb11fd05b09a023d0aec1e57e16
|
[
"Apache-2.0"
] | null | null | null |
tests/test_data.py
|
giangbui/fence
|
5a28b77c30ce7fb11fd05b09a023d0aec1e57e16
|
[
"Apache-2.0"
] | null | null | null |
from . import utils
import jwt
import urlparse
import pytest
from fence.errors import NotSupported
@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl", "s3_external"], indirect=True
)
def test_indexd_download_file(
client,
oauth_client,
user_client,
indexd_client,
kid,
rsa_private_key,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/download/1``.
"""
indexed_file_location = indexd_client["indexed_file_location"]
path = "/data/download/1"
query_string = {"protocol": indexed_file_location}
headers = {
"Authorization": "Bearer "
+ jwt.encode(
utils.authorized_download_context_claims(
user_client.username, user_client.user_id
),
key=rsa_private_key,
headers={"kid": kid},
algorithm="RS256",
)
}
response = client.get(path, headers=headers, query_string=query_string)
print(response.json)
assert response.status_code == 200
assert "url" in response.json.keys()
@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl", "s3_external"], indirect=True
)
def test_indexd_upload_file(
client,
oauth_client,
user_client,
indexd_client,
kid,
rsa_private_key,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/download/1``.
"""
indexed_file_location = indexd_client["indexed_file_location"]
path = "/data/upload/1?protocol=" + indexed_file_location
headers = {
"Authorization": "Bearer "
+ jwt.encode(
utils.authorized_upload_context_claims(
user_client.username, user_client.user_id
),
key=rsa_private_key,
headers={"kid": kid},
algorithm="RS256",
)
}
response = client.get(path, headers=headers)
assert response.status_code == 200
assert "url" in response.json.keys()
@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl", "s3_external"], indirect=True
)
def test_indexd_download_file_no_protocol(
client,
oauth_client,
user_client,
indexd_client,
kid,
rsa_private_key,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/download/1``.
"""
path = "/data/download/1"
headers = {
"Authorization": "Bearer "
+ jwt.encode(
utils.authorized_download_context_claims(
user_client.username, user_client.user_id
),
key=rsa_private_key,
headers={"kid": kid},
algorithm="RS256",
)
}
response = client.get(path, headers=headers)
assert response.status_code == 200
assert "url" in response.json.keys()
def test_indexd_download_file_no_jwt(client, auth_client):
"""
Test ``GET /data/download/1``.
"""
path = "/data/download/1"
response = client.get(path)
assert response.status_code == 401
# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl"], indirect=True
)
def test_indexd_unauthorized_download_file(
client,
oauth_client,
unauthorized_user_client,
indexd_client,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/download/1``.
"""
path = "/data/download/1"
response = client.get(path)
assert response.status_code == 401
# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl"], indirect=True
)
def test_unauthorized_indexd_download_file(
client,
oauth_client,
user_client,
indexd_client,
kid,
rsa_private_key,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/download/1``.
"""
path = "/data/download/1"
headers = {
"Authorization": "Bearer "
+ jwt.encode(
utils.unauthorized_context_claims(
user_client.username, user_client.user_id
),
key=rsa_private_key,
headers={"kid": kid},
algorithm="RS256",
)
}
response = client.get(path, headers=headers)
assert response.status_code == 401
# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl"], indirect=True
)
def test_unauthorized_indexd_upload_file(
client,
oauth_client,
encoded_jwt,
user_client,
indexd_client,
kid,
rsa_private_key,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/upload/1``.
"""
path = "/data/upload/1"
headers = {
"Authorization": "Bearer "
+ jwt.encode(
utils.unauthorized_context_claims(
user_client.username, user_client.user_id
),
key=rsa_private_key,
headers={"kid": kid},
algorithm="RS256",
)
}
response = client.get(path, headers=headers)
assert response.status_code == 401
# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
@pytest.mark.parametrize(
"unauthorized_indexd_client", ["gs", "s3", "gs_acl", "s3_acl"], indirect=True
)
def test_unavailable_indexd_upload_file(
client,
oauth_client,
encoded_jwt,
user_client,
unauthorized_indexd_client,
kid,
rsa_private_key,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/upload/1``.
"""
path = "/data/upload/1"
headers = {
"Authorization": "Bearer "
+ jwt.encode(
utils.unauthorized_context_claims(
user_client.username, user_client.user_id
),
key=rsa_private_key,
headers={"kid": kid},
algorithm="RS256",
)
}
response = client.get(path, headers=headers)
assert response.status_code == 401
# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
@pytest.mark.parametrize(
"public_indexd_client", ["gs", "s3", "gs_acl", "s3_acl"], indirect=True
)
def test_public_object_download_file(
client,
auth_client,
public_indexd_client,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/upload/1``.
"""
path = "/data/download/1"
response = client.get(path)
print(response.json)
assert response.status_code == 200
assert "url" in response.json.keys()
@pytest.mark.parametrize(
"public_bucket_indexd_client", ["gs", "s3", "gs_acl", "s3_acl"], indirect=True
)
def test_public_bucket_download_file(
client,
auth_client,
public_bucket_indexd_client,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/upload/1`` with public bucket
"""
path = "/data/download/1"
response = client.get(path)
print(response.json)
assert response.status_code == 200
url = response.json["url"]
# public url without signature
assert urlparse.urlparse(url).query == ""
@pytest.mark.parametrize("public_bucket_indexd_client", ["s2"], indirect=True)
def test_public_bucket_unsupported_protocol_file(
client,
auth_client,
public_bucket_indexd_client,
google_proxy_group,
primary_google_service_account,
cloud_manager,
google_signed_url,
):
"""
Test ``GET /data/upload/1`` with public bucket
"""
path = "/data/download/1"
response = client.get(path)
assert response.status_code == 400
# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
| 25.103858
| 83
| 0.636643
| 974
| 8,460
| 5.243326
| 0.094456
| 0.051694
| 0.035637
| 0.045232
| 0.930488
| 0.923634
| 0.901312
| 0.890151
| 0.890151
| 0.890151
| 0
| 0.014958
| 0.249291
| 8,460
| 336
| 84
| 25.178571
| 0.789167
| 0.085816
| 0
| 0.808271
| 0
| 0
| 0.101825
| 0.019307
| 0
| 0
| 0
| 0
| 0.06015
| 1
| 0.041353
| false
| 0
| 0.018797
| 0
| 0.06015
| 0.011278
| 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
|
5c56c51e1b681c0671d00c99943bd139ed69b63e
| 1,300
|
py
|
Python
|
data-structures/linkend-list/test_linked_list.py
|
jamesbond007dj/py-data-structures-and-algorithms
|
ce66faa99f7c7e9c0f9d248a56d78c9ebf069e25
|
[
"MIT"
] | null | null | null |
data-structures/linkend-list/test_linked_list.py
|
jamesbond007dj/py-data-structures-and-algorithms
|
ce66faa99f7c7e9c0f9d248a56d78c9ebf069e25
|
[
"MIT"
] | 1
|
2020-01-21T17:00:14.000Z
|
2020-01-21T17:00:14.000Z
|
data-structures/linkend-list/test_linked_list.py
|
jamesbond007dj/py-data-structures-and-algorithms
|
ce66faa99f7c7e9c0f9d248a56d78c9ebf069e25
|
[
"MIT"
] | null | null | null |
from linked_list import LinkedList
# def test_insert():
# ll = LinkedList()
# ll.insert(2)
# expected = '2'
# actual = ll.to_string()
# assert actual == expected
# def test_include_empty():
# ll = LinkedList()
# expected = False
# actual = ll.includes(1)
# assert actual == expected
# def test_include_true():
# ll = LinkedList()
# ll.insert(1)
# expected = True
# actual = ll.includes(1)
# assert actual == expected
# def test_include_false():
# ll = LinkedList()
# ll.insert(1)
# expected = False
# actual = ll.includes(2)
# assert actual == expected
# def test_include_three_true():
# ll = LinkedList()
# ll.insert(1)
# ll.insert(2)
# ll.insert(3)
# expected = True
# actual = ll.includes(2)
# assert actual == expected
# def test_to_string():
# ll = LinkedList()
# ll.insert(1)
# expected = '1'
# actual = ll.to_string()
# assert actual == expected
# def test_to_string_empty():
# ll = LinkedList()
# expected = ''
# actual = ll.to_string()
# assert actual == expected
# def test_to_string_two():
# ll = LinkedList()
# ll.insert(1)
# ll.insert(2)
# expected = '2 1'
# actual = ll.to_string()
# assert actual == expected
| 22.413793
| 34
| 0.579231
| 154
| 1,300
| 4.74026
| 0.155844
| 0.09863
| 0.219178
| 0.220548
| 0.836986
| 0.753425
| 0.60411
| 0.593151
| 0.458904
| 0.279452
| 0
| 0.018066
| 0.276154
| 1,300
| 58
| 35
| 22.413793
| 0.757705
| 0.891538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
5c6e0c1e7299c6bc9de553f87e34bf90ec500fd1
| 804
|
py
|
Python
|
onion/request.py
|
ksk001100/onion
|
318429ba6a14da996d02d7c96cbbed18a51f5adc
|
[
"MIT"
] | null | null | null |
onion/request.py
|
ksk001100/onion
|
318429ba6a14da996d02d7c96cbbed18a51f5adc
|
[
"MIT"
] | null | null | null |
onion/request.py
|
ksk001100/onion
|
318429ba6a14da996d02d7c96cbbed18a51f5adc
|
[
"MIT"
] | null | null | null |
import requests
from requests.models import Response
from onion.onion import Onion
def get(url: str, headers=None, params=None) -> Response:
onion = Onion()
res = requests.get(url, headers=headers, params=params, proxies=onion.proxies)
return res
def post(url: str, headers=None, params=None) -> Response:
onion = Onion()
res = requests.post(url, headers=headers, params=params, proxies=onion.proxies)
return res
def put(url: str, headers=None, params=None) -> Response:
onion = Onion()
res = requests.put(url, headers=headers, params=params, proxies=onion.proxies)
return res
def delete(url: str, headers=None, params=None) -> Response:
onion = Onion()
res = requests.delete(url, headers=headers, params=params, proxies=onion.proxies)
return res
| 28.714286
| 85
| 0.705224
| 108
| 804
| 5.25
| 0.175926
| 0.088183
| 0.091711
| 0.119929
| 0.813051
| 0.813051
| 0.813051
| 0.813051
| 0.813051
| 0.813051
| 0
| 0
| 0.172886
| 804
| 27
| 86
| 29.777778
| 0.852632
| 0
| 0
| 0.421053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.210526
| false
| 0
| 0.157895
| 0
| 0.578947
| 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
|
8ff4f9ba18caefbc03796cb9a3471dae34bc998a
| 44
|
py
|
Python
|
siapp/blueprints/page/__init__.py
|
saidulislam/siapp-python-crud-template
|
4ee8ae8855f703eee36031244341a88f5c8dd2e2
|
[
"Apache-2.0"
] | null | null | null |
siapp/blueprints/page/__init__.py
|
saidulislam/siapp-python-crud-template
|
4ee8ae8855f703eee36031244341a88f5c8dd2e2
|
[
"Apache-2.0"
] | null | null | null |
siapp/blueprints/page/__init__.py
|
saidulislam/siapp-python-crud-template
|
4ee8ae8855f703eee36031244341a88f5c8dd2e2
|
[
"Apache-2.0"
] | null | null | null |
from siapp.blueprints.page.views import page
| 44
| 44
| 0.863636
| 7
| 44
| 5.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 44
| 1
| 44
| 44
| 0.926829
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
|
0
| 7
|
890b4d6d2150a06ff443196364baa005956ddba7
| 75
|
py
|
Python
|
src/tftools/__init__.py
|
tygerlord/tftools
|
76d636432115cfeae65a454e93500401fad58199
|
[
"MIT"
] | null | null | null |
src/tftools/__init__.py
|
tygerlord/tftools
|
76d636432115cfeae65a454e93500401fad58199
|
[
"MIT"
] | null | null | null |
src/tftools/__init__.py
|
tygerlord/tftools
|
76d636432115cfeae65a454e93500401fad58199
|
[
"MIT"
] | null | null | null |
from .tftools1 import Model
from .tftools1 import VideoImageDataGenerator
| 18.75
| 45
| 0.853333
| 8
| 75
| 8
| 0.625
| 0.375
| 0.5625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030303
| 0.12
| 75
| 3
| 46
| 25
| 0.939394
| 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
|
8f24dd7e6943730fc52d7cb2f5a62771232dd52f
| 1,561
|
py
|
Python
|
uwupy/security.py
|
justnat3/uwupy
|
6f724bdcb16202d353d89f09ce6f2293e6db08f5
|
[
"MIT"
] | null | null | null |
uwupy/security.py
|
justnat3/uwupy
|
6f724bdcb16202d353d89f09ce6f2293e6db08f5
|
[
"MIT"
] | 2
|
2020-10-04T13:36:52.000Z
|
2020-10-04T13:37:31.000Z
|
uwupy/security.py
|
justnat3/uwupy
|
6f724bdcb16202d353d89f09ce6f2293e6db08f5
|
[
"MIT"
] | null | null | null |
class Fail_AuthUwU(Exception):
"""Thrown when when authentication fails
Attrs: objName
"""
def __init__(self, objName, message='sowwy {self.objName} has failed auwthenication..'):
self.objName = objName
self.message = message
super().__init__(message)
def __str__(self):
return f'{self.objName} -> {self.message}'
class UwUNoAccess(Exception):
"""Thrown when when authentication fails
Attrs: objName
"""
def __init__(self, objName, message='sowwy {self.objName} Can not hit me here..'):
self.objName = objName
self.message = message
super().__init__(message)
def __str__(self):
return f'{self.objName} -> {self.message}'
class UwUMemberAccessException(Exception):
"""Thrown when when authentication fails
Attrs: objName
"""
def __init__(self, objName, message='sowwy {self.objName} does not have access to this..'):
self.objName = objName
self.message = message
super().__init__(message)
def __str__(self):
return f'{self.objName} -> {self.message}'
class UwUPolicies(Exception):
"""Thrown when when authentication fails
Attrs: objName
"""
def __init__(self, objName, message='sowwy {self.objName} our powicies do not permit this..'):
self.objName = objName
self.message = message
super().__init__(message)
def __str__(self):
return f'{self.objName} -> {self.message}'
| 28.381818
| 99
| 0.613069
| 165
| 1,561
| 5.50303
| 0.236364
| 0.193833
| 0.15859
| 0.101322
| 0.844714
| 0.844714
| 0.844714
| 0.844714
| 0.844714
| 0.844714
| 0
| 0
| 0.271621
| 1,561
| 54
| 100
| 28.907407
| 0.798593
| 0.13517
| 0
| 0.714286
| 0
| 0
| 0.264105
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0.142857
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 10
|
8f40234120f2ae00dc8a3164f9a735844b389119
| 100
|
py
|
Python
|
pytorch_agents/ppo/__init__.py
|
AiForAlpha/pytorch_agents
|
0151b16f0a8cf7131cede83c369cbc728435b3c2
|
[
"MIT"
] | null | null | null |
pytorch_agents/ppo/__init__.py
|
AiForAlpha/pytorch_agents
|
0151b16f0a8cf7131cede83c369cbc728435b3c2
|
[
"MIT"
] | null | null | null |
pytorch_agents/ppo/__init__.py
|
AiForAlpha/pytorch_agents
|
0151b16f0a8cf7131cede83c369cbc728435b3c2
|
[
"MIT"
] | null | null | null |
from pytorch_agents.ppo.policies import CnnPolicy, MlpPolicy
from pytorch_agents.ppo.ppo import PPO
| 33.333333
| 60
| 0.86
| 15
| 100
| 5.6
| 0.533333
| 0.261905
| 0.404762
| 0.47619
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09
| 100
| 2
| 61
| 50
| 0.923077
| 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
|
8f6d42fd4f47f146dcad433adec9fcfad6bc6a23
| 5,525
|
py
|
Python
|
fast_mri_view.py
|
shahryarkhorasani/brats_tumor_segmentation_vnet
|
85e6a2c745bc09839aef2815c95c5dedab39aacf
|
[
"MIT"
] | null | null | null |
fast_mri_view.py
|
shahryarkhorasani/brats_tumor_segmentation_vnet
|
85e6a2c745bc09839aef2815c95c5dedab39aacf
|
[
"MIT"
] | null | null | null |
fast_mri_view.py
|
shahryarkhorasani/brats_tumor_segmentation_vnet
|
85e6a2c745bc09839aef2815c95c5dedab39aacf
|
[
"MIT"
] | null | null | null |
import os
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
def show_slices(scan, x=None, y=None, z=None, size=30): #scan: directory to a nifti file
""" Function to display the middle slice in each axis of a scan """
fig, axes = plt.subplots(1, 3, figsize=(size,size))
if type(scan) == str:
scan = nib.load(scan)
scan = scan.get_fdata()
elif type(scan) == np.array:
scan = scan
if len(scan.shape) == 3:
if x:
slice_x = scan[x,:,:]
else:
slice_x = scan[int(scan.shape[0]/2),:,:]
if y:
slice_y = scan[:,y,:]
else:
slice_y = scan[:,int(scan.shape[1]/2),:]
if z:
slice_z = scan[:,:,z]
else:
slice_z = scan[:,:,int(scan.shape[2]/2)]
slices = [slice_x, slice_y, slice_z]
for i, slice in enumerate(slices):
axes[i].imshow(slice.T, origin="lower")
elif len(scan.shape) == 4:
if x:
slice_x = scan[x,:,:, 0]
else:
slice_x = scan[int(scan.shape[0]/2),:,:, 0]
if y:
slice_y = scan[:,y,:, 0]
else:
slice_y = scan[:,int(scan.shape[1]/2),:, 0]
if z:
slice_z = scan[:,:,z, 0]
else:
slice_z = scan[:,:,int(scan.shape[2]/2), 0]
slices = [slice_x, slice_y, slice_z]
for i, slice in enumerate(slices):
axes[i].imshow(slice.T, origin="lower")
def show_scan(scan, x=None, y=None, z=None, size=30, save_to=None): #scan: directory to a nifti file
""" Function to display the middle slice in each axis of a scan """
fig, axes = plt.subplots(1, 3, figsize=(size,size),sharey=True)
if type(scan) == str:
scan = nib.load(scan)
scan = scan.get_fdata()
elif type(scan) == np.array:
scan = scan
if x:
slice_x = scan[x,:,:].T
else:
slice_x = scan[int(scan.shape[0]/2),:,:]
if y:
slice_y = scan[:,y,:]
else:
slice_y = scan[:,int(scan.shape[1]/2),:]
if z:
slice_z = scan[:,:,z]
else:
slice_z = scan[:,:,int(scan.shape[2]/2)]
slices = [slice_x, slice_y, slice_z]
for i, slice in enumerate(slices):
axes[i].imshow(slice.T, origin="lower")
axes[i].axis('off')
plt.tight_layout(pad=0)
plt.subplots_adjust(wspace=0.0,hspace=0.0)
if save_to:
plt.savefig(fname=save_to, quality =90)
def show_mask(scan, mask, mask_valu=None, x=None, y=None, z=None, size=30, alpha=.2):
""" Function to display a scan and its mask - optional: specific mask_value and/or slices"""
fig, axes = plt.subplots(1, 3, figsize=(size,size))
#reading the file
if type(scan) == str:
scan = nib.load(scan)
scan = scan.get_fdata()
elif type(scan) == np.array:
scan = scan
if type(mask) == str:
mask = nib.load(mask)
mask = mask.get_fdata()
elif type(mask) == np.array:
mask = mask
###
#indexing the scan
if len(scan.shape) == 3:
if x:
slice_x = scan[x,:,:]
else:
slice_x = scan[int(scan.shape[0]/2),:,:]
if y:
slice_y = scan[:,y,:]
else:
slice_y = scan[:,int(scan.shape[1]/2),:]
if z:
slice_z = scan[:,:,z]
else:
slice_z = scan[:,:,int(scan.shape[2]/2)]
slices = [slice_x, slice_y, slice_z]
elif len(scan.shape) == 4:
if x:
slice_x = scan[x,:,:, 0]
else:
slice_x = scan[int(scan.shape[0]/2),:,:, 0]
if y:
slice_y = scan[:,y,:, 0]
else:
slice_y = scan[:,int(scan.shape[1]/2),:, 0]
if z:
slice_z = scan[:,:,z, 0]
else:
slice_z = scan[:,:,int(scan.shape[2]/2), 0]
slices = [slice_x, slice_y, slice_z]
###
#selecting specific label
if mask_valu:
mask = np.isin(mask, mask_valu)
mask = mask.astype(int)
###
#indexing the mask
if len(mask.shape) == 3:
if x:
slice_x = mask[x,:,:]
else:
slice_x = mask[int(mask.shape[0]/2),:,:]
if y:
slice_y = mask[:,y,:]
else:
slice_y = mask[:,int(mask.shape[1]/2),:]
if z:
slice_z = mask[:,:,z]
else:
slice_z = mask[:,:,int(mask.shape[2]/2)]
slices_mask = [slice_x, slice_y, slice_z]
for i, slice in enumerate(slices):
axes[i].imshow(slice.T, origin="lower", cmap='gray')
for i, slice in enumerate(slices_mask):
axes[i].imshow(slice.T, origin="lower", cmap='gnuplot', alpha=alpha)
elif len(mask.shape) == 4:
if x:
slice_x = mask[x,:,:, 0]
else:
slice_x = mask[int(mask.shape[0]/2),:,:, 0]
if y:
slice_y = mask[:,y,:, 0]
else:
slice_y = mask[:,int(mask.shape[1]/2),:, 0]
if z:
slice_z = mask[:,:,z, 0]
else:
slice_z = mask[:,:,int(mask.shape[2]/2), 0]
slices_mask = [slice_x, slice_y, slice_z]
for i, slice in enumerate(slices):
axes[i].imshow(slice.T, origin="lower", cmap='gray')
for i, slice in enumerate(slices_mask):
axes[i].imshow(slice.T, origin="lower", cmap='gnuplot', alpha=alpha)
| 33.083832
| 100
| 0.495747
| 789
| 5,525
| 3.366286
| 0.119138
| 0.04744
| 0.062123
| 0.090361
| 0.804593
| 0.803087
| 0.775979
| 0.769202
| 0.753765
| 0.658509
| 0
| 0.023626
| 0.341176
| 5,525
| 167
| 101
| 33.083832
| 0.706044
| 0.06371
| 0
| 0.758389
| 0
| 0
| 0.01168
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.020134
| false
| 0
| 0.026846
| 0
| 0.04698
| 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
|
56d316a3f9435615f648638a88909b0af5bacb74
| 18,823
|
py
|
Python
|
transphire_transform/dump_load/tests/test_util.py
|
MPI-Dortmund/transphire_transform
|
4ef249f3806c4aa33215637c9ff869ad91f86bef
|
[
"MIT"
] | 2
|
2018-08-06T20:07:51.000Z
|
2019-10-10T04:52:44.000Z
|
transphire_transform/dump_load/tests/test_util.py
|
MPI-Dortmund/transphire_transform
|
4ef249f3806c4aa33215637c9ff869ad91f86bef
|
[
"MIT"
] | 14
|
2018-08-07T10:02:01.000Z
|
2021-06-01T22:31:58.000Z
|
transphire_transform/dump_load/tests/test_util.py
|
MPI-Dortmund/transphire_transform
|
4ef249f3806c4aa33215637c9ff869ad91f86bef
|
[
"MIT"
] | null | null | null |
"""
MIT License
Copyright (c) 2018 Max Planck Institute of Molecular Physiology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import numpy as np
import pandas as pd
import pytest
from .. import util
OUTPUT_TEST_FOLDER = 'OUTPUT_TESTS_LOAD_DUMP_UTIL'
class TestCreateHeader:
def test_create_header_list(self):
"""
"""
header = ['a', 'b', 'c', 'd']
header_out = ['_a', '_b', '_c', '_d']
assert util.create_header(names=header, index=False, prefix='') == header_out
def test_create_header_index_list(self):
"""
"""
header = ['a', 'b', 'c', 'd']
header_out = ['_a #1', '_b #2', '_c #3', '_d #4']
assert util.create_header(names=header, index=True, prefix='') == header_out
def test_create_header_array(self):
"""
"""
header = np.array(['a', 'b', 'c', 'd'], dtype=str)
header_out = ['_a', '_b', '_c', '_d']
assert util.create_header(names=header, index=False, prefix='') == header_out
def test_create_header_index_array(self):
"""
"""
header = np.array(['a', 'b', 'c', 'd'], dtype=str)
header_out = ['_a #1', '_b #2', '_c #3', '_d #4']
assert util.create_header(names=header, index=True, prefix='') == header_out
def test_create_header_array_prefix(self):
"""
"""
header = np.array(['a', 'b', 'c', 'd'], dtype=str)
header_out = ['_testa', '_testb', '_testc', '_testd']
assert util.create_header(names=header, index=False, prefix='test') == header_out
def test_create_header_index_array_prefix(self):
"""
"""
header = np.array(['a', 'b', 'c', 'd'], dtype=str)
header_out = ['_testa #1', '_testb #2', '_testc #3', '_testd #4']
assert util.create_header(names=header, index=True, prefix='test') == header_out
def test_create_header_array_empty(self):
"""
"""
header = np.array([], dtype=str)
with pytest.raises(IOError):
util.create_header(names=header, index=True, prefix='')
def test_create_header_list_empty(self):
"""
"""
header = []
with pytest.raises(IOError):
util.create_header(names=header, index=True, prefix='')
class TestDumpFile:
def test_dump_file_empty(self, tmpdir):
"""
"""
data = pd.DataFrame({
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_empty')
with pytest.raises(IOError):
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=True,
)
def test_dump_file_four(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data_2 = ['a', 'b', 'c', 'd']
data_3 = np.array(np.arange(4), dtype=float)
data_4 = [1]*4
data = pd.DataFrame({
'_rlnTest1': data_1,
'_rlnTest2': data_2,
'_rlnTest3': data_3,
'_pipeTest4': data_4,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_four')
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=True,
)
load_data = util.load_file(file_name=output_file)
assert np.array_equal(load_data.values, data.values)
def test_dump_file_single(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data = pd.DataFrame({
'_rlnTest1': data_1,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_single')
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=True,
)
load_data = util.load_file(file_name=output_file)
assert np.array_equal(load_data.values, data.values)
def test_dump_file_four_hor(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data_2 = ['a', 'b', 'c', 'd']
data_3 = np.array(np.arange(4), dtype=float)
data_4 = [1]*4
data = pd.DataFrame({
'_rlnTest1': data_1,
'_rlnTest2': data_2,
'_rlnTest3': data_3,
'_pipeTest4': data_4,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_four_hor')
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=False,
)
load_data = util.load_file(file_name=output_file)
assert np.array_equal(load_data.values, data.values)
def test_dump_file_single_hor(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data = pd.DataFrame({
'_rlnTest1': data_1,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_single_hor')
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=False,
)
load_data = util.load_file(file_name=output_file)
assert np.array_equal(load_data.values, data.values)
def test_dump_file_four_header(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data_2 = ['a', 'b', 'c', 'd']
data_3 = np.array(np.arange(4), dtype=float)
data_4 = [1]*4
data = pd.DataFrame({
'_rlnTest1': data_1,
'_rlnTest2': data_2,
'_rlnTest3': data_3,
'_pipeTest4': data_4,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_four')
util.dump_file(
file_name=output_file,
data=data,
header=data.keys(),
vertical=True,
)
assert util.load_file(file_name=output_file, names=data.keys(), skiprows=4).equals(data)
def test_dump_file_single_header(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data = pd.DataFrame({
'_rlnTest1': data_1,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_single')
util.dump_file(
file_name=output_file,
data=data,
header=data.keys(),
vertical=True,
)
assert util.load_file(file_name=output_file, names=data.keys(), skiprows=1).equals(data)
def test_dump_file_four_hor_header(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data_2 = ['a', 'b', 'c', 'd']
data_3 = np.array(np.arange(4), dtype=float)
data_4 = [1]*4
data = pd.DataFrame({
'_rlnTest1': data_1,
'_rlnTest2': data_2,
'_rlnTest3': data_3,
'_pipeTest4': data_4,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_four_hor')
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=False,
)
util.dump_file(
file_name=output_file,
data=data,
header=data.keys(),
vertical=False,
)
assert util.load_file(file_name=output_file, names=data.keys(), skiprows=1).equals(data)
def test_dump_file_single_hor_header(self, tmpdir):
"""
"""
data_1 = np.arange(4)
data = pd.DataFrame({
'_rlnTest1': data_1,
})
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_dump_file_single_hor')
util.dump_file(
file_name=output_file,
data=data,
header=None,
vertical=False,
)
util.dump_file(
file_name=output_file,
data=data,
header=data.keys(),
vertical=False,
)
assert util.load_file(file_name=output_file, names=data.keys(), skiprows=1).equals(data)
class TestImportKeys:
def test_import_keys_filled_file_should_work(self, tmpdir):
"""
"""
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_import_keys_filled_file_should_work')
keys = ('test_a', 'test_b', 'test_c')
suffix = ('test', 'test2', 'test3')
with open(output_file, 'w') as w:
for key, suf in zip(keys, suffix):
w.write(f'{key} # {suf}\n')
imported_keys = util.import_keys(output_file)
assert keys == imported_keys
def test_import_keys_filled_file_multi_hastag_should_work(self, tmpdir):
"""
"""
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_import_keys_filled_file_multi_hastag_should_work')
keys = ('test_a', 'test_b', 'test_c')
suffix = ('test', 'test2', 'test3')
with open(output_file, 'w') as w:
for key, suf in zip(keys, suffix):
w.write(f'{key} # TEST1 # {suf}\n')
imported_keys = util.import_keys(output_file)
assert keys == imported_keys
def test_import_keys_empty_file_should_work(self, tmpdir):
"""
"""
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_import_keys_empty_file_should_work')
keys = ()
suffix = ()
with open(output_file, 'w') as w:
pass
imported_keys = util.import_keys(output_file)
assert keys == imported_keys
def test_import_keys_contains_whitespace_should_raise_AssertError(self, tmpdir):
"""
"""
output_file: str = tmpdir.mkdir(OUTPUT_TEST_FOLDER).join('test_import_keys_contains_whitespace_should_raise_AssertError')
keys = ()
suffix = ()
keys = ('test_a', 'test_b', 'test_c')
suffix = ('test', 'test2', 'test3')
with open(output_file, 'w') as w:
for key, suf in zip(keys, suffix):
w.write(f'{key} TEST1 # {suf}\n')
with pytest.raises(AssertionError):
util.import_keys(output_file)
class TestParseKeysToDict:
def test_input_unspecified_to_output(self):
data = ('test',)
data_output = {'test': 'test'}
data_return = util.parse_keys_to_dict(data)
assert data_output == data_return
def test_input_unspecified_export_to_output(self):
data = ('test',)
data_output = {'test': 'test'}
data_return = util.parse_keys_to_dict(data, True)
assert data_output == data_return
def test_input_specified_to_output(self):
data = ('test:test2',)
data_output = {'test': 'test2'}
data_return = util.parse_keys_to_dict(data)
assert data_output == data_return
def test_input_specified_export_to_output(self):
data = ('test:test2',)
data_output = {'test2': 'test'}
data_return = util.parse_keys_to_dict(data, True)
assert data_output == data_return
class TestAddToDict():
def test_new_key_should_return_filled_dict(self):
data_dict = {}
key = 'a'
value = 'b'
util.add_to_dict(data_dict, key, value)
assert data_dict == {'a': 'b'}
def test_new_key_int_should_return_filled_dict(self):
data_dict = {}
key = 'a'
value = 1
util.add_to_dict(data_dict, key, value)
assert data_dict == {'a': 1}
def test_double_key_should_attributeerror(self):
data_dict = {'a': 'c'}
key = 'a'
value = 'b'
with pytest.raises(AttributeError):
util.add_to_dict(data_dict, key, value)
class TestExtractFunctionFromFunctionDict:
def dummy_function_1(self): # pragma: no cover
pass
def dummy_function_2(self): # pragma: no cover
pass
def dummy_function_3(self): # pragma: no cover
pass
def test_empty_version_ordered_should_return_dummy_function_3(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_3 == util.extract_function_from_function_dict(func_dict)
def test_empty_version_unordered_should_return_dummy_function_3(self):
func_dict = {
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
'0.0.4': self.dummy_function_1,
}
assert self.dummy_function_3 == util.extract_function_from_function_dict(func_dict)
def test_version_225_ordered_should_return_dummy_function_3(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_3 == util.extract_function_from_function_dict(func_dict, '2.2.5')
def test_version_326_ordered_should_return_dummy_function_3(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_3 == util.extract_function_from_function_dict(func_dict, '3.2.6')
def test_version_112_ordered_should_return_dummy_function_2(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_2 == util.extract_function_from_function_dict(func_dict, '1.1.2')
def test_version_122_ordered_should_return_dummy_function_2(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_2 == util.extract_function_from_function_dict(func_dict, '1.2.2')
def test_version_004_ordered_should_return_dummy_function_1(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_1 == util.extract_function_from_function_dict(func_dict, '0.0.4')
def test_version_005_ordered_should_return_dummy_function_1(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'1.1.2': self.dummy_function_2,
'2.2.5': self.dummy_function_3,
}
assert self.dummy_function_1 == util.extract_function_from_function_dict(func_dict, '0.0.5')
def test_version_225_unordered_should_return_dummy_function_3(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
assert self.dummy_function_3 == util.extract_function_from_function_dict(func_dict, '2.2.5')
def test_version_326_unordered_should_return_dummy_function_3(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
assert self.dummy_function_3 == util.extract_function_from_function_dict(func_dict, '3.2.6')
def test_version_112_unordered_should_return_dummy_function_2(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
assert self.dummy_function_2 == util.extract_function_from_function_dict(func_dict, '1.1.2')
def test_version_122_unordered_should_return_dummy_function_2(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
assert self.dummy_function_2 == util.extract_function_from_function_dict(func_dict, '1.2.2')
def test_version_004_unordered_should_return_dummy_function_1(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
assert self.dummy_function_1 == util.extract_function_from_function_dict(func_dict, '0.0.4')
def test_version_005_unordered_should_return_dummy_function_1(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
assert self.dummy_function_1 == util.extract_function_from_function_dict(func_dict, '0.0.5')
def test_version_003_unordered_should_raise_AssertionError(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
with pytest.raises(AssertionError):
util.extract_function_from_function_dict(func_dict, '0.0.3')
def test_version_unequal_format_raises_AssertionError(self):
func_dict = {
'0.0.4': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
with pytest.raises(AssertionError):
util.extract_function_from_function_dict(func_dict, '1.0')
def test_version_unequal_format_in_keys_raises_AssertionError(self):
func_dict = {
'0.0': self.dummy_function_1,
'2.2.5': self.dummy_function_3,
'1.1.2': self.dummy_function_2,
}
with pytest.raises(AssertionError):
util.extract_function_from_function_dict(func_dict, '1.0.1')
| 34.34854
| 129
| 0.598789
| 2,445
| 18,823
| 4.265849
| 0.093252
| 0.102205
| 0.105944
| 0.039693
| 0.852445
| 0.834036
| 0.829914
| 0.81371
| 0.782838
| 0.767114
| 0
| 0.03198
| 0.284014
| 18,823
| 547
| 130
| 34.411335
| 0.741931
| 0.061202
| 0
| 0.715711
| 0
| 0
| 0.07616
| 0.02064
| 0
| 0
| 0
| 0
| 0.114713
| 1
| 0.119701
| false
| 0.009975
| 0.049875
| 0
| 0.184539
| 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
|
710707b4768e4d919c9fde2f8f1c6bbaa1acedf9
| 140
|
py
|
Python
|
tests/test_import.py
|
buzzjmd/keld-python-cli
|
2ec461c0489520c7c59ddb72d8157f99703eff6d
|
[
"BSD-3-Clause"
] | 1
|
2018-02-14T15:08:24.000Z
|
2018-02-14T15:08:24.000Z
|
tests/test_import.py
|
buzzjmd/keld-python-cli
|
2ec461c0489520c7c59ddb72d8157f99703eff6d
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_import.py
|
buzzjmd/keld-python-cli
|
2ec461c0489520c7c59ddb72d8157f99703eff6d
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
import keldcli
def test_import():
assert keldcli
assert keldcli.__title__
assert keldcli.__version__
| 14
| 30
| 0.685714
| 16
| 140
| 5.4375
| 0.625
| 0.448276
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009091
| 0.214286
| 140
| 9
| 31
| 15.555556
| 0.781818
| 0.15
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.6
| 1
| 0.2
| true
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
a48b39672fb8f2d1ea55c411b13c5f6d40c4960c
| 8,911
|
py
|
Python
|
Testing.py
|
evanxia1018/CSE539_Project_LLE
|
881ea2278c39c16716e5de83dd8abbd267806a35
|
[
"MIT"
] | 2
|
2019-11-10T02:04:52.000Z
|
2020-04-19T03:51:51.000Z
|
Testing.py
|
SarahLynnePu/CSE539_Project_LLE
|
881ea2278c39c16716e5de83dd8abbd267806a35
|
[
"MIT"
] | null | null | null |
Testing.py
|
SarahLynnePu/CSE539_Project_LLE
|
881ea2278c39c16716e5de83dd8abbd267806a35
|
[
"MIT"
] | 3
|
2017-12-28T14:09:24.000Z
|
2020-04-19T04:25:03.000Z
|
import Dataset_Generator as dg
import Evaluation as eval
import Plot_Graph as ploter
hd_dataset = dg.get_hd_dataset(5000)
reduced_hd = eval.pca_dim_reduction(hd_dataset, 3)
ploter.plot3D(reduced_hd)
broken_swiss_roll_dataset = dg.get_broken_swiss_roll_dataset(5000)
ploter.plot3D(broken_swiss_roll_dataset)
reduced_broken_swiss = eval.pca_dim_reduction(broken_swiss_roll_dataset, 2)
ploter.plot2D(reduced_broken_swiss)
broken_helix_dataset = dg.get_helix_dataset(5000)
ploter.plot3D(broken_helix_dataset)
reduced_helix = eval.pca_dim_reduction(broken_helix_dataset, 2)
ploter.plot2D(reduced_helix)
swiss_roll_dataset = dg.get_swiss_roll_dataset(5000)
ploter.plot3D(swiss_roll_dataset)
reduced_swiss = eval.pca_dim_reduction(swiss_roll_dataset, 2)
ploter.plot2D(reduced_swiss)
twin_peaks_dataset = dg.get_twin_peaks(5000)
ploter.plot3D(twin_peaks_dataset)
reduced_twin_peaks = eval.pca_dim_reduction(twin_peaks_dataset, 2)
ploter.plot2D(reduced_twin_peaks)
# ***********************************scripts to evaluate Trust
# Swiss roll
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_swiss_roll_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
# Helix
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_helix_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 1)
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
# Twin peaks
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_twin_peaks(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
# Broken Swiss
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_broken_swiss_roll_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
# HD
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_hd_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 5)
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
# ***********************************scripts to evaluate Continuity
# Swiss roll
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_swiss_roll_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Helix
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_helix_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 1)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Twin peaks
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_twin_peaks(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Broken Swiss
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_broken_swiss_roll_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# HD
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_hd_dataset(5000)
reduced_dataset = eval.pca_dim_reduction(dataset, 5)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# ***********************************scripts to test label_generation and generalization error
import Dataset_Generator as dg
import Evaluation as eval
dataset = dg.get_broken_swiss_roll_dataset(5000)
labels = eval.get_artificial_dataset_labels(dataset)
reduced_dataset = eval.pca_dim_reduction(dataset, 2)
error = eval.get_generalization_error(reduced_dataset, dataset)
# ***********************************scripts to read MNIST
from mnist import MNIST
mndata = MNIST('/Users/evanxia/Dropbox/CSE569/MNIST_dataset')
images, labels = mndata.load_training()
# ***********************************scripts to test Trustworthiness and continuity in Natural dataset using LLE
# MNIST
import Evaluation as eval
import MyLLE as lle
import numpy as np
dataset, labels = eval.get_natural_dataset_samples()
reduced_dataset, error = lle.locally_linear_embedding(np.array(dataset, np.float64), 5, 20)
reduced_dataset = reduced_dataset.tolist()
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# ***********************************scripts to test Trustworthiness and continuity in artificial dataset using LLE
# Swiss roll
import Dataset_Generator as dg
import Evaluation as eval
import MyLLE as lle
import numpy as np
dataset = dg.get_swiss_roll_dataset(5000)
reduced_dataset, error = lle.locally_linear_embedding(np.array(dataset, np.float64), 5, 2)
reduced_dataset = reduced_dataset.tolist()
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Helix
import Dataset_Generator as dg
import Evaluation as eval
import MyLLE as lle
import numpy as np
dataset = dg.get_helix_dataset(5000)
reduced_dataset, error = lle.locally_linear_embedding(np.array(dataset, np.float64), 5, 1)
reduced_dataset = reduced_dataset.tolist()
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Twin peaks
import Dataset_Generator as dg
import Evaluation as eval
import MyLLE as lle
import numpy as np
dataset = dg.get_twin_peaks(5000)
reduced_dataset, error = lle.locally_linear_embedding(np.array(dataset, np.float64), 5, 2)
reduced_dataset = reduced_dataset.tolist()
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Broken Swiss
import Dataset_Generator as dg
import Evaluation as eval
import MyLLE as lle
import numpy as np
dataset = dg.get_broken_swiss_roll_dataset(5000)
reduced_dataset, error = lle.locally_linear_embedding(np.array(dataset, np.float64), 5, 2)
reduced_dataset = reduced_dataset.tolist()
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# HD
import Dataset_Generator as dg
import Evaluation as eval
import MyLLE as lle
import numpy as np
dataset = dg.get_hd_dataset(5000)
reduced_dataset, error = lle.locally_linear_embedding(np.array(dataset, np.float64), 5, 5)
reduced_dataset = reduced_dataset.tolist()
trust = eval.get_trustworthiness(reduced_dataset, dataset, 12)
continuity = eval.get_continuity(reduced_dataset, dataset, 12)
# Following code evaluate the generalization error of original datasets
import time
import Evaluation as evaluation
import pickle
original_datasets = pickle.load(open('original_datasets.p', 'rb'))
datasets_labels = pickle.load(open('datasets_labels.p', 'rb'))
for key in original_datasets:
name = key
error = evaluation.get_generalization_error(original_datasets[key], datasets_labels[key])
print("The Generalization Error of the " + name + " is: " + str(error))
# Plot all original datasets with labels
import time
import Evaluation as evaluation
import pickle
import Plot_Graph as pg
original_datasets = pickle.load(open('original_datasets.p', 'rb'))
datasets_labels = pickle.load(open('datasets_labels.p', 'rb'))
pca_reduced_datasets = pickle.load(open('pca_reduced_datasets.p', 'rb'))
lle_reduced_datasets_under_diff_k = pickle.load(open('lle_reduced_datasets_under_diff_k.p', 'rb'))
for key in original_datasets:
pg.plot3D_color(original_datasets[key], datasets_labels[key])
# Plot lle_reduced datasets with k == 12
import time
import Evaluation as evaluation
import pickle
import Plot_Graph as pg
original_datasets = pickle.load(open('original_datasets.p', 'rb'))
datasets_labels = pickle.load(open('datasets_labels.p', 'rb'))
pca_reduced_datasets = pickle.load(open('pca_reduced_datasets.p', 'rb'))
lle_reduced_datasets_under_diff_k = pickle.load(open('lle_reduced_datasets_under_diff_k.p', 'rb'))
k = 9
for key in lle_reduced_datasets_under_diff_k[k - 5]:
print(key)
if key == "helix":
pg.plot1D_color(lle_reduced_datasets_under_diff_k[k - 5][key], datasets_labels[key])
else:
pg.plot2D_color(lle_reduced_datasets_under_diff_k[k - 5][key], datasets_labels[key])
# Plot pca_reduced datasets
import time
import Evaluation as evaluation
import pickle
import Plot_Graph as pg
original_datasets = pickle.load(open('original_datasets.p', 'rb'))
datasets_labels = pickle.load(open('datasets_labels.p', 'rb'))
pca_reduced_datasets = pickle.load(open('pca_reduced_datasets.p', 'rb'))
lle_reduced_datasets_under_diff_k = pickle.load(open('lle_reduced_datasets_under_diff_k.p', 'rb'))
for key in pca_reduced_datasets:
print(key)
if key == "helix":
pg.plot1D_color(pca_reduced_datasets[key], datasets_labels[key])
else:
pg.plot2D_color(pca_reduced_datasets[key], datasets_labels[key])
| 35.931452
| 115
| 0.791045
| 1,291
| 8,911
| 5.191325
| 0.07591
| 0.108624
| 0.072068
| 0.0755
| 0.86422
| 0.836914
| 0.813339
| 0.776186
| 0.721874
| 0.712026
| 0
| 0.024015
| 0.102794
| 8,911
| 247
| 116
| 36.076923
| 0.814259
| 0.091236
| 0
| 0.78022
| 0
| 0
| 0.053649
| 0.026515
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.351648
| 0
| 0.351648
| 0.016484
| 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
| 1
| 0
| 0
| 0
|
0
| 8
|
f17ef4b919c5bc807194347348620f112a9b7c65
| 18,334
|
py
|
Python
|
ncem/models/layers/output_layers.py
|
theislab/ncem
|
cd0ea2e9de8e1815e1f1f4139c62b4f33979f9ca
|
[
"BSD-3-Clause"
] | 37
|
2021-07-02T11:40:26.000Z
|
2022-03-25T20:17:03.000Z
|
ncem/models/layers/output_layers.py
|
theislab/ncem
|
cd0ea2e9de8e1815e1f1f4139c62b4f33979f9ca
|
[
"BSD-3-Clause"
] | 61
|
2021-07-06T08:30:59.000Z
|
2022-03-31T05:16:41.000Z
|
ncem/models/layers/output_layers.py
|
theislab/ncem
|
cd0ea2e9de8e1815e1f1f4139c62b4f33979f9ca
|
[
"BSD-3-Clause"
] | 1
|
2022-01-28T13:36:54.000Z
|
2022-01-28T13:36:54.000Z
|
import tensorflow as tf
IDENTIFIER_OUTPUT_LAYER = "Output"
def get_out(output_layer: str, out_feature_dim, scale_node_size, name: str = 'decoder'):
if output_layer == "gaussian":
output_decoder_layer = GaussianOutput(
original_dim=out_feature_dim,
use_node_scale=scale_node_size,
name=f"Gaussian{IDENTIFIER_OUTPUT_LAYER}_{name}",
)
elif output_layer == "nb":
output_decoder_layer = NegBinOutput(
original_dim=out_feature_dim,
use_node_scale=scale_node_size,
name=f"NegBin{IDENTIFIER_OUTPUT_LAYER}_{name}",
)
elif output_layer == "nb_shared_disp":
output_decoder_layer = NegBinSharedDispOutput(
original_dim=out_feature_dim,
use_node_scale=scale_node_size,
name=f"NegBinSharedDisp{IDENTIFIER_OUTPUT_LAYER}_{name}",
)
elif output_layer == "nb_const_disp":
output_decoder_layer = NegBinConstDispOutput(
original_dim=out_feature_dim,
use_node_scale=scale_node_size,
name=f"NegBinConstDisp{IDENTIFIER_OUTPUT_LAYER}_{name}",
)
else:
raise ValueError("tried to access a non-supported output layer %s" % output_layer)
return output_decoder_layer
class LinearOutput(tf.keras.layers.Layer):
"""Linear output layer."""
def __init__(self, use_node_scale: bool = False, name: str = "linear_output", **kwargs):
"""Initialize LinearOutput.
Parameters
----------
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.use_node_scale = use_node_scale
self.var_bias = None
def get_config(self):
"""Get config LinearOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def build(self, input_shapes):
"""Build LinearOutput layer.
Parameters
----------
input_shapes
Input shapes.
"""
genes_dim = input_shapes[0][-1]
self.var_bias = self.add_weight("var_bias", shape=[1, genes_dim], initializer="zeros")
def call(self, inputs, **kwargs):
"""Call LinearOutput layer.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
eta_loc
eta_scale
"""
bound = 60.0
mean, sf = inputs
var = self.var_bias
if self.use_node_scale:
mean = mean * tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip")
var = tf.zeros_like(mean) + var # broadcast
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -tf.exp(bound), tf.exp(bound), "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
# exp_mean = mean_clip + sf
eta_loc = mean_clip
eta_scale = tf.exp(var_clip)
return [eta_loc, eta_scale]
class LinearConstDispOutput(tf.keras.layers.Layer):
"""Linear output layer with constant dispersion."""
def __init__(self, use_node_scale: bool = False, name: str = "linear_const_disp_output", **kwargs):
"""Initialize LinearConstDispOutput.
Parameters
----------
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.use_node_scale = use_node_scale
self.var_bias = None
def get_config(self):
"""Get config LinearConstDispOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def call(self, inputs, **kwargs):
"""Call LinearConstDispOutput layer.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
eta_loc
eta_scale
"""
bound = 60.0
mean, sf = inputs
var = tf.zeros_like(mean)
if self.use_node_scale:
mean = mean * tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip")
var = tf.zeros_like(mean) + var
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -tf.exp(bound), tf.exp(bound), "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
# exp_mean = mean_clip + sf
eta_loc = mean_clip
eta_scale = tf.exp(var_clip)
return [eta_loc, eta_scale]
class GaussianOutput(tf.keras.layers.Layer):
"""Log normal likelihood output layer."""
def __init__(self, original_dim=None, use_node_scale: bool = False, name: str = "gaussian_output", **kwargs):
"""Initialize GaussianOutput.
Parameters
----------
original_dim
original dimension.
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.original_dim = original_dim
self.intermediate_dim = None
self.use_node_scale = use_node_scale
self.means = None
self.var_bias = None
def get_config(self):
"""Get config GaussianOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def build(self, input_shapes):
"""Build GaussianOutput layer.
Parameters
----------
input_shapes
Input shapes.
"""
input_shape = input_shapes[0]
self.intermediate_dim = input_shape[2]
self.means = tf.keras.layers.Dense(units=self.original_dim, use_bias=True, activation="linear")
self.var_bias = self.add_weight("var_bias", shape=[1, self.original_dim], initializer="zeros")
def call(self, inputs, **kwargs):
"""Call GaussianOutput layer.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
eta_loc
eta_scale
"""
bound = 60.0
activation, sf = inputs
in_node_dim = activation.shape[1]
activation = tf.reshape(activation, [-1, self.intermediate_dim], name="output_layer_reshape_activation_fwdpass")
mean = self.means(activation)
var = self.var_bias
mean = tf.reshape(mean, [-1, in_node_dim, self.original_dim], name="output_layer_reshape_mean")
var = tf.zeros_like(mean) + var # broadcast
if self.use_node_scale:
mean = mean * tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip")
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -tf.exp(bound), tf.exp(bound), "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
# exp_mean = mean_clip + sf
eta_loc = mean_clip
eta_scale = tf.exp(var_clip)
return [eta_loc, eta_scale]
class GaussianConstDispOutput(tf.keras.layers.Layer):
"""Log normal likelihood output layer."""
def __init__(self, original_dim=None, use_node_scale: bool = False, name: str = "gaussian_output", **kwargs):
"""Initialize GaussianConstDispOutput.
Parameters
----------
original_dim
original dimension.
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.original_dim = original_dim
self.intermediate_dim = None
self.use_node_scale = use_node_scale
self.means = None
def get_config(self):
"""Get config GaussianConstDispOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def build(self, input_shapes):
"""Build GaussianConstDispOutput layer.
Parameters
----------
input_shapes
Input shapes.
"""
input_shape = input_shapes[0]
self.intermediate_dim = input_shape[2]
self.means = tf.keras.layers.Dense(units=self.original_dim, use_bias=True, activation="linear")
def call(self, inputs, **kwargs):
"""Call GaussianConstDispOutput layer.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
eta_loc
eta_scale
"""
bound = 60.0
activation, sf = inputs
in_node_dim = activation.shape[1]
activation = tf.reshape(activation, [-1, self.intermediate_dim], name="output_layer_reshape_activation_fwdpass")
mean = self.means(activation)
mean = tf.reshape(mean, [-1, in_node_dim, self.original_dim], name="output_layer_reshape_mean")
var = tf.zeros_like(mean)
if self.use_node_scale:
mean = mean * tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip")
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -tf.exp(bound), tf.exp(bound), "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
# exp_mean = mean_clip + sf
eta_loc = mean_clip
eta_scale = tf.exp(var_clip)
return [eta_loc, eta_scale]
class NegBinOutput(tf.keras.layers.Layer):
"""Negative binomial output layer."""
def __init__(self, original_dim=None, use_node_scale: bool = False, name: str = "neg_bin_output", **kwargs):
"""Initialize NegBinOutput.
Parameters
----------
original_dim
original dimension.
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.original_dim = original_dim
self.intermediate_dim = None
self.use_node_scale = use_node_scale
self.means = None
self.var = None
def get_config(self):
"""Get config NegBinOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def build(self, input_shapes):
"""Build NegBinOutput layer.
Parameters
----------
input_shapes
Input shapes.
"""
input_shape = input_shapes[0]
self.intermediate_dim = input_shape[2]
self.means = tf.keras.layers.Dense(units=self.original_dim, use_bias=True, activation="linear")
self.var = tf.keras.layers.Dense(units=self.original_dim, use_bias=True, activation="linear")
def call(self, inputs, **kwargs):
"""Call NegBinOutput.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
exp_mean
exp_var
"""
bound = 60.0
activation, sf = inputs
activation = tf.reshape(activation, [-1, self.intermediate_dim], name="output_layer_reshape_activation_fwdpass")
mean = self.means(activation)
var = self.var(activation)
if self.use_node_scale:
mean = mean + tf.math.log(tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip"))
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -bound, bound, "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
exp_mean = tf.exp(mean_clip)
exp_var = tf.exp(var_clip)
return [exp_mean, exp_var]
class NegBinSharedDispOutput(tf.keras.layers.Layer):
"""Negative binomial output layer with dispersion shared over features."""
def __init__(
self, original_dim=None, use_node_scale: bool = False, name: str = "neg_bin_shared_disp_output", **kwargs
):
"""Initialize NegBinSharedDispOutput.
Parameters
----------
original_dim
original dimension.
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.original_dim = original_dim
self.intermediate_dim = None
self.use_node_scale = use_node_scale
self.means = None
self.var = None
self.var_bias = None
def get_config(self):
"""Get config NegBinSharedDispOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def build(self, input_shapes):
"""Build NegBinSharedDispOutput layer.
Parameters
----------
input_shapes
Input shapes.
"""
input_shape = input_shapes[0]
self.intermediate_dim = input_shape[2]
self.means = tf.keras.layers.Dense(units=self.original_dim, use_bias=True, activation="linear")
self.var_bias = self.add_weight("var_bias", shape=[1, self.original_dim], initializer="zeros")
def call(self, inputs, **kwargs):
"""Call NegBinSharedDispOutput layer.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
exp_mean
exp_var
"""
bound = 60.0
activation, sf = inputs
in_node_dim = activation.shape[1]
activation = tf.reshape(activation, [-1, self.intermediate_dim], name="output_layer_reshape_activation_fwdpass")
mean = self.means(activation)
var = self.var_bias
mean = tf.reshape(mean, [-1, in_node_dim, self.original_dim], name="output_layer_reshape_mean")
if self.use_node_scale:
mean = mean + tf.math.log(tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip"))
var = tf.zeros_like(mean) + var # broadcast
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -bound, bound, "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
exp_mean = tf.exp(mean_clip)
exp_var = tf.exp(var_clip)
return [exp_mean, exp_var]
class NegBinConstDispOutput(tf.keras.layers.Layer):
"""Negative binomial output layer with constant dispersion."""
def __init__(
self, original_dim=None, use_node_scale: bool = False, name: str = "neg_bin_const_disp_output", **kwargs
):
"""Initialize NegBinConstDispOutput.
Parameters
----------
original_dim
original dimension.
use_node_scale : bool
Use node scale.
name : str
Layer name.
kwargs
Arbitrary keyword arguments.
"""
super().__init__(name=name, **kwargs)
self.original_dim = original_dim
self.intermediate_dim = None
self.use_node_scale = use_node_scale
self.means = None
self.var = None
def get_config(self):
"""Get config NegBinConstDispOutput.
Returns
-------
config
"""
config = super().get_config().copy()
config.update({"original_dim": self.original_dim, "use_node_scale": self.use_node_scale})
return config
def build(self, input_shapes):
"""Build NegBinConstDispOutput layer.
Parameters
----------
input_shapes
Input shapes.
"""
input_shape = input_shapes[0]
self.intermediate_dim = input_shape[2]
self.means = tf.keras.layers.Dense(units=self.original_dim, use_bias=True, activation="linear")
def call(self, inputs, **kwargs):
"""Call NegBinConstDispOutput layer.
Parameters
----------
inputs
Inputs.
kwargs
Arbitrary keyword arguments.
Returns
-------
exp_mean
exp_var
"""
bound = 60.0
activation, sf = inputs
in_node_dim = activation.shape[1]
activation = tf.reshape(activation, [-1, self.intermediate_dim], name="output_layer_reshape_activation_fwdpass")
mean = self.means(activation)
var = tf.zeros_like(mean)
mean = tf.reshape(mean, [-1, in_node_dim, self.original_dim], name="output_layer_reshape_mean")
if self.use_node_scale:
mean = mean + tf.math.log(tf.clip_by_value(sf, tf.exp(-bound), tf.exp(bound), "decoder_sf_clip"))
var = tf.zeros_like(mean) + var # broadcast
# clip to log of largest values supported by log operation
mean_clip = tf.clip_by_value(mean, -bound, bound, "decoder_clip")
var_clip = tf.clip_by_value(var, -bound, bound, "decoder_clip")
exp_mean = tf.exp(mean_clip)
exp_var = tf.exp(var_clip)
return [exp_mean, exp_var]
| 29.61874
| 120
| 0.590542
| 2,094
| 18,334
| 4.899236
| 0.059217
| 0.04094
| 0.070182
| 0.035871
| 0.881762
| 0.874257
| 0.868311
| 0.858953
| 0.838386
| 0.824349
| 0
| 0.003807
| 0.298026
| 18,334
| 618
| 121
| 29.666667
| 0.793318
| 0.222919
| 0
| 0.840336
| 0
| 0
| 0.099184
| 0.043893
| 0
| 0
| 0
| 0
| 0
| 1
| 0.117647
| false
| 0.021008
| 0.004202
| 0
| 0.214286
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
74b932a9b3f86406af2f23cdd52e7d07d13d89c6
| 62,126
|
py
|
Python
|
install/app_store/tk-framework-qtwidgets/v2.6.5/python/navigation/ui/resources_rc.py
|
JoanAzpeitia/lp_sg
|
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
|
[
"MIT"
] | null | null | null |
install/app_store/tk-framework-qtwidgets/v2.6.5/python/navigation/ui/resources_rc.py
|
JoanAzpeitia/lp_sg
|
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
|
[
"MIT"
] | null | null | null |
install/app_store/tk-framework-qtwidgets/v2.6.5/python/navigation/ui/resources_rc.py
|
JoanAzpeitia/lp_sg
|
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
|
[
"MIT"
] | 1
|
2020-02-15T10:42:56.000Z
|
2020-02-15T10:42:56.000Z
|
# -*- coding: utf-8 -*-
# Resource object code
#
# by: The Resource Compiler for PySide (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from tank.platform.qt import QtCore
qt_resource_data = "\x00\x00\x02\xb2\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00'\x00\x00\x00$\x08\x04\x00\x00\x00\xa0>\xeb\x10\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x01\xa5IDATH\xc7\xed\x96\xbdKBQ\x18\xc6\x9fs\xd2>\xcc\x08E\xa8%H\xc4\xa9\x96\xf4\xaa\x90\x0e\x06\xadm\x09Y\x08A\xd6\xdfaK\x7fC\x04Q\x10\x11\x0e\x81\xb5H\xb54\xd4\xe0gA\x10\x92C\x83N}\x10\xa1\x85\x99\x9e\xd3 u\xefU\xf1\xda\xad!\xc2g:\xef\xbd/\xbf\xf3\x9c\xc3\xfb\xbe\x1c\xc2\xf1\x9b\xa2\xbfJ\xeb\xe0~ M;I)\x1d\x1b+g\xdc\x05\xe5L\xd2X(\xe9\x05f\xfd2\x9f\xb5\xed\xa6L\x98\xe7F^D\xd8\x91SqX\x11\x060k\xdc\x8c 7\xd22\xd1\xd3\xc5\x94M\x85\xbbd\x08\x10B\x9f+\xce\x08E\xa6\x18\xd1O\xc1\x05 ~{\xe4\xab~\xcb]\xdd~\x14\xe7B\xd8[\x12\xa28 U8-\x81\xe3~\x958R\xe2\x8c\x1c\x0a'\xe0\x00 \x5cT\xb6H\x81\x8d\x1aW\x12\xc3\xaapt\xf3}\xdd\x9e\x16cW\xbe\xb4A\xf2\x18$K\xc9q\x15\xb8\x89\xfb\xc9;\xf9\x17w\xa1\xb0M.\xa1\xc5lrz\x95\xb6\x81\xbb\xeen}\x97\xde\x8a=B\xa2\x84\xc13\xe3?\xedU\xc0]\x19^\x82\x00yl\x8d\xb4\xc7\xaa;xe\xd6\x81\xe5\x94\xa9\xee\xb6\xa5\x85\x127S\x1ftx`{N\x05 pf\xe8\x9b\xe3C\xfc\x8d\xef;o\x9a\xbaK\x8ct\x05\xa0\x03\xf0\xac\x0c\x03<O\xbc\x08\x90\x1e\x8d?fm\x8a\x03x\x05\x00`Q\x86\x89y\xac\xa2\x95\x1cP2\x02\x1c9\xac\xd5:A\x94\xb4\x7f\x81Z\x0fKc!$\xdfA\xa1+\xe4\xb0\xc6\xb8^m\x0c(\xd1\x81\xdcy3\xfd\xedi\xdc\xc1\xa9W\xd3BiU\x10\xad\x8b\xa5\xc1\x1d\xcd\xcac\x9em\xef_M\xa4\xf3\x82\xfa\xa7\xb8\x0f\xd2\x18\x86h\xd3\x7fsX\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x06\xd4\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00$\x08\x03\x00\x00\x00\xdb\xc0\x18\xed\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x02\x0aPLTE\xff\xff\xff\x00\xff\xff\x00\x80\xff\x00\xaa\xff3\x99\xff+\xaa\xff$\x92\xff\x00\x80\xff\x1c\x8e\xe3.\x8b\xe8'\x9d\xeb+\x95\xea\x1a\x99\xe6 \x9f\xdf\x22\x99\xee+\x8e\xe3$\x92\xe7#\x97\xe8&\x99\xe6 \x8f\xef'\x93\xe2+\x91\xe6)\x94\xe6&\x97\xe3+\x95\xea(\x94\xe4$\x92\xe4\x1b\xa4\xe4\x1b\xa5\xe4&\x97\xe3+\x92\xe1-\x93\xe6)\x91\xe3-\x96\xe1,\x90\xe9-\x96\xe1$\x92\xed+\x95\xe3\x18\xa8\xe4\x19\xa7\xe3\x1d\xa4\xe4+\x92\xe3*\x92\xe5)\x91\xe2(\x94\xe4(\x8f\xe7)\x8f\xe0'\x93\xe8*\x94\xe1\x18\xa7\xe3!\xa1\xe3*\x94\xe3+\x95\xe4,\x95\xe6\x1f\xa0\xe4\x18\xa7\xe3\x1a\xa6\xe4!\x9e\xe7)\x94\xe6,\x93\xe2,\x94\xe1)\x94\xe6\x1d\xa3\xe2\x18\xa8\xe4\x18\xa7\xe3\x1c\xa6\xe5&\x9b\xe6(\x93\xe3+\x95\xe2+\x92\xe1+\x93\xe2'\x97\xe6\x1a\xa4\xe3\x18\xa7\xe4\x18\xa7\xe4\x1d\xa3\xe2*\x97\xe5,\x92\xe2,\x92\xe4*\x93\xe3+\x93\xe2 \x9e\xe6\x1a\xa7\xe4\x19\xa7\xe4 \xa1\xe4'\x90\xe5,\x95\xe5+\x91\xe3,\x92\xe2,\x94\xe1+\x93\xe4-\x92\xe3+\x95\xe1\x1d\xa2\xe4\x18\xa7\xe3\x19\xa6\xe3#\x9c\xe6*\x94\xe4,\x93\xe3)\x94\xe2(\x94\xe4%\x94\xe6\x1d\xa3\xe4\x1a\xa3\xe3'\x9d\xe7+\x91\xe4*\x92\xe2,\x91\xe5+\x93\xe1%\x9b\xe6\x1a\xa5\xe3\x18\xa8\xe4\x1e\xa3\xe5+\x97\xe3)\x92\xe4 \x9e\xe3\x1a\xa6\xe3\x19\xa6\xe4\x1e\xa3\xe6+\x92\xe4(\x91\xe1 \xa0\xe3\x19\xa7\xe5\x1c\xa5\xe3,\x90\xe3)\x93\xe2\x1f\x9f\xe4\x19\xa8\xe4\x1c\xa4\xe5$\x9d\xe4\x19\xa6\xe4\x1a\xa6\xe4 \xa0\xe2$\x99\xe4\x1b\xa5\xe4\x19\xa7\xe3\x1f\xa2\xe6'\x93\xe5\x1c\xa2\xe5\x18\xa7\xe4\x19\xa7\xe2\x1b\xa3\xe4+\x98\xe5)\x92\xe1\x1d\xa1\xe4\x19\xa7\xe3\x1b\xa5\xe3&\x9b\xe5\x1e\x9d\xe3\x1a\xa6\xe3\x19\xa6\xe4 \x9e\xe4)\x94\xe3%\x99\xe6\x1b\xa5\xe4\x18\xa7\xe3\x1d\xa3\xe4(\x95\xe3\x1c\xa3\xe3\x18\xa6\xe3\x19\xa8\xe3&\x98\xe4 \x9e\xe3\x19\xa6\xe4\x1a\xa5\xe4%\x9c\xe6\x1a\xa6\xe4!\x9e\xe5\x18\xa6\xe3\x1d\xa2\xe6\x1c\xa3\xe3\x1a\xa6\xe5\x18\xa7\xe3\xff\xff\xff\xfa\xbe\xcaG\x00\x00\x00\xactRNS\x00\x01\x02\x03\x05\x06\x07\x04\x09\x0b\x0d\x0c\x0a\x08\x0f\x12\x15\x16\x14\x10\x1a\x1e\x1f\x1b\x18\x13\x1c\x86\x966*(%\x22\x17\x11\x0e$\xfc\xee\x8661,& \x19!+\xdcm70)\x83\xe7\xc3T24LQ\xa0\xf5\xfa\xa4=-5MN[\xb8\xfd\xed\x851#KIGg\xd0\xd9g'\x1dHFEB?<{\xe6\xbfPC@>9>\x98\xa4AA=:;R\xb8\xfe\x8868n\xd4\xdaf/3\x89\xe8\x88.P\x8d\xea\x87r\xd7\xd9iU\xbb\xed\x8c;\x9a\xf6\xf9\xa7MDz\xe7\xc0We\xd2\xd8iJZ\xba\xec\x85R\xa3\xf7\xf9C\x89\xe9\xc3Z\xdct\xee\x8c\x8a\x9a\x08\x80=\x81\x00\x00\x00\x01bKGD\x00\x88\x05\x1dH\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x02\xfaIDAT8\xcb\x8dT\xf7w\x12a\x10\xf4\xfaq\x05\x0e\x8e\x16\xd4\xe3B\x89\x02G@\x01\xcb\x11+$j\x94\xc4F\x12\x93\xd8\x22\x96\x184\x8a\x05\x0b\xf6^c\xef-\xf6\xb2\x7f\xa4\xdf\x81QHy\xcf\xfdy\xde\xee\xec\xce\xcc\xce\x9a\xf5\x7f\x85a8*\x0c\x9b\x19\x80\x13$E\xd1\x14\xc9\x10\xf8\xf4(\x8c i\xd6\xc4q\x1c/\x88\x14\x83O\x07\xc1I\xd1d\xb6HV\xc9f1\xf3\x22ILm\x841\x22/Kv\x87\xd3\xe9p\xb9\x9b\xcc\x02\xcdL\x99\x86S\x82l\xf5\xcc\x9e3W\xf1\xaa\xcd\x1e\x9f\x9fc\xa9\xc9 B\x0c\xd8<\xc1\x16\x987?\x14\x8eh\xd1V\x9b\xcc\x8b\x14\xd1@\x89\x11\xfc\xad\xb18\xa0Z\xb00\x91L5{\xd04S#%\x92o\xf2hI\x80E\x8b\x01\x96,\xd5\xe3j\xd4e\xb5\x04\x1a(Q\x9c\xe4\xf0\xa6\x01\xda\x96-_\x01+W\xad\xce\xa4\x82N\xbb\xd4@\x89\x0aX\x9dJ\x16\xa0\xbd\xa3}\xcd\xdau\xd0\xb9~C\xc4\x9bsT)ML\xa3\xcd\xbe\xa8\x12B]\xda\xba\xba7n\xda\x0c\xb0ek2\x92o\xeeq7\x05\x84?\x97\xa4\xcd\xee\x98\xd1\xa5\xbb\xb7o[\xff\xc0\xe0\xf6\x1d\x00;w\x853\xf9\x98K2\x0bT\xb5\x0f-\xbb\xa3\x0a\xe2\xd2\xb7{h\xcf`!\x14\xda\xbb\x0fQ\xda\x7f@\x8f\x07=R\x80%\x8d6\x22\x82\xa4t\x80\xe1\x83#\x89\xb4\x9e\x0cg\x8b\x87\x0e\x8fB\xe7\x91\xa3\x99\xa0\xab\x89\xa7\x89\x1a\xc4\xe9\x0d\x03\x0c\x96\xd2\xc9L\x5c\x89\xe8#\xc3}\xc7\x8e\x03\x9c8\xa9D\xadf\x91\xc1j\x90|\x19\xa0p\xaa\x1c\xf7j\x9a\xb7\x5c\x1a\xeem\xeb8}\x06\xe0l\xd0\xee\x17\xea!\x09=\x93\xd2\x82\xc1|\x05A\xda\xcf\x9d\xbf\x00pQuYLd\x1d\xa4\xa4W\x94\xbc\xaaV\xbb\x5c\xba\x0cp\xe5jR\xb5[\x84\xbf\x10$@1\xa4W\xe2)o<\x5c\xb8v}\x14n\xdc\x1cJDbn\x99\x9d\x18\xe4E\x1b\x0d\x14Kh\xa1J\xf9\xd6\xed;p\xf7\xde\xfd\xa1BR\xeb\xb1q\xd5\x8d&\xee26\x8c\xce\x92H?x\x08\xf0\xe8\xf1\x9eb\xa8\x9cw\xfad\x81\xc2\xeb\xae\xdb\xdb7\xd6?\xf4\xe4)\xc0\xb3\xe7#\xa5l2\xae:|~\x9ef\xb0\x1a\xa4\xaaQ\xd7\x8b\xee\x97\xafF\xe1\xf5\x9bB\xe8TY\xd1\x90%\x0c!k\x1a\x05\x90\x8c\x86\xd2o\xdf\xbd\x87\x0f\xfb\xc7\xb3\xe8>Z\xcc\xe3\xab\xf3\x0c\xc5Y\x1d)\xc4\xe5\xe3'\x80\xcf_\x8a\xe9\x9a\xcc\xb6z\xe7\x91\xbc\xad'\xaf\x1b\xc6\xfc\xfa\xad\x7f0[1\xcc\x22\xc9<[\x17)\xd2d\xb1\xe72-\xf0\xfd\xc7\xee\x81\x91tDu\xba\xac~\xae1*\x0ck\xb6:\xb4\x9f\xbf\xc6\x0bHG%g\x900\xd1\x8d\x81\xc3i\xde\xefvj\x91J%\x92R\xa3v\xdbd\xfb\x1bi$Y\xce\xe2\xeb\x89\xe5r\xb1\xea\x0cvj\xae1\x82b9\xbf\xe4nm\xf5I\x93\xc2\xf1o\x12C\x89\xa6\x80,\xcb\x01N\x986\xf5\x06\x06\xbd\x17\x91eE\xf4a\x88i\x7fG\xedI\x11\xa8\xf0\x19\x1e\xd0o\x94\xee\xbfL\x8d\x012\xff\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x0cS\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00'\x00\x00\x00$\x08\x06\x00\x00\x00\x0a7#\x9b\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x0bUIDATX\xc3\x9d\x98]\x88e\xd9U\xc7\xffk\xad\xbd\xf79\xe7\xde\xbaU]\xd5U3)\xd2I7C\xa9P\x03\x91\xa1\x09\x184\xce \x06|\x19E\xb4\x07|\x09\xf8\x22\xc1\xe0C4\x0f\xe2K\xd3b\xf4A\x84\x80\xbe\x98\x01?\x9e\x84\x19P4/\x06\x04{P4\x08M\x88\xda\xe5\x07\x0d\xce\xc4\x0a5\xdd\xd5\xd5Uuo\xdd\xba\xe7\x9c\xbd\xd7Z>\xdc\xaa[\xfd5\xcd\xc4\x03\x97{\xee={\x9d\xf5\xdb\xff\xb5\xd7\xda\x1f\xe4\xee\xf88\x17\x01\xf4\xdc\x07\xb7\x9e\xfa\xff&\x9ex\xa1\x03\x1f\xcf\xc1\xf3|~\x14\xdc\x02\xe6\xcc\xf9\x8d\xed\xf9\xf7\xfe\x0eh\xb2\x09j\xf7v\xe6\xcf\xb7\xb7\xcf,v\x00\x00\xf5\xe1\xb6\xe3\x0e\xf0\xcaO\xc3\xde\xdd9\x03\xbb\x09\xff\xff@>\x17\x8e\x00\xc2-\xd0\x1b\x00O6A\xc7\xdd=.\x8f\x02\xf5\x9b\x15k\xc3ti\xef\x88\x81\xcb\xd0\x86\xc9\xaa#\x02\x80x\xb4l\x00\xf0h\xc9=\x86\x0d\xe3Ux\xfd\xe1=[\xa9\xb6\xec\xce\xdf\xc1\xf0\x0e\xec\x07U\xf2\x19\xb8\x05\xd8\xeb\xe0\xfd}\xf0\xf1\xee\xaetU%\x9f\x0eA\xfa%\xe6|\xc8\x9c\xe5\x81\xd4&\x0c\x0c\x1f\xb3\x9c\xe24\x0f\x5c\xd8,\xb0Z\x9d\xb3~?]+\xd5\x06\xb4\xfe\xf0\x9e]y\xb4\xa5\xb7\x01\xfbAT|.\xdc\x1b\xb7!\xfb\xfb\xe0\xc3\xc3\xbd\xf0\xa9\xae\x0a\xc7\x1ccWf!Z\x1f\xa2\x88h\x22\x8e\xcelm\xcf\xe7v\x5c'\xebu\xe6Lf\xa9_.c\xd6\x12\x8b\xea@\xba\xb2W\xae\xe5f\x1dz\xed\x1a\xca\xed\xf7>>\xe0\x13p\x04\x10\xde\x02\xbf\xfa*\xe4ps/l\x1e\xce\xe2d\xb5\x89\xcdT\xab6j\x0a<\x10\xb6\x12J\xe0 ]f\x8fe\x0e'\xd1K\xeb\xce\xe4&\x16\xb4\xc4\x99\xbaK\xae\xf3R?\xe6q\x19X\xcc\xf7W\xea\x5c\x1f\xb7\xe5\xe5\xe1\x95rg\x0f\xfaq\x00\x9f\x81\xbb\xfe\x0d\x84\x83\x04\x09\x93G)\xac\xccb3\xae\xaa\x9c\xac\xf1\xce*H\x9b\xc8$\xa8s`Rq'\x06\x00\x22\xb7\xf1%\xfa\x85,\xfcEq\xbcs\xe9\x08\xdfp\x97\xecZz\x88\xf4\x88}\xaf\x93\x94WS\xd5\x7f\xff\x13ky\x05\xd0\xbb\xefB\xf1\x0e\xecE\x80O\xc2\xbd\x05\xd9\xfae\x84\xe3\xff\xd9\x8f/u]:\xa1\xba\xaap\xda\x9c\xbc\xcc\x7ff\x84\xcf?cl\xf4/\x97\x0e\xe5\xd6xE\xbf\xa4\xc1\xdf\x5c\x84\xd8\xf0\xad\xe5)\xff6\x5c&I\xb5\xefT\xfa:\xe7~6\x94nt8\xcb\xbbrR\xd6\xaf~&o\xec\xc0n\xdf\x84~T\xa2<\x09\xf7.\xe4\xca\xeenZ\xa7RM\xea&%=m\xd8dx\xb0\xc1w?\xaawl\xf4\x1dc\x7f\x8d\x80\x9e3\xfd\x95&\xbc\x09\xf7\x01;\xfd\xebpJ_\xc5I\xbf_\x81\xbaV\x9a~\x80\xd0M\xbb\xc3~\xb4~\xb9\xdf{\xd8\xe5Q5)/J\x94\xc5\x80&\x80\xae\x1f\x82\xf3z\xe4<\x0a\x1c\x8a\x84l\xc3\x90!\xf1\xbc\xcd\xfa\x01\xbd\xb9\xfa\xd0\x7f\xfe\xf2}\xfd\xc5\xf3\xff\x8c\xfd5r:\x1a\x9c\xd2o\xad\x1c\xfb\x9f\x0f\xa6\xf6\x1b\x04z`\xe4\x9f9Y\xb2?-\xa3\xf8C\x9eBU\xc1*\x95\xd3\xba\x194\xd5\xa4\xed\xd2K\xc3.M\xba\xad\xb0\xbb\x06y\xe3u0n\x81\x9e.\xf4\xfc\xf8\x8fv\x0f4:\x9aH\x9bc\x08\x96\xc3\xc0J\xa8\x02\x87\x05\x88f\x11\x22\xa2(\x8b\x1e\x92\xe1{Kc\xfb\xf5\xfa\xd4\xfe\x9d\x95\xcbp*\xf7\x86\xc7\xf82;\xfe\xd3\x81O\xce\x86\xf8\x93\x93!\xfdx@WY\xf1ZK\xac\xd3\xf4\xb4\x99xS\xad\xaf\xeeVG\xc3\x87\xe9\xdewv\xe3\xf5M\xc8\xd3\x80\x17po\x81\xa7W\xc1K\xba\xce\xa9m%\xc7\x1czi\x93\x9a\x86\x0b|\x01\x81\x8d\x8ak0\xfe\x96\x18\xde[\x99\xe0+\xb1\xe3\xef\xa9S\xabA\xbb\xc2\xda\xa7\x9e\xef\x8f\x8e\x9b/\x8b\xd1\xdf\x03\xbe\xd4\xd5\xfe\xf5\x83\xb5\xf8V\x94\x90\x9c\xbb:\x0e\xaa\xba\xb2\xd3\xa6\xcc\xeaz\xed0W\x9f\x0c\x83x\x7f\x15\xe1U \xe0-\xf09 \xb9\xfb\xa2\xb6\xfd\xc7\xff\xde\xafV\x1eX\x93\x1ao8cP\x18\x03r\x1a\x1e\xbc\xa4\xff\x00\x00\x97\xef\xfb\xcf\x81\xdd\x8dY\xd9]\x89\xdcJ\xb6\x1c\x12\xf5\xaeU\xc9\x02\x0f\xb9p`\x22\x00p\x06=Z\xc5\x97\x94\xfd\x8b\x00\x10\x14\x7f\xb12\x09_G\xdb\xf6\x84\xaaks\xe9\x87\x81\xda\xf3D\xb9\x9fR\xbf2\xbe\xa2w\xef\xce3y\xa1\xdc\xfe{\xe0\xd1\xd1Drh\xa50K\x09%\x90i \xee\x16\xcaQ`s\xe2\x22\xe6\x05\xc5\xb2\x16\xeaR\x15\xdbRR\x07m\xfb\xd8\xb7\x19\xac}\xef\x9a[3U\xb8\xad>\xa4?\x8e\xbd\xff.\x80\x5c\x04\xbft\xb8\xac\x7f\xa0K\xe1\x12q\x1e\xa4A\xacu\x98\xea\xba\xb3z\xb2\xda\xc4\xe1\xca\x950\xbd\x0a~\xe3W\xe7\xca\xf1EH\xdf\x9f\x87TF\x22V\x82r-\x96X&K\xe9\xb3gh\xaa\xea\xc6d\xa5P\xec\x91R\x1f\x13\xf7\xd9\xb8\x0f\xb1\xcd\x1e\xeb\xec\xb1\xceBR\x84\xea\x12X\x0a\x1572\xf7\xd11\xfe\xb6\xee\xe4\xab\x00\xc6\xc6\xfe\x13\xe3\x01\xde>\x1d\xd2\xa7\xd8s\xa3m\xd7\xb4!&9\x8d1\x1c\xef\xc6\xe9\xe9N\xd8\x7fo\x9e s\xb8\x1b@\xffA\xc5yt\xc2\x91{a\x93\xc06\x0b\xd3\x81\xffd\xdf\xd8\xef\x00@(\xfeMfW\xcf\xae\xc2}\x81j\x9f\x8d{\xe1\xb6\xc0\xeb\x5c\xdc\x95\xa93\xf3\xa0L\xbd\x91\xf4^\x04^\x04N\x12|xl\xff6<\x09\xbfFN\xbb\xc6\xd8:\x1d\xf0\xdb\xd3\x01\xfdh\x94\x90\x92k\x858Im\x13\xc3\xca\xca6O\xaf\xbe\xcf\xb8\x0b\xe2\xf3\x12\xb2\xfe\xca&u\x1c\xa4\xf4\xbdX\xcc<]\x91/\xf4\x15}\xcd\x1dI\x0a\xfd\xcd\xe8\x11\xde&r\xb3\xc8\xc5T\x8a\x06Q6S3Q2x-\xee\xe8\x13\x9c{\xca\xb9\x074:\x99;\xb1;\x90\x01\x00M\xd7\xef-\x8f\xf1\x15v\xfa\xae\x93\xaf\xb7\x03\xfa\xa3\xa3\x91\x7f\xa1o\xdb\xc4\x14c(\x12\xaa\x07\xbb\xa1\xff\xa0b\xdcx,[\xbb\xbd\xffb\x1d3{h\xe8\xa4\x8e\xaf\xf5\x91\xbe\x06x8\xcb\xe9M\x8ap58Yp\x04 \xe6\x0ch&sf\xcdYJ\xcb\xa1\x04\x0d\xa5\xd3`\x83%v\x10\x07&r&r\xd5Ey\x10\xf3)\xdc\xca|V\xf0\xba\xaf\xfc\xf7\xba\x97\x9a\xcf\xb3I\x086\x0e\xd9\x84\xd7_\xd9\xa4\xeb\x87\xe0\x8bR\xb2\xfe#\x18\x02H\xd2\x11\x04\x80\xa3=\x7f\xa4\xec\x9fu\x03\xc1@\x12\x94=\x176b\xa1P\x85h\x92\xd0\x84$\xd2\xd7\xc2^\xc7\xbaI\xb1\xef+\x82\xc5R,\xba\x13\x8b\x05\x02\x040\x227\x901]\xbf\x98\xa2\xd0\xb9\x15R\x9a\x8a\xc9\x1a\xd9\x1a\x91N\xf6\x09\x00\x16\x99\xa8\xd3{\x14\xe2\x0a\x11\x80\xc1I\xf9\xee\x12\xe8\xa74\x87\xe6h\xa3\xdc^\xf4:\x00\x96\x89SL\xd2\xa9\xd3d\xcd~\xdf\xd8?\xf7d\xc9,\x17U\xd1\xc2\xb7\xd7\x0e\xec7]\x229\xf5\x0c\xa7'f\x80\xcb\xf7\xfdg\x94\xd1\x8a\xf9)x\xc9M\x8f\xc8\x0f\x1a\xc2\x00\xb8\xb3\x07g\x07\xfc\xce\x1e\xbc\xfa\xc4\x96\x09\x9b\xe5n\xd98G\xa3\xe2F<\xf3\x0bGD\xae,F*%\xe7\x14\x90\xab\x0b\xb0\xe7_\xca\xfec\x85-)\xf5\xd1\x8c\x04F$v\x01H\x0c\xe7\xe0V\x04\x0e\xf4\x90\xc1\x8a\xc9\xb2\x19\xf6\xf7\xf1\x84r\xd8\xd9\xc1\xe9\xda\x9a\xc78s\xa2\xde\x0b%\x17\x0f\x86\xf9\xa2\x01`\x10\x99J !\x92''\xe8\xcb\xfb\xfc\xb3 %'\x90\xbb\x12C\xec`\x9d\xfe\x1a\x00${\xa2 \x06\x02\x1c\xca\xe0p\x01\x17\xdc(\x17g\x13\xcb!Yl\x0f\x81\xbaA\xbd\xb9m\xf8\x95\xc7\x8ap\xbd\xb9m\x5c\xb9\xf7\x9d[\xce\xd1\xb8\xb8\xc1\xf2\x02\xc24\x8b\x13\x8b!GU\x8b\xaa\xb6X\x10(rT\xb7\xc0F\x22\x1e\xd8\x88da\x179\x18<\x1a<:E1\xb5\xc53\xcd\xe2\x14j\xe3\x14\x8c\xc9\xac\xa3\xca\xe2Tm\x0fw\x80[\xe7\x03\xe5&\xec\xfe\xea\xae\xc7\xa9\x9a\x0c\xcc\x98\xcc\x08\x9dq\x11\xbb\xd0'\xc1\x006\xd4l\x14\xc5(.\x9c\x08\x09\x05Ip\x029\x81\xe6:\x9d\x09n$g\xd1\x14#\x13\x97\x0bA(\xc0\xccM\xd9\x82\x063\x152\x9b\xd4#O{\xd7\xed\x22\xac\xb7\x80\x80\xe2\xd3\xab\xb0\xe6\x88,\x86\xba\x14\x0a\xc5$\x97\xf3E\x82sOB\x81`Jn\xe7\xa5A\xce\xc6\x8e8\x8a:\xc9\xd9j\xc5t\xd1%'!.=-\xda\xf1\xc5\x8aF5\x9bS\xa5\xc8\x9d\x85\xe8\x16\xebF\xf3\x81Y\xb3\x0d\xf3\x1bga\xf5\x9b\xb0\xe1\xf65\x0b\x93e\x8b\xa5\xd6L\xa7V\xbcU\xf3\xb0\xf0\xc2*F~\xf6b\x11PL\x8f-\x9b\x8a9\xbb\xba\x97\xf9\x87\xfd1\xbaL\x10\x01\xe4\xac#~\x01'\x94\x8ax\xafZ\x872\xe5QigfqC\x17\xd1ZH|\xf7\x10^\x89Z\xdf\x14UY.bA\xd9\xda\x85\x13\x0alJ\xc5\xe1pb8\x8a.\x9cd\xf5\xe2\xb0\x0c\xa0\x03\xd0\x9d\xdd\x9f\xa9\xcaJ$F\x0c\x87\xc3\x95\xca\xc2\x8e\x8b\x9b\x90\x94X\xb4H\xf7\xd0\x02\xabU\x8f\xd4\xee\xee\xe0\xb1\xb0\x02\xc0\x1e\xbc\xde,\xb6\xafK6l\x8f\x16\xa1=\xaf[\x0f/\xfb7?\xeaD\x22\xa6\xd0:Y)\xed\xbc\xad\xa4\x8br\xf1\xf02\xfer\x91\xf1s\xdc\xc5]\x97\xac$\x84\xc2\xd6[\xacVu:\x98\xea8~\xe8\x98\xbe\xfc\xa4r\x00p\x906-\x8c\x0f,\xd6\xb5\x9e\x98\xa9\xf2\xac\xb0\xd3?\xe2\x05\x17\x1b}\xdb\xb4\xccL1\x13\x09\xa7\x22\xe1\xd44\xcc\xd8\xe8\x9f_dGN\xff\x14{\xcd\xa55\x9dr,IU\xc3d\xd9\xd2\xdeu\xc3\xcd\xb9r\x8b\x0d\x0e\x01\xbc\xf5\x87\xf7\xe2\xe0\xd2Vx\xd4\x8f\xab\x91\x1eV\xb1G\xad^5\xea\xde@,\x09\xb1\xb0\xcf\xf7\xaaF\xc1\xa8\xf4\xe6$\xc5\xa1YH\x8aR0\x00\x10/\x5cH\x22\x15\x8dL*\x1e\x12?n\xa7n\x0a\xd5\xde\xea8\x95\x8c\x19S\xe8&4\xeb.-}\xba\xd7\x1a\xf9\xee\x0e\x8a\xdf\x84]\xc0\xdd\x02c\x13re\xba\x1b\xea0\x88\xdcwIF1\xc6~Z\x1b\xa3\x9e\xefW58\xa7\xf9B0\x9bQ\xe5ffj\x90\x1c,*\x85\xd6\x01\xc0Z\xe6\xc2Y$4\x81L\x83\xa3\xf0\xe3v\x1c\x5c;H\xe6B-\xa1\xeb&\xa3\xd5nx\xd0\xe7il\xcb\xee\xf8J\xc6M\xa8\x03\xfe\xcc\xd6\xf0U@\xea\xc3\xbdp<\xac\xc2\xec(\xc6\xe5\xdc%\xc7I\x15d \xea\xc4\xe6'\x0c\x00L\xd1\x84\x92\x155\xcdf\x1a\x92*\x97f\x0e\xb7\x0c\x0a'\xe3Px(1\x11k\xfb\xac\x9dW\x9a\xed\xb4\xcf\x93\xd1jW\xef>(\x1b\xdb[y\x0c\xe8\xdd\x1b(\x8e\xa7\xc2\xbaP\x0f\xe0\xad\xb5{\xb2R\x0d\xe5xo\x1a\xda+u\xb8\xe4)\xe6G\x9dh\xc3\x0c4g\xadg\x90\x99YXRKZ\xeb\x03V\x13^2\x00P;\xe1\x97L\xb8\x97V\xca\x89\xf0\xf3\xec*\xee\xcb\xd1p=\xa7\x07\xfb\xba\xb1\xbd\x95\xf7?\xbcg\xf7\x1em)\x00\xf3\x9b\xcf\x81;\x1f{\xb85\x07\xdc([<\xae\xf6e\x16\x82\x14\x9d\xf0\xc0\x84-\xf2yx\xfc\x94\xd5\x82\x8c,\x06\xb5\xd0\xba\xcb\xc8\x5c'\x07\x04l\xa0\xd3c.\xa3u\xb6\x19\xd1\xc0N\x9e\xb5\x1b\x17kF\xadn\x0c\xb6\xcb\xed\x0fv\x0c\xdb\xdb\x8a\x1b\xf0s\xd5\x9e\x0b\xb7\x00|\x17\x84C0\xf6@\x9f[\xde\x95~x\x85r\xf3X\x1d\xb8\x0f\xc4ex\x9a\xee\xfa\xdej\xf1\xf7?\xb8f\xf3\x03\xc4\xf9a\xe2\x1bW\xc1\xdd\xe1.M52^~\x19O\xdb\x8d\x12\xec\xf6\x070l\xc2\xb1\x0a\xc3\x0e\xfc\x5c\xb1\x17\xc2\x01\x00\x11\x08\x8e\xf9\xc9\xe6\xebg%\xe7\xbf\xef\x5c\xc0\xfd\xf0\xf5\x0b\xc3}8v\x9e:\xeb\xd8\x06a\xe3\xac3\xcf\xb3;\xb7\xb9\x09\x07\x01\xee\xcf\x9e\x95\xfc\x1f\xcbB\x0f\xbb\x18\xe9\xa8\xa6\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x02\xc9\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00\x22\x08\x04\x00\x00\x00\x90N\xc3I\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x01\xbcIDATH\xc7\xd5\xd5\xdbK\xc2p\x14\x07\xf0\xef\xf9m\xebbv\xb1\x8bt\x11\xcaZ\xa5\x06AY\x94A`\xf4\xd4\xdf\xdac/=\x05A\x90\xba\x86Q02\x12\xc2.\x90\x15\x94i\xa5\xb9\xdf\xaf\x87\x08Zin\xab\x87:oc\xbf}8\xbf\xc39g$\xf0\xf3`\xbf`\xfcw$\xd3nx?>\xcbN\x01\xdd\x83\x10\x1f\xc2\x0b6]\x22\xba\xc2\xc6\x11\xe4\x0c\x80\xe2.\x13\xb67\x22&\xb8\x02\xb0\x0b>d}e\x13I\x0fV\xc3\xf0\x00\xb8-\x19\xf1;\xcd9bt\x17\xa7\xa8\x0b\xe0E\x18\x0bW\xb5N4@\x0co)\x8c~\x02+\xb3\xccL\x0eu\xda\xfb\x1b\xe4\xa4\xf9~\x82\x86Ad\x22\xfb\x90\x8dW\xeb\x9f\xac\x87H\xc9QI\x152 r\xa5L\xfc\xf9\xfb|k!\xa4\x05(\xc4Z\x04X\xdekL>4\xae\xda\x17$\xddW\x8d\xa0C@\xbe\xe7F\xf4\xa61\xf0\x05\xd1\x15\xccr?@OMG\xd3\x17\xb0\xbd%,H\xd9\xa7\xf8\x012i\x7f\xdaf\x0eoa\x19\xc0\xa5\xbcy(*B\xe2\xb1\xd4\xdcA\x9b}\xe4SM\x16Oq\xae\xab\xe6\x18\x0d<\xf7\xef\x9dz\x8e#\x15\xc7\x99\x00\x00\xaa\xd1#s\x8b\xce\x89D\xf0quW]\x97\xdc \x00bOsi\xdf\xb6t-d9\x1c\x5cI\x06@.\x10\x00P\x0b\xb3\x89\x97$\x0a\xa2\x95\xcdh\xcbz\xaf\x83\x9aXc)\x8fk-@!\xd1\xc9c\x89\xbc\xafn\xe35\x9ab1\x7f\x86\xcb\xd4\x98P%\x7f\xc1\x9f\xca=\xd6\x1c\x01\xb2\xd7Qo\xc3h\x12\x99\xc8\x16\xb3mk\xc0\xfc\x86c\x04x_\x0b\x00+\xf3f+\xe2`\xc7F\x8a\xd0R=\x88\xf0.\x97\xd7\xf9\xf8Ez@\x84D%\xba\xf3\x13\xa4F\xfc\xf3\xdf\xe8\xdfE^\x01\xa5\x94\x9b\xec\x07\x0a\x00{\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x0az\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00\x22\x08\x06\x00\x00\x00:G\x0b\xc2\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x09|IDATX\xc3\xb5\x98\xfb\x8f]Wu\xc7\xbf\xeb\xb1\xcf9\xf7\xdc\xb9\xf3\xf0d\xb0\xc7L\xe8\xd8L\xd2\xdaqh\x93I\x1b)U \xb8AJ\xa3\xc8}\xa0 \x91\x88\x1f@\x85&\xe2\x07\xe8\x0fU\xa5\xaaR\xe4?\xa0\xb4\x15j**\xe4\xa8T\xa0RT\x95>@ \x88\x80\xa6\x02\xac\xc8 \xd9d\xd2\x88\x89\xe3\x10\x9b\xb1=\xb6\xe7u\xef=\x8f\xfdX\xfda\x1e\x1eS\x97\x92G\xb7t\xa4\xa3\xad\xad\xb3>Z\xeb\xbb\xd7\xfe\xeeCf\x86\xff\xafA\xc7\xc1x\x0a\xc0\x97@;\x93\x0b\xd8\x0c\xf8\x14\xcc\x80\x9d\xe0\xf4V\x83\xd0q0\x0e\x83\xb0\x02\xbec\x024X8\xc7\xf8\xa5Y\x84\x15\x90N\xc0\xba]\xa4\x17V`\xb8\x1d\x86\xa7a\xf8G$\x03\xec-\x03\xd9\x0d03\x80\xfax\x9a\xc7\xd3~\x8eogJ\x03\xa24$\xe2\xf2\x9a\xb9U\x9f6\xc6Gc\xd9L\xc7\xc5;\x11\xb7a\xde4\x08\x01\x84/\x81\xb1r\x8ag\x97&e05\xd4\x9e\x16\xd2\x19\xdc\x22\xd2Y\xd6\xd4\xf4(Z\xc5\x9c\x95F\xde\xacT\x1f.{\x1f\xab\xc9\x8e\xef\x9c\xdd\x1b\xcf\xbd\x07\x01\xdfy\x93 \xf4\x01\x08\x1e<\xc5s\xcd<\xd7\xfb\xc0\xdd\x0d\xe8Xu!\x1b\x86qm\xf3\x15\x0d\xad\x88c\x16\x13\x22\xa0\x86$\x17c\x1bCW\xb5\xbd\xaamhF\xf2\xb6\xb7\xba7,^C|C t\x1c\x8c\xf7\x80\xefX\x06\xaf\x01\xd2}\xe5\x8af=\xa7DW\x5c\x8d\xdc\xc1R\xde\xa9D\x83\x13\x15\xf3|\xef\x0c\x0e\x1e\x99\xa1'c\xa2\xd5\xa7O\xbb?C\xe3\x9b\x1e\xa4Y\x1b\xe6m]\x9f\xf5\xd3\x8f\xcc\xfb\xd7\x05r\x03\xc0yH\xd7_\xd1&S\x99\x8c\x97u({\x5c\xc3\xdee\xa1*\xf2\xbct>5\xd9\x81I~\xdb{\x0f\xf2\xc7F3\x1c\x03L\x89\xc8>\xfd\x5cz\xd7\x90\xf2J\x88+\xcb|\xeb&\xa6\xeb\xe6\xe2\xa2\xd7\xd7%\xc4i\xf0\xcc\x0f\xa1\x97\xf3\x05\xe9u\x0b\x19\xd9\x08N\xb3L\xd7\xb2\xaer\x7f\x989S\xa7\x92\xe5#\xb9\x1f{\xe8\x97\xdd\x87\xde\xd6\xb5\xc7\x09V\xc2\x10A\x80\x99Q\xc3(\x0a\x8e1\xf00\xba\xcab\x7fxN1>\x17\xf4\x17\x05\x98]8'Uw]\xb2\xd1\x11\xdd\xef\xc7tX9]\x1b\xf3N\xfb\xa2.\x04Wt\xe0,\xb6\xd9\xef\x1c\xce\xdf?\xdd\x8bO0\xa5[\x00`\xa3\xc5\xf7\x9f\xbf\x90N\x1c=\xc0\x7f\x0b\x00\x94$\x83\xd4\xadT\xce\xc7n\xc1\xbd\xe8he\xe5<\xfd\xaf ;B\xbc8\xcf\xc3|I\xf2[g\xa5\xbb\xb6\xee$U\xba\xdaz'Y\xd4\xbc5G0G\x0c}\xf0\xa0\xbe{v\x22}\xd2q\x9c\x03\x80:\xd2K?Z\xb2\x13\xdf}\x8d\x16\x00\xc1\xd1\x03\x9b\x12\x90\x22\xb0\x85\x11N\xd2\x90oV\xc58p\xea\x8e\xfdO\x90\x1d\x1d<\x0a^\xc3\xbc\xc8+WtRK\xa5\xf4\xb2k\xdc\x98VmR\xeef.o\xa3\x83\xc1\xdd7\x17\x0e\x1f\xd9\xc7\x7f\x94s\xba\x17\x00b\xc2\xd2\xd9\x15z\xe6\xab?\xb6\xe7(\x92 \xc5\xad\xae\xca\x00\x80\xe4\x89\x81\xc0&D\x05\x95\xd4*\xd1\xc4\xd2\x0a\xeb\xcd \xe6\xce@\xae\x8c_\xd2\xce\xd5\xca\x8d\x8c\xe7\xda_\xad2_\x94JZg%GG\x83\xa8Gf\xb3\xb7\xdf3M\x1f\xef\xe5\xf40\xcc8\x01\xeb\x97\xfb\xf8\xdc\xbf\x9dI_\x1e\x8aX\x8c\xa6f\x80dL\x92v\xb5\xf8\x00@\x81T3\x9b\x03A\x01LMa\x07\x84\x00\x026!6\xc6/i\xdeo\xb2\xd1\xa2\xe3V\xeaA\xc1\xe3#\xae\x0c1\x03eno\x8f\xc6\xdew\xa0\xfd\xc8D'}\x90\x80\x1c\x06\xbfZ\xe3\x8b\xcf\xbe\x94\x9d\xf8I\xdf\xf7E\x94\xb9i\x94\xa4\x93\xcc5\x9c\x1a\x12\xcf\x8e\x80\xb8\x19\x87a\x06\xa0(\xcd\xa2'\xa4\x86\x08\xfbv\x81\xe08h\xfe\x11\xd0\xd2\xbf\x9f\x92\xee\xf0\xa0\x8e\x08\xdc\xa0\x8cy&y\xa1\xd5\xa0\xc8\xbaey\xec6\xff\xe8\xbe\x11|\x84\xc9\xc6\x89\xd8\xd6\x1b<\xfb\xbd\xf3\xf8\xcc\x0b\xcb\xfa\x1a[\x13\x1dkL)p\xd42r\xec\x0bR\xc9\xaa\xe0d\xad\x02\xb2\x09\xe2$\xc1\xb7\xd6\x04\x07\xdd\xcaS\xd8\xb8r\x83Fx\xed\xbb\x8b<qx\x9e\xe3\xe5\x0bZK\xe1\xb2\xd6\x17L\xbe\xf3\xc8\x9d\xee\xa1w\x8c\x85\x8f+\xd9\xad\x00Py\x9c9s\x91>\xf3\xbdWm\x01\x1a=yo\xad9/\x16\xa31\x91q \x91R8\xd6\x8a\xc8\x82\x8c\xd2N\x90h)\xa1\x93H\xbd\x11\xc1\xb0%!\xddU\x16\x84\xde\x1c\xa5\xb3g\xa5,H\x83x\xf7\xf0\xedr\xcf\x81\xc9\xecO2\xb1_\x05\x0cm\xa4\xd7^\xba\x8a\xbf\xfb\xd6\xcb8i1\x05\xb0#0\x99d\x14\x8cBp&\x1e\x00R\xe39\x1aKp\xdd\x90sT\xf3\xd1m\x83\xc4`)\xa256\xd8NJ\xb6A\xb6G\xdb.\xf1\xe4\xe8$\x07\xf1|l\xb6\xb9\xe7\xb6)|\xde\xcc\xc8@\xd5\xab+\xe9\x99\xaf\xfc8~\xb3\xad\xd9X\xc1\xc6D\xa0@\x14\x22\x029\xe3\xdaR\xea\xc5\x00\x00\x96\x099\xe2\x14\xeaZk\x15\xca3\xd9\xa5\x11oD\xce\x90p\xc3\xe0\xed\x97\xf9\xe9\xcd\xac\xa4\xfa\x02\xc5\xc15^\x1e\xd8rH\xb6\xb4\x991\xebL\x8d\xe0\xdeCS\xd9\xad\xe2\x12Y\x02\x19m\xae\xa7\xa4F\xc9\x8c{.Q4\xa3h\x86\x06\xf0>%\xe9\xba\x98\x93\xa5\x90\xae\x1b \x88\xde\xf4L\xe1\x9f\x9dp\x13\xfb\x93t\xf7\xa4\xe7\xcf\xdb\xf9\x13g\xf4w/\xf7\xe9\xe9\x04\xeaw\x1d\xcd\x1f=\x98\xfe\xe2C\xbf\xa6O\xbec\x02\x13\xdb\xeb\x0d5\x1b\x13\xa5\xc6s\xaay\xf3\x11Pd\x11m\x88\x93\x11'\x0b\xd7\xe38\x07\xf7\xf3@NM eY\x93\xd6[\xb3\xba\xdaH\xc1\xb98\xdc\xc0\xe0\x1fN\xa7g\xfe\xf5\xc5\xf8\xc1k5\xbel\x09i\xa2c\xef\xfb\xbd\xc3\xfc7\x8f\xbd\x0b\x8fM\x8e\xa0\x80*R\x1b\x98\x89\xc5\xbb\xa0\xde\x05\xed\xa8h\x8e\xe8\xdaXg\x81\x92\xa3\x90vb\xa7\xba\x16\x8b\xbb\xfa\xcan\x90m\xef\xa8?\x98\xb5N\x081\xd7,\x0c\x82\xb6\x10i\x03\xa8y\xf5Jv\xe9\x0b'\xfd\xa7\x9e}\x99?\xbc\xe1\xf1\x1c\x91\x15{\xbbx\xfc\xf1#\xf8\xdc\xfb\x0f\xf1\xb1\xceH\xca\xa2\xb1\xe6\xe8\xb8,jVG+|J\x19\xb2\xc2\x11\xb1\xe3\xfcz\xe34.\xc9\x1c\xf1\xa6G\xb9Yi\x16`cG\x90\xd6\xa6\x9a\xd8\xf6\xcb\x90\xdb\xaa'\xf8\x86\x12\xea(\xa1\xf6\xddb\xf0\xe2\xf2\xe0\xe5\x13'\xd3\x9f\xfe\xf0\xa7\xf4d\x1d\xf1#&\xdb33\x86?\xfe\xd8\xdd\xee\xf3\xc7\x0e\xd9\x03^RfNsC\x9b\x1bka\xb1*\xe0-\xd7\xc8;\x19\x91\xd8\x17\x8bD\xa9f\xb6p\x1df\xc7\x8fl[\xbe\xb9\xe7\xa0\xe5\xaf_RWe\xba\xba~-\xa7\xbc\xc8J\x0a\x0e\xd1e\xadH\xc6\x1a\x95\x9a\xa8\xc2,\xbf\xfd+\xe1\xe8\xec\x84<)\x8c\x19\x00h\x22\xfd\xe0\xf4e\xfa\xeb\xff<\x17\x173b1\x03'D\xb6@\xfc\x89\xfb\xe9k\x00\xf0\x97'\xed\xdd\x96t\xe0\xd8\x06\xd1S\xd5\x10UR\xad\xd5;\x191\xc0\xb0\x00[\xbc\x1fa\xb8\xba7\x00\xb5\xa7\xfc\x9d\xb5\xf2h\xb5\xcee5p\x18:\xa1\x81\x0c\xda*\x11\xaaJP\x7fu1\xfb\xfa3\xa7\xb3\x0f,\xad\xcb\x9f'\xa3\xd5\x5c\xec\xee\xdf\xd8o\x9f\xfd\xe8\xdd\xf4\xd4;\xc71\x13\xa3\xb9\x08s)\xdbU\x9a\xads\xa7i\xaf\x97EG\xf6\xd8\x8d\xbb\xe6\xa9-\x98}\x08\xc0\xb4\xaf\xc3y/\xf4Z3\xde\x0ejQ\xaa\xd6\x9b\xaa\xb2\xce\xe8@\x9d\x0d;\x9e\xaa\xe0C\xb3R\xfb\xea\x9f^\xc0\x17\xfe\xf9%\xf9\xfd\x95\x9a\xfe\xde`\xedH\x8e\xa3\x0f\x1d\xb2\xcf>v7}t\x7f\xaf\xe8q\x88\xd7\xe3\x84\xeb\xe1H\xcd\x94\xbbIzS7\xbfNl\x97\xe9\x81)\xd0\xf22\xb8XX\xd2~g]\xd4E\xd7\xe8\x1e\xf1Q\xb5t>\x93\x14\x94\xda\xe8\x82\x13\x0d\xca\x9a\xc56\xbb}\x9ag~sF\x9f\x18\xcb\xf1\xa0\x99Q2l\x5cX\xc5\x17o\x9d\xc0\x1f\x00\xc0_}_\xeeG\x9b\xfa\xd1a\x98Z\x1bp\xd6\xaf\xb3j\xa2\xfe\xb9\x9eu\xdb\xa1=0\x05:\x7f\x062v\x00\xb2\xf6\xca5\xcd\xc3E\xad;\x93*\xf0N\xa2(St\x84\xe8\xbc\xef8E\xca%\xf9\xe2\xae\x03v\xe8\xae\xfd\xf2D\xa9v\xd7\xeeo~\xfa?\xe2}^\xa5\xaffCO\xa8:#\xbd\xe1\xe5\xb6j\xffO\xf3L\x00\xe18\x08\x87A\xf3+\xe0\xabK\xe7dr~\x96\xd7^\x81\xe6\xe5\xba\x0e\xfbW\x9d\xcb\x9d\x96up\xe8t]\xed\x9b\xc2`y\xe6\xd8Q\xcb\xfa\xde\xdb\xfd}\xb7\xed\xe1?\xcc\x04\x07\x00\xb4\x9f:)\xf7i\xd3\x0e\xad\x1c\x1d\x0c\xd97\x94\x5c\x9d\xb2\xb5\xe6\x17v\xf17\x03\x1a=\xd8\x11We:\xf0\xaa5\xd5N\xe0]\x81\x94CR\xe6[q\xacQS\x9bqW\xa3>|\x07\xffVJ\xe8\xff\xcb\x8b\xfe\x1b\xc2\xa8V#\xd5]\xe2F(k\x9a\xff\x9az}\xd7\x89\x9f\x05\xbac\x01\xb26z^\xf6\xdc\xe2\x98\xafVnX\xe6Z\xb5!\x9b\x0c1kX\x9d\xa4\xa8\xd6!\xb2\xb0\xb9S\xa4N\x91\xc6:M\x1d\xb4M~\xa5M\xc3\xc9\xb6=8h\xf7\xae\xcc\x847|\xd3\xbbA\xd0\xdf\x01\x17X\xd2\xb5=\x03\xcdC\xa1C\xf6.\x93\x9e\x04f\xe9\xb5\xeb\x92\xb6\x1aW*{a--\xc7\xdc\xc4\xa7\xe1d;\xb2\xbf\x0d\xc3\xe7\xf7\x86\xc5\xfb\xf1\xc6An\x06t]\xd0\xd0\x8e\xfeD\x1aq\x92\x5c\x8f\xe2\xfa2\x03\x80p'\xe5e\x19\x9b\xe1h(\xc7/\xc5\xe1\xea\xde0s'\xe2\xb7\xdf\xec\xdd\xf7\x06\xa0\xad\x1d\xb6#h\xe4\xec\x0f2\x0dW7\x04\x98\xdbZ\xb5\x88r\xbc\x17\xaf\x15>\x15\x17g\xd2\xcc\x9d\x88\xdf^\x86\xe1\xd1\xb7\x10d';[\xfa\xd9.\x19\x0e\x03\xcd\xc5E\x02\x80|\xdf\x9ca\x01(\xa6a\xa7&\xb6\xac\xd1\xa3\x9b\xffG\xfe\x1b_\xd7\x0fZ#\x1f\xd2~\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x04b\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00\x22\x08\x04\x00\x00\x00\x90N\xc3I\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x03UIDATH\xc7\xa5\x96_h\x97U\x18\xc7?\xcf9o[\xb6e\xb5\xa9\x8b\xc0\xa0\xd9EC\x22b\xbf\x96T\x84\x18EI\x09-\x10!,\xbd\x0c\x8b1\x08\x93\x16\xee\x9fX\xb1\xa6\xb1\x9b\xc2\x02A\xd0\x9b@\x13$w\x91\x11\xfdQ\xb3_Hw\xb1\xbaQ\x08lak\xb5\x8c\xe9\xef\x9c\xa7\x8b\xf3\x9e\xf7\xcf~s\x9bt^8W\xef\xf9\xbc\xdf\xf3}\x9e\xf3=\xaf(\xff\x7f$7\xf2\xb2\x08 \x08\x00\x1e@\x15@\x96\xaaD\x04\x03) \x0cEQ\xd5%*\x11!\x22$\xc3x@\xf0\x82\xea\xa2JD\x88\x8fA\x00\x93!\x14\x07x\xd4,\x0c\x10\xc1`\x10\x0c\x16\x8b%\xc1\x1e\xee8{\xe8\xcc\x186U\xb7\x90'\x12\xbe\x1af\x03a\xd1p\xdb\x86]\x8d/\x91\x88v.Gq8\x14\x9f\x5c\x17\x11\x01a#\x06\xd3\xdd\xd4\xb3\xa3\xb9G\x9b\xa9\x81\x0a\x095\x04A\xe3\x0e\xe7n\xc2\xa4\x8b-\x06\x83\xc5\xb4\xdb\xcf\xb7\xbe\xf9CS\x9f6_\x1d\xff\xfa\xf1\xf0Z\xeeSR\xa7\xa0l\xa3E\x90\x13O\xae\x1a2k\xc1\x9d\x9f\x18\xd8z\x16\xaa9\x04@\x92\x12\xa0\xde\x059\xf2@\xfbp\xb2\x1e\xf4\xc2o{\xb7\x1c\x9b\x91B\xa7H\x9c\x93\x92\x06S\x020vw\xa5\xafq\x8b\x1a\xfe\x9c\x1e\xdd\xf5\xf1\xf7\xd7J\xad\x16\xd5\x90A2\x84EB\x1d^[\xbe\xb9w\xd9+,\xe3\xea\xbf\x1f}:2:\x8dAP\x94\xa2\x16\xad\xdbN\x86\xb0\x9d\x0d#\xdbo}CZEg\x8f~7\xdc{\x01\x0f\xb8\xac\xd5\xb4\x84\x88J$\x1a)X\xcc\xc9M+\x06d\x0d\xb8\xd3?\xf5\xbf|\x1e\xc5\xa7\x0a\x14\xc1e-\xa6\xf9\x9c\x94wx\xbc\xeb\xce\xbdv\x1d\xb8\x9f\x7f\xdd\xd3=\x9e.\x05\x0dg6\xb5\xdd\xa5\xcb\xcbJR\x8b\xcc\xc9\x87W\x9dR\x91\x7f&\x07{\x8eL\xb8\x0c\x10\x17\x08\xbe\xee$\xa7\xec\xc2\xb8tI/\x826\xdd\xf6\xf4\xab\xf7\x16\x8aX\xf4\xa0\xf0\xfd\xf9!\xba\xfd\xe2\xbb\x0f\xfd=\xa8\x7f5lx\xf4\x8b\xaf\xde{\xbd\xad\xd4\x0fy\x1c\xd5)\x11\xcd\x8d\xb5X\x0c\xb6w\xe5\xf3;o\xd9\xc6M\x5c\x99\xfe\xe0\xc3\xb1Of\xf0\xb8XL\xc0Bu\x0a*w\xe0\xf08<>\x87\x84\xfeH0\x18\x92}\xf7\xac\xdb\xdd\xf0\x1c09\xf5N\xdf\xa1s\xd7\xd0T\xb5\x00\xa6z\x19*-8\x5c\x01\x92\x9d\xda\xf4\xb8\x85r\x1f\xeeZ3\x94t\x81\x9f\x98\xec\x7fv<Sb\x90\xea\xef)\xc4\x07L\x0e\xc9\xd5D\x1c\xc8g\x9bV\xf6K;\xb8o~\xd9\xfd\xe2\x8f\xa9\x83R\x9d\x84J+\x8eZ\xc0\xa4\xc6\xaa\x86\xd8\xcd\xe9\xd4p\xe8\xc6\xe3;\xbafv\xeae\xfb\xd8}\xa7\xbe=\xf0\xf6\xeaR\xca\xd6W\xa7\x80\x89\x08O\x0dw\xae\xb6\xfe\xc0\xc1\x07\xaf\xbc\xaf\xb3\x8d/<u\xe6\xcb\x81m\xb7\xcfI|\xe6\xc4c\xe1^\x11,\xf1D\x0b\x16FV?\xf2\xd6\xcd\x9bU\x98\xfac\x7f\xcb\x10TZ\xa9Ek\xeb2v^P\xf0)9x\x7f\xc7`\x12r\x8dJK\x0a\xf1\xf3@2\x9b\x99\x93o&<\xc7\x9e\xb8k\xc0v\xc8lg\x1b5|\xe8\x94\x85\xd2\xbe\x08\xca\xeb\xc6Z;\xda\xad3\xcf\x9cH\x9b\xd0\xb1\xf0\xe5%\x92m,\x96=\x9a\x1aJ\x10b\xc2/r\x03\x16\x1c\x8a&K\x06\x89I\xb3\xf85Z\x00\xe5A\x1e0>^\xe9K\xfc+\xc8\x1c\x22\x9dc\xae)K\xb9\xd0\xeb\x14\x15\x87\x86?\x94\xff\x00\x102I8\xdb~\xab\xb1\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x0a\x0c\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00\x22\x08\x06\x00\x00\x00:G\x0b\xc2\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x09\x0eIDATX\xc3\xb5\x98\xdd\xabg\xd7Y\xc7\xbf\xcf\xcbZ\xfb\xe5w~\xe7w~\xe7\xe4t2\xe9\x04\xa7\xe3Ppb\x14=-\x85@\xdaP+\x88\x94\x22J\x0am\xf1\xc2bmBo\xea\x85\x08\x22\x84\xf9\x03\xd4++\x95\x92`\xa5B\xedM/\xbcPTh\x09\x88\x22\xd3\x0b\xa3\x07\x85\xd3$4\x13\xceL\xce\xcc\xfc\xde\x7f\xfbe\xbd<^\x9c\x979\x13\xc7\x9a&q\xc1\x86\xcd\xda\x8b\xfd|x\x9e\xefz\xf6wm23\xfc\x7f\x0d\xba\x0e\xc6\x0b\x00\xbe\x03:\x9b\xdc\xc7q\xc0\x17`\x06\x9c\x05\xa7\xf7\x1b\x84\xae\x83q\x0d\x84\x09\xf8\x891h\xb5\xff:\xe3\xa7.#N@:\x86\x0d\x06\xc8\xff1\x81\xe1\xc30|\x0d\x86\xbfF6\xc0\xde7\x90\xf3\x00\x97V\xd0\x90\xfe\x8d\xb7\xf2c\x9c>\xc8\x94WDyM\xc4\xf5=s\xd3\x90\x17[\x9b\xa9\xee.\xa6\x83'\x91Na\xde3\x08\x01\x84\xef\x801\xb9\xc1\x97\x0fwd\xb5\xbb\xd6\xa1\x96R\xad\x1e\x11\xa9\x8e4wCJ\xd60\xfb\xda(\x98\xd5\x1a\xe2[!\xa4f\xa7\x0a\xd5\xab\x17\xd2\xeb\x9f@\xc4\xf7\xdf#\x08}\x16\x82O\xdd\xe0\xab\xdd\x1e\xb7\x8f\x82\x07\x0b\xe8\xa8y\xd3\xaf\xe3\x96\xf6\xc5Dc/\xe2\x98\xc5\x84\x08h!\xd9\xa5\xd4\xa78P\xed\xefj\x1f\xbb\x8d\xa2\x1fN/\xc4\x83{H\xef\x0a\x84\xae\x83\xf1\x09\xf0\x13G\xe0\x19 \x83\xd7\xee\xa8\x1f:%\xba\xe3Z\x14\x0e\x96\x8b\xaa\x11\x8dNT,\xf0\xa2\xc2\x95v\x83\x9e'\xa3i\xbdt\x7f\x88.tCH7[\x17}\xdb\xbe\x1a.~z/\xfcD \x0f\x00\xdc\x84\x0c\xc2\x1d\xed\xbc\xcaNzK\xd7\xb2\xed:\x0e\xce\xc7\xa6,\x8a\xda\x85\xdc\xf9\xbe\xe4\x0f4\x03\xfe\x9d$\xf8\x0c\xcc\x14D\xf6\x81\xdb\xf9\xe7\xd6T4B\xdc\x98\x0f\xbd\x1b_l\xbb[\x07\xef\x0c\xe4\xedB\xec\x8a}\x19j)\xe3Etm\xe5\xb5\xf3Ny\x99<\x91:\x87\x5c\xac\xd8F\xdd\xb6\xfcfV\xfb\x02\xccj\x00\x09\x80\x00\xc0\xe8\x8e}\xd4\xb1\xae\x22w\x8dv\xd6,\x8d:l]n\xf5\x1d\x01\x5c\x04_\xde\x7f]\x9a\xc1\x5c\xfc\xe6\x86>\x16F\xban\x9c\xceF\xc1\xe9R\xd4\xc5\xe8\xca\x0a\xaeO\xbd\x9f\x8d\x8a\xdf\x88\x9c\x9e3\xca\x8f\xc0\x00N\xf8\xe7\xaa\xcb/\xaej\xfes\x00\xa0,\x1e\xd2\xf6\xd2\xb8\x90\x06%\x0f\x93\xa3\xc9\xe4&\xfd\xaf gB\xbc\xb5\xc7\xeb\xe2P\x8a\xc7/\xcb`6w\x92\x1b\x9d\xf6\xc1\x89OZ\xf4\xe6\x08\xe6\x88\xa1wj\xfdxp\xf9\xab@\xba\x0a\x00l\xf4_\xbe\xb5\x177\xd6\xb4\x0f\x08V\xf5q\xe6\xa5\x8clq\x83\xb3t\x14\xba\xa9\x18G\xce\x83\xd1\xff\x049\xd3\xc1\xb3\xe0\x19\xf6D^\xbb\xa3;Z+\xe5\x1f\xba\xce\x8d\xb4\xe9\xb3\xf2\xc0\xbb\xa2O\x0e\x06\xb7\x18\xc5k}\xc5\xbf\x9b\x91?\x06\x000\x1c\x16\x81^\xdaX\xda\xcb\x94H\x90\xd3IWe\x00@\x0e\xc4@d\x13\xa2\x92j\xea\x95h|8a}\x18\xc4\xd5W w\xb6nku\xb7q\x1b[\x85.\xa7\x8d\x0fe\xad\xa4\xad\xaf99Z%]o\xfa\x0f6\x15}%3\xfd*`\x0c`\xae\x11\xdf\xdc\xbc\x97\xbfK^,%S3@<\x93\xe4s->\x02P \xb7\xcc\xe6@P\x00\xbb\xbb8\x03!\x80\x80c\x88\xc5\xd6m-\x96\x9d\xdf,+7iW%om\xb8:&\x0f\xf2\xaew4Z\x8d\xfa/f\xcd\x9f3C\x01 h\xc2\xb7\xeb\xb9\x7fQbX\xb2*S\xd7)I\x95\xcdu\x9c;\x92\xc0\x8e\x8e\xf5\x0a\x10\xc3\x0c@Y\x9b\xa5@\xc8\x1d\x11\x1e=\x07\x82\xeb\xa0\xbdO\x83\x0e\xff\xe6\x86\x0c\xd6WtC\xe0Vu*\xbc\x14\xa56\xab\xb2\xf5u\xdd\x0d\xc3\xb3Q\xf0E#\xdb\x02\xd88\xe3\x1f\xeb\x06_w\xbd\xbe\xc1\xd6%aM9GNZ'NKA\xaeY\x15\x9c\xad\xd7\x93M\x03r\x92\x11z\xeb\xa2\x83\x9e\xe4).\xee<\xa0\x11\x9e\xfd\xd3\x01\x8f\xaf\xedqz\xebMm\xa5t\xbe\x0f%S\xa8\xe6;\xeeW\x82\xc6\xaf\x18\xecq\x00\xe0\x8cW\x8a\x96\xbe^/m\x1f\x9a\x82\x85`\xbd\xb9 \x96\x921\x91q$\x91Z8\xb5\x8a\xc4\x02O\xf9,H\xb2\x9cQe\xd2`D0\x9cHH\xcf\x95\x05qx\x95\xf2\xab\xafJ]\x92F\x09\xae\x1b\xcaG\xda\xca\xff~\x86\xfd<` \xa37|\x8f\xbf\x18.\xf1/\x96r\x04;\x02\x93\x89\xa7h\x14\xa33\x09\x00\x90\xbb\xc0\xc9X\xa2\x1b\xc4\x82\x93ZH\xee\x14$E\xcb\x09\xbd\xb1\xc1\xceRr\x0ar:\xfa\xfe\x90w6w8J\xe0u\xd9}\xa4/\xf0-\x98\x11@\x8d\xeb\xf3K\x1b\x8b\xf4\x0f\x08l\xa6`c\x22P$\x8a\x09\x91\x9cqk9\x0fS\x04\x00\xf3B\x8e8\xc7\xb6\xd5V\x85\x0a/\xe74\x12\x8c\xc8\x192\x1e\x18|z\xb3w\xf18+\xb9}\x93\xd2\xea\x1es\xb2#\x98\x1d\x1e?\xb5*)>\xd6\x17\xfeqq\x99,\x83\x8c\x8e\xd7SV\xa3l\xc6C\x97)\x99Q2C\x07\x84\x90\xb3\x0c\x5c*\xc8r\xcc\xf7\x0d\x10D\x1f\xda\xca\xf9\xed\x13n\xfcX\x96\xc1v\xdeX\xda\xcdz\xa1\xbf\xe6\x22}\x0dD\xcb\xcc\xb4\xb7\xda\xc8\x7f2\x19\xeb\xf3\xa1\xc2\xf8t\xbd\xa1ec\xa2\xdc\x05\xce-\x1f_\x02J,\xa2\x1dq6\xe2l\xf1~\x1c\xe7\xe0~\x1c\xc8\x8d1\xb2\xf7]\x9e\xf7fm\xb3\xc8\xd1\xb9T\xb5X\x8d\xa6\xf9\xa5\xady\xfa\x1cg|\x17@Nl\xbf\xbc\x1c\xf2\x9f-\xc6\xf8\xbc9\x94PE\xee#3\xb1\x04\x175\xb8\xa8\x95\x8a\x16H\xaeO\xad\x8f\x94\x1d\xc5|\x16;\xb7\xadX:\xd7W\xce\x83\x9czG\xfd\xc1e\xabbL\x85\xfa\xb8\x8a\xdaC\xa4\x8f\xa0N\xd6\xfe\xf6#\xb7\xc3\x1fo,\xf9\xb7\xd8\xf0\xb2\xc1\xca\xc8\xf8\xc2d\x13\xdf\x9cm\xf2g\xa8\xc8>\x19k\x81\xca\xf9\xa4\xbeMV\x86\x9c=|\xe9\x88\xd8qq\xbfq\x1a\xd7d\x8e\xf8\xd8\xa3<\xac4\xfb\xb0\xd1\xcf\x22\xcfv\xbb\xd4/\xebX\xd84\x10BG\x19m\x92\xd8\x86A\xb9\xaa\xba\xd5\x0f\xc7G\xf9\x0f\xea\x96\x9e'\xe0\xdf\x01\xdb\x8e\x8a\xdf\x9bm\xbbo\xad\xb7\xec\x99 \xd9\x9b\xd3\xc2\xd0\x17\xc6ZZjJ\x04+4\xf1YF$-\xc5\x12Qn\x99-\xde\x879\xb3\x01\xa7\x96\xef\xea\xcb\xd0\xfa\xa3\xb7\xd55^\xa7\xf3{\x05\x15\xa5\xaf):$\xe7{\x11\xcf\x9a\x94\xba\xa4\xc2,\x93Q\xfcdt\xf2\xbc\x11.\x1d\xf7\x17\xfa\x81\x8b\xf4\xa7\xf5\x22\x1dxb1\x03g$\xb6H|\xf7\x02\xfd-\x00lO\xec\xe3\x96u\xe5\xd8V)P\xd3\x115\xd2\xcc\xda\xb3\x8c\x18`\xd8\x87\x1d<\x8d\xb8\x9e^\x88@\x1b\xa8\xf8\xe9Vy\xb3\x99s\xdd\xac\x1c\xd6Nh%\xab\xbe\xc9\x84\xa6\x11\xb4[+\xffw\xa3\xb9\xff\xac\x0b\xf2Gd4\xcdl\xbf\xd8\x15\xf6\x8d\xf9\x98^h\x18\x97R2\x97`.\xfbs\xa59\xf9\xeet\xfd\xfd\xb2\xe8\xc6\xb6=\xb8k^8\x81y\x14\x11\xb8\x18\xdax3\x08\xbd\xd1m\xf5\xabV\x94\x9ay\xd74Vm\xae\xd4\xd9\xba\x0a\xd4\xc4\x10\xbb\x94B3\x9e\xe3\xaf6\x17\xf2\xeb\x92\xe9/\x09\xd6'\xc6'\x17c\xfb\xc6l\x87\xbe\x84\xa2\x1crL\xf7\xe3\xc4\xfb\xe1H\xcd\x94\x07Y\x86\xbb\x0f?N\x9c\x96\xe9\x99]\xd0\xd1\x11\xb8\xdc?\xd4e5\x17u\xc9u\xba-!\xa9\xd6.x\xc9Q\xa9O.:\xd1\xa8\xac>\xf5\xbe\xa9\xf8R7\xd0\xe7\x12\xe3S0#\x10\x16\xbe\xc3\xb7{\x8f\xdf\x06\x80\x9d{\xf24\xfa\xbcL\x0e\xeb\xdc\xdb\x8a\xfd\xb2\xf5\xcd\xb8\xfd\xb1V\xf1\xd4\xa1=\xb3\x0b\xba\xf9\x0ad\xf4!\xc8\xec\xb5{Z\xc4[\xdaV;*\x08N\x92(Sr\x84\xe4B\xa8\x9c\x22\x17\x92C\xb9\xd8\xb2\x9fiKy\xce\xc8~\xe1\xfc;wo\xa5\xa7\x82\xcaR\xcd\xd6\x81\xd0T\x1b\xc3\xf5[}\xd3\xff\x9f\x9e\x95\x00\xc2u\x10\xae\x81\xf6&\xe0\xbb\x87\xaf\xcb\xce\xdee\x9e\xbd\x06-\xea\xb9\xae\x97w\x9d+\x9c\xd6mt\xa8\x06\xae\x0d]i\xb0\xc2;v\xd4\xb3NG\xe1\xa9\xde\xf3\x97\x01|\x88\x80~4\x91\xa7\xb4\xeb\xd7Vo\xae\xd6\x1c:\xca\xae\xcd~\xd6\xbdc\x17\xff0\xa0\xcd+\x95\xb8\xc6\xeb*\xa8\xb6\xd4:Ap%r\x01\xc9>\xf4\xe2X\x93\xe6\xdesaI\xa7;\xfcK\xc4XnL\xc3\xdf\x0b\xa3\x99&j\x07\xc4\x9d\x90\xef\xba\xff\xdc\xfd\xc9\x8e\x13o\x07zb\x1f2\xdb\xbc)\xdb\x8f8\xe6\xbb\x8d[\xd7\x856}\xf4;1\xf9\x8e\xd5INj\x15\x91\xc5\xe3\x9d\x22mN4\xaa\xba6j\x9f\xc3\xa4\xcf\xeb\x9d\xbe\xbf\xb2\xea/L.\xc5w}\xd2{@\xd0\xdf\x07\x978\xd4\xd9\xf6J\x8bX\xea\x9a\x83\xf32\x94\xc8,\xc3~.\xf9\xa4q\xe5z\x18g\xf9(\x15&!\xafw\xfa\x8d\xc7\xfa\xb8\xfe\xd7\x0b\xf1\xe0i\xbc{\x90\x87\x01\xdd\x174\xb4\xd2\x1fI'N\xb2\x1bR\x9a\x1f1\x00\x08W\xb9\xa8\xeb\xd4\xad7c\xbdu;\xad\xa7\x17\xe2\xa5'\x91\xbe\xf7^\xcf\xbe\x0f\x00\x9d\xec\xb03A\xa3\xe0p\x85i=]\x08p\xf5d\xd5\x01\xea\xada\xbaW\x86\x5c\xde\xba\x94/=\x89\xf4\xbd#\x18\x9e}\x1fA\xce\xb2s\xa2\x9f\xd3\x92\xe1\x1a\xd0\xdd: \x00(\x1e\xbdj\xd8\x07\xca\x8b\xb0\x1b\xe3\x13k\xf4\xec\xf1\xff\x91\xff\x06b6\x13s\x15!\xbe\xb6\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x02\xba\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00$\x08\x04\x00\x00\x00F\x17 T\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x01\xadIDATH\xc7\xdd\xd5]O\x13Q\x10\x06\xe0w\xce\xe9\x16*\xad\x82M\x9aHBh\xa1\xf2\x91&\x86\xba\xad\xc1\x12-\x1f\xe1'\xf8+\xf9\x0fP$\xa8\xb4\xac\x92*\x1b\xa1_\xe2\x8d4R\x12[)\x81\xee\xeep-\xdd\xb6\xcb.\x17\xea\xdc\xce\xe4\xc9\xe4=\x93\x1cbx/q\x0f\xc6\x7f\x8dh\x8a\xa6xF8\xcb\xeb\x07O7\xa47$\xc0\xb23\x17[\xf94\xee5\x93&\x07\x0cu\x7f)7\xea\x01I\xbf\xf5\x15\xf9\x9a\x1f\x8f\xbc*,\xe4\x86\xddn\xc2\xc9\x13\xb9\xe9\xab0c\x22\xb0\xba\xe7(!\xdb'V;I}x\x8b\xeaB\x8a\xb9\xd8\xca\xee\xc0\x84z\xde\xc9\xb3\x8bT^\xbc7[\x1c\xf0\xab\x85\x8c\xf6\xc8\x15\x02\x00\xea\xd9\xe2\xb6\xf9\x99\xaf\x11\xb6^\x17\x16\xcaC\xae\x10\x00\xbc\xf8Mn\xa2\xca\x8c\x89\xc6\xda\xc7\xb8}B\x0e\xce^\xed\xa4\x0f\xdb9\xaa\x0bi\xceG\x97\xb5'\xae\x10\x00X\xfe\x9d\xca\xfb>P\x0b\x0f\xacT!S\x1cq\x85\x00@\xf2gm\x87\xce\x01\x84\x8d\xe9?;>\xe7H12\x95\xb0\x82\x00\x9fq\xd9\x15\xa2\x07/\x13V\x04\x90\x17\xa6\xfe\xe2\xf4v\xd7\x01\xa2\xfb\xdb3V\x94\x88\x0c:~^\x83\xd5=1\x08\xa1|\x94f\xa1\x10\xe4\xc9\xc3\xa3\xf8\x95\xfdP_\xe4]D&D\x10@c\xecK\xbc\xd9{\xae'\xa2\x07\x9b\x09%\x02\xa0-t\xf5G\xffum\x11M\xb1f8&\x89\x8cN\xe9e\xd5.\x85A\x08\x1dL\xd2,\xfc\x04\xfe>\xf6\xb5W\x0a\x03\x90\xfd,\x87\x004\xc4\xa1\xfa\xcb\x09`\x8bp\xc8I\x0a}\x10\xba\x84\x22J\x95\xda\x1b\xf3.\x04@|\x9b4\xee\x06t#.\xeb/\xfd\x8b\xff}\xe4\x06\xbe~\x90U@\xcb\xd0\xa5\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x04-\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00$\x08\x04\x00\x00\x00F\x17 T\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x03 IDATH\xc7\xadVKHUA\x18\xfe\xfe9GJ$RZ\xe4\x22\x15zl\x22{\x80\xa4BA\x04mL0\x14CW\x92\x95\xa1`\x0a\x81\xa0H\xe2\xabv=\xa0\x17\x15h\xa0\xb5(zh-\xa2\x16e\x8aE\x97\xc0\x84vQ]%\xd0\x02_WJ\xe1\xce\xdf\xe2\xcc\x9c3s\xbd]/\xd4\x1c\x0e\xe7\xdesf\xbe\xf9\xe6\xfb\xbf\xff\x9f!\xc6\xbf7\xf1\x1f0\xe0\xea\x1fD\x00H\xfda\x00\xe0\xa4I\x12\x9b\x00\xa4`X\xdf\xc9\x01i&\xe4_\x9a\x0b\x83=\xe4\xd5\x81\x5c\x80\xbc\xc1B\xdd\x01\x88\xf4\xa0hU\x18\xa1X\x08\x10\xc4p\xe3H[S\x06\x1c\xe3\x12\x10 \x12D\x89@4\x0b\x01\x01\x11\x9a\x87\x83\x9fs\xdd\x8dw\xc6\xa3`HH\xc5F&V(\x80p\xe0\x84\xe6\xbd\x97\xd1O\x93\xcdeC\x0aD\x06\x0b\x03\xc7WHX\x8c\x00LV\xf37g{\xce\x93\xd1\xfe+[\xfd%9\x9a+(\xde\xc2\x84\x11\x17\x02\x80#\xcf\xea\xf6\xcft!\x92RT8:\xdcY\xbf^A8>P\x1c\x85L\xc7z\x9f\xe8\xfd\xf2\xa1+\xf7\x0b~\xdd\x85\xbb\xb6\xbe\xea\xc3\xcb\xea\xcd6\x1f\x07\x04\x22\x8b\x11\xa9\x0f\x02\x0e\xdc\xd0\x0c\x90\xb7Q\xdb\xedV\xee\xce.\xa7\x10\xe0\xf1\x89\x96\xd2!\xa5\x8c\xa5\x90\xd6GX,\x02\x9b1\xe4\xc9\xb1\xfc\xe2\xa9c\x1c\xa6\xdc\xec\xc1\xd1\xfe\xab[\xac\xc0\x93\xc7\xc7\xf4I`t\x0fF\xc7D\x1e~\xdc\xb97\xd2I\x91\x94\xe2\x82wo:\xea\xd2\xe1\x06\xda\xc4\xd7\xc4k:\xb0Q\xef9\xb0t\xe0\xe2\x83\xfc\xa5{HIm\xa8\x0e=\xaf\xca\xd60\x06\x172\x04\x13\xa19 o\x83\xbff\x80\x03#\xde\xdc\x95\xdb\x95\x92\x0f\xc8\xf1\x89\xe6\xb2\xd7\x88\xaaI\x98\xd9d\xc21\x9aX\x16\x03j>\x16\x96\x84kxB\xe4\xe6<}U\xab\x12\x85\xfc\x04\x8cil\x00\x99\xe0\x94F\xe4\xb2 \x00,a9e%\x88\xed\x1b\x7f\xb6\xdb{vt\xbay@t\xecKs\xc5\x88\xdd\xd1\x8d;T@\x82\xc0\x1a\xa8#\xf3\xe0\xd9\xd4r&9\xf5\xe3\x5cE\xffB\xd4\xd0,\x06D\xcf) U\xd4\x18\x0c\xaaL=uz]\x03\xa7\xf1\xef\xc5\x1b\x97/=\x8c\x18i\xc9\x89\x98\x88@\x97\x17\xa5\xe9\xed\x94\xc5X\x1a\x18ik\x0a+\xb9\xa3A\xfc<\xcf\xba\x8aTP\xa6\x09\xe4q\xe8\xdb\xbd\xad\xdb\xc9\x07\xa2c\xe1\xe6\xf2\xb7`@[0\x96\x8bf\xc2\x06\x13\x00-\x99E\xad\xa9G\x99xj\xb6\xebx\x7f8\x08\xb9\x95?\xcc\x7f]\xce\xbe5\xed\xb5\xe9\xf5\x9c\x86\xa5\xc5\xeb\xbd\x17z\x16\xb0\x12\xc2J?\x0db8\xe2Q\xc9\xa6V\xcab,\x0f\x8e\xb6\x9d\xf9j\x94Gi\x19\xd0\xaap\xe4\x1b\xdf\x81\x1b\x9aU\xe93\xfe\xb9\xb5rD\x89\x18\x0b\x11\xa7\xd6\x06L\xbc!\x0e\xa6\xa7\xcf\x9f\xe8\xfbn\x0b\x18$@\xdcb\xedB\xef1\x04\x19i\xa1\x8c\xdek=\x11_\x85\xa4\xca4@\x0c\x12A\xae\xfa\x09\x19(!\x13\x03\x98>aH5\xd4\x06Q\xef\x13\xef\x81:\xc4\xd2\xc8\x17\x0d\x92@\x85\x15\xcbQ\xbb\xb1\xb1\xf7\x18\xe5 \xa9\x03\x06y}\xac\xd3\x89\xe6\x92\xf4\x09\x85\xcc~\xbaz'\x7f\xbc\xf1\xda\x1f\x04\xff\xcbh,\x0do\xe9\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x04p\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00'\x00\x00\x00$\x08\x04\x00\x00\x00\xa0>\xeb\x10\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x02bKGD\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x03cIDATH\xc7\x85\x96\xcbKTQ\x1c\xc7\xbf\xbf3w\x0cM\xa2M1\xb6\x90\x5c\xb5\xa861 m2#_\x90P\xb6\xb1\x84\x16\xd6\xa6lS\x04\xad\xb2\xa0\xc4\xfe\x80\x82\xa2$R\x84$I\x93\x01cL\x0a\x0a,\x19\x82\x16-\x22\xa4\x08\x22#{Q>\x1ag\xce\xaf\xc5=\xcf;\xd7\xe9^\xe6\xce\xbd\xf7\xfc\xce\xe7\xfe\xde\xe7\x10\xa3\xfcA\x14\xfe\xf3\xff\x04Ci^c\xba}\x01\xc0\x13*\x07\xf6p\x06E \x05\xf28\x00dy\xa0\x83S0\xa1pdt\xb3\xdaI\x00\x5c\x0e\x19D\x9e\x05\x08BAED7VH\x01@\x12\xc5\x01\x8dvD\x06&\x14\x8c\x1cs\xa5\x02JH\xb0\xba\x8b\xd1Px\xf7dp\x01\x12H \x81\x00\x01\x82\xe9\x93\xb9\xb9g\xe7\x91\x80\x80PW\x82\x88\x09\x9b\xd6\x8e\xc8\xa0\x12/\xc6\x82f=\xfcw\xaa\xeb\xd8P_e7\x00\xe4\xef_:\x9d]\x814g\x8c\x86\x16'\xd4\x99\xc8\xfdv\x05V\x9f$\x1b\xb1\xb2xc\xfd\x09T\x17^\x8e\x1f\xbd\xba\xe0\xe1\x22a\x11\x11mE\xe8\xaft*\x9dJ\xd7\x00@\xb2\x91\x17^w4\xf4\xcf\x1e\x90\x9f\x82\xfa\x8e\xe9;\xdb\xcc\x87I]\x1d\xa3}\xdf\xb9\xf1T\x22\xc5\xb7\x93\xad\xc7s\x90\xa7\xde\x8c5\xcbWb\xeb\x8e\xc7\x13\x8d\x10\xca\xb3\x1al\x80\xc21\xd5\x22\xd5\xb14\xb4\xfc\xe0Z[\xef\x87\xd0\xb8\xfe\xf9+\xed\xf9\x87\xb4a\xcb\xe8t\xb7\x0aJ\x88t\xc2BlqA\xf8\xcb}\x07\xd2)\xb0J\x0d\x86\xb4E\xb6\x11\x13\xbdUg\x80\xe5\xeb]\x17>\x16K\xc3\x22\xe0\x9am\x8d\x0d\x0b\x8a!Qt\xa6\xe0'\xf6\x5c\xfe\xdaC\xf9\xca\x9e\x91\xe1\xcejc\xacN~\xa5\xa6S\x09\xa3{\x01\x14\x0cL\x9a\xe4\xd5\xe5\xc5m\xf7\xde\x1d\xc6\x8fd\xdb\xd9G}\xb5\xc6\x5c\xd7w \x0d\xcb\xb4\xd4\x0d\x03\x8b\xb7\x95\xa9\x1a\x06\x85W\xd5\xdb9\xf3\xb4E\xce\x89\x9d-\xd9\xbb\xbb\x5c\x0d\x89\xdc8\x8a\xc9\x83\xa9A^\xf7\xe7V\xc3E\xaf\x9cB\x88W\x01\xe7\xde\xdfl]}\x8e\x9a\xed\x99L\xbb6\x14\xe4\xa6\x05\x8d\xd7o\x1a@\x12\xa8\xa8S\xae'\x03\x12\xaaa\xd9\xb6E\x03\xbf8\x0f\xa0\xaaf0\xd3d\xd3\xcb\x1a\x0bf,\x01@\xc5~g\x9aP\x9eqRB\x03+\xf6\x01\x00/\x17a\xdf:\x0d\xea\xd0,j!r\xdf\xd4\x07\x18\x0413\x92l\xf2Jnj\xf7\x11\xf79\xbd\x19E7\x914\xce\xb8\xd9V3\x00\xf2a@\xb2)\xd2\xa7#\xf3\x02\xef%;(3)\x9d\xd2\xc2\xb9y\x00B\xf93\x06\xc9\x1c\xac\xf1\x1dW\xdc\xefj\x14y\xb6\xaa0\x10\x00\xcc\xc4\xaa\x0a\x84\xca\xb1rG\x14\xe6\xa9\xe1\xfaN\xaf\x03\xa5k\x98\x8fc\x0f\x176~\x15\x0ek\xac\x04\x8cv\x1ccP\xdc=\x0c,\xa2\x9d\x1e\x1218\x89\xb5\x17j\x0b\xd3\xbeCX\x9dd\x86\x91\xfb\x12\x99\xe2\xe0r\x9fc\x80\xa6\x89\xd9\x06\xa5\xaa\xb4\x90\xf5\xa5\xf3Y\x14!Q@\x012fLZ\x14\xb3]zl\xd7\x0a\xf4\x0a`L`\xe3\x1b\xe1\xec\x0fB\x05\x0a\x90\x90(\x02\x90,\xe3BQ0\x0b\xb7N\x03\xe9\x8c\xba\x0d\x96m[\xd5\x1a\xda]@(\xa8\xd7\xa7\xf8\xc8E\xb7\x1a\xce\xf2\xc8\xd2\x8f,\x83 \x11\xe6\x9cT&\xb1\xcdwG\xc6\x1d\x93\xbaG+\xa5\xbc\x1d\x94\xeejn\x9a\xf8\xb5\x5cZ\x13\xac5\x8b\xe0\x8c\xc9(\xc1y\x22\xd11v\x0a\x93J34\xba\x91qw!\xfeX\xe9\x0e\xea\x1fU\xec\x8e%\xab\x96H\xd7\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x06\xe0\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x22\x00\x00\x00$\x08\x03\x00\x00\x00\xdb\xc0\x18\xed\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x02\x13PLTE\xff\xff\xff\x00\xff\xff\x00\x80\xff\x00\xaa\xff3\x99\xff+\xaa\xff$\x92\xff\x00\x80\xff\x1c\x8e\xe3.\x8b\xe8'\x9d\xeb+\x95\xea\x1a\x99\xe6 \x9f\xdf\x22\x99\xee+\x8e\xe3$\x92\xe7#\x97\xe8&\x99\xe6 \x8f\xef'\x93\xe2+\x91\xe6)\x94\xe6&\x97\xe3+\x95\xea(\x94\xe4$\x92\xe4\x8b\xc4\xe4\x8d\xc7\xe4L\xa5\xe3+\x92\xe1-\x93\xe6)\x91\xe3-\x96\xe1,\x90\xe9-\x96\xe1$\x92\xed+\x95\xe3\x9b\xcd\xe4\x98\xcd\xe3\x81\xc0\xe4/\x97\xe3*\x92\xe5)\x91\xe2(\x94\xe4(\x8f\xe7)\x8f\xe0'\x93\xe8*\x94\xe1\x94\xcb\xe3n\xb9\xe3*\x94\xe3+\x95\xe4,\x95\xe6s\xb7\xe4\x96\xcb\xe3\x90\xc8\xe4X\xad\xe7)\x94\xe6,\x93\xe2,\x94\xe16\x97\xe6~\xbf\xe2\x99\xcd\xe4\x9a\xcd\xe3\x89\xc5\xe5C\xa3\xe6(\x93\xe3+\x95\xe2+\x92\xe1+\x93\xe2I\xa3\xe6\x89\xc5\xe3\x9a\xce\xe4\x98\xcc\xe4\x80\xc0\xe2/\x97\xe5,\x92\xe2+\x92\xe3,\x92\xe4*\x93\xe3+\x93\xe2a\xb2\xe6\x93\xc9\xe4\x95\xcb\xe4r\xba\xe4'\x90\xe5,\x95\xe5+\x91\xe3,\x92\xe2,\x94\xe1+\x93\xe4-\x92\xe3+\x95\xe1x\xbd\xe4\x97\xcc\xe3\x90\xc8\xe3\x5c\xaf\xe6*\x94\xe4,\x93\xe3)\x94\xe2(\x94\xe45\x98\xe6\x85\xc3\xe4\x87\xc4\xe3C\xa5\xe7+\x91\xe4*\x92\xe2,\x91\xe5+\x93\xe1N\xa8\xe6\x8c\xc5\xe3\x9b\xce\xe4~\xbf\xe5)\x92\xe4]\xae\xe3\x92\xc9\xe3\x95\xca\xe4q\xb9\xe6+\x92\xe4(\x91\xe1p\xb8\xe3\x97\xcc\xe5\x85\xc3\xe3,\x90\xe3)\x93\xe2r\xb8\xe4\x96\xcc\xe4\x82\xc3\xe5`\xae\xe4\x91\xca\xe4\x94\xc9\xe4k\xb6\xe2N\xa5\xe4\x8b\xc6\xe4\x97\xcb\xe3x\xbc\xe6=\x9c\xe5\x86\xc2\xe5\x99\xcd\xe4\x9a\xcd\xe2\x83\xc2\xe4?\x9f\xe5)\x92\xe1{\xbc\xe4\x97\xcb\xe3\x8e\xc7\xe3U\xaa\xe5e\xb1\xe3\x93\xca\xe3\x94\xca\xe4k\xb6\xe4)\x94\xe3J\xa2\xe6\x8c\xc5\xe4\x97\xcc\xe3}\xbe\xe4-\x94\xe45\x98\xe3\x7f\xbf\xe3\x99\xcc\xe3\x9a\xce\xe3\x86\xc2\xe3=\xa0\xe4r\xb6\xe3\x96\xcc\xe4\x8c\xc7\xe4R\xaa\xe6\x94\xca\xe4j\xb2\xe5\x97\xcc\xe3z\xbd\xe6.\x94\xe4\x85\xc2\xe3\x86\xc5\xe5\x9a\xcd\xe3\xff\xff\xffU\xe0rt\x00\x00\x00\xaftRNS\x00\x01\x02\x03\x05\x06\x07\x04\x09\x0b\x0d\x0c\x0a\x08\x0f\x12\x15\x16\x14\x10\x1a\x1e\x1f\x1b\x18\x13\x1c\x86\x966*(%\x22\x17\x11\x0e$\xfc\xee\x8661,& \x19!+\xdcm70)\x83\xe7\xc3T24LQ\xa0\xf5\xfa\xa4=-5MN[\xb8\xfd\xed\x851#6KIGg\xd0\xd9g'\x1dHFEB?<{\xe6\xbfPC@>9>\x98\xa4AA=:;R\xb8\xfe\x888n\xd4\xdaf/3\x89\xe8\x88.P\x8d\xea\x87r\xd7\xd9iU\xbb\xed\x8c;\x9a\xf6\xf9\xa7MDz\xe7\xc0We\xd2\xd8iJZ\xba\xec\x859R\xa3\xf7\xf9\xa4C\x89\xe9\xc3Z\xdct\xee\x8cC\x8a\x9ay\x9btY\x00\x00\x00\x01bKGD\x00\x88\x05\x1dH\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\x07\xe1\x03\x0e\x10\x10\x17c\x84[\x82\x00\x00\x02\xfaIDAT8\xcb\x8dT\xf7w\x12a\x10\xf4\xfaq\x05\x0e\x8e\x16\xd4\xe3BQ\x03G@\x01\xcb\x11+\xc4\x0e\xc6F\x12\x93\xd8\x12,1h\xc4BT\xec\xbd\xf7\xde{w\xffE\xbf\x03\xa3\x90\xf2\x9e\xfb\xf3\xbc\xdd\xd9\x9d\x99\x9d2\xe5\xff\x0a\xc3pT\x1869\x00'H\x8a\xa2)\x92!\xf0\x89Q\x18A\xd2\xac\x89\xe38^\x10)\x06\x9f\x08\x82\x93\xa2\xc9l\x91\xac\x92\xcdb\xe6E\x92\x18\xdf\x08cD^\x96\xec\x0e\xa7\xd3\xe1r7\x99\x05\x9a\x197\x0d\xa7\x04\xd9\xea\x99:m\xba\xe2U\x9b=>?\xc7RcA\x84\x18\xb0y\x823`\xe6\xac\x96PX\x8b\xb4\xdad^\xa4\x88\x06J\x8c\xe0o\x8d\xc6\x00\xd5\xec9\xf1D\xb2\xd9\x83\xa6\x99\x1a)\x91|\x93GK\x00\xcc\x9d\x070\x7f\x81\x1eS#.\xab%\xd0@\x89\xe2$\x877\x05\xd0\xb6p\xd1bX\xb2tY:\x19t\xda\xa5\x06JT\xc0\xeaT2\x00\xed\xcb\xdbW\xac\x5c\x05\xab\xd7\xac\x0d{\xb3\x8e*\xa5\xd1i\xb4\xd9\x17Qr\xa8K\xdb\xba\x8e\xf5\x1b6\x02l\xda\x9c\x08\xe7\x9b;\xddM\x01\xe1\xcf%i\xb3;jt\xe9\xe8\xea\xde\xd2\xd3\xdb\xb7u\x1b\xc0\xf6\x1d\xa1t>\xea\x92\xcc\x02U\xedC\xcb\xee\x88\x82\xb8t\xef\xec\x1f\xe8+\xe4r\xbbv#J{\xf6\xea\xb1\xa0G\x0a\xb0\xa4\xd1FD\x90\xa4\x0e0\xb8o(\x9e\xd2\x13\xa1Lq\xff\x81aX}\xb0%\x1dt5\xf14Q\x838\xbd!\x80\xbeR*\x91\x8e)a}h\xb0\xfb\xd0a\x80#G\x95\x88\xd5,2X\x0d\x92/\x03\x14F\xca1\xaf\xa6y\xcb\xa5\xc1\xae\xb6\xe5\xc7\x8e\x03\x9c\x08\xda\xfdB=$\xae\xa7\x93Z0\x98\xaf H\xfb\xc9S\xa7\x01\xce\xa8.\x8b\x89\xac\x83\x94\xf4\x8a\x92W\xd5j\x97\xb3\xe7\x00\xce_H\xa8v\x8b\xf0\x17\x82\x04(\xe6\xf4J,\xe9\x8d\x85\x0a\x17/\x0d\xc3\xe5+\xfd\xf1p\xd4-\xb3\xa3\x83\xbch\xa3\xdeb\x09-T)_\xbdv\x1dn\xdc\xbc\xd5_Hh\x9d6\xae\xba\xd1\xe8]n\x0f\xa2\xb3\xc4Sw\xee\x02\xdc\xbb?P\xcc\x95\xf3N\x9f,Px\xddu\xbb\xbao\xf7\xf4?x\x08\xf0\xe8\xf1P)\x93\x88\xa9\x0e\x9f\x9f\xa7\x19\xac\x06\xa9j\xb4\xeeI\xc7\xd3g\xc3\xf0\xfc\xc5\xcb\xdcHY\xd1\x90%\x0c!k\x1a\x05\x90\x8c\x86\xd2\xaf^\xbf\x81\xb7\xef\xdeg\xd0}\xb4\xa8\xc7W\xe7\x19\x8a\xb3:\x92\x88\xcb\x87\x8f\x00\x9f>\x17S5\x99m\xf5\xce#y[g^7\x8c\xf9\xe5kO_\xa6b\x98E\x92y\xb6.R\xa4\xc9b\xcf\xa6g\xc0\xb7\xef?z\x87Ra\xd5\xe9\xb2\xfa\xb9\xc6\xa80\xac\xd9\xea\xd0~\xfez_@:*Y\x83\x84\x89n\x0c\x1cN\xf3~\xb7S\x0bW*\xe1\xa4\x1a\xb1\xdb\xc6\xda\xdfH#\xc9r\x16_g4\x9b\x8dVg\xb0\xe3s\x8d\x11\x14\xcb\xf9%wk\xabO\x1a\x13\x8e\x7f\x93\x18J4\x05dY\x0ep\xc2\x84\xa970\xe8\xbd\x88,+\xa2\x0fCL\xf8;jO\x8a@\x85O\xf2\x80~\x03J\x0d\xc2\x1dT\x99\x06\x92\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82\x00\x00\x0c\xaa\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00'\x00\x00\x00$\x08\x06\x00\x00\x00\x0a7#\x9b\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z%\x00\x00\x80\x83\x00\x00\xf9\xff\x00\x00\x80\xe9\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17o\x92_\xc5F\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x0b\xacIDATX\xc3\x9d\x98]le\xd7U\xc7\xffk\xad\xbd\xcf\xc7\xf5\xd7xbgb\xd5\xc9L\x13\x13\x90Gi\x89F\x91\x92&\xa1\x01Q\x11!\x85\x82\xaa\x19\xa9}\xa8\xd4\x17T\xa8\xda(U\x1ex\x1b\x0dj\xe1\x01!5\xc0\x0b\x0d\x02\x1e\x88*%\xa8\x15\xed\x03\x04*1Q\x80\xa6ACI\xc8\xb8\xa15%\x13\x1c\x9c\x19gl\x8f\xed\xeb{\xce\xd9{\xad\xc5\xc3\xb5\xaf=\x99I\x94r\xa4\xab{u\xf7Y{\xfd\xf6\x7f\xed\xb5\xf6\x07\xb9;>\xc8C\x00\xdd\xb4\xe1\xdc\xbb\xfe?\x8b\xeb:t\xe0\x839\xb8\x99\xcf\xf7\x82\x1b\xc1\xec9?\xbd8\xfc^[\x02m\xcf\x81\x9a\xd5\xa5a\xfb\xe2\xe2\x9e\xc5\x12\x00\xa0\xdaXt\x5c\x00\xee\xfce\xd8sK{`g\xe1\xff\x1f\xc8\x9b\xc2\x11@8\x07z\x04\xe0\xed9\xd0\xb5v\x99\xf3z\xa0n\xaed\xad\x99\x8e\xacn2p\x0b\xb4f\xb2r\x93\x00 nN\x1a\x00\xac\x8f\xbb\xc70k<\x0d\xaf\xde^\xb6\xa9r\xc1.|\x17\x86ga?\xad\x927\xc0\x8d\xc0>\x0e^[\x03_[Y\x91\xb6,\xe5\x8e\x10\xa4\x1bgN\x1b\xccI\xaeHe\xc2\xc0\xd8!\xcb>vS\xcf\x85\xcd\x02\xabU)\xe9[\xc5\x89\x5c\xceB\xab\xb7\x97m~}A\xcf\x03\xf6\xd3\xa8xS\xb8G\xceC\xd6\xd6\xc0\x1b\x1b\xab\xe1\xf6\xb6\x0c\xd78\xc66\x0fB\xb4.D\x11\xd1\x828:\xb35\x1d\xef\xdbqUX\xa7\x03g2+\xba\xc9\xbc\xc5\x9acV\xedI\x9bW\xf3\x89T\xcf@O\x9c@>\xff\xc2\x07\x07\xbc\x0e\x8e\x00\xc2\x19\xf0\xc9\x93\x90\x8d\xb9\xd50\xb71\x88\xdb\xd3u\xac\xfbZ6Q\x8b\xc0=a\xcb!\x07\x0e\xd2&\xf6\x98\x87p\x12=7\xeeLnbAs\x1c\xa8\xbb\xa4*\x8dw[\xbc\x95{\x16\xd3\xe5\xa9*U\xd7\x9a|ll>_X\x85~\x10\xc0\x1b\xe0N}\x1d\xe1j\x01\x09\xdb\xebE\x98\x1a\xc4z\xab,Sa\xb5\xb7VB\x9a\x82L\x82:\x07&\x15wb\x00 r;s\x0f}\xea\xd88\x7fv\xbd\xc1\xb3\xcf\xbc\x82\xaf\xbbKr\xcd\x1dD:\xc4\xae\xd3\xed\x22M\x17e\xf7\xd6mG\xd3\x14\xa0\x17\x9f\x83\xe2Y\xd8\xfb\x01^\x0fw\x06\xb2\xf09\x84k\xff\xbd\x16om\xdbb\x87\xaa\xb2\xc4n\xfd\xc5\x8f\xf1_\x96\x01\x0f\xbf\xdbx\xa7\xa3\x97\xff\xe2\x159\xf7\x99\x93\xfa\xf9[z\xfe\xd8h\xf6\xb5x\xfe\xd9\xd7\xf9w7\x92l\x17\xaa]\xab\xd2U)u\x831i'6\x06iEv\xf2\xcc\xf1\x8f\xa4\xd9%\xd8\xf9\xb3\xd0\xf7J\x94\xeb\xe1\x9e\x83\xcc\xaf\xac\x143\x94\xcb\xed\xaa.\x0a\xdd\xad\xd9d\xec\xf1\x07\xf9\xe2{\x8dn\xa7\xa5\x1f\x8c\x97~/\x80\xee\xf2\x0e}\xeb\xd6q<F\xf0^\x97\xe9\xd5\xbf\xff/z\xf2\x87\x97\xbb\xb5\x12\xd46Rw=\x84\xb6\xdfnt\x133\xb7t\xab\xef\xb4i\xa2\xdc\xce\xef\x97(#\xb8\xfd\x90\xae\xd4\x97\x8b\x99.\x95yPU\xeaV3\xd2\xf8\x93\x0f\xfa\xbf\x03\xc0\x1f}\x8f\x1eS\xb7\xc0j\xf2\xf8\xc3\xf2\xd7\xfb\x9d\x98\xd3\xe6\xcbo\xe1+/\xbd\xe9K\xf7\xce\xf9\xf1\x87N\xf09!\xbfU\x1do}\xffMz\xe2_W\xf1c\xa8t\x90\xdc\x11\xb8\x1d\xb0\xb4=o\xd3\x95\xfe\x1d\xddD\x89<\x7f\x0f\xf4f\x89\xc2\x87I\x9bU\xd0\xc4\xe6\xb64)\x86`)\xf4,\x872p\x18Ah\x12!\x22\x8a2\xea\xa0S\xbc\xf9\xb7?\xb2/\x7f\xffM{\x8d\x95\xf3\xab\xff+\xcb\xdf~\x1d_h\x15\xaf\x0b\xe1C\xf7\xdf\x81?\xff\x95\xbb\xe8\xc1\x80\xb6\xb4\xec\x95\xe6X\x15\xfd\xddz\xdb\xebrfz\xa5\xdc\x1c{\xa7X\xfe\xc1J<5\x07\xc19\xd0\xe1\x95\xe8\x00\xee\x0c\xb8\x7f\x1c<\xae3\x5c4\x8d\xa4\x98B'M\xa1\xa6\xe1\x00_@`\xa3\xec\xba\xbe\xcb\xcfo6x\xe1\xd9\x8bx\xe2\xc7k\xfc\xa6:5\x1a\xb4\xcd\xac\xdd\xa5u\xbe\xfc\x8d\xd7\xea/\xec&\xfaG&\x1f\xff\xb9Y\xff\xdao|4\x9e\x89\x12\x0a\xe7\xb6\x8a\xbd\xb2*m\xb7\xce\x83\xaa:\xba\x91\xca\x0f\x85^\xbc<\x8dp\x12\x088\x03\xde\x07$w\x1f\xd5\xb6\x1f\xfe\xcf\xe5r\xea\x8a\xd5E\xed5'\xf42\xa3GNc\x8f?\xa4/\x02\xc0S/\xfa'\xc1\xee\xc6\xac\xec\xaeDn9Y\x0a\x05u\xaeeN\x02\x0f)s`\x22\x00p\x06}\xe6\xe7\xf1\xf9[j\xff,\x00l6\xf8\xc63\xaf\x86\xaf\xe5\xa6\xe9\x08e\xdb\xa4\xdc\x8d\x05j\xf6\x13\xe5rQtS[\xf3z\xf1\xe20\x93G\xca\xad\xbd\x00\x9e\xd8\xdc\x96\x14\x1a\xc9\xcc\x92C\x0ed\x1a\x88\xdb\x91r\x14\xd8\x9c8\x8byF\xb6\xa4\x99\xda\xa2\x8cM\xceE\x0bm\xba\xd85\x09\xac]\xe7\x9a\x1a3U\xb8=s\x81\xfe\xf4\xd2\x86\xff\x1e\x80t\xa4\xc2\xa7?w\xaf\xfe\xe1\xf4\x91p\x848\xf5\x8a^\xact\xac\xa8\xaa\xd6\xaa\xed\xe9:\x8eM\xcd\x87\xfeq\xf0#\xbf=T\x8e\x0fB\xfa\xc60\xa42!b9(Wb\x05\xcb/.\x14\xf7\x01\x00\x9cT\xd5\x8d\xc9r\xa6\xd8\xa1(\xbaXp\x97\x8c\xbb\x10\x9b\xe4\xb1J\x1e\xab$$Y\xa8\xca\x81%Sv#s\xff\xd6\x12\xfe\xee\x95\xb7\xe5Isl\xf5\xa2?\xf4\xe9E<}\xd7mt;{\xaa\xb5i\xeb&\xc4Bvc\x0c\xd7Vb\x7fw)\xac\xbd\x00\xc69\x0c\x8b(N\x03\xdd\xa5\x92\xd3\xc4\x0eG\xee\x84M\x02\xdb \xfc\xea\x9d\xfe\x0b\xf7\x1c\xb3\xaf\x00\xc0\xda\xc0\xbf\xc3\xec\xea\xc9U\xb8\xcbP\xed\x92q'\xdcdx\x95\xb2\xbb2\xb5f\x1e\x94\xa93\x92\xce\xb3\xc0\xb3\xc0I\x82\x9f_\xb6\xff\xf8\xeer\xf8bRZ\x89\x01\x0b\x8f\xde\xc5O\xdf?O\x1f\x8d\x12\x8a\xc2\xb5D\xdc.\x9a:\x86\xa9\xa9E\xee\x1f\x7f\x83q\x11\xc4\x04\xd0\xa9\x0d\xf0\xcc\x9ds\xd4r\x90\xdcub1\xf1\xa7N\xca'\xee\x9e\xa1\xaf\xc2Q\xbc\xd3\xa7o\xff\xd5\xbf\xe1i\x227\x8b\x9cM%k\x10e35\x13%\x83W\xe2\x8e\xae\x80sG)u\x80F's'v\x07\x12\x00\xe0\xf5w\xba\xd5o\xbe\x86'\x06\x89^a\xf2\x99\xfbn\xa7?y\xf4n\xffD\xd74\x05S\x8c!K(\xaf\xac\x84\xeeR\xc98}([\xdb\xd5\xffd\xddb\xf6P\xd3\xa3\x1f\x8e\xf7\x1e\x9f\xa4\xaf\x12y\x00\x80:b\x8e\x22\x5c\x0dN\x16\x1c\x01\x88)\x01\x9a\xc8\x9cYS\x92\xdcp\xc8ACn5Xo\x9c\x1d\xc4\x81\x89\x9c\x89\x5cuT\x1eV\x1b\xef\x1b,\xef-{\xd5\xcf\xcc\xf8\xef\xff\xfaG\xea\x87\xd9$\x04\xdb\x0a\xc9\x84g\xee\x9c\xa3S\x1b\xe0\x83R2\xf3\xb3\x18\x03PHK:\x5cN\x9a\xfd\xa6\xb1\xc2\xefs\x03\xc1@\x12\x94=e6b\xa1P\x86hR\xa0\x0e\x85HW\x09{\x15\xab\xba\x88]W\x12,\xe6l\xd1\x9dX,\x10 \x80\x11\xb9\x81\xc6\x22\x9d\x1a\xd5NC\xab\xc8\xa4\xd4\x17\x93\xa3dG\x89t{\x8d\x00`\x94\x89\xda_\xa6\x10\xa7\x88\x00<\xff\x93\xfc\xca?\xfc\x84~IS\xa8\xbf\xfc`>?\xaar\x01\xb0D\x5c\xc4BZu\xfa\xad\xfb\xec\x0fz\xd1\x1f\xb8\xbed\xe6\xd1x\x07)\xbc\xf4g/\xdb\xef\xb8Dr\xea\x18N\xd7m\xe9\x9fz\xd1\x1fUF#\xe6\xbb\xc4\xe3n\xbaI~\xb5&\xf4\x80\x0b\xabpv\xc0/\xac\xc2\xcb\xdb\x16L\xd8,\xb5\x93\xc6)\x1ae7\xe2\xc1h%\x10#re1R\xc9)\x15\x01\xa9<\x00\xbb\xf9SG\xbf?\xb3\x15J]4#\x81\x11\x89\x1d\x00\x12\xc39\xb8e\x81\x03\x1d\xa47e2i\x86\xb55\x5c\xa7\x1c\x96\x96\xb0{\xf4\xa8\xc78p\xa2\xce3\x15.\x1e\x0c\xc3M\x03\xc0 2\x95@B$\xd7/\xd0O\xfd3\xff\x1aH\xc9\x09\xe4\xae\xc4\x10{\xfcc\xf47\x00 \xc9\x0b\x0ab \xc0\xa1\x0c\x0e\x07p\xc1\x8dRv6\xb1\x14\x0a\x8b\xcd\x06P\xd5\xa8\xe6\x16\x0d\xbfy\xa8\x08Ws\x8b\xc6\xa5{\xd7\xba\xa5\x14\x8d\xb3\x1b,\x8d L\x938\xb1\x18RT\xb5\xa8jq4%\x90\xa2\xba\x056\x12\xf1\xc0F$#\xbb\xc8\xc1\xe0\xd1\xe0\xd1)\x8a\xa9\x8d\xda4\x89S\xa8\x8c\x8b`Lf-\x95\x16\xfbj\xab\xb8\x00\x9c\xdb\x9f(ga\x97\xa7W<\xf6\xd5\xa4g\xc6dFh\x8d\xb3\xd8\x81>\x05\x0c`C\xc5FQ\x8c\xe2\xc8\x89\x90P\x90\x02N '\xd0P\xa7=\xc1\x8dd/\x9abd\xe2r \x08\x05\x98\xb9)[\xd0`\xa6Bf\xdb\xd5\x84\x17\xab\xa7\xec \xac\xe7\x80\x80\xec\xfd\xe3\xb0z\x93,\x86*g\x0a\xd9$\xe5\xfdM\x82sGB\x81`Jn\xfb\xa5A\xf6\xe6\x8e8\xb2:\xc9\xden\xc5t4$'!\xce\x1d\x8d\xde\xe3\x83\x1d\x8dj2\xa7R\x91Z\x0b\xd1-V\xb5\xa6\xabf\xf5\x22\xccO\xef\x85\xd5\xcf\xc2\xc6\x16OX\xd8\x9e\xb4\x98+M\xb4k\xd9\x1b5\x0f#/\xacb\xe4{\x1d\x8b\x80b1rB\x96\xcd\xd9\xd5=\x0f?\xec\x87\xe8\x12A\x04\x90\xbd\x81\xf8\x01\x9cP\x91\xc5;\xd5*\xe4>O\xe4f`\x16gu\x14\xad\x91\xc4\x177\xe0\xa5\xa8uuV\x95\xc9,\x16\x94\xad\x199\xa1\xc0\xa6\x94\x1d\x0e'\x86#\xeb\xc8IR\xcf\x0eK\x00Z\x00\xed\xde\xef=UY\x89\xc4\x88\xe1p\xb8R>\xd8Lf7!\xc91k\x96\xf6\x1d\x0b\xacV\xae\xab]\x5c\xc2\xa1\xb0\x02\xc0*\xbc\x9a\xcb\xb6\xa6\xe36\xd6l\x8eB\xbb_\xb7\xbe\xf4\x80\x7f\xe7\xbdn$b\x11\x1a'\xcb\xb9\x19\xbe+\xc5A\xb9\xf8\xd2\x03\xf8\xe6(\xe3\x87\xb8\xa3_ma\xb9@\xc8l\x9d\xc5rZ\xfb\xbd\xben\xc5\xb7\x1d\xfdc\xd7+\x07\x00W\x8b9\x0b[W-V\x95\xee\x98\xa9\xf2 7\x99\xfe\x09\xef\xf3\xec&z\xc94\x0fL1\x10\x09\xbb\x22a\xd74\x0cv\x13}\xef}\xed2\xfdK\xec4\xe5\xc6\xb4\xcf1\x17\xaa\x1a\xb6'\xadX=e8;T\xee\xf0\x19\x82\x17\xfex9\xf6\x8e,\x84\xf5n\xab\x9c\xd0\x8d2v\xa8\xd4\xcbZ\xddk\x88\x15B,\xec\xc3\xb3\xaaQ0\xca\x9d9Ivh\x12\x92\xac\x14\x0c\x00\xc43g\x92HY#\x93\x8a\x87\x82\x0f\xdb\xa9\x9bB\xb5\xb3*\xf6%a\xc0\x14\xdam\x1a\xb4G\xc6\xef\xe8\xb4B\xba\xb8\x84\xecga\x07p\xe7\xc0\x98\x83\xcc\xf7WB\x15z\x91\xbb\xb6\x90\x89\x18c\xd7\xaf\x8cQ\x0d\xcf\xab\x1a\x9c\x8b\xe1F0\x99Q\xe9ffj\x90\x14,*\x85\xc6\x01\xc0\x1a\xe6\xccI$\xd4\x81L\x83#\xf3a;\x0e\xae-$q\xa6\x86\xd0\xb6\xdb\x13\xd3\xed\xd8\xd5.\xf5c\x93W\xb6\xe6\x13\xceB\x1d\xf0\x1b\x8e\x86'\x01\xa96V\xc3\xb5\xb12\x0c6c\x9cLm\xe1\xd8)\x83\xf4D\x9d\xd8|\x87\x01\x80)\x9aPaYM\x93\x99\x86B\x95s=\x84\x9b\x04\x85\x9d\xad\x90yLbA\xac\xcd\x8dv^j\xb2\xdd.mOL\xb7\xd5\xca\x95<\xbb\xb8\x90\xb6\x00\xbdx\x1a\xd9\xf1\xae\xb0\x8e\xd4\x03x\xe1\xe8\xb2L\x95crm\xb5\x1f\x9a\xf9*\x1c\xf1\x22\xa6\xf5V\xb4f\x06\xea\xbd\xb7\x07\x90\x81Y\x18W+\xb4\xd2+\xac&<n\x00\xa0\xb6\xc3\xb7\x9ap'\x8d\xe4\x1d\xe1\x9b\xd9\x95\xdc\xe5\xcd\xb1\x99T\x5cY\xd3\xd9\xc5\x85\xb4\xf6\xf6\xb2-\xaf/(\x00\xf3\xb37\x81\xdb\x9f{87\x04\x9c\xcd\x0b\xbcU\xae\xc9 \x04\xc9\xba\xcd=\x13\xb6\xc8\xfb\xe1\xf1]V\x0b2a1\xa8\x85\xc6]&\xccu\xfb*\x01\xb3h\xf5\x1a\xe7\x89\x19\xb6\x01Q\xcfvn\xb4\xdb\xcaVO4:\xdb[\xcc\xe7/-\x19\x16\x17\x15\xa7\xe1\xfb\xaa\xdd\x14n\x04\xf8\x1c\x08\x1b`\xac\x82\x1e\x98\x5c\x91nl\x9eR}\xa8\x0e\x5c\x06\xe2$\xbc\xe8\xaf\xf8\xeat\xf67.\x9d\xb0\xe1\x05\xe2\xf02\xf1\x91\xe3\xe0vc\x85\xfa\x1a\x19\xc7\x8e\xe1\xddv\x13\x05\xec\xfc%\x18\xe6\xe0\x98\x86a\x09\xbe\xaf\xd8\xfb\xc2\x01\x00\x11\x08\x8e\xe1\xcd\xe6\xc7\xf7J\xce\x8f.\x1c\xc0\xdd}\xea\xc0p\x0d\x8e\xa5w\xddu,\x820\xbb7\x98\x9b\xd9\xed\xdb\x9c\x85\x83\x00\xf7\x1b\xefJ\xfe\x0f\x99\xac-w\xc26\xe7[\x00\x00\x00%tEXtdate:create\x002017-03-14T16:16:23-07:00&X7\x8a\x00\x00\x00%tEXtdate:modify\x002017-03-14T16:16:23-07:00W\x05\x8f6\x00\x00\x00\x00IEND\xaeB`\x82"
qt_resource_name = "\x00\x13\x0e\xd8\xd2b\x00t\x00k\x00-\x00m\x00u\x00l\x00t\x00i\x00-\x00w\x00o\x00r\x00k\x00f\x00i\x00l\x00e\x00s\x002\x00\x11\x08k\xf6\xa7\x00h\x00o\x00m\x00e\x00_\x00d\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00.\x00p\x00n\x00g\x00\x17\x09\xdd\xc4g\x00r\x00i\x00g\x00h\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00p\x00r\x00e\x00s\x00s\x00e\x00d\x00.\x00p\x00n\x00g\x00\x10\x0fc\x96\xe7\x00h\x00o\x00m\x00e\x00_\x00p\x00r\x00e\x00s\x00s\x00e\x00d\x00.\x00p\x00n\x00g\x00\x17\x0ce\xce\x07\x00l\x00e\x00f\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00d\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00.\x00p\x00n\x00g\x00\x14\x01v\xb2\xa7\x00l\x00e\x00f\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00h\x00o\x00v\x00e\x00r\x00.\x00p\x00n\x00g\x00\x0e\x0e\xde\xfa\xc7\x00l\x00e\x00f\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00.\x00p\x00n\x00g\x00\x16\x0a#ug\x00l\x00e\x00f\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00p\x00r\x00e\x00s\x00s\x00e\x00d\x00.\x00p\x00n\x00g\x00\x18\x03\x8e\xdeg\x00r\x00i\x00g\x00h\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00d\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00.\x00p\x00n\x00g\x00\x0f\x02\x9f\x05\x87\x00r\x00i\x00g\x00h\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00.\x00p\x00n\x00g\x00\x08\x068Z\xa7\x00h\x00o\x00m\x00e\x00.\x00p\x00n\x00g\x00\x15\x09\xf5L\x07\x00r\x00i\x00g\x00h\x00t\x00_\x00a\x00r\x00r\x00o\x00w\x00_\x00h\x00o\x00v\x00e\x00r\x00.\x00p\x00n\x00g\x00\x0e\x00\xb3\xf2G\x00h\x00o\x00m\x00e\x00_\x00h\x00o\x00v\x00e\x00r\x00.\x00p\x00n\x00g"
qt_resource_struct = "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x02\x00\x00\x02\x04\x00\x00\x00\x00\x00\x01\x00\x00C\xed\x00\x00\x00\xe2\x00\x00\x00\x00\x00\x01\x00\x00\x18\xb2\x00\x00\x01\x9a\x00\x00\x00\x00\x00\x01\x00\x004d\x00\x00\x01d\x00\x00\x00\x00\x00\x01\x00\x001\xa6\x00\x00\x01\xbe\x00\x00\x00\x00\x00\x01\x00\x008\x95\x00\x00\x00,\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00T\x00\x00\x00\x00\x00\x01\x00\x00\x02\xb6\x00\x00\x01\xd4\x00\x00\x00\x00\x00\x01\x00\x00=\x09\x00\x00\x012\x00\x00\x00\x00\x00\x01\x00\x00'\x96\x00\x00\x00\xae\x00\x00\x00\x00\x00\x01\x00\x00\x15\xe5\x00\x00\x01\x10\x00\x00\x00\x00\x00\x01\x00\x00#0\x00\x00\x00\x88\x00\x00\x00\x00\x00\x01\x00\x00\x09\x8e"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| 2,958.380952
| 59,425
| 0.743747
| 14,141
| 62,126
| 3.260448
| 0.182236
| 0.06728
| 0.040016
| 0.012233
| 0.19325
| 0.190691
| 0.185789
| 0.182796
| 0.17681
| 0.172537
| 0
| 0.266186
| 0.002785
| 62,126
| 20
| 59,426
| 3,106.3
| 0.478024
| 0.002398
| 0
| 0
| 0
| 0.333333
| 0.994013
| 0.991754
| 0
| 0
| 0.000129
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.111111
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
74bca0469d3810f6d9dfb1c0e7af54dbe7408d3e
| 50,447
|
py
|
Python
|
test/test_rules.py
|
konysko/pyseeyou
|
6ee169d32d9449f12fc76032f6060bba687a9155
|
[
"MIT"
] | 12
|
2016-03-04T00:54:17.000Z
|
2019-08-06T14:10:28.000Z
|
test/test_rules.py
|
konysko/pyseeyou
|
6ee169d32d9449f12fc76032f6060bba687a9155
|
[
"MIT"
] | 14
|
2017-07-06T15:48:11.000Z
|
2021-05-09T15:26:06.000Z
|
test/test_rules.py
|
konysko/pyseeyou
|
6ee169d32d9449f12fc76032f6060bba687a9155
|
[
"MIT"
] | 11
|
2017-09-21T11:52:15.000Z
|
2021-03-10T19:40:30.000Z
|
import pytest
from pyseeyou.locales import get_parts_of_num
from pyseeyou.cldr_rules import CARDINALS
# ========================
# GENERATED AUTOMATICALLY
# DON'T MODIFY MANUALLY
# ========================
def check(assertions, plural_fn):
for assertion in assertions:
match, samples = assertion
for sample in samples:
assert plural_fn(*get_parts_of_num(sample)) == match
def test_cardinal_af():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['af'])
def test_cardinal_ak():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['ak'])
def test_cardinal_am():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['am'])
def test_cardinal_ar():
assertions = [
('zero', ['0','0.0','0.00','0.000']),
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('few', ['3','7','10','103','107','110','1003','3.0','4.0','5.0']),
('many', ['11','19','26','111','1011','11.0','12.0','13.0']),
('other', ['100','101','102','200','201','202','300','301','302','0.1','0.5','0.9','1.1','1.4','1.7','10.1'])
]
check(assertions, CARDINALS['ar'])
def test_cardinal_ars():
assertions = [
('zero', ['0','0.0','0.00','0.000']),
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('few', ['3','7','10','103','107','110','1003','3.0','4.0','5.0']),
('many', ['11','19','26','111','1011','11.0','12.0','13.0']),
('other', ['100','101','102','200','201','202','300','301','302','0.1','0.5','0.9','1.1','1.4','1.7','10.1'])
]
check(assertions, CARDINALS['ars'])
def test_cardinal_as():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['as'])
def test_cardinal_asa():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['asa'])
def test_cardinal_ast():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ast'])
def test_cardinal_az():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['az'])
def test_cardinal_be():
assertions = [
('one', ['1','21','31','1.0','21.0','31.0']),
('few', ['2','3','4','22','23','24','32','33','34','2.0','3.0','4.0']),
('many', ['0','5','12','19','100','0.0','5.0','6.0']),
('other', ['0.1','0.5','0.9','1.1','1.4','1.7','10.1'])
]
check(assertions, CARDINALS['be'])
def test_cardinal_bem():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['bem'])
def test_cardinal_bez():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['bez'])
def test_cardinal_bg():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['bg'])
def test_cardinal_bh():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['bh'])
def test_cardinal_bm():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['bm'])
def test_cardinal_bn():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['bn'])
def test_cardinal_bo():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['bo'])
def test_cardinal_br():
assertions = [
('one', ['1','21','31','1.0','21.0','31.0']),
('two', ['2','22','32','2.0','22.0','32.0']),
('few', ['3','4','9','3.0','4.0','9.0']),
('many', ['1000000','1000000.0','1000000.00','1000000.000']),
('other', ['0','5','7','8','10','15','20','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['br'])
def test_cardinal_brx():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['brx'])
def test_cardinal_bs():
assertions = [
('one', ['1','21','31','0.1','1.1','2.1']),
('few', ['2','3','4','22','23','24','32','33','34','0.2','0.3','0.4','1.2','1.3','1.4','2.2','2.3','2.4']),
('other', ['0','5','12','19','100','0.0','0.5','0.75','1.0','1.5','1.75','2.0'])
]
check(assertions, CARDINALS['bs'])
def test_cardinal_ca():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ca'])
def test_cardinal_ce():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ce'])
def test_cardinal_ceb():
assertions = [
('one', ['0','2','3','5','7','0.0','0.15','0.3','0.5','0.7']),
('other', ['4','6','9','0.4','0.6','0.9'])
]
check(assertions, CARDINALS['ceb'])
def test_cardinal_cgg():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['cgg'])
def test_cardinal_chr():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['chr'])
def test_cardinal_ckb():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ckb'])
def test_cardinal_cs():
assertions = [
('one', ['1']),
('few', ['2','3','4']),
('many', ['0.0','0.75','1.5','10.0','100.0']),
('other', ['0','5','12','19','100'])
]
check(assertions, CARDINALS['cs'])
def test_cardinal_cy():
assertions = [
('zero', ['0','0.0','0.00','0.000']),
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('few', ['3','3.0','3.00','3.000']),
('many', ['6','6.0','6.00','6.000']),
('other', ['4','5','7','14','20','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['cy'])
def test_cardinal_da():
assertions = [
('one', ['1','0.1','0.85','1.6']),
('other', ['0','2','9','16','100','0.0','2.0','2.7','3.4','10.0'])
]
check(assertions, CARDINALS['da'])
def test_cardinal_de():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['de'])
def test_cardinal_dsb():
assertions = [
('one', ['1','101','201','0.1','1.1','2.1']),
('two', ['2','102','202','0.2','1.2','2.2']),
('few', ['3','4','103','0.3','0.4','1.3']),
('other', ['0','5','12','19','100','0.0','0.5','0.75','1.0','1.5','1.75','2.0'])
]
check(assertions, CARDINALS['dsb'])
def test_cardinal_dv():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['dv'])
def test_cardinal_dz():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['dz'])
def test_cardinal_ee():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ee'])
def test_cardinal_el():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['el'])
def test_cardinal_en():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['en'])
def test_cardinal_eo():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['eo'])
def test_cardinal_es():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['es'])
def test_cardinal_et():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['et'])
def test_cardinal_eu():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['eu'])
def test_cardinal_fa():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['fa'])
def test_cardinal_ff():
assertions = [
('one', ['0','1','0.0','0.75','1.5']),
('other', ['2','10','17','100','1000','2.0','2.75','3.5','10.0','100.0'])
]
check(assertions, CARDINALS['ff'])
def test_cardinal_fi():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['fi'])
def test_cardinal_fil():
assertions = [
('one', ['0','2','3','5','7','0.0','0.15','0.3','0.5','0.7']),
('other', ['4','6','9','0.4','0.6','0.9'])
]
check(assertions, CARDINALS['fil'])
def test_cardinal_fo():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['fo'])
def test_cardinal_fr():
assertions = [
('one', ['0','1','0.0','0.75','1.5']),
('other', ['2','10','17','100','1000','2.0','2.75','3.5','10.0','100.0'])
]
check(assertions, CARDINALS['fr'])
def test_cardinal_fur():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['fur'])
def test_cardinal_fy():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['fy'])
def test_cardinal_ga():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('few', ['3','5','6','3.0','4.0','5.0']),
('many', ['7','9','10','7.0','8.0','9.0']),
('other', ['0','11','18','25','100','0.0','0.45','0.9','1.1','1.35','1.6','10.1'])
]
check(assertions, CARDINALS['ga'])
def test_cardinal_gd():
assertions = [
('one', ['1','11','1.0','11.0','1.00']),
('two', ['2','12','2.0','12.0','2.00']),
('few', ['3','7','10','13','16','19','3.0','4.0','5.0']),
('other', ['0','20','27','34','100','0.0','0.45','0.9','1.1','1.35','1.6','10.1'])
]
check(assertions, CARDINALS['gd'])
def test_cardinal_gl():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['gl'])
def test_cardinal_gsw():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['gsw'])
def test_cardinal_gu():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['gu'])
def test_cardinal_guw():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['guw'])
def test_cardinal_gv():
assertions = [
('one', ['1','11','21']),
('two', ['2','12','22']),
('few', ['0','20','40']),
('many', ['0.0','0.75','1.5','10.0','100.0']),
('other', ['3','7','10','13','16','19','23'])
]
check(assertions, CARDINALS['gv'])
def test_cardinal_ha():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ha'])
def test_cardinal_haw():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['haw'])
def test_cardinal_he():
assertions = [
('one', ['1']),
('two', ['2']),
('many', ['20','30','40']),
('other', ['0','3','10','17','101','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['he'])
def test_cardinal_hi():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['hi'])
def test_cardinal_hr():
assertions = [
('one', ['1','21','31','0.1','1.1','2.1']),
('few', ['2','3','4','22','23','24','32','33','34','0.2','0.3','0.4','1.2','1.3','1.4','2.2','2.3','2.4']),
('other', ['0','5','12','19','100','0.0','0.5','0.75','1.0','1.5','1.75','2.0'])
]
check(assertions, CARDINALS['hr'])
def test_cardinal_hsb():
assertions = [
('one', ['1','101','201','0.1','1.1','2.1']),
('two', ['2','102','202','0.2','1.2','2.2']),
('few', ['3','4','103','0.3','0.4','1.3']),
('other', ['0','5','12','19','100','0.0','0.5','0.75','1.0','1.5','1.75','2.0'])
]
check(assertions, CARDINALS['hsb'])
def test_cardinal_hu():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['hu'])
def test_cardinal_hy():
assertions = [
('one', ['0','1','0.0','0.75','1.5']),
('other', ['2','10','17','100','1000','2.0','2.75','3.5','10.0','100.0'])
]
check(assertions, CARDINALS['hy'])
def test_cardinal_ia():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ia'])
def test_cardinal_id():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['id'])
def test_cardinal_ig():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ig'])
def test_cardinal_ii():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ii'])
def test_cardinal_in():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['in'])
def test_cardinal_io():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['io'])
def test_cardinal_is():
assertions = [
('one', ['1','21','31','0.1','0.85','1.6','10.1','100.1']),
('other', ['0','2','9','16','100','0.0','2.0','3.0'])
]
check(assertions, CARDINALS['is'])
def test_cardinal_it():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['it'])
def test_cardinal_iu():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['iu'])
def test_cardinal_iw():
assertions = [
('one', ['1']),
('two', ['2']),
('many', ['20','30','40']),
('other', ['0','3','10','17','101','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['iw'])
def test_cardinal_ja():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ja'])
def test_cardinal_jbo():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['jbo'])
def test_cardinal_jgo():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['jgo'])
def test_cardinal_ji():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ji'])
def test_cardinal_jmc():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['jmc'])
def test_cardinal_jv():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['jv'])
def test_cardinal_jw():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['jw'])
def test_cardinal_ka():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ka'])
def test_cardinal_kab():
assertions = [
('one', ['0','1','0.0','0.75','1.5']),
('other', ['2','10','17','100','1000','2.0','2.75','3.5','10.0','100.0'])
]
check(assertions, CARDINALS['kab'])
def test_cardinal_kaj():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['kaj'])
def test_cardinal_kcg():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['kcg'])
def test_cardinal_kde():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['kde'])
def test_cardinal_kea():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['kea'])
def test_cardinal_kk():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['kk'])
def test_cardinal_kkj():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['kkj'])
def test_cardinal_kl():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['kl'])
def test_cardinal_km():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['km'])
def test_cardinal_kn():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['kn'])
def test_cardinal_ko():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ko'])
def test_cardinal_ks():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ks'])
def test_cardinal_ksb():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ksb'])
def test_cardinal_ksh():
assertions = [
('zero', ['0','0.0','0.00','0.000']),
('one', ['1','1.0','1.00','1.000']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['ksh'])
def test_cardinal_ku():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ku'])
def test_cardinal_kw():
assertions = [
('zero', ['0','0.0','0.00','0.000']),
('one', ['1','1.0','1.00','1.000']),
('two', ['2','22','42','2.0','22.0','42.0']),
('few', ['3','23','43','3.0','23.0','43.0']),
('many', ['21','41','61','21.0','41.0','61.0']),
('other', ['4','12','19','100','1000000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['kw'])
def test_cardinal_ky():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ky'])
def test_cardinal_lag():
assertions = [
('zero', ['0','0.0','0.00','0.000']),
('one', ['1','0.1','0.85','1.6']),
('other', ['2','10','17','100','1000','2.0','2.75','3.5','10.0','100.0'])
]
check(assertions, CARDINALS['lag'])
def test_cardinal_lb():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['lb'])
def test_cardinal_lg():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['lg'])
def test_cardinal_lkt():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['lkt'])
def test_cardinal_ln():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['ln'])
def test_cardinal_lo():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['lo'])
def test_cardinal_lt():
assertions = [
('one', ['1','21','31','1.0','21.0','31.0']),
('few', ['2','6','9','22','26','29','102','2.0','3.0','4.0']),
('many', ['0.1','0.5','0.9','1.1','1.4','1.7','10.1']),
('other', ['0','10','15','20','30','0.0','10.0','11.0'])
]
check(assertions, CARDINALS['lt'])
def test_cardinal_lv():
assertions = [
('zero', ['0','10','15','20','30','0.0','10.0','11.0']),
('one', ['1','21','31','0.1','1.0','1.1']),
('other', ['2','6','9','22','26','29','102','0.2','0.55','0.9','1.2','1.55','1.9','10.2'])
]
check(assertions, CARDINALS['lv'])
def test_cardinal_mas():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['mas'])
def test_cardinal_mg():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['mg'])
def test_cardinal_mgo():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['mgo'])
def test_cardinal_mk():
assertions = [
('one', ['1','21','31','0.1','1.1','2.1']),
('other', ['0','2','9','16','100','0.0','0.2','0.6','1.0','1.2','1.45','1.7'])
]
check(assertions, CARDINALS['mk'])
def test_cardinal_ml():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ml'])
def test_cardinal_mn():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['mn'])
def test_cardinal_mo():
assertions = [
('one', ['1']),
('few', ['0','2','9','16','102','0.0','0.75','1.5','10.0','100.0']),
('other', ['20','28','35','100','1000'])
]
check(assertions, CARDINALS['mo'])
def test_cardinal_mr():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['mr'])
def test_cardinal_ms():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ms'])
def test_cardinal_mt():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('few', ['0','2','6','10','102','105','107','0.0','2.0','3.0']),
('many', ['11','15','19','111','114','117','1011','11.0','12.0','13.0']),
('other', ['20','28','35','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.1'])
]
check(assertions, CARDINALS['mt'])
def test_cardinal_my():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['my'])
def test_cardinal_nah():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nah'])
def test_cardinal_naq():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['naq'])
def test_cardinal_nb():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nb'])
def test_cardinal_nd():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nd'])
def test_cardinal_ne():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ne'])
def test_cardinal_nl():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['nl'])
def test_cardinal_nn():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nn'])
def test_cardinal_nnh():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nnh'])
def test_cardinal_no():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['no'])
def test_cardinal_nqo():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['nqo'])
def test_cardinal_nr():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nr'])
def test_cardinal_nso():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['nso'])
def test_cardinal_ny():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ny'])
def test_cardinal_nyn():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['nyn'])
def test_cardinal_om():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['om'])
def test_cardinal_or():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['or'])
def test_cardinal_os():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['os'])
def test_cardinal_pa():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['pa'])
def test_cardinal_pap():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['pap'])
def test_cardinal_pl():
assertions = [
('one', ['1']),
('few', ['2','3','4','22','23','24','32','33','34']),
('many', ['0','5','12','19','100']),
('other', ['0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['pl'])
def test_cardinal_prg():
assertions = [
('zero', ['0','10','15','20','30','0.0','10.0','11.0']),
('one', ['1','21','31','0.1','1.0','1.1']),
('other', ['2','6','9','22','26','29','102','0.2','0.55','0.9','1.2','1.55','1.9','10.2'])
]
check(assertions, CARDINALS['prg'])
def test_cardinal_ps():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ps'])
def test_cardinal_pt():
assertions = [
('one', ['0','1','0.0','0.75','1.5']),
('other', ['2','10','17','100','1000','2.0','2.75','3.5','10.0','100.0'])
]
check(assertions, CARDINALS['pt'])
def test_cardinal_pt_PT():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['pt-PT'])
def test_cardinal_rm():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['rm'])
def test_cardinal_ro():
assertions = [
('one', ['1']),
('few', ['0','2','9','16','102','0.0','0.75','1.5','10.0','100.0']),
('other', ['20','28','35','100','1000'])
]
check(assertions, CARDINALS['ro'])
def test_cardinal_rof():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['rof'])
def test_cardinal_root():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['root'])
def test_cardinal_ru():
assertions = [
('one', ['1','21','31']),
('few', ['2','3','4','22','23','24','32','33','34']),
('many', ['0','5','12','19','100']),
('other', ['0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ru'])
def test_cardinal_rwk():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['rwk'])
def test_cardinal_sah():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['sah'])
def test_cardinal_saq():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['saq'])
def test_cardinal_sc():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['sc'])
def test_cardinal_scn():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['scn'])
def test_cardinal_sd():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['sd'])
def test_cardinal_sdh():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['sdh'])
def test_cardinal_se():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['se'])
def test_cardinal_seh():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['seh'])
def test_cardinal_ses():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ses'])
def test_cardinal_sg():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['sg'])
def test_cardinal_sh():
assertions = [
('one', ['1','21','31','0.1','1.1','2.1']),
('few', ['2','3','4','22','23','24','32','33','34','0.2','0.3','0.4','1.2','1.3','1.4','2.2','2.3','2.4']),
('other', ['0','5','12','19','100','0.0','0.5','0.75','1.0','1.5','1.75','2.0'])
]
check(assertions, CARDINALS['sh'])
def test_cardinal_shi():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('few', ['2','6','10','2.0','3.0','4.0']),
('other', ['11','19','26','100','1000','1.1','1.5','1.9','2.1','2.4','2.7','10.1'])
]
check(assertions, CARDINALS['shi'])
def test_cardinal_si():
assertions = [
('one', ['0','1','0.0','0.1','1.0']),
('other', ['2','10','17','100','1000','0.2','0.55','0.9','1.1','1.45','1.8','10.0'])
]
check(assertions, CARDINALS['si'])
def test_cardinal_sk():
assertions = [
('one', ['1']),
('few', ['2','3','4']),
('many', ['0.0','0.75','1.5','10.0','100.0']),
('other', ['0','5','12','19','100'])
]
check(assertions, CARDINALS['sk'])
def test_cardinal_sl():
assertions = [
('one', ['1','101','201']),
('two', ['2','102','202']),
('few', ['3','4','103','0.0','0.75','1.5','10.0','100.0']),
('other', ['0','5','12','19','100'])
]
check(assertions, CARDINALS['sl'])
def test_cardinal_sma():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['sma'])
def test_cardinal_smi():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['smi'])
def test_cardinal_smj():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['smj'])
def test_cardinal_smn():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['smn'])
def test_cardinal_sms():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('two', ['2','2.0','2.00','2.000']),
('other', ['0','3','10','17','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['sms'])
def test_cardinal_sn():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['sn'])
def test_cardinal_so():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['so'])
def test_cardinal_sq():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['sq'])
def test_cardinal_sr():
assertions = [
('one', ['1','21','31','0.1','1.1','2.1']),
('few', ['2','3','4','22','23','24','32','33','34','0.2','0.3','0.4','1.2','1.3','1.4','2.2','2.3','2.4']),
('other', ['0','5','12','19','100','0.0','0.5','0.75','1.0','1.5','1.75','2.0'])
]
check(assertions, CARDINALS['sr'])
def test_cardinal_ss():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ss'])
def test_cardinal_ssy():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ssy'])
def test_cardinal_st():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['st'])
def test_cardinal_sv():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['sv'])
def test_cardinal_sw():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['sw'])
def test_cardinal_syr():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['syr'])
def test_cardinal_ta():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ta'])
def test_cardinal_te():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['te'])
def test_cardinal_teo():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['teo'])
def test_cardinal_th():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['th'])
def test_cardinal_ti():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['ti'])
def test_cardinal_tig():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['tig'])
def test_cardinal_tk():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['tk'])
def test_cardinal_tl():
assertions = [
('one', ['0','2','3','5','7','0.0','0.15','0.3','0.5','0.7']),
('other', ['4','6','9','0.4','0.6','0.9'])
]
check(assertions, CARDINALS['tl'])
def test_cardinal_tn():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['tn'])
def test_cardinal_to():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['to'])
def test_cardinal_tr():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['tr'])
def test_cardinal_ts():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ts'])
def test_cardinal_tzm():
assertions = [
('one', ['0','1','11','18','24','0.0','1.0','11.0']),
('other', ['2','6','10','100','103','106','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['tzm'])
def test_cardinal_ug():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ug'])
def test_cardinal_uk():
assertions = [
('one', ['1','21','31']),
('few', ['2','3','4','22','23','24','32','33','34']),
('many', ['0','5','12','19','100']),
('other', ['0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['uk'])
def test_cardinal_ur():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['ur'])
def test_cardinal_uz():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['uz'])
def test_cardinal_ve():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['ve'])
def test_cardinal_vi():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['vi'])
def test_cardinal_vo():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['vo'])
def test_cardinal_vun():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['vun'])
def test_cardinal_wa():
assertions = [
('one', ['0','1','0.0','1.0','0.00']),
('other', ['2','10','17','100','1000','0.1','0.5','0.9','1.1','1.4','1.7','10.0'])
]
check(assertions, CARDINALS['wa'])
def test_cardinal_wae():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['wae'])
def test_cardinal_wo():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['wo'])
def test_cardinal_xh():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['xh'])
def test_cardinal_xog():
assertions = [
('one', ['1','1.0','1.00','1.000']),
('other', ['0','2','9','16','100','0.0','0.45','0.9','1.1','1.35','1.6','10.0'])
]
check(assertions, CARDINALS['xog'])
def test_cardinal_yi():
assertions = [
('one', ['1']),
('other', ['0','2','9','16','100','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['yi'])
def test_cardinal_yo():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['yo'])
def test_cardinal_yue():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['yue'])
def test_cardinal_zh():
assertions = [
('other', ['0','8','15','100','1000','0.0','0.75','1.5','10.0','100.0'])
]
check(assertions, CARDINALS['zh'])
def test_cardinal_zu():
assertions = [
('one', ['0','1','0.0','0.5','1.0','0.00','0.02','0.04']),
('other', ['2','10','17','100','1000','1.1','1.85','2.6','10.0','100.0'])
]
check(assertions, CARDINALS['zu'])
# ================================
# END AUTOMATICALLY GENERATED CODE
# ================================
| 29.21077
| 118
| 0.422523
| 7,786
| 50,447
| 2.682892
| 0.040586
| 0.0405
| 0.149361
| 0.226196
| 0.764134
| 0.759634
| 0.75614
| 0.75073
| 0.748863
| 0.746661
| 0
| 0.193401
| 0.217238
| 50,447
| 1,726
| 119
| 29.227694
| 0.335596
| 0.003846
| 0
| 0.478797
| 1
| 0
| 0.244626
| 0
| 0
| 0
| 0
| 0
| 0.323824
| 1
| 0.161141
| false
| 0
| 0.002313
| 0
| 0.163454
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
2d0abfa6db0aeaa48eeb2240a4ad11ea164550a4
| 147
|
py
|
Python
|
tests/test_get_skins.py
|
exizt/tistory-skin-simulator
|
0ede9e5daeadd7aa3ed1f74bf40d7e0924a1655a
|
[
"MIT"
] | 4
|
2021-09-29T08:55:37.000Z
|
2022-03-06T18:01:58.000Z
|
tests/test_get_skins.py
|
exizt/tistory-skin-simulator
|
0ede9e5daeadd7aa3ed1f74bf40d7e0924a1655a
|
[
"MIT"
] | null | null | null |
tests/test_get_skins.py
|
exizt/tistory-skin-simulator
|
0ede9e5daeadd7aa3ed1f74bf40d7e0924a1655a
|
[
"MIT"
] | null | null | null |
import SkinLoader
def test_get_skins():
print(SkinLoader.get_skins())
def test_get_skin_path():
print(SkinLoader.get_skins_dir_path())
| 14.7
| 42
| 0.755102
| 21
| 147
| 4.857143
| 0.47619
| 0.235294
| 0.196078
| 0.45098
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136054
| 147
| 9
| 43
| 16.333333
| 0.80315
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| true
| 0
| 0.2
| 0
| 0.6
| 0.4
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 8
|
2d33010b9a4a61a5d059373f88ac50c2aa74e9fc
| 36,682
|
py
|
Python
|
plot_producers/off_line_bcpnn_learning.py
|
h-mayorquin/BCPNN_sequences
|
a7d6dcd699abf91ce8c2d0b8e36e96a56b941f4a
|
[
"MIT"
] | null | null | null |
plot_producers/off_line_bcpnn_learning.py
|
h-mayorquin/BCPNN_sequences
|
a7d6dcd699abf91ce8c2d0b8e36e96a56b941f4a
|
[
"MIT"
] | null | null | null |
plot_producers/off_line_bcpnn_learning.py
|
h-mayorquin/BCPNN_sequences
|
a7d6dcd699abf91ce8c2d0b8e36e96a56b941f4a
|
[
"MIT"
] | null | null | null |
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
from network import Protocol, NetworkManager, BCPNNPerfect, TimedInput
from connectivity_functions import create_orthogonal_canonical_representation, build_network_representation
from connectivity_functions import get_weights_from_probabilities, get_probabilities_from_network_representation
from analysis_functions import calculate_recall_time_quantities, get_weights
from analysis_functions import get_weights_collections
def generate_plot_for_variable(filename, x_values, xlabel):
format = '.pdf'
folder = './plot_producers/off_line_rule_learning_'
fig = plt.figure(figsize=figsize)
ax = fig.add_subplot(111)
ax.plot(x_values, w_self_vector, 'o-', markersize=markersize, linewidth=linewidth, label=r'$w_{self}$')
ax.plot(x_values, w_next_vector, 'o-', markersize=markersize, linewidth=linewidth, label=r'$w_{next}$')
ax.plot(x_values, w_rest_vector, 'o-', markersize=markersize, linewidth=linewidth, label=r'$w_{rest}$')
ax.axhline(0, ls='--', color='gray')
ax.axvline(0, ls='--', color='gray')
ax.set_ylabel(r'$w$')
ax.set_xlabel(xlabel)
ax.legend()
type = 'w'
aux_filename = folder + filename + type + format
fig.savefig(aux_filename, frameon=False, dpi=110, bbox_inches='tight')
fig.clear()
fig = plt.figure(figsize=figsize)
ax = fig.add_subplot(111)
ax.plot(x_values, factor * Pij_self_vector, 'o-', markersize=markersize, linewidth=linewidth,
label=r'$P_{self}$')
ax.plot(x_values, factor * Pij_next_vector, 'o-', markersize=markersize, linewidth=linewidth,
label=r'$P_{next}$')
ax.plot(x_values, factor * Pij_rest_vector, 'o-', markersize=markersize, linewidth=linewidth,
label=r'$P_{rest}$')
ax.plot(x_values, factor * pi_self_vector, 'o-', markersize=markersize, linewidth=linewidth,
label=r'$p_i * p_j s$', color='black')
ax.axhline(0, ls='--', color='gray')
ax.axvline(0, ls='--', color='gray')
ax.set_ylabel(r'Probabilities')
ax.set_xlabel(xlabel)
ax.legend()
type = 'p'
aux_filename = folder + filename + type + format
fig.savefig(aux_filename, frameon=False, dpi=110, bbox_inches='tight')
fig.clear()
fig = plt.figure(figsize=figsize)
ax = fig.add_subplot(111)
ax.plot(x_values, persistence_time_vector, 'o-', markersize=markersize,
linewidth=linewidth, label=r'$T_{persistence}$')
ax.plot(x_values, success_vector / 100.0, 'o-', markersize=markersize,
linewidth=linewidth, label=r'Success')
ax.axhline(0, ls='--', color='gray')
ax.axvline(0, ls='--', color='gray')
ax.set_ylabel(r'$T_{persistence} (s)$')
ax.set_xlabel(xlabel)
ax.legend()
type = 'time'
aux_filename = folder + filename + type + format
fig.savefig(aux_filename, frameon=False, dpi=110, bbox_inches='tight')
fig = plt.figure(figsize=figsize)
ax = fig.add_subplot(111)
ax.plot(x_values[:-1], np.diff(Pij_self_vector) / np.abs(Pij_self_vector[:-1]),
'o-', markersize=markersize, linewidth=linewidth, label=r'$P_{self}$', alpha=alpha)
ax.plot(x_values[:-1], np.diff(Pij_next_vector) / np.abs(Pij_next_vector[:-1]), 'o-',
markersize=markersize, linewidth=linewidth, label=r'$P_{next}$', alpha=alpha)
ax.plot(x_values[:-1], np.diff(Pij_rest_vector) / np.abs(Pij_rest_vector[:-1]),
'o-', markersize=markersize, linewidth=linewidth, label=r'$P_{rest}$', alpha=alpha)
ax.plot(x_values[:-1], np.diff(pi_self_vector) / np.abs(pi_self_vector[:-1]), 'o-', alpha=alpha,
markersize=markersize, linewidth=linewidth, color='black', label=r'$p_i * p_j$')
ax.axhline(0, ls='--', color='gray')
ax.axvline(0, ls='--', color='gray')
ax.set_ylabel(r'$\Delta $ Probabilities')
ax.set_xlabel(xlabel)
ax.legend()
type = 'diff'
aux_filename = folder + filename + type + format
fig.savefig(aux_filename, frameon=False, dpi=110, bbox_inches='tight')
plt.close()
sns.set(font_scale=2.8)
sns.set_style(style='white')
epsilon = 10e-10
from_pattern = 2
to_pattern = 3
figsize = (16, 12)
markersize = 25
linewidth = 10
factor = 1.0
alpha = 0.8
normal_palette = sns.color_palette()
plot_training_time = False
plot_tau_z = False
plot_resting_time = False
plot_epochs = False
plot_inter_sequence_time = False
plot_inter_pulse_interval = False
plot_minicolumns_fixed = True
plot_minicolumns_var = True
plot_hypercolumns = False
#####################
# General parameters
#####################
always_learning = False
strict_maximum = True
perfect = False
z_transfer = False
k_perfect = True
diagonal_zero = False
normalized_currents = True
g_w_ampa = 2.0
g_w = 0.0
g_a = 10.0
tau_a = 0.250
G = 1.0
sigma = 0.0
tau_m = 0.020
tau_z_pre_ampa = 0.025
tau_z_post_ampa = 0.025
tau_p = 10.0
hypercolumns = 1
minicolumns = 10
n_patterns = 10
# Manager properties
dt = 0.001
values_to_save = ['o']
# Protocol
training_time = 0.100
inter_sequence_interval = 1.0
inter_pulse_interval = 0.0
epochs = 3
resting_time = 3.0
# Recall
T_recall = 3.0
n = 1
T_cue = 0.050
##############################
# Training time
##############################
if plot_training_time:
epsilon_ = epsilon
num = 20
training_times = np.linspace(0.050, 1.0, num=num)
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, training_time_ in enumerate(training_times):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time_,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns, epsilon_)
nn = BCPNNPerfect(hypercolumns, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'training_time_'
x_values = training_times
xlabel = r'Training Time (s)'
generate_plot_for_variable(filename, x_values, xlabel)
##############################
# tau_z
###############################
if plot_tau_z:
num = 15
tau_z_vector = np.linspace(0.025, 0.250, num=num)
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, tau_z_pre_ampa_ in enumerate(tau_z_vector):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa_)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa_)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa_, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'tau_z_'
x_values = tau_z_vector
xlabel = r'$\tau_z$ (s)'
generate_plot_for_variable(filename, x_values, xlabel)
#########################
# Resting time
#########################
if plot_resting_time:
num = 15
resting_times = np.linspace(0.0, 3.0, num=num)
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, resting_time_ in enumerate(resting_times):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time_)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'resting_'
x_values = resting_times
xlabel = r'Resting time (s)'
generate_plot_for_variable(filename, x_values, xlabel)
###########################
# Epochs
###########################
if plot_epochs:
num = 15
epochs_vector = np.arange(1, 10, 1, dtype='int')
success_vector = np.zeros(epochs_vector.size)
persistence_time_vector = np.zeros(epochs_vector.size)
w_self_vector = np.zeros(epochs_vector.size)
w_next_vector = np.zeros(epochs_vector.size)
w_rest_vector = np.zeros(epochs_vector.size)
pi_self_vector = np.zeros(epochs_vector.size)
Pij_self_vector = np.zeros(epochs_vector.size)
pi_next_vector = np.zeros(epochs_vector.size)
Pij_next_vector = np.zeros(epochs_vector.size)
pi_rest_vector = np.zeros(epochs_vector.size)
Pij_rest_vector = np.zeros(epochs_vector.size)
for index, epochs_ in enumerate(epochs_vector):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs_, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'epochs_'
x_values = epochs_vector
xlabel = r'Epochs'
generate_plot_for_variable(filename, x_values, xlabel)
#############################
# Inter-sequence times
#############################
if plot_inter_sequence_time:
num = 15
inter_sequence_times = np.linspace(0.0, 3.0, num=num)
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, inter_sequence_interval_ in enumerate(inter_sequence_times):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval_,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'ISI_'
x_values = inter_sequence_times
xlabel = r'$ISI (s)$'
generate_plot_for_variable(filename, x_values, xlabel)
##########################
# Inter Pulse Interval
##########################
if plot_inter_pulse_interval:
num = 15
inter_pulse_times = np.linspace(0.0, 1.0, num=num)
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, inter_pulse_interval_ in enumerate(inter_pulse_times):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval_,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'IPI_'
x_values = inter_pulse_times
xlabel = r'$IPI (s)$'
generate_plot_for_variable(filename, x_values, xlabel)
########################
# Minicolumns
########################
if plot_minicolumns_fixed:
num = 20
minicolumns_vector = np.linspace(10, 100, num=num, dtype='int')
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, minicolumns_ in enumerate(minicolumns_vector):
matrix = create_orthogonal_canonical_representation(minicolumns_, hypercolumns)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns_, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns_, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns_, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
T_recall = 0.200 * n_patterns
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
w_rest = w_timed[to_pattern + 1, from_pattern]
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'minicolumns_fixed_'
x_values = minicolumns_vector
xlabel = r'Minicolumns'
generate_plot_for_variable(filename, x_values, xlabel)
###############################
# Minicolumns Variable
###############################
if plot_minicolumns_var:
num = 20
minicolumns_vector = np.linspace(10, 100, num=num, dtype='int')
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, minicolumns_ in enumerate(minicolumns_vector):
n_patterns_ = minicolumns_
matrix = create_orthogonal_canonical_representation(minicolumns_, hypercolumns)[:n_patterns_]
network_representation = build_network_representation(matrix, minicolumns_, hypercolumns)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns_, hypercolumns, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns, minicolumns_, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns_)]
sequences = [patterns_indexes]
T_recall = 0.200 * n_patterns_
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'minicolumns_var_'
x_values = minicolumns_vector
xlabel = r'Minicolumns'
generate_plot_for_variable(filename, x_values, xlabel)
#######################
# Hypercolumns
#######################
if plot_hypercolumns:
num = 10
hypercolumns_vector = np.linspace(1, 10, num=num, dtype='int')
success_vector = np.zeros(num)
persistence_time_vector = np.zeros(num)
w_self_vector = np.zeros(num)
w_next_vector = np.zeros(num)
w_rest_vector = np.zeros(num)
pi_self_vector = np.zeros(num)
Pij_self_vector = np.zeros(num)
pi_next_vector = np.zeros(num)
Pij_next_vector = np.zeros(num)
pi_rest_vector = np.zeros(num)
Pij_rest_vector = np.zeros(num)
for index, hypercolumns_ in enumerate(hypercolumns_vector):
matrix = create_orthogonal_canonical_representation(minicolumns, hypercolumns_)[:n_patterns]
network_representation = build_network_representation(matrix, minicolumns, hypercolumns_)
timed_input = TimedInput(network_representation, dt, training_time,
inter_pulse_interval=inter_pulse_interval,
inter_sequence_interval=inter_sequence_interval,
epochs=epochs, resting_time=resting_time)
S = timed_input.build_timed_input()
z_pre = timed_input.build_filtered_input_pre(tau_z_pre_ampa)
z_post = timed_input.build_filtered_input_post(tau_z_pre_ampa)
pi, pj, P = timed_input.calculate_probabilities_from_time_signal(filtered=True)
w_timed, beta_timed = get_weights_from_probabilities(pi, pj, P, minicolumns, hypercolumns_, epsilon)
# Patterns parameters
nn = BCPNNPerfect(hypercolumns_, minicolumns, g_w_ampa=g_w_ampa, g_w=g_w, g_a=g_a, tau_a=tau_a, tau_m=tau_m,
sigma=sigma, G=G, tau_z_pre_ampa=tau_z_pre_ampa, tau_z_post_ampa=tau_z_post_ampa, tau_p=tau_p,
z_transfer=z_transfer, diagonal_zero=diagonal_zero, strict_maximum=strict_maximum,
perfect=perfect, k_perfect=k_perfect, always_learning=always_learning,
normalized_currents=normalized_currents)
# Build the manager
manager = NetworkManager(nn=nn, dt=dt, values_to_save=values_to_save)
# Build the protocol for training
nn.w_ampa = w_timed
# Recall
patterns_indexes = [i for i in range(n_patterns)]
sequences = [patterns_indexes]
# manager.run_network_recall(T_recall=1.0, T_cue=0.100, I_cue=0, reset=True, empty_history=True)
aux = calculate_recall_time_quantities(manager, T_recall, T_cue, n, sequences)
total_sequence_time, mean, std, success, timings = aux
w_self, w_next, w_rest = get_weights(manager, from_pattern, to_pattern, mean=False)
w_rest = w_timed[to_pattern + 1, from_pattern]
success_vector[index] = success
persistence_time_vector[index] = mean
w_self_vector[index] = w_self
w_next_vector[index] = w_next
w_rest_vector[index] = w_rest
pi_self_vector[index] = pi[from_pattern] * pj[from_pattern]
Pij_self_vector[index] = P[from_pattern, from_pattern]
pi_next_vector[index] = pi[from_pattern] * pj[to_pattern]
Pij_next_vector[index] = P[to_pattern, from_pattern]
pi_rest_vector[index] = pi[from_pattern] * pj[to_pattern + 1]
Pij_rest_vector[index] = P[to_pattern + 1, from_pattern]
# Plot
filename = 'hypercolumns_'
x_values = hypercolumns_vector
xlabel = r'Hypercolumns'
generate_plot_for_variable(filename, x_values, xlabel)
plt.close()
| 42.163218
| 121
| 0.678589
| 5,010
| 36,682
| 4.589421
| 0.042315
| 0.037577
| 0.055974
| 0.061236
| 0.887531
| 0.883704
| 0.87892
| 0.859479
| 0.849345
| 0.825643
| 0
| 0.009295
| 0.216946
| 36,682
| 870
| 122
| 42.163218
| 0.791185
| 0.045227
| 0
| 0.715909
| 0
| 0
| 0.016558
| 0.001162
| 0
| 0
| 0
| 0
| 0
| 1
| 0.001623
| false
| 0
| 0.019481
| 0
| 0.021104
| 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
|
741c1d9921cb8c102685856d7459fbd8665f223a
| 3,037
|
py
|
Python
|
service/restapi_service.py
|
estuaryoss/discovery-cli
|
49b2eee58d14430aa58071aad9a368b4164ef898
|
[
"Apache-2.0"
] | null | null | null |
service/restapi_service.py
|
estuaryoss/discovery-cli
|
49b2eee58d14430aa58071aad9a368b4164ef898
|
[
"Apache-2.0"
] | null | null | null |
service/restapi_service.py
|
estuaryoss/discovery-cli
|
49b2eee58d14430aa58071aad9a368b4164ef898
|
[
"Apache-2.0"
] | null | null | null |
import re
import requests
from requests.auth import HTTPBasicAuth
class RestApiService:
def __init__(self, connection):
self.conn = connection
def about(self):
endpoint = "/about"
url_format = f"{self.conn.get('homePageUrl')}{endpoint}"
headers = {
"Content-Type": "application/json"
}
response = requests.get(url_format, headers=headers, timeout=5, verify=self.conn.get('cert'),
auth=HTTPBasicAuth(self.conn.get('username'), self.conn.get('password')))
if response.status_code != 200:
raise BaseException("Error: Http code: {}. Http body: {}".format(response.status_code, response.text))
return response.json()
def ping(self):
endpoint = "/ping"
url_format = f"{self.conn.get('homePageUrl')}{endpoint}"
headers = {
"Content-Type": "application/json"
}
response = requests.get(url_format, headers=headers, timeout=5, verify=self.conn.get('cert'),
auth=HTTPBasicAuth(self.conn.get('username'), self.conn.get('password')))
if response.status_code != 200:
raise BaseException("Error: Http code: {}. Http body: {}".format(response.status_code, response.text))
return response.json()
def get_commands(self):
endpoint = "/agents/commands"
url_format = f"{self.conn.get('homePageUrl')}{endpoint}"
headers = {
"Content-Type": "application/json"
}
response = requests.get(url_format, headers=headers, timeout=5, verify=self.conn.get('cert'),
auth=HTTPBasicAuth(self.conn.get('username'), self.conn.get('password')))
# error, server sent non 20x code
if not re.search('^20\d$', str(response.status_code)):
print(response.json())
return {'description': []}
body = response.json()
# error, the type should be dict
if isinstance(body['description'], str):
print(body.get('description'))
return {'description': []}
return body
def get_eureka_apps(self):
endpoint = "/eureka/apps"
url_format = f"{self.conn.get('homePageUrl')}{endpoint}"
headers = {
"Content-Type": "application/json"
}
response = requests.get(url_format, headers=headers, timeout=5, verify=self.conn.get('cert'),
auth=HTTPBasicAuth(self.conn.get('username'), self.conn.get('password')))
# error, server sent non 20x code
if not re.search('^20\d$', str(response.status_code)):
print(response.json())
return {'description': {}}
body = response.json()
# error, the type should be dict
if isinstance(body['description'], str):
print(body.get('description'))
return {'description': {}}
return body
def get_connection(self):
return self.conn
| 33.373626
| 114
| 0.578531
| 326
| 3,037
| 5.322086
| 0.196319
| 0.082997
| 0.101441
| 0.032277
| 0.851873
| 0.851873
| 0.851873
| 0.851873
| 0.851873
| 0.851873
| 0
| 0.008246
| 0.281199
| 3,037
| 90
| 115
| 33.744444
| 0.786532
| 0.041159
| 0
| 0.677419
| 0
| 0
| 0.192982
| 0.05504
| 0
| 0
| 0
| 0
| 0
| 1
| 0.096774
| false
| 0.064516
| 0.048387
| 0.016129
| 0.306452
| 0.064516
| 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
|
742f99cc65dd0b73aadb4762d17f9a427f8acc40
| 2,962
|
py
|
Python
|
day_01.py
|
philarmour/aoc-2017
|
94fed879c766a41f55a6fa1a1e3d02fc1b5b366e
|
[
"Apache-2.0"
] | null | null | null |
day_01.py
|
philarmour/aoc-2017
|
94fed879c766a41f55a6fa1a1e3d02fc1b5b366e
|
[
"Apache-2.0"
] | null | null | null |
day_01.py
|
philarmour/aoc-2017
|
94fed879c766a41f55a6fa1a1e3d02fc1b5b366e
|
[
"Apache-2.0"
] | null | null | null |
captcha="428122498997587283996116951397957933569136949848379417125362532269869461185743113733992331379856446362482129646556286611543756564275715359874924898113424472782974789464348626278532936228881786273586278886575828239366794429223317476722337424399239986153675275924113322561873814364451339186918813451685263192891627186769818128715595715444565444581514677521874935942913547121751851631373316122491471564697731298951989511917272684335463436218283261962158671266625299188764589814518793576375629163896349665312991285776595142146261792244475721782941364787968924537841698538288459355159783985638187254653851864874544584878999193242641611859756728634623853475638478923744471563845635468173824196684361934269459459124269196811512927442662761563824323621758785866391424778683599179447845595931928589255935953295111937431266815352781399967295389339626178664148415561175386725992469782888757942558362117938629369129439717427474416851628121191639355646394276451847131182652486561415942815818785884559193483878139351841633366398788657844396925423217662517356486193821341454889283266691224778723833397914224396722559593959125317175899594685524852419495793389481831354787287452367145661829287518771631939314683137722493531318181315216342994141683484111969476952946378314883421677952397588613562958741328987734565492378977396431481215983656814486518865642645612413945129485464979535991675776338786758997128124651311153182816188924935186361813797251997643992686294724699281969473142721116432968216434977684138184481963845141486793996476793954226225885432422654394439882842163295458549755137247614338991879966665925466545111899714943716571113326479432925939227996799951279485722836754457737668191845914566732285928453781818792236447816127492445993945894435692799839217467253986218213131249786833333936332257795191937942688668182629489191693154184177398186462481316834678733713614889439352976144726162214648922159719979143735815478633912633185334529484779322818611438194522292278787653763328944421516569181178517915745625295158611636365253948455727653672922299582352766484"
# captcha="123123"
def check(val, next):
if val == next:
return int(val)
else:
return 0
def two():
sum = 0
dist = int(len(captcha) / 2)
for i, d in enumerate(captcha):
# print("i={}; d={}; i+dist={}; i + dist - len(captcha)={}".format(i,d,(i + dist),(i + dist - len(captcha))))
if i + dist > len(captcha) - 1:
next = captcha[(i + dist - len(captcha))]
else:
next = captcha[(i + dist)]
sum += check(d, next)
print("sum is {}".format(sum))
def one():
sum = 0
for i, d in enumerate(captcha):
# print("i={}; d={}".format(i,d))
if i == len(captcha) - 1:
next = captcha[0]
else:
next = captcha[i]
sum += check(d, next)
print("sum is {}".format(sum))
def main():
# one()
two()
if __name__ == "__main__":
main()
| 55.886792
| 2,062
| 0.836597
| 121
| 2,962
| 20.413223
| 0.239669
| 0.01417
| 0.012955
| 0.024292
| 0.087449
| 0.069636
| 0.069636
| 0.069636
| 0.052632
| 0.02834
| 0
| 0.778951
| 0.104997
| 2,962
| 52
| 2,063
| 56.961538
| 0.152773
| 0.054693
| 0
| 0.37931
| 0
| 0
| 0.743737
| 0.734431
| 0
| 1
| 0
| 0
| 0
| 1
| 0.137931
| false
| 0
| 0
| 0
| 0.206897
| 0.068966
| 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
|
7435d25b2e20cacd6a8d1f812d3a6df1b859ce67
| 2,913
|
py
|
Python
|
clients/python/pacman.py
|
jsestrich/light-project
|
3b00472feb859dc8a4a839e976fdfbb70bd23c1b
|
[
"CC0-1.0"
] | 1
|
2018-01-31T14:18:19.000Z
|
2018-01-31T14:18:19.000Z
|
clients/python/pacman.py
|
jsestrich/light-project
|
3b00472feb859dc8a4a839e976fdfbb70bd23c1b
|
[
"CC0-1.0"
] | null | null | null |
clients/python/pacman.py
|
jsestrich/light-project
|
3b00472feb859dc8a4a839e976fdfbb70bd23c1b
|
[
"CC0-1.0"
] | null | null | null |
#!/usr/bin/env python
# Open Pixel Control client: All lights to solid white
import opc, time
w = 8
h = 8
numLEDs = w * h
client = opc.Client('localhost:8080')
pixels = [(0, 0, 0)] * numLEDs
PACMAN_IMGS = [
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
];
black = (0,0,0)
white = (255,255,255)
yellow = (100, 100, 0)
offset = 0
while True:
for x in range(w):
for y in range(h):
if (PACMAN_IMGS[offset % len(PACMAN_IMGS)][y * 2][x * 2] > 0):
pixels[x + y * w] = yellow
else:
pixels[x + y * w] = black
client.put_pixels(pixels)
time.sleep(0.5)
offset += 1
| 35.52439
| 74
| 0.343289
| 769
| 2,913
| 1.295189
| 0.059818
| 0.63253
| 0.822289
| 0.943775
| 0.677711
| 0.677711
| 0.677711
| 0.677711
| 0.677711
| 0.677711
| 0
| 0.38172
| 0.361483
| 2,913
| 81
| 75
| 35.962963
| 0.153763
| 0.02506
| 0
| 0.643836
| 0
| 0
| 0.004933
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.013699
| 0
| 0.013699
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 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
| 7
|
77943aec4b1c16db9048237350d8d48977293d28
| 306
|
py
|
Python
|
main.py
|
PoPoPoPony/flow_bot
|
682eb653b7194a1e72e499a552a2512d3ac1b373
|
[
"MIT"
] | null | null | null |
main.py
|
PoPoPoPony/flow_bot
|
682eb653b7194a1e72e499a552a2512d3ac1b373
|
[
"MIT"
] | null | null | null |
main.py
|
PoPoPoPony/flow_bot
|
682eb653b7194a1e72e499a552a2512d3ac1b373
|
[
"MIT"
] | null | null | null |
import flow
ip_lst = flow.get_ip_lst_1()
flow.check_ip(ip_lst, song_id=157014)
ip_lst = flow.get_ip_lst_2()
flow.check_ip(ip_lst, song_id=157014)
ip_lst = flow.get_ip_lst_3()
flow.check_ip(ip_lst, song_id=157014)
ip_lst = flow.get_ip_lst_4(3)
flow.check_ip(ip_lst, song_id=157014)
| 17
| 38
| 0.728758
| 63
| 306
| 3.095238
| 0.206349
| 0.307692
| 0.184615
| 0.246154
| 0.933333
| 0.933333
| 0.846154
| 0.846154
| 0.846154
| 0.692308
| 0
| 0.111969
| 0.153595
| 306
| 17
| 39
| 18
| 0.640927
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.111111
| 0
| 0
| 0
| 0
| null | 1
| 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
| 9
|
77ae5b2dd2890a2f970641fe663643086fa494e8
| 10,061
|
py
|
Python
|
src/foreign_if/python/main/python/frovedis/mllib/tree.py
|
wmeddie/frovedis
|
c134e5e64114799cc7c265c72525ff98d06b49c1
|
[
"BSD-2-Clause"
] | null | null | null |
src/foreign_if/python/main/python/frovedis/mllib/tree.py
|
wmeddie/frovedis
|
c134e5e64114799cc7c265c72525ff98d06b49c1
|
[
"BSD-2-Clause"
] | null | null | null |
src/foreign_if/python/main/python/frovedis/mllib/tree.py
|
wmeddie/frovedis
|
c134e5e64114799cc7c265c72525ff98d06b49c1
|
[
"BSD-2-Clause"
] | null | null | null |
#!/usr/bin/env python
from .model_util import *
from ..exrpc.rpclib import *
from ..exrpc.server import *
from ..matrix.ml_data import FrovedisLabeledPoint
from ..matrix.dtype import TypeUtil
from .metrics import *
import numpy as np
# Decision Tree Regressor Class
class DecisionTreeRegressor:
"A python wrapper of Frovedis Decision Tree Regressor"
"""
parameter : default value
criterion or impurity : 'mse'
plitter : 'best'
in_impurity_decrease : 0.0
in_samples_split : 2
min_samples_leaf : 1
in_weight_fraction_leaf : 0.0
presort : False
verbose : 0
"""
# defaults are as per Frovedis/scikit-learn
# Decision Tree Regressor constructor
def __init__(cls, criterion='mse', splitter='best',
max_depth=None, min_samples_split=2, min_samples_leaf=1,
min_weight_fraction_leaf=0.0, max_features=None, random_state=None,
max_leaf_nodes=1, min_impurity_decrease=0.0, min_impurity_split=None,
class_weight=None, presort=False,
min_info_gain = 0.0, max_bins = 32, verbose = 0):
cls.criterion = criterion.upper()
cls.splitter = splitter
if max_depth is None: cls.max_depth = 5
else: cls.max_depth = max_depth
cls.min_samples_split = min_samples_split
cls.min_samples_leaf = min_samples_leaf
cls.min_weight_fraction_leaf = min_weight_fraction_leaf
cls.max_features = max_features
cls.random_state = random_state
cls.max_leaf_nodes = max_leaf_nodes
cls.min_impurity_decrease = min_impurity_decrease
cls.min_impurity_split = min_impurity_split
cls.class_weight = class_weight
cls.presort = presort
cls.verbose = verbose
# extra
cls.__mid = None
cls.__mdtype = None
cls.__mkind = M_KIND.DTM
# Frovedis side parameters
cls.min_info_gain = min_info_gain
cls.max_bins = max_bins
cls.algo = "Regression"
cls.n_classes_ = 0
#To validate the input parameters
def validate(cls):
if cls.criterion != "MSE":
raise ValueError("Invalid criterion for Decision Tree Regressor!")
elif cls.max_depth < 0:
raise ValueError("max depth can not be negative !")
elif cls.min_info_gain < 0:
raise ValueError("Value of min_info_gain should be greater than 0")
elif cls.max_bins < 0:
raise ValueError("Value of max_bin should be greater than 0")
elif cls.n_classes_ < 0:
raise ValueError("Value of number of classes should be +ve integer or zero!")
elif cls.min_samples_leaf < 0:
raise ValueError("Value of min_samples_leaf should be greater than 0!")
# Fit Decision Tree Regressor according to X (input data), y (Label)
def fit(cls, X, y):
cls.validate()
cls.release()
cls.__mid = ModelID.get()
inp_data = FrovedisLabeledPoint(X,y)
(X, y) = inp_data.get()
dtype = inp_data.get_dtype()
itype = inp_data.get_itype()
dense = inp_data.is_dense()
cls.__mdtype = dtype
(host,port) = FrovedisServer.getServerInstance()
rpclib.dt_train(host,port,X.get(),y.get(),
cls.algo.encode('ascii'), cls.criterion.encode('ascii'),
cls.max_depth, cls.n_classes_, cls.max_bins, cls.min_samples_leaf,
cls.min_info_gain, cls.verbose, cls.__mid,
dtype, itype, dense)
excpt = rpclib.check_server_exception()
if excpt["status"]: raise RuntimeError(excpt["info"])
return cls
# Perform prediction on an array of test vectors X.
def predict(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,False)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
# Load the model from a file
def load(cls,fname,dtype=None):
cls.release()
cls.__mid = ModelID.get()
if dtype is None:
if cls.__mdtype is None:
raise TypeError("model type should be specified for loading from file!")
else: cls.__mdtype = TypeUtil.to_id_dtype(dtype)
GLM.load(cls.__mid,cls.__mkind,cls.__mdtype,fname)
return cls
# Save model to a file
def save(cls,fname):
if cls.__mid is not None: GLM.save(cls.__mid,cls.__mkind,cls.__mdtype,fname)
# calculate the root mean square value on the given test data and labels.
def score(cls, X, y):
if cls.__mid is not None:
return r2_score(y, cls.predict(X))
# Show the model
def debug_print(cls):
if cls.__mid is not None: GLM.debug_print(cls.__mid,cls.__mkind,cls.__mdtype)
# Release the model-id to generate new model-id
def release(cls):
if cls.__mid is not None:
GLM.release(cls.__mid,cls.__mkind,cls.__mdtype)
cls.__mid = None
# Check FrovedisServer is up then release
def __del__(cls):
if FrovedisServer.isUP(): cls.release()
# Decision Tree Classifier Class
class DecisionTreeClassifier:
"A python wrapper of Frovedis Decision Tree Classifier"
"""
parameter : default value
criterion or impurity : 'gini'
splitter : 'best'
min_impurity_decrease : 0.0
min_samples_split : 2
min_samples_leaf : 1
min_weight_fraction_leaf : 0.0
presort : False
verbose : 0
"""
# defaults are as per Frovedis/scikit-learn
# Decision Tree Regressor constructor
def __init__(cls, criterion='gini', splitter='best',
max_depth=None, min_samples_split=2, min_samples_leaf=1,
min_weight_fraction_leaf=0.0, max_features=None, random_state=None,
max_leaf_nodes=1, min_impurity_decrease=0.0, min_impurity_split=None,
class_weight=None, presort=False,min_info_gain=0.0,
max_bins=32,verbose=0):
cls.criterion = criterion.upper()
cls.splitter = splitter
if max_depth is None: cls.max_depth = 5
else: cls.max_depth = max_depth
cls.min_samples_split = min_samples_split
cls.min_samples_leaf = min_samples_leaf
cls.min_weight_fraction_leaf = min_weight_fraction_leaf
cls.max_features = max_features
cls.random_state = random_state
cls.min_impurity_decrease = min_impurity_decrease
cls.min_impurity_split = min_impurity_split
cls.class_weight = class_weight
cls.max_leaf_nodes = max_leaf_nodes
cls.presort = presort
cls.verbose = verbose
# extra
cls.__mid = None
cls.__mdtype = None
cls.__mkind = M_KIND.DTM
# Frovedis side parameters
cls.min_info_gain = min_info_gain
cls.max_bins = max_bins
cls.algo = "Classification"
def validate(cls):
if cls.criterion != "GINI" and cls.criterion != "ENTROPY":
raise ValueError("Invalid criterion for Decision Tree Regressor!")
elif cls.max_depth < 0:
raise ValueError("max depth can not be negative !")
elif cls.min_info_gain < 0:
raise ValueError("Value of min_info_gain should be greater than 0")
elif cls.max_bins < 0:
raise ValueError("Value of max_bin should be greater than 0")
elif cls.min_samples_leaf < 0:
raise ValueError("Value of min_samples_leaf should be greater than 0!")
elif cls.n_classes_ < 0:
raise ValueError("Value of number of classes should be +ve integer or zero!")
# Fit Decision Tree classifier according to X (input data), y (Label)
def fit(cls, X, y):
# compute number of classes in given label vector (y)
n_labels = []
for e in y:
if e not in n_labels: n_labels.append(e)
cls.n_classes_ = len(n_labels)
# validate hyper-parameters
cls.validate()
# release old model, if any
cls.release()
# perform the fit
cls.__mid = ModelID.get()
inp_data = FrovedisLabeledPoint(X,y)
(X, y) = inp_data.get()
dtype = inp_data.get_dtype()
itype = inp_data.get_itype()
dense = inp_data.is_dense()
cls.__mdtype = dtype
(host,port) = FrovedisServer.getServerInstance()
rpclib.dt_train(host,port,X.get(),y.get(),
cls.algo.encode('ascii'), cls.criterion.encode('ascii'),
cls.max_depth, cls.n_classes_, cls.max_bins, cls.min_samples_leaf,
cls.min_info_gain, cls.verbose, cls.__mid,
dtype, itype, dense)
excpt = rpclib.check_server_exception()
if excpt["status"]: raise RuntimeError(excpt["info"])
return cls
# Perform classification on an array of test vectors X.
def predict(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,False)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
# Perform classification on an array and return probability estimates for the test vector X.
def predict_proba(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,True)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
# Load the model from a file
def load(cls,fname,dtype=None):
cls.release()
cls.__mid = ModelID.get()
if dtype is None:
if cls.__mdtype is None:
raise TypeError("model type should be specified for loading from file!")
else: cls.__mdtype = TypeUtil.to_id_dtype(dtype)
GLM.load(cls.__mid,cls.__mkind,cls.__mdtype,fname)
return cls
# calculate the mean accuracy on the given test data and labels.
def score(cls,X,y):
if cls.__mid is not None:
return accuracy_score(y, cls.predict(X))
# Save model to a file
def save(cls,fname):
if cls.__mid is not None: GLM.save(cls.__mid,cls.__mkind,cls.__mdtype,fname)
# Show the model
def debug_print(cls):
if cls.__mid is not None: GLM.debug_print(cls.__mid,cls.__mkind,cls.__mdtype)
# Release the model-id to generate new model-id
def release(cls):
if cls.__mid is not None:
GLM.release(cls.__mid,cls.__mkind,cls.__mdtype)
cls.__mid = None
# Check FrovedisServer is up then release
def __del__(cls):
if FrovedisServer.isUP(): cls.release()
| 36.060932
| 94
| 0.678163
| 1,461
| 10,061
| 4.414784
| 0.13347
| 0.029767
| 0.030388
| 0.017054
| 0.869767
| 0.857674
| 0.831783
| 0.816279
| 0.808837
| 0.808837
| 0
| 0.007485
| 0.229798
| 10,061
| 278
| 95
| 36.190647
| 0.824881
| 0.132094
| 0
| 0.84456
| 0
| 0
| 0.126291
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.108808
| false
| 0
| 0.036269
| 0
| 0.202073
| 0.020725
| 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
|
77afb70f992cb547996100055ca785fdf64c44c6
| 183
|
py
|
Python
|
venv/Scripts/ex096.py
|
SamuelNunesDev/starting_point_in_python
|
9a9e39cabb5f3526ee0037012e3943898c1d9dfa
|
[
"MIT"
] | null | null | null |
venv/Scripts/ex096.py
|
SamuelNunesDev/starting_point_in_python
|
9a9e39cabb5f3526ee0037012e3943898c1d9dfa
|
[
"MIT"
] | null | null | null |
venv/Scripts/ex096.py
|
SamuelNunesDev/starting_point_in_python
|
9a9e39cabb5f3526ee0037012e3943898c1d9dfa
|
[
"MIT"
] | null | null | null |
def area(l, c):
return f'A área do terreno {l}x{c} é de {l * c:.2f} m²'
print(area(float(input('Qual a largura do terreno? ')), float(input('Qual o comprimento do terreno? '))))
| 36.6
| 105
| 0.639344
| 35
| 183
| 3.342857
| 0.628571
| 0.230769
| 0.239316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013245
| 0.174863
| 183
| 4
| 106
| 45.75
| 0.761589
| 0
| 0
| 0
| 0
| 0.333333
| 0.562842
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 0.666667
| 0.333333
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
77fb348a4025f86570371535f2d3c6aa8aaffff8
| 1,229
|
py
|
Python
|
examples/markdown/estimatingtheareaofacircleMD/problem_statement/gen_xfig_points.py
|
etdickey/problemtools
|
6ab0e6fc3b00893bda387d25c5fef0f36b4a9be0
|
[
"MIT"
] | null | null | null |
examples/markdown/estimatingtheareaofacircleMD/problem_statement/gen_xfig_points.py
|
etdickey/problemtools
|
6ab0e6fc3b00893bda387d25c5fef0f36b4a9be0
|
[
"MIT"
] | null | null | null |
examples/markdown/estimatingtheareaofacircleMD/problem_statement/gen_xfig_points.py
|
etdickey/problemtools
|
6ab0e6fc3b00893bda387d25c5fef0f36b4a9be0
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
"""Generate 75 points inside and 25 points outside the circle"""
import random
boundary_x = (3300, 7700)
boundary_y = (3000, 7400)
radius_2 = 2250 ** 2
center_x = 5490
center_y = 5220
point_radius = 45
count = 0
while count < 75:
cx = random.randint(*boundary_x)
cy = random.randint(*boundary_y)
if (cx - center_x) ** 2 + (cy - center_y) ** 2 < radius_2:
sx = cx - (point_radius - 1) / 2
sy = cy - (point_radius - 1) / 2
ex = cx + (point_radius - 1) / 2
ey = cy + (point_radius - 1) / 2
print '1 4 0 1 0 0 50 -1 20 0.000 1 0.0000 {cx} {cy} {point_radius} {point_radius} {sx} {sy} {ex} {ey}'.format(**locals())
count += 1
count = 0
while count < 25:
cx = random.randint(*boundary_x)
cy = random.randint(*boundary_y)
if (cx - center_x) ** 2 + (cy - center_y) ** 2 >= radius_2:
sx = cx - (point_radius - 1) / 2
sy = cy - (point_radius - 1) / 2
ex = cx + (point_radius - 1) / 2
ey = cy + (point_radius - 1) / 2
print '1 4 0 1 0 0 50 -1 20 0.000 1 0.0000 {cx} {cy} {point_radius} {point_radius} {sx} {sy} {ex} {ey}'.format(**locals())
count += 1
| 29.261905
| 131
| 0.540277
| 194
| 1,229
| 3.278351
| 0.252577
| 0.224843
| 0.150943
| 0.163522
| 0.701258
| 0.701258
| 0.701258
| 0.701258
| 0.701258
| 0.701258
| 0
| 0.127059
| 0.308381
| 1,229
| 41
| 132
| 29.97561
| 0.621176
| 0.013019
| 0
| 0.62069
| 1
| 0.068966
| 0.165505
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.034483
| null | null | 0.068966
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
24b88f8120db1c60cb2aec3bad7360bf7727c63f
| 29,754
|
py
|
Python
|
tests/medianizer_test.py
|
fxfactorial/open-oracle-medianizer
|
5b642a8d6f64b61c41759eaf370d673da5eeacd4
|
[
"MIT"
] | null | null | null |
tests/medianizer_test.py
|
fxfactorial/open-oracle-medianizer
|
5b642a8d6f64b61c41759eaf370d673da5eeacd4
|
[
"MIT"
] | null | null | null |
tests/medianizer_test.py
|
fxfactorial/open-oracle-medianizer
|
5b642a8d6f64b61c41759eaf370d673da5eeacd4
|
[
"MIT"
] | 1
|
2021-09-05T22:34:24.000Z
|
2021-09-05T22:34:24.000Z
|
REPORTS = [
{
"address": "0xCd0D1a6BD24fCD578d1bb211487cD24f840BC900",
"payload": {
"messages": [
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000001789e100000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cb935e0000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a0f0e600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000619562600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000185f100000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000657d40000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d7ec80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000",
],
"prices": {
"BAT": "0.415700",
"BTC": "39091.900000",
"COMP": "481.900000",
"ETH": "1637.180000",
"KNC": "1.933000",
"LINK": "24.682000",
"ZRX": "1.597200",
},
"signatures": [
"0x3a6b0b7d403f330be0f12e49da0d108f424d50b11c604383800f98cb471906796b221ea563ec725db448eed29430758e83957fd30110fd0ef1d9de6cc306672b000000000000000000000000000000000000000000000000000000000000001c",
"0x34374c83f25bec8e1a86e67ef0c6fd3075c44cb13075d38edba85973298978316787099a2c4449e14f774aa2531c4486e268dc905a22af3190e941430bbff664000000000000000000000000000000000000000000000000000000000000001b",
"0xb1413117fffafad10df28a16da2b0a2e99147dc01b99c0ae91fbdb2ecb85d81a7197f9396ea6f012eabf9084ff1cd2385f76d2ae1c38f772971b9cd1fb3cd9c4000000000000000000000000000000000000000000000000000000000000001c",
"0x5bedbc0d17bfaa04428b4c0b59023a234de4e89e7c85652c72620a4570d6de6e10994e106b8be085c4368d16de90d97e93e0b99c0cdf676dc732f18b1973bd1e000000000000000000000000000000000000000000000000000000000000001b",
"0xfc74694cb78c70b48d5a895923d891f0939d9f68b1faa07c48bb9d01aa852deb68f95b90d81998491d9af978ced94df5ebfdde064ea1f0c366b9473ab51fe40f000000000000000000000000000000000000000000000000000000000000001c",
"0x8c0a744a76bcda0fb1709e29ba447e625b521c77eb52618e42bd79acb7dd5ae33fac5adcc3b095d89b80ccbcf092d088350d539a1b932bd432a3f05829551230000000000000000000000000000000000000000000000000000000000000001b",
"0xc470bb19e3b8328c6a4f59f6ba91b61585a6a644ba3e8161b1c9510e21c29fe16c7b0e095be9835e6c13785eb3413a615b6098c972fd6e1f0846367f4f25d822000000000000000000000000000000000000000000000000000000000000001c",
],
"timestamp": "1612779749",
},
},
{
"address": "0xef207780639b911e6B064B8Bf6F03f8BE5260a58",
"payload": {
"messages": [
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001862f80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000658380000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d82b00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a1f80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cab7a40000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a1e50a00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006196e9000000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000",
],
"prices": {
"BAT": "0.415800",
"BTC": "39092.900000",
"COMP": "481.000000",
"ETH": "1637.280000",
"KNC": "1.934000",
"LINK": "24.683000",
"ZRX": "1.598200",
},
"signatures": [
"0x24f319f2ff0978613240ac8317bdbd380243a43aeeeee955fbdb99740471bb6e42d344d27056df235a9795d37aa4323b9ad1241551684c4cdf28245f63fdc7bd000000000000000000000000000000000000000000000000000000000000001b",
"0x809c8af8b57f95e913902e8af9d4a047521b1cb91752b5c7859326de125f6bdf3010f79c8f741cbc0778ec4ccc9fc7d0f9e369b0e2850bc19e65fe56f72604d8000000000000000000000000000000000000000000000000000000000000001c",
"0xebf24d5982c4f3a0527414133a6b1fc368d7b45e15ae3543f4e0a661db79fd3735f28edba94616b21211f61f93e83460a32e3d9d17ad1524785906d398edd653000000000000000000000000000000000000000000000000000000000000001b",
"0xf5f0709e7f3719bde5003f33d71b3806291002133ff5062e4a7964a307a3d0a60a66f5308947b07a235c1d560733b41da5b183b438c9fb4e05991a0803584c15000000000000000000000000000000000000000000000000000000000000001b",
"0x0597fd1934139b341177d00e849f32e48682310167324ba01d1c92911441179b7ae5e110fa4ad95339ff86d8f8908f54c05f98395116b9649b1eb9d22641e41f000000000000000000000000000000000000000000000000000000000000001c",
"0xf392088cbb3e6d208cae3b76b5168966122cc329af7dc288d4bead0aaa08b4fe1fab124958a23a1b38cbcdda1d9ec01bfaac473baa9ea7ef5a4623d0536fd2da000000000000000000000000000000000000000000000000000000000000001c",
"0xca0c50b59661bbdded30c8747eedb78f94f399269aa88a0ba0b6caf5e07b431d2b322e03d0b25df0f54b0e12bb781419d20246902d2c72b8d7cc5b1015ebebac000000000000000000000000000000000000000000000000000000000000001b",
],
"timestamp": "1612779750",
},
},
{
"address": "0xd264c579e7b7B278395303aB64ee583917228bfd",
"payload": {
"messages": [
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000061986fa00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001866e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000006589c0000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d86980000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a5e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cad00e0000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a2d92e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000",
],
"prices": {
"BAT": "0.415900",
"BTC": "39093.900000",
"COMP": "481.100000",
"ETH": "1637.380000",
"KNC": "1.935000",
"LINK": "24.684000",
"ZRX": "1.599200",
},
"signatures": [
"0x8d0e96469b80f11cebe95e4cb6cb089dbd2c9fb0b767f6d70ae381bee3efbdf67d58ff8ddc62743f2a85d8a3b22d5baba12a2be89eb2d652fe552d00c8aa5dfb000000000000000000000000000000000000000000000000000000000000001c",
"0xa079c89c55432039b1506a3964b7276a47013fa092b6d5d07087e953f6e1fec661eb2998e4b1396fc26557b1c5366010147e1c8f25987f75256d0e9d425b3a6d000000000000000000000000000000000000000000000000000000000000001b",
"0x066eb88ad643a97d095523207e84072497f5f89e9648183e9a77aeef3f16eac31573dea48cce787085a805442fe72151301ea94debb821839b3245eb3205df8c000000000000000000000000000000000000000000000000000000000000001b",
"0x8c9d61b86c68d46cd1fa578c5d252faa9cbb119c344cad61b2b67105e69813670577db1f9604a70ebadd8490fa52a968fba885964051457355c721a0bccf19ae000000000000000000000000000000000000000000000000000000000000001c",
"0x5a3da98cb87f3fb14023418837f6d2cd3aa832f0ca5881fbd66be13b4e05cd25007cdb112f20d0662d7cc5262bd616efe396201c65c92caa7b528d1297362d11000000000000000000000000000000000000000000000000000000000000001b",
"0x57e09b6d4f0d414a705b8e5cd21fc86e8167891df4055bd8f2e46a81b1bb09596a02f8ffed52f8fd5a5b03da450f4eee2c42fe29444ef5343aacbf48a72747fd000000000000000000000000000000000000000000000000000000000000001b",
"0x3f82eaf2ac86d37d8ecfdbd0ed8e2a9e5186e0d819e3fadbea1b200447cbcaa0700bbd4be635e6e741a53768f305a78ab4888c567077987e859792eb3bda0cec000000000000000000000000000000000000000000000000000000000000001b",
],
"timestamp": "1612779751",
},
},
{
"address": "0x4994779B1f4e1cA4582d0527cF0bf5A01248DF5C",
"payload": {
"messages": [
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cae8780000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a3cd5200000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006199f6400000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001843b80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000655180000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d8a800000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a9c80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000",
],
"prices": {
"BAT": "0.415000",
"BTC": "39094.900000",
"COMP": "481.200000",
"ETH": "1637.480000",
"KNC": "1.936000",
"LINK": "24.685000",
"ZRX": "1.590200",
},
"signatures": [
"0x70d6d8ea44af86024c1417ffec64b1a68d9f15fc9e9f7d56404f3164057139ef46c8b470da85569fad4bcdb8dadee79338a158feb606ace2cfc3c3afd241bae8000000000000000000000000000000000000000000000000000000000000001b",
"0x1757a9af7796f7929b86657cae31401f34418a90f40332a54381f5d984c75ca621bf37ffe6ea1124fd09c12ebdb369a05e6922442170466208b0d00cdff590b4000000000000000000000000000000000000000000000000000000000000001c",
"0xd53d341bd6583813c2a7c9d0c62a0fb12d948cf14a80a09d1a0b4ba0554c3825796321469f0460dfbed697e13e6189a50b1149d95904a68796763dbee432fae3000000000000000000000000000000000000000000000000000000000000001c",
"0x43cd23f8696b2f099af12a905207dc4d2fcc955ba2ebdefefb95016cd5db1056081aed5f99f2ec2f139070801849ccae6e1635d69e98849509c5cd4f5e3bd67a000000000000000000000000000000000000000000000000000000000000001c",
"0x704b2bbd0ba687dcc753ae0e1c61f14a4b66cda13c3f91326b3e75b557e43bee3d5e162d08c40fcc38dee0672242394c7c82959e8be4da6bdbfaccbf9507c0d4000000000000000000000000000000000000000000000000000000000000001b",
"0x5f993deecec1c2acdbc006a427999b6e29e0bd3b25d0c830942da50d289f05f65f6ef14547a45c3bec6f5989e61f9b305618efa0488b6a14db76eadec42ab7e3000000000000000000000000000000000000000000000000000000000000001b",
"0x8c9fdfc3357762adeb613e741fe4cfb37291cda30442bd89e2831a4750e479f058c13187272134fb2e848ca06faf276cfa27d53b8c3d714f4968d9852ce6f038000000000000000000000000000000000000000000000000000000000000001b",
],
"timestamp": "1612779752",
},
},
{
"address": "0xDb3DD6a3E8216381fFf19648067ca964A8bf2C1c",
"payload": {
"messages": [
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178adb00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cb00e20000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a4c17600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000619b7ce00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001847a00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000006557c0000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d8e680000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000",
],
"prices": {
"BAT": "0.415100",
"BTC": "39095.900000",
"COMP": "481.300000",
"ETH": "1637.580000",
"KNC": "1.937000",
"LINK": "24.686000",
"ZRX": "1.591200",
},
"signatures": [
"0x1c4c0b0add2a10836fdcf0ba71ea939e472920e5ab38305f5950598f834efd3659b088cbdec1f66a8ffebb5182f6255f49e380eb6939b483d971f64a4454742b000000000000000000000000000000000000000000000000000000000000001c",
"0x9e9ae712269067270787d1e9fc7bd51697143f228a41373151e5a0ef00e2ec5038dedbf1c558df7ec06ca7bd4ca10653e22762bf3d7c6001aea7078c1c0ffc1e000000000000000000000000000000000000000000000000000000000000001b",
"0xa8797f59180db4f3ed51c3c11d3d59b151edbf80f54c0d8711c972655049e3331d01ee1d48f6a4faddce1ec7085fec886167f6fda8a71c44962832c81be18254000000000000000000000000000000000000000000000000000000000000001c",
"0x899b2993ee394e7f8077b900faec02b96380653d1f1909d87020e5980ec30efe3c168fac123babc429933512450fbba7f6f8ed2eb8a61ef97a38925585b26990000000000000000000000000000000000000000000000000000000000000001c",
"0x8ff31d3cbd608a539ea4c09da617dca509fac0f84be75840d124c490caef5e007bcefef6646404bd62669ea247fe554b1b3cf7ba0eb17612969f81cfd40481ba000000000000000000000000000000000000000000000000000000000000001c",
"0xaf9e90951a5f4528a500d6eb3f5b0b2922e3da95730b71fe4df8fd38909021486bdc7d2bb7d80857042bbff43a30b5c3ffcc30b987501823988324d184b85c1f000000000000000000000000000000000000000000000000000000000000001b",
"0x3cb850e04b74cf2f45df60d27c3e30f596c2df76e51bb29cac44c5818443d59b2dbc2474da481952dc3e6a00b2470cb8fb1caeb158d3234dc5a26be411e4b810000000000000000000000000000000000000000000000000000000000000001b",
],
"timestamp": "1612779753",
},
},
]
def test_weighted_median(a, OpenOraclePriceData, OpenOracleMedianizer):
p = OpenOraclePriceData.deploy({"from": a[0]})
m = OpenOracleMedianizer.deploy(p, 100 * 86400, {"from": a[0]})
for each in REPORTS:
m.postPrices(each["payload"]["messages"], each["payload"]["signatures"])
m.setReporter(REPORTS[0]["address"], 100)
assert m.repoterCount() == 1
assert m.price("BTC") == 39091900000
m.setReporter(REPORTS[1]["address"], 100)
m.setReporter(REPORTS[2]["address"], 100)
m.setReporter(REPORTS[3]["address"], 100)
m.setReporter(REPORTS[4]["address"], 100)
assert m.repoterCount() == 5
assert m.price("BTC") == 39093900000
m.setReporter(REPORTS[3]["address"], 500)
assert m.repoterCount() == 5
assert m.price("BTC") == 39094900000
m.setReporter(REPORTS[3]["address"], 0)
assert m.repoterCount() == 4
assert m.price("BTC") == 39092900000
| 156.6
| 533
| 0.883511
| 328
| 29,754
| 80.140244
| 0.5
| 0.00213
| 0.00506
| 0.002283
| 0.009549
| 0.002663
| 0.002663
| 0.002663
| 0
| 0
| 0
| 0.862855
| 0.088862
| 29,754
| 189
| 534
| 157.428571
| 0.10675
| 0
| 0
| 0.171123
| 0
| 0
| 0.867816
| 0.839887
| 0
| 1
| 0.839887
| 0
| 0.042781
| 1
| 0.005348
| false
| 0
| 0
| 0
| 0.005348
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
24c7cc197a589715d35591d8ba779bbe5a535015
| 76
|
py
|
Python
|
Modulo_1/semana2/variables_contantes/verificar-palabras-reservadas.py
|
rubens233/cocid_python
|
492ebdf21817e693e5eb330ee006397272f2e0cc
|
[
"MIT"
] | null | null | null |
Modulo_1/semana2/variables_contantes/verificar-palabras-reservadas.py
|
rubens233/cocid_python
|
492ebdf21817e693e5eb330ee006397272f2e0cc
|
[
"MIT"
] | null | null | null |
Modulo_1/semana2/variables_contantes/verificar-palabras-reservadas.py
|
rubens233/cocid_python
|
492ebdf21817e693e5eb330ee006397272f2e0cc
|
[
"MIT"
] | 1
|
2022-03-04T00:57:18.000Z
|
2022-03-04T00:57:18.000Z
|
import keyword
print(keyword.iskeyword('as'))
print(keyword.iskeyword('x'))
| 19
| 30
| 0.763158
| 10
| 76
| 5.8
| 0.6
| 0.413793
| 0.724138
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 76
| 3
| 31
| 25.333333
| 0.805556
| 0
| 0
| 0
| 0
| 0
| 0.039474
| 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
|
24e9ab3f9ac1b64d760f7e8273126a6ba79d71cb
| 8,320
|
py
|
Python
|
tests/test_optimizer.py
|
AFDWang/Hetu
|
c2c85a8db885dabec41aeafe3895e5f818795e57
|
[
"Apache-2.0"
] | 82
|
2021-07-20T02:45:54.000Z
|
2022-03-14T07:08:45.000Z
|
tests/test_optimizer.py
|
AFDWang/Hetu
|
c2c85a8db885dabec41aeafe3895e5f818795e57
|
[
"Apache-2.0"
] | 4
|
2021-11-25T13:39:21.000Z
|
2022-03-13T04:14:14.000Z
|
tests/test_optimizer.py
|
AFDWang/Hetu
|
c2c85a8db885dabec41aeafe3895e5f818795e57
|
[
"Apache-2.0"
] | 13
|
2021-07-18T14:40:56.000Z
|
2022-03-09T06:37:42.000Z
|
import numpy as np
import hetu as ht
from hetu import gpu_links as gpu_op
def test_adamw():
ctx = ht.gpu(0)
shape = (500,400)
param = np.random.uniform(-10, 10, size=shape).astype(np.float32)
grad = np.random.uniform(-10, 10, size=shape).astype(np.float32)
m = np.random.uniform(-10, 10, size=shape).astype(np.float32)
v = np.random.uniform(0, 10, size=shape).astype(np.float32)
lr = 1e-2
beta1 = 0.9
beta2 = 0.99
beta1t = beta1**10
beta2t = beta2**10
eps = 1e-7
weight_decay = 0.1
print("Prev param:")
print(param)
print("Prev m:")
print(m)
print("Prev v:")
print(v)
arr_param = ht.array(param, ctx)
arr_grad = ht.array(grad, ctx)
arr_m = ht.array(m, ctx)
arr_v = ht.array(v, ctx)
gpu_op.adamw_update(arr_param, arr_grad, arr_m, arr_v, lr, beta1, beta2, beta1t, beta2t, eps, weight_decay)
re_param = arr_param.asnumpy()
re_m = arr_m.asnumpy()
re_v = arr_v.asnumpy()
m = beta1 * m + (1 - beta1) * grad
v = beta2 * v + (1 - beta2) * grad * grad
mc = m / (1 - beta1t)
vc = v / (1 - beta2t)
update = mc / (np.sqrt(vc) + eps)
param = param - lr * (update + weight_decay * param)
print("Cur param:")
print(re_param)
print(param)
print("Cur m:")
print(re_m)
print(m)
print("Cur v:")
print(re_v)
print(v)
np.testing.assert_allclose(re_param, param, atol=1e-5)
np.testing.assert_allclose(re_m, m, atol=1e-5)
np.testing.assert_allclose(re_v, v, atol=1e-5)
def test_lamb():
ctx = ht.gpu(0)
shape = (4,5)
param = np.random.uniform(-10, 10, size=shape).astype(np.float32)
grad = np.random.uniform(-10, 10, size=shape).astype(np.float32)
m = np.random.uniform(-10, 10, size=shape).astype(np.float32)
v = np.random.uniform(0, 10, size=shape).astype(np.float32)
lr = 1e-2
beta1 = 0.9
beta2 = 0.99
beta1t = beta1**10
beta2t = beta2**10
eps = 1e-7
weight_decay = 0.1
print("Prev param:")
print(param)
print("Prev m:")
print(m)
print("Prev v:")
print(v)
arr_param = ht.array(param, ctx)
arr_grad = ht.array(grad, ctx)
arr_m = ht.array(m, ctx)
arr_v = ht.array(v, ctx)
gpu_op.lamb_update(arr_param, arr_grad, arr_m, arr_v, lr, beta1, beta2, beta1t, beta2t, eps, weight_decay)
re_param = arr_param.asnumpy()
re_m = arr_m.asnumpy()
re_v = arr_v.asnumpy()
m = beta1 * m + (1 - beta1) * grad
v = beta2 * v + (1 - beta2) * grad * grad
mc = m / (1 - beta1t)
vc = v / (1 - beta2t)
update = mc / (np.sqrt(vc) + eps)
norm2_param = np.sqrt(np.sum(np.power(param, 2)))
norm2_update = np.sqrt(np.sum(np.power(update, 2)))
param = param - lr * norm2_param / norm2_update * (update + weight_decay * param)
print("Cur param:")
print(re_param)
print(param)
print("Cur m:")
print(re_m)
print(m)
print("Cur v:")
print(re_v)
print(v)
np.testing.assert_allclose(re_param, param, atol=1e-5)
np.testing.assert_allclose(re_m, m, atol=1e-5)
np.testing.assert_allclose(re_v, v, atol=1e-5)
def test_adamw_sparse():
ctx = ht.gpu(0)
shape = (500, 400)
l = np.random.randint(0,500,size=(100))
indices = np.array(l)
param = np.random.uniform(-10, 10, size=shape).astype(np.float32)
grad = np.random.uniform(-10, 10, size=(indices.shape[0], shape[1])).astype(np.float32)
m = np.random.uniform(-10, 10, size=shape).astype(np.float32)
v = np.random.uniform(0, 10, size=shape).astype(np.float32)
lr = 1e-2
beta1 = 0.9
beta2 = 0.99
beta1t = beta1**10
beta2t = beta2**10
eps = 1e-7
weight_decay = 0.1
print("Prev param:")
print(param)
print("Prev m:")
print(m)
print("Prev v:")
print(v)
print("Indices:")
print(indices)
print("Grad:")
print(grad)
arr_param = ht.array(param, ctx)
arr_indices = ht.array(indices, ctx)
arr_value = ht.array(grad, ctx)
arr_grad = ht.IndexedSlices(indices = arr_indices, values = arr_value, dense_shape = shape)
arr_m = ht.array(m, ctx)
arr_v = ht.array(v, ctx)
gpu_op.adamw_update(arr_param, arr_grad, arr_m, arr_v, lr, beta1, beta2, beta1t, beta2t, eps, weight_decay)
re_param = arr_param.asnumpy()
re_m = arr_m.asnumpy()
re_v = arr_v.asnumpy()
# numpy deduplicate
d = dict()
for i in l:
d[i]=[]
for i, g in zip(l, grad):
d[i].append(g)
for key in d.keys():
g0 = d[key][0]
for i in range(1, len(d[key])):
g0 += d[key][i]
d[key] = g0
grad_new = []
l_new = []
for key in d.keys():
l_new.append(key)
grad_new.append(d[key])
grad_new = np.array(grad_new)
for idx, g in zip(l_new, grad_new):
m[idx] = beta1 * m[idx] + (1 - beta1) * g
v[idx] = beta2 * v[idx] + (1 - beta2) * g * g
mc_idx = m[idx] / (1 - beta1t)
vc_idx = v[idx] / (1 - beta2t)
update = mc_idx / (np.sqrt(vc_idx) + eps)
param[idx] = param[idx] - lr * (update + weight_decay * param[idx])
print("Cur param:")
print(re_param)
print(param)
print("Cur m:")
print(re_m)
print(m)
print("Cur v:")
print(re_v)
print(v)
np.testing.assert_allclose(re_param, param, atol=1e-5)
np.testing.assert_allclose(re_m, m, atol=1e-5)
np.testing.assert_allclose(re_v, v, atol=1e-5)
def test_lamb_sparse():
ctx = ht.gpu(0)
shape = (500, 400)
l = np.random.randint(0,500,size=(100))
# shape = (5,4)
# l = [0,2,3]
indices = np.array(l)
param = np.random.uniform(-10, 10, size=shape).astype(np.float32)
grad = np.random.uniform(-10, 10, size=(indices.shape[0], shape[1])).astype(np.float32)
m = np.random.uniform(-10, 10, size=shape).astype(np.float32)
v = np.random.uniform(0, 10, size=shape).astype(np.float32)
lr = 1e-2
beta1 = 0.9
beta2 = 0.99
beta1t = beta1**10
beta2t = beta2**10
eps = 1e-7
weight_decay = 0.1
print("Prev param:")
print(param)
print("Prev m:")
print(m)
print("Prev v:")
print(v)
print("Indices:")
print(indices)
print("Grad:")
print(grad)
arr_param = ht.array(param, ctx)
arr_indices = ht.array(indices, ctx)
arr_value = ht.array(grad, ctx)
arr_grad = ht.IndexedSlices(indices = arr_indices, values = arr_value, dense_shape = shape)
arr_m = ht.array(m, ctx)
arr_v = ht.array(v, ctx)
gpu_op.lamb_update(arr_param, arr_grad, arr_m, arr_v, lr, beta1, beta2, beta1t, beta2t, eps, weight_decay)
re_param = arr_param.asnumpy()
re_m = arr_m.asnumpy()
re_v = arr_v.asnumpy()
# numpy deduplicate
d = dict()
for i in l:
d[i]=[]
for i, g in zip(l, grad):
d[i].append(g)
for key in d.keys():
g0 = d[key][0]
for i in range(1, len(d[key])):
g0 += d[key][i]
d[key] = g0
grad_new = []
l_new = []
for key in d.keys():
l_new.append(key)
grad_new.append(d[key])
grad_new = np.array(grad_new)
updates = []
for idx, g in zip(l_new, grad_new):
m[idx] = beta1 * m[idx] + (1 - beta1) * g
v[idx] = beta2 * v[idx] + (1 - beta2) * g * g
mc_idx = m[idx] / (1 - beta1t)
vc_idx = v[idx] / (1 - beta2t)
update = mc_idx / (np.sqrt(vc_idx) + eps)
updates.append(update)
updates = np.array(updates)
param_indexed = []
for idx in l_new:
param_indexed.append(param[idx])
param_indexed = np.array(param_indexed)
norm2_param = np.sqrt(np.sum(np.power(param_indexed, 2))) # only use indexed params to calculate norm2
norm2_update = np.sqrt(np.sum(np.power(updates, 2)))
#print(norm2_param, norm2_update)
for idx, u in zip(l_new, updates):
param[idx] = param[idx] - lr * norm2_param / norm2_update * (u + weight_decay * param[idx])
print("Cur param:")
print(re_param)
print(param)
print("Cur m:")
print(re_m)
print(m)
print("Cur v:")
print(re_v)
print(v)
np.testing.assert_allclose(re_param, param, atol=1e-5)
np.testing.assert_allclose(re_m, m, atol=1e-5)
np.testing.assert_allclose(re_v, v, atol=1e-5)
test_adamw()
test_lamb()
test_adamw_sparse()
test_lamb_sparse()
| 27.458746
| 111
| 0.589183
| 1,350
| 8,320
| 3.5
| 0.071852
| 0.046561
| 0.050794
| 0.05037
| 0.917037
| 0.89545
| 0.89545
| 0.891217
| 0.878942
| 0.864974
| 0
| 0.052699
| 0.251923
| 8,320
| 303
| 112
| 27.458746
| 0.706459
| 0.016346
| 0
| 0.889328
| 0
| 0
| 0.026168
| 0
| 0
| 0
| 0
| 0
| 0.047431
| 1
| 0.01581
| false
| 0
| 0.011858
| 0
| 0.027668
| 0.268775
| 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
|
706e2fe849958455888e9078a2a0eb54ff6cb2f8
| 173
|
py
|
Python
|
third_party_package/RDKit_2015_03_1/rdkit/_py2_pickle.py
|
Ivy286/cluster_basedfps
|
7fc216537f570436f008ea567c137d03ba2b6d81
|
[
"WTFPL"
] | 9
|
2019-04-23T01:46:12.000Z
|
2021-08-16T07:07:12.000Z
|
third_party_package/RDKit_2015_03_1/rdkit/_py2_pickle.py
|
Ivy286/cluster_basedfps
|
7fc216537f570436f008ea567c137d03ba2b6d81
|
[
"WTFPL"
] | null | null | null |
third_party_package/RDKit_2015_03_1/rdkit/_py2_pickle.py
|
Ivy286/cluster_basedfps
|
7fc216537f570436f008ea567c137d03ba2b6d81
|
[
"WTFPL"
] | 5
|
2016-09-21T03:47:48.000Z
|
2019-07-30T22:17:35.000Z
|
from cPickle import load as _load
from cPickle import loads as _loads
from cPickle import *
def load(f, **kwargs): return _load(f)
def loads(s, **kwargs): return _loads(s)
| 24.714286
| 40
| 0.745665
| 29
| 173
| 4.310345
| 0.37931
| 0.264
| 0.408
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156069
| 173
| 6
| 41
| 28.833333
| 0.856164
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.6
| 0.4
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 8
|
708bf211dc5dcdfb62ff16191fc2112f3343c1ce
| 110
|
py
|
Python
|
test_demo.py
|
justinharringa/jenkins-config-driven-demo-another-repo
|
55280fee3fd729e665eda8135c2a5be5d2869166
|
[
"MIT"
] | null | null | null |
test_demo.py
|
justinharringa/jenkins-config-driven-demo-another-repo
|
55280fee3fd729e665eda8135c2a5be5d2869166
|
[
"MIT"
] | null | null | null |
test_demo.py
|
justinharringa/jenkins-config-driven-demo-another-repo
|
55280fee3fd729e665eda8135c2a5be5d2869166
|
[
"MIT"
] | null | null | null |
from demo import do_something
def test_do_something():
assert do_something("anything") == "Do anything"
| 18.333333
| 52
| 0.745455
| 15
| 110
| 5.2
| 0.6
| 0.423077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154545
| 110
| 5
| 53
| 22
| 0.83871
| 0
| 0
| 0
| 0
| 0
| 0.172727
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
562850106a818f51947f72c021d59416dfc76759
| 58,529
|
py
|
Python
|
das_decennial/programs/writer/cef_2020/mdf_validator_classes.py
|
p-b-j/uscb-das-container-public
|
7f7ba44055da15d13b191180249e656e1bd398c6
|
[
"MIT"
] | 1
|
2021-11-13T01:35:31.000Z
|
2021-11-13T01:35:31.000Z
|
das_decennial/programs/writer/cef_2020/mdf_validator_classes.py
|
p-b-j/uscb-das-container-public
|
7f7ba44055da15d13b191180249e656e1bd398c6
|
[
"MIT"
] | 1
|
2021-10-30T00:48:45.000Z
|
2021-11-01T23:33:46.000Z
|
das_decennial/programs/writer/cef_2020/mdf_validator_classes.py
|
p-b-j/uscb-das-container-public
|
7f7ba44055da15d13b191180249e656e1bd398c6
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file was automatically generated by ../etl_2020/census_etl/spec_scanner.py on Fri Oct 30 14:46:58 2020
# Command line: ../etl_2020/census_etl/spec_scanner.py ../etl_2020/mdf/2020 Microdata Detail File Specification v8_05292020.docx --output_parser ../das_decennial/programs/writer/cef_2020/mdf_validator_classes.py --tablenames MDF_Person MDF_Unit
# Automatically generated on Fri Oct 30 14:46:58 2020 by /mnt/users/will0555/new-das-vm/das-vm-config/das_decennial/das_framework/ctools/schema/table.py
def leftpad(x,width):
return ' '*(width-len(str(x)))+str(x)
def between(a,b,c,width):
if len(b) > width:
return False
if '.' in a or '.' in b or '.' in c:
try:
return float(a) <= float(b) <= float(c)
except ValueError:
pass # tries to return a float but might have weird input like 1.1.0 which will be compared traditionally instead
b = b.replace(' ', '0')
return leftpad(a,width) <= leftpad(b,width) <= leftpad(c,width)
def safe_int(i):
try:
return int(i)
except (TypeError, ValueError) as e:
return None
def safe_float(i):
try:
return float(i)
except (TypeError, ValueError) as e:
return None
def safe_str(i):
try:
return str(i)
except (TypeError, ValueError) as e:
return None
class MDF_Person_validator:
@classmethod
def is_valid_SCHEMA_TYPE_CODE(self,x):
"""Schema Type Code"""
if x is None or x == "None":
return False
return (leftpad(x,3)==leftpad('MPD',3))
@classmethod
def is_valid_SCHEMA_BUILD_ID(self,x):
"""Schema Build ID"""
if x is None or x == "None":
return False
return True
@classmethod
def is_valid_TABBLKST(self,x):
"""2020 Tabulation State (FIPS)"""
if x is None or x == "None":
return False
return (between('44',x,'51',2)) or (leftpad(x,2)==leftpad('72',2)) or (between('08',x,'13',2)) or (between('53',x,'56',2)) or (between('01',x,'02',2)) or (between('04',x,'06',2)) or (between('15',x,'42',2))
@classmethod
def is_valid_TABBLKCOU(self,x):
"""2020 Tabulation County (FIPS)"""
if x is None or x == "None":
return False
return (between('001',x,'840',3))
@classmethod
def is_valid_TABTRACTCE(self,x):
"""2020 Tabulation Census Tract"""
if x is None or x == "None":
return False
return (between('000100',x,'998999',6))
@classmethod
def is_valid_TABBLKGRPCE(self,x):
"""2020 Census Block Group"""
if x is None or x == "None":
return False
return (between('0',x,'9',1))
@classmethod
def is_valid_TABBLK(self,x):
"""2020 Block Number"""
if x is None or x == "None":
return False
return (between('0001',x,'9999',4))
@classmethod
def is_valid_EPNUM(self,x):
"""Privacy Edited Person Number"""
if x is None or x == "None":
return False
x = str(x).strip()
try:
x = int(x)
except ValueError:
return False
return (0 <= x <= 999999999)
@classmethod
def is_valid_RTYPE(self,x):
"""Record Type"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1))
@classmethod
def is_valid_GQTYPE(self,x):
"""Group Quarters Type"""
if x is None or x == "None":
return False
return (leftpad(x,3)==leftpad('106',3)) or (leftpad(x,3)==leftpad('103',3)) or (leftpad(x,3)==leftpad('102',3)) or (leftpad(x,3)==leftpad('104',3)) or (leftpad(x,3)==leftpad('602',3)) or (leftpad(x,3)==leftpad('105',3)) or (leftpad(x,3)==leftpad('301',3)) or (leftpad(x,3)==leftpad('401',3)) or (leftpad(x,3)==leftpad('402',3)) or (leftpad(x,3)==leftpad('403',3)) or (leftpad(x,3)==leftpad('203',3)) or (leftpad(x,3)==leftpad('997',3)) or (leftpad(x,3)==leftpad('501',3)) or (leftpad(x,3)==leftpad('601',3)) or (leftpad(x,3)==leftpad('706',3)) or (leftpad(x,3)==leftpad('801',3)) or (leftpad(x,3)==leftpad('201',3)) or (leftpad(x,3)==leftpad('704',3)) or (leftpad(x,3)==leftpad('701',3)) or (leftpad(x,3)==leftpad('904',3)) or (leftpad(x,3)==leftpad('405',3)) or (leftpad(x,3)==leftpad('802',3)) or (leftpad(x,3)==leftpad('202',3)) or (leftpad(x,3)==leftpad('903',3)) or (leftpad(x,3)==leftpad('900',3)) or (leftpad(x,3)==leftpad('901',3)) or (leftpad(x,3)==leftpad('101',3)) or (leftpad(x,3)==leftpad('000',3)) or (leftpad(x,3)==leftpad('404',3))
@classmethod
def is_valid_RELSHIP(self,x):
"""Edited Relationship"""
if x is None or x == "None":
return False
return (leftpad(x,2)==leftpad('25',2)) or (leftpad(x,2)==leftpad('32',2)) or (leftpad(x,2)==leftpad('23',2)) or (leftpad(x,2)==leftpad('20',2)) or (leftpad(x,2)==leftpad('26',2)) or (leftpad(x,2)==leftpad('30',2)) or (leftpad(x,2)==leftpad('34',2)) or (leftpad(x,2)==leftpad('37',2)) or (leftpad(x,2)==leftpad('33',2)) or (leftpad(x,2)==leftpad('36',2)) or (leftpad(x,2)==leftpad('24',2)) or (leftpad(x,2)==leftpad('38',2)) or (leftpad(x,2)==leftpad('21',2)) or (leftpad(x,2)==leftpad('35',2)) or (leftpad(x,2)==leftpad('31',2)) or (leftpad(x,2)==leftpad('22',2)) or (leftpad(x,2)==leftpad('29',2)) or (leftpad(x,2)==leftpad('28',2)) or (leftpad(x,2)==leftpad('27',2))
@classmethod
def is_valid_QSEX(self,x):
"""Edited Sex"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_QAGE(self,x):
"""Edited Age"""
if x is None or x == "None":
return False
x = str(x).strip()
try:
x = int(x)
except ValueError:
return False
return (0 <= x <= 115)
@classmethod
def is_valid_CENHISP(self,x):
"""Hispanic Origin"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_CENRACE(self,x):
"""Census Race"""
if x is None or x == "None":
return False
return (leftpad(x,2)==leftpad('14',2)) or (leftpad(x,2)==leftpad('16',2)) or (leftpad(x,2)==leftpad('09',2)) or (leftpad(x,2)==leftpad('11',2)) or (leftpad(x,2)==leftpad('01',2)) or (leftpad(x,2)==leftpad('12',2)) or (leftpad(x,2)==leftpad('20',2)) or (leftpad(x,2)==leftpad('17',2)) or (leftpad(x,2)==leftpad('06',2)) or (leftpad(x,2)==leftpad('15',2)) or (leftpad(x,2)==leftpad('26',2)) or (leftpad(x,2)==leftpad('30',2)) or (leftpad(x,2)==leftpad('36',2)) or (leftpad(x,2)==leftpad('45',2)) or (leftpad(x,2)==leftpad('46',2)) or (leftpad(x,2)==leftpad('55',2)) or (leftpad(x,2)==leftpad('61',2)) or (leftpad(x,2)==leftpad('18',2)) or (leftpad(x,2)==leftpad('27',2)) or (leftpad(x,2)==leftpad('03',2)) or (leftpad(x,2)==leftpad('10',2)) or (leftpad(x,2)==leftpad('13',2)) or (leftpad(x,2)==leftpad('23',2)) or (leftpad(x,2)==leftpad('54',2)) or (leftpad(x,2)==leftpad('07',2)) or (leftpad(x,2)==leftpad('33',2)) or (leftpad(x,2)==leftpad('53',2)) or (leftpad(x,2)==leftpad('22',2)) or (leftpad(x,2)==leftpad('31',2)) or (leftpad(x,2)==leftpad('41',2)) or (leftpad(x,2)==leftpad('48',2)) or (leftpad(x,2)==leftpad('50',2)) or (leftpad(x,2)==leftpad('25',2)) or (leftpad(x,2)==leftpad('28',2)) or (leftpad(x,2)==leftpad('29',2)) or (leftpad(x,2)==leftpad('32',2)) or (leftpad(x,2)==leftpad('34',2)) or (leftpad(x,2)==leftpad('52',2)) or (leftpad(x,2)==leftpad('59',2)) or (leftpad(x,2)==leftpad('02',2)) or (leftpad(x,2)==leftpad('47',2)) or (leftpad(x,2)==leftpad('37',2)) or (leftpad(x,2)==leftpad('19',2)) or (leftpad(x,2)==leftpad('40',2)) or (leftpad(x,2)==leftpad('08',2)) or (leftpad(x,2)==leftpad('21',2)) or (leftpad(x,2)==leftpad('56',2)) or (leftpad(x,2)==leftpad('39',2)) or (leftpad(x,2)==leftpad('38',2)) or (leftpad(x,2)==leftpad('44',2)) or (leftpad(x,2)==leftpad('42',2)) or (leftpad(x,2)==leftpad('49',2)) or (leftpad(x,2)==leftpad('57',2)) or (leftpad(x,2)==leftpad('63',2)) or (leftpad(x,2)==leftpad('51',2)) or (leftpad(x,2)==leftpad('04',2)) or (leftpad(x,2)==leftpad('24',2)) or (leftpad(x,2)==leftpad('58',2)) or (leftpad(x,2)==leftpad('60',2)) or (leftpad(x,2)==leftpad('62',2)) or (leftpad(x,2)==leftpad('35',2)) or (leftpad(x,2)==leftpad('05',2)) or (leftpad(x,2)==leftpad('43',2))
@classmethod
def is_valid_LIVE_ALONE(self,x):
"""Person Living Alone"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def validate_pipe_delimited(self,x):
fields = x.split('|')
if len(fields)!=16: return False
if self.is_valid_SCHEMA_TYPE_CODE(fields[1]) == False: return False
if self.is_valid_SCHEMA_BUILD_ID(fields[2]) == False: return False
if self.is_valid_TABBLKST(fields[3]) == False: return False
if self.is_valid_TABBLKCOU(fields[4]) == False: return False
if self.is_valid_TABTRACTCE(fields[5]) == False: return False
if self.is_valid_TABBLKGRPCE(fields[6]) == False: return False
if self.is_valid_TABBLK(fields[7]) == False: return False
if self.is_valid_EPNUM(fields[8]) == False: return False
if self.is_valid_RTYPE(fields[9]) == False: return False
if self.is_valid_GQTYPE(fields[10]) == False: return False
if self.is_valid_RELSHIP(fields[11]) == False: return False
if self.is_valid_QSEX(fields[12]) == False: return False
if self.is_valid_QAGE(fields[13]) == False: return False
if self.is_valid_CENHISP(fields[14]) == False: return False
if self.is_valid_CENRACE(fields[15]) == False: return False
if self.is_valid_LIVE_ALONE(fields[16]) == False: return False
return True
class MDF_Person:
__slots__ = ['SCHEMA_TYPE_CODE', 'SCHEMA_BUILD_ID', 'TABBLKST', 'TABBLKCOU', 'TABTRACTCE', 'TABBLKGRPCE', 'TABBLK', 'EPNUM', 'RTYPE', 'GQTYPE', 'RELSHIP', 'QSEX', 'QAGE', 'CENHISP', 'CENRACE', 'LIVE_ALONE']
def __repr__(self):
return 'MDF_Person<SCHEMA_TYPE_CODE:{},SCHEMA_BUILD_ID:{},TABBLKST:{},TABBLKCOU:{},TABTRACTCE:{},TABBLKGRPCE:{},TABBLK:{},EPNUM:{},RTYPE:{},GQTYPE:{},RELSHIP:{},QSEX:{},QAGE:{},CENHISP:{},CENRACE:{},LIVE_ALONE:{}>'.format(self.SCHEMA_TYPE_CODE,self.SCHEMA_BUILD_ID,self.TABBLKST,self.TABBLKCOU,self.TABTRACTCE,self.TABBLKGRPCE,self.TABBLK,self.EPNUM,self.RTYPE,self.GQTYPE,self.RELSHIP,self.QSEX,self.QAGE,self.CENHISP,self.CENRACE,self.LIVE_ALONE)
def __init__(self,line=None):
if line:
if '|' in line:
self.parse_pipe_delimited(line)
else:
self.parse_column_specified(line)
@classmethod
def name(self):
return 'MDF_Person'
def parse_pipe_delimited(self,line):
fields = line.split('|')
if len(fields)!=16:
raise ValueError(f'expected 16 fields, found {len(fields)}')
self.SCHEMA_TYPE_CODE = fields[0] # Schema Type Code
self.SCHEMA_BUILD_ID = fields[1] # Schema Build ID
self.TABBLKST = fields[2] # 2020 Tabulation State (FIPS)
self.TABBLKCOU = fields[3] # 2020 Tabulation County (FIPS)
self.TABTRACTCE = fields[4] # 2020 Tabulation Census Tract
self.TABBLKGRPCE = fields[5] # 2020 Census Block Group
self.TABBLK = fields[6] # 2020 Block Number
self.EPNUM = fields[7] # Privacy Edited Person Number
self.RTYPE = fields[8] # Record Type
self.GQTYPE = fields[9] # Group Quarters Type
self.RELSHIP = fields[10] # Edited Relationship
self.QSEX = fields[11] # Edited Sex
self.QAGE = fields[12] # Edited Age
self.CENHISP = fields[13] # Hispanic Origin
self.CENRACE = fields[14] # Census Race
self.LIVE_ALONE = fields[15] # Person Living Alone
def parse_column_specified(self,line):
self.SCHEMA_TYPE_CODE = None # no column information for SCHEMA_TYPE_CODE
self.SCHEMA_BUILD_ID = None # no column information for SCHEMA_BUILD_ID
self.TABBLKST = None # no column information for TABBLKST
self.TABBLKCOU = None # no column information for TABBLKCOU
self.TABTRACTCE = None # no column information for TABTRACTCE
self.TABBLKGRPCE = None # no column information for TABBLKGRPCE
self.TABBLK = None # no column information for TABBLK
self.EPNUM = None # no column information for EPNUM
self.RTYPE = None # no column information for RTYPE
self.GQTYPE = None # no column information for GQTYPE
self.RELSHIP = None # no column information for RELSHIP
self.QSEX = None # no column information for QSEX
self.QAGE = None # no column information for QAGE
self.CENHISP = None # no column information for CENHISP
self.CENRACE = None # no column information for CENRACE
self.LIVE_ALONE = None # no column information for LIVE_ALONE
def validate(self):
"""Return True if the object data validates"""
if not MDF_Person_validator.is_valid_SCHEMA_TYPE_CODE(self.SCHEMA_TYPE_CODE): return False
if not MDF_Person_validator.is_valid_SCHEMA_BUILD_ID(self.SCHEMA_BUILD_ID): return False
if not MDF_Person_validator.is_valid_TABBLKST(self.TABBLKST): return False
if not MDF_Person_validator.is_valid_TABBLKCOU(self.TABBLKCOU): return False
if not MDF_Person_validator.is_valid_TABTRACTCE(self.TABTRACTCE): return False
if not MDF_Person_validator.is_valid_TABBLKGRPCE(self.TABBLKGRPCE): return False
if not MDF_Person_validator.is_valid_TABBLK(self.TABBLK): return False
if not MDF_Person_validator.is_valid_EPNUM(self.EPNUM): return False
if not MDF_Person_validator.is_valid_RTYPE(self.RTYPE): return False
if not MDF_Person_validator.is_valid_GQTYPE(self.GQTYPE): return False
if not MDF_Person_validator.is_valid_RELSHIP(self.RELSHIP): return False
if not MDF_Person_validator.is_valid_QSEX(self.QSEX): return False
if not MDF_Person_validator.is_valid_QAGE(self.QAGE): return False
if not MDF_Person_validator.is_valid_CENHISP(self.CENHISP): return False
if not MDF_Person_validator.is_valid_CENRACE(self.CENRACE): return False
if not MDF_Person_validator.is_valid_LIVE_ALONE(self.LIVE_ALONE): return False
return True
def validate_reason(self):
reason=[]
if not MDF_Person_validator.is_valid_SCHEMA_TYPE_CODE(self.SCHEMA_TYPE_CODE): reason.append('SCHEMA_TYPE_CODE ('+str(self.SCHEMA_TYPE_CODE)+') out of range (MPD-MPD)')
if not MDF_Person_validator.is_valid_SCHEMA_BUILD_ID(self.SCHEMA_BUILD_ID): reason.append('SCHEMA_BUILD_ID ('+str(self.SCHEMA_BUILD_ID)+') out of range ()')
if not MDF_Person_validator.is_valid_TABBLKST(self.TABBLKST): reason.append('TABBLKST ('+str(self.TABBLKST)+') out of range (44-51, 72-72, 08-13, 53-56, 01-02, 04-06, 15-42)')
if not MDF_Person_validator.is_valid_TABBLKCOU(self.TABBLKCOU): reason.append('TABBLKCOU ('+str(self.TABBLKCOU)+') out of range (001-840)')
if not MDF_Person_validator.is_valid_TABTRACTCE(self.TABTRACTCE): reason.append('TABTRACTCE ('+str(self.TABTRACTCE)+') out of range (000100-998999)')
if not MDF_Person_validator.is_valid_TABBLKGRPCE(self.TABBLKGRPCE): reason.append('TABBLKGRPCE ('+str(self.TABBLKGRPCE)+') out of range (0-9)')
if not MDF_Person_validator.is_valid_TABBLK(self.TABBLK): reason.append('TABBLK ('+str(self.TABBLK)+') out of range (0001-9999)')
if not MDF_Person_validator.is_valid_EPNUM(self.EPNUM): reason.append('EPNUM ('+str(self.EPNUM)+') out of range (0-999999999)')
if not MDF_Person_validator.is_valid_RTYPE(self.RTYPE): reason.append('RTYPE ('+str(self.RTYPE)+') out of range (5-5, 3-3)')
if not MDF_Person_validator.is_valid_GQTYPE(self.GQTYPE): reason.append('GQTYPE ('+str(self.GQTYPE)+') out of range (106-106, 103-103, 102-102, 104-104, 602-602, 105-105, 301-301, 401-401, 402-402, 403-403, 203-203, 997-997, 501-501, 601-601, 706-706, 801-801, 201-201, 704-704, 701-701, 904-904, 405-405, 802-802, 202-202, 903-903, 900-900, 901-901, 101-101, 000-000, 404-404)')
if not MDF_Person_validator.is_valid_RELSHIP(self.RELSHIP): reason.append('RELSHIP ('+str(self.RELSHIP)+') out of range (25-25, 32-32, 23-23, 20-20, 26-26, 30-30, 34-34, 37-37, 33-33, 36-36, 24-24, 38-38, 21-21, 35-35, 31-31, 22-22, 29-29, 28-28, 27-27)')
if not MDF_Person_validator.is_valid_QSEX(self.QSEX): reason.append('QSEX ('+str(self.QSEX)+') out of range (2-2, 1-1)')
if not MDF_Person_validator.is_valid_QAGE(self.QAGE): reason.append('QAGE ('+str(self.QAGE)+') out of range (0-115)')
if not MDF_Person_validator.is_valid_CENHISP(self.CENHISP): reason.append('CENHISP ('+str(self.CENHISP)+') out of range (2-2, 1-1)')
if not MDF_Person_validator.is_valid_CENRACE(self.CENRACE): reason.append('CENRACE ('+str(self.CENRACE)+') out of range (14-14, 16-16, 09-09, 11-11, 01-01, 12-12, 20-20, 17-17, 06-06, 15-15, 26-26, 30-30, 36-36, 45-45, 46-46, 55-55, 61-61, 18-18, 27-27, 03-03, 10-10, 13-13, 23-23, 54-54, 07-07, 33-33, 53-53, 22-22, 31-31, 41-41, 48-48, 50-50, 25-25, 28-28, 29-29, 32-32, 34-34, 52-52, 59-59, 02-02, 47-47, 37-37, 19-19, 40-40, 08-08, 21-21, 56-56, 39-39, 38-38, 44-44, 42-42, 49-49, 57-57, 63-63, 51-51, 04-04, 24-24, 58-58, 60-60, 62-62, 35-35, 05-05, 43-43)')
if not MDF_Person_validator.is_valid_LIVE_ALONE(self.LIVE_ALONE): reason.append('LIVE_ALONE ('+str(self.LIVE_ALONE)+') out of range (2-2, 0-0, 1-1)')
return ', '.join(reason)
def SparkSQLRow(self):
"""Return a SparkSQL Row object for this object."""
from pyspark.sql import Row
return Row(
schema_type_code=safe_str(self.SCHEMA_TYPE_CODE),
schema_build_id=safe_str(self.SCHEMA_BUILD_ID),
tabblkst=safe_str(self.TABBLKST),
tabblkcou=safe_str(self.TABBLKCOU),
tabtractce=safe_str(self.TABTRACTCE),
tabblkgrpce=safe_str(self.TABBLKGRPCE),
tabblk=safe_str(self.TABBLK),
epnum=safe_int(self.EPNUM),
rtype=safe_str(self.RTYPE),
gqtype=safe_str(self.GQTYPE),
relship=safe_str(self.RELSHIP),
qsex=safe_str(self.QSEX),
qage=safe_int(self.QAGE),
cenhisp=safe_str(self.CENHISP),
cenrace=safe_str(self.CENRACE),
live_alone=safe_str(self.LIVE_ALONE),
)
@staticmethod
def parse_line(line):
# Read a line and return it as a dictionary.
inst: MDF_Person = MDF_Person()
inst.parse_column_specified(line)
assert inst.validate(), f'A line is invalid!! line: {line}, validate_reason: {inst.validate_reason()}'
row = inst.SparkSQLRow()
return row
@staticmethod
def parse_piped_line(line):
# Read a pipe-delimited line and return it as a dictionary.
inst: MDF_Person = MDF_Person()
inst.parse_pipe_delimited(line)
assert inst.validate(), f'A line is invalid!! line: {line}, validate_reason: {inst.validate_reason()}'
row = inst.SparkSQLRow()
return row
# Automatically generated on Fri Oct 30 14:46:58 2020 by /mnt/users/will0555/new-das-vm/das-vm-config/das_decennial/das_framework/ctools/schema/table.py
def leftpad(x,width):
return ' '*(width-len(str(x)))+str(x)
def between(a,b,c,width):
if len(b) > width:
return False
if '.' in a or '.' in b or '.' in c:
try:
return float(a) <= float(b) <= float(c)
except ValueError:
pass # tries to return a float but might have weird input like 1.1.0 which will be compared traditionally instead
b = b.replace(' ', '0')
return leftpad(a,width) <= leftpad(b,width) <= leftpad(c,width)
def safe_int(i):
try:
return int(i)
except (TypeError, ValueError) as e:
return None
def safe_float(i):
try:
return float(i)
except (TypeError, ValueError) as e:
return None
def safe_str(i):
try:
return str(i)
except (TypeError, ValueError) as e:
return None
class MDF_Unit_validator:
@classmethod
def is_valid_SCHEMA_TYPE_CODE(self,x):
"""Schema Type Code"""
if x is None or x == "None":
return False
return (leftpad(x,3)==leftpad('MUD',3))
@classmethod
def is_valid_SCHEMA_BUILD_ID(self,x):
"""Schema Build ID"""
if x is None or x == "None":
return False
return True
@classmethod
def is_valid_TABBLKST(self,x):
"""2020 Tabulation State (FIPS)"""
if x is None or x == "None":
return False
return (between('44',x,'51',2)) or (leftpad(x,2)==leftpad('72',2)) or (between('08',x,'13',2)) or (between('53',x,'56',2)) or (between('01',x,'02',2)) or (between('04',x,'06',2)) or (between('15',x,'42',2))
@classmethod
def is_valid_TABBLKCOU(self,x):
"""2020 Tabulation County (FIPS)"""
if x is None or x == "None":
return False
return (between('001',x,'840',3))
@classmethod
def is_valid_TABTRACTCE(self,x):
"""2020 Tabulation Census Tract"""
if x is None or x == "None":
return False
return (between('000100',x,'998999',6))
@classmethod
def is_valid_TABBLKGRPCE(self,x):
"""2020 Census Block Group"""
if x is None or x == "None":
return False
return (between('0',x,'9',1))
@classmethod
def is_valid_TABBLK(self,x):
"""2020 Block Number"""
if x is None or x == "None":
return False
return (between('0001',x,'9999',4))
@classmethod
def is_valid_RTYPE(self,x):
"""Record Type"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_GQTYPE(self,x):
"""Group Quarters Type"""
if x is None or x == "None":
return False
return (leftpad(x,3)==leftpad('106',3)) or (leftpad(x,3)==leftpad('103',3)) or (leftpad(x,3)==leftpad('102',3)) or (leftpad(x,3)==leftpad('104',3)) or (leftpad(x,3)==leftpad('602',3)) or (leftpad(x,3)==leftpad('105',3)) or (leftpad(x,3)==leftpad('301',3)) or (leftpad(x,3)==leftpad('401',3)) or (leftpad(x,3)==leftpad('402',3)) or (leftpad(x,3)==leftpad('403',3)) or (leftpad(x,3)==leftpad('203',3)) or (leftpad(x,3)==leftpad('997',3)) or (leftpad(x,3)==leftpad('501',3)) or (leftpad(x,3)==leftpad('601',3)) or (leftpad(x,3)==leftpad('706',3)) or (leftpad(x,3)==leftpad('801',3)) or (leftpad(x,3)==leftpad('201',3)) or (leftpad(x,3)==leftpad('704',3)) or (leftpad(x,3)==leftpad('701',3)) or (leftpad(x,3)==leftpad('904',3)) or (leftpad(x,3)==leftpad('405',3)) or (leftpad(x,3)==leftpad('802',3)) or (leftpad(x,3)==leftpad('202',3)) or (leftpad(x,3)==leftpad('903',3)) or (leftpad(x,3)==leftpad('900',3)) or (leftpad(x,3)==leftpad('901',3)) or (leftpad(x,3)==leftpad('101',3)) or (leftpad(x,3)==leftpad('000',3)) or (leftpad(x,3)==leftpad('404',3))
@classmethod
def is_valid_TEN(self,x):
"""Tenure"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_VACS(self,x):
"""Vacancy Status"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('7',1)) or (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('6',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_HHSIZE(self,x):
"""Population Count"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('7',1)) or (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('6',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_HHT(self,x):
"""Household/Family Type"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('7',1)) or (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('6',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_HHT2(self,x):
"""Household/Family Type (Includes Cohabiting)"""
if x is None or x == "None":
return False
return (leftpad(x,2)==leftpad('02',2)) or (leftpad(x,2)==leftpad('03',2)) or (leftpad(x,2)==leftpad('09',2)) or (leftpad(x,2)==leftpad('01',2)) or (leftpad(x,2)==leftpad('00',2)) or (leftpad(x,2)==leftpad('10',2)) or (leftpad(x,2)==leftpad('11',2)) or (leftpad(x,2)==leftpad('06',2)) or (leftpad(x,2)==leftpad('07',2)) or (leftpad(x,2)==leftpad('04',2)) or (leftpad(x,2)==leftpad('12',2)) or (leftpad(x,2)==leftpad('08',2)) or (leftpad(x,2)==leftpad('05',2))
@classmethod
def is_valid_CPLT(self,x):
"""Couple Type"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_UPART(self,x):
"""Presence and Type of Unmarried Partner Household"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_MULTG(self,x):
"""Multigenerational Household"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_THHLDRAGE(self,x):
"""Age of Householder"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('7',1)) or (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('5',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('6',1)) or (leftpad(x,1)==leftpad('8',1)) or (leftpad(x,1)==leftpad('9',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_THHSPAN(self,x):
"""Hispanic Householder"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_THHRACE(self,x):
"""Race of Householder"""
if x is None or x == "None":
return False
return (leftpad(x,2)==leftpad('02',2)) or (leftpad(x,2)==leftpad('03',2)) or (leftpad(x,2)==leftpad('01',2)) or (leftpad(x,2)==leftpad('00',2)) or (leftpad(x,2)==leftpad('06',2)) or (leftpad(x,2)==leftpad('07',2)) or (leftpad(x,2)==leftpad('04',2)) or (leftpad(x,2)==leftpad('05',2))
@classmethod
def is_valid_PAOC(self,x):
"""Presence and Age of Own Children Under 18"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_TP18(self,x):
"""Presence of People Under 18 Years in Household"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_TP60(self,x):
"""Presence of People 60 Years and Over in Household"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_TP65(self,x):
"""Presence of People 65 Years and Over in Household"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_TP75(self,x):
"""Presence of People 75 Years and Over in Household"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def is_valid_PAC(self,x):
"""Presence and Age of Children Under 18"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('1',1)) or (leftpad(x,1)==leftpad('3',1)) or (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('4',1))
@classmethod
def is_valid_HHSEX(self,x):
"""Sex of Householder"""
if x is None or x == "None":
return False
return (leftpad(x,1)==leftpad('2',1)) or (leftpad(x,1)==leftpad('0',1)) or (leftpad(x,1)==leftpad('1',1))
@classmethod
def validate_pipe_delimited(self,x):
fields = x.split('|')
if len(fields)!=27: return False
if self.is_valid_SCHEMA_TYPE_CODE(fields[1]) == False: return False
if self.is_valid_SCHEMA_BUILD_ID(fields[2]) == False: return False
if self.is_valid_TABBLKST(fields[3]) == False: return False
if self.is_valid_TABBLKCOU(fields[4]) == False: return False
if self.is_valid_TABTRACTCE(fields[5]) == False: return False
if self.is_valid_TABBLKGRPCE(fields[6]) == False: return False
if self.is_valid_TABBLK(fields[7]) == False: return False
if self.is_valid_RTYPE(fields[8]) == False: return False
if self.is_valid_GQTYPE(fields[9]) == False: return False
if self.is_valid_TEN(fields[10]) == False: return False
if self.is_valid_VACS(fields[11]) == False: return False
if self.is_valid_HHSIZE(fields[12]) == False: return False
if self.is_valid_HHT(fields[13]) == False: return False
if self.is_valid_HHT2(fields[14]) == False: return False
if self.is_valid_CPLT(fields[15]) == False: return False
if self.is_valid_UPART(fields[16]) == False: return False
if self.is_valid_MULTG(fields[17]) == False: return False
if self.is_valid_THHLDRAGE(fields[18]) == False: return False
if self.is_valid_THHSPAN(fields[19]) == False: return False
if self.is_valid_THHRACE(fields[20]) == False: return False
if self.is_valid_PAOC(fields[21]) == False: return False
if self.is_valid_TP18(fields[22]) == False: return False
if self.is_valid_TP60(fields[23]) == False: return False
if self.is_valid_TP65(fields[24]) == False: return False
if self.is_valid_TP75(fields[25]) == False: return False
if self.is_valid_PAC(fields[26]) == False: return False
if self.is_valid_HHSEX(fields[27]) == False: return False
return True
class MDF_Unit:
__slots__ = ['SCHEMA_TYPE_CODE', 'SCHEMA_BUILD_ID', 'TABBLKST', 'TABBLKCOU', 'TABTRACTCE', 'TABBLKGRPCE', 'TABBLK', 'RTYPE', 'GQTYPE', 'TEN', 'VACS', 'HHSIZE', 'HHT', 'HHT2', 'CPLT', 'UPART', 'MULTG', 'THHLDRAGE', 'THHSPAN', 'THHRACE', 'PAOC', 'TP18', 'TP60', 'TP65', 'TP75', 'PAC', 'HHSEX']
def __repr__(self):
return 'MDF_Unit<SCHEMA_TYPE_CODE:{},SCHEMA_BUILD_ID:{},TABBLKST:{},TABBLKCOU:{},TABTRACTCE:{},TABBLKGRPCE:{},TABBLK:{},RTYPE:{},GQTYPE:{},TEN:{},VACS:{},HHSIZE:{},HHT:{},HHT2:{},CPLT:{},UPART:{},MULTG:{},THHLDRAGE:{},THHSPAN:{},THHRACE:{},PAOC:{},TP18:{},TP60:{},TP65:{},TP75:{},PAC:{},HHSEX:{}>'.format(self.SCHEMA_TYPE_CODE,self.SCHEMA_BUILD_ID,self.TABBLKST,self.TABBLKCOU,self.TABTRACTCE,self.TABBLKGRPCE,self.TABBLK,self.RTYPE,self.GQTYPE,self.TEN,self.VACS,self.HHSIZE,self.HHT,self.HHT2,self.CPLT,self.UPART,self.MULTG,self.THHLDRAGE,self.THHSPAN,self.THHRACE,self.PAOC,self.TP18,self.TP60,self.TP65,self.TP75,self.PAC,self.HHSEX)
def __init__(self,line=None):
if line:
if '|' in line:
self.parse_pipe_delimited(line)
else:
self.parse_column_specified(line)
@classmethod
def name(self):
return 'MDF_Unit'
def parse_pipe_delimited(self,line):
fields = line.split('|')
if len(fields)!=27:
raise ValueError(f'expected 27 fields, found {len(fields)}')
self.SCHEMA_TYPE_CODE = fields[0] # Schema Type Code
self.SCHEMA_BUILD_ID = fields[1] # Schema Build ID
self.TABBLKST = fields[2] # 2020 Tabulation State (FIPS)
self.TABBLKCOU = fields[3] # 2020 Tabulation County (FIPS)
self.TABTRACTCE = fields[4] # 2020 Tabulation Census Tract
self.TABBLKGRPCE = fields[5] # 2020 Census Block Group
self.TABBLK = fields[6] # 2020 Block Number
self.RTYPE = fields[7] # Record Type
self.GQTYPE = fields[8] # Group Quarters Type
self.TEN = fields[9] # Tenure
self.VACS = fields[10] # Vacancy Status
self.HHSIZE = fields[11] # Population Count
self.HHT = fields[12] # Household/Family Type
self.HHT2 = fields[13] # Household/Family Type (Includes Cohabiting)
self.CPLT = fields[14] # Couple Type
self.UPART = fields[15] # Presence and Type of Unmarried Partner Household
self.MULTG = fields[16] # Multigenerational Household
self.THHLDRAGE = fields[17] # Age of Householder
self.THHSPAN = fields[18] # Hispanic Householder
self.THHRACE = fields[19] # Race of Householder
self.PAOC = fields[20] # Presence and Age of Own Children Under 18
self.TP18 = fields[21] # Presence of People Under 18 Years in Household
self.TP60 = fields[22] # Presence of People 60 Years and Over in Household
self.TP65 = fields[23] # Presence of People 65 Years and Over in Household
self.TP75 = fields[24] # Presence of People 75 Years and Over in Household
self.PAC = fields[25] # Presence and Age of Children Under 18
self.HHSEX = fields[26] # Sex of Householder
def parse_column_specified(self,line):
self.SCHEMA_TYPE_CODE = None # no column information for SCHEMA_TYPE_CODE
self.SCHEMA_BUILD_ID = None # no column information for SCHEMA_BUILD_ID
self.TABBLKST = None # no column information for TABBLKST
self.TABBLKCOU = None # no column information for TABBLKCOU
self.TABTRACTCE = None # no column information for TABTRACTCE
self.TABBLKGRPCE = None # no column information for TABBLKGRPCE
self.TABBLK = None # no column information for TABBLK
self.RTYPE = None # no column information for RTYPE
self.GQTYPE = None # no column information for GQTYPE
self.TEN = None # no column information for TEN
self.VACS = None # no column information for VACS
self.HHSIZE = None # no column information for HHSIZE
self.HHT = None # no column information for HHT
self.HHT2 = None # no column information for HHT2
self.CPLT = None # no column information for CPLT
self.UPART = None # no column information for UPART
self.MULTG = None # no column information for MULTG
self.THHLDRAGE = None # no column information for THHLDRAGE
self.THHSPAN = None # no column information for THHSPAN
self.THHRACE = None # no column information for THHRACE
self.PAOC = None # no column information for PAOC
self.TP18 = None # no column information for TP18
self.TP60 = None # no column information for TP60
self.TP65 = None # no column information for TP65
self.TP75 = None # no column information for TP75
self.PAC = None # no column information for PAC
self.HHSEX = None # no column information for HHSEX
def validate(self):
"""Return True if the object data validates"""
if not MDF_Unit_validator.is_valid_SCHEMA_TYPE_CODE(self.SCHEMA_TYPE_CODE): return False
if not MDF_Unit_validator.is_valid_SCHEMA_BUILD_ID(self.SCHEMA_BUILD_ID): return False
if not MDF_Unit_validator.is_valid_TABBLKST(self.TABBLKST): return False
if not MDF_Unit_validator.is_valid_TABBLKCOU(self.TABBLKCOU): return False
if not MDF_Unit_validator.is_valid_TABTRACTCE(self.TABTRACTCE): return False
if not MDF_Unit_validator.is_valid_TABBLKGRPCE(self.TABBLKGRPCE): return False
if not MDF_Unit_validator.is_valid_TABBLK(self.TABBLK): return False
if not MDF_Unit_validator.is_valid_RTYPE(self.RTYPE): return False
if not MDF_Unit_validator.is_valid_GQTYPE(self.GQTYPE): return False
if not MDF_Unit_validator.is_valid_TEN(self.TEN): return False
if not MDF_Unit_validator.is_valid_VACS(self.VACS): return False
if not MDF_Unit_validator.is_valid_HHSIZE(self.HHSIZE): return False
if not MDF_Unit_validator.is_valid_HHT(self.HHT): return False
if not MDF_Unit_validator.is_valid_HHT2(self.HHT2): return False
if not MDF_Unit_validator.is_valid_CPLT(self.CPLT): return False
if not MDF_Unit_validator.is_valid_UPART(self.UPART): return False
if not MDF_Unit_validator.is_valid_MULTG(self.MULTG): return False
if not MDF_Unit_validator.is_valid_THHLDRAGE(self.THHLDRAGE): return False
if not MDF_Unit_validator.is_valid_THHSPAN(self.THHSPAN): return False
if not MDF_Unit_validator.is_valid_THHRACE(self.THHRACE): return False
if not MDF_Unit_validator.is_valid_PAOC(self.PAOC): return False
if not MDF_Unit_validator.is_valid_TP18(self.TP18): return False
if not MDF_Unit_validator.is_valid_TP60(self.TP60): return False
if not MDF_Unit_validator.is_valid_TP65(self.TP65): return False
if not MDF_Unit_validator.is_valid_TP75(self.TP75): return False
if not MDF_Unit_validator.is_valid_PAC(self.PAC): return False
if not MDF_Unit_validator.is_valid_HHSEX(self.HHSEX): return False
return True
def validate_reason(self):
reason=[]
if not MDF_Unit_validator.is_valid_SCHEMA_TYPE_CODE(self.SCHEMA_TYPE_CODE): reason.append('SCHEMA_TYPE_CODE ('+str(self.SCHEMA_TYPE_CODE)+') out of range (MUD-MUD)')
if not MDF_Unit_validator.is_valid_SCHEMA_BUILD_ID(self.SCHEMA_BUILD_ID): reason.append('SCHEMA_BUILD_ID ('+str(self.SCHEMA_BUILD_ID)+') out of range ()')
if not MDF_Unit_validator.is_valid_TABBLKST(self.TABBLKST): reason.append('TABBLKST ('+str(self.TABBLKST)+') out of range (44-51, 72-72, 08-13, 53-56, 01-02, 04-06, 15-42)')
if not MDF_Unit_validator.is_valid_TABBLKCOU(self.TABBLKCOU): reason.append('TABBLKCOU ('+str(self.TABBLKCOU)+') out of range (001-840)')
if not MDF_Unit_validator.is_valid_TABTRACTCE(self.TABTRACTCE): reason.append('TABTRACTCE ('+str(self.TABTRACTCE)+') out of range (000100-998999)')
if not MDF_Unit_validator.is_valid_TABBLKGRPCE(self.TABBLKGRPCE): reason.append('TABBLKGRPCE ('+str(self.TABBLKGRPCE)+') out of range (0-9)')
if not MDF_Unit_validator.is_valid_TABBLK(self.TABBLK): reason.append('TABBLK ('+str(self.TABBLK)+') out of range (0001-9999)')
if not MDF_Unit_validator.is_valid_RTYPE(self.RTYPE): reason.append('RTYPE ('+str(self.RTYPE)+') out of range (2-2, 4-4)')
if not MDF_Unit_validator.is_valid_GQTYPE(self.GQTYPE): reason.append('GQTYPE ('+str(self.GQTYPE)+') out of range (106-106, 103-103, 102-102, 104-104, 602-602, 105-105, 301-301, 401-401, 402-402, 403-403, 203-203, 997-997, 501-501, 601-601, 706-706, 801-801, 201-201, 704-704, 701-701, 904-904, 405-405, 802-802, 202-202, 903-903, 900-900, 901-901, 101-101, 000-000, 404-404)')
if not MDF_Unit_validator.is_valid_TEN(self.TEN): reason.append('TEN ('+str(self.TEN)+') out of range (1-1, 3-3, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_VACS(self.VACS): reason.append('VACS ('+str(self.VACS)+') out of range (7-7, 1-1, 5-5, 3-3, 6-6, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_HHSIZE(self.HHSIZE): reason.append('HHSIZE ('+str(self.HHSIZE)+') out of range (7-7, 1-1, 5-5, 3-3, 6-6, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_HHT(self.HHT): reason.append('HHT ('+str(self.HHT)+') out of range (7-7, 1-1, 5-5, 3-3, 6-6, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_HHT2(self.HHT2): reason.append('HHT2 ('+str(self.HHT2)+') out of range (02-02, 03-03, 09-09, 01-01, 00-00, 10-10, 11-11, 06-06, 07-07, 04-04, 12-12, 08-08, 05-05)')
if not MDF_Unit_validator.is_valid_CPLT(self.CPLT): reason.append('CPLT ('+str(self.CPLT)+') out of range (1-1, 5-5, 3-3, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_UPART(self.UPART): reason.append('UPART ('+str(self.UPART)+') out of range (1-1, 5-5, 3-3, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_MULTG(self.MULTG): reason.append('MULTG ('+str(self.MULTG)+') out of range (2-2, 0-0, 1-1)')
if not MDF_Unit_validator.is_valid_THHLDRAGE(self.THHLDRAGE): reason.append('THHLDRAGE ('+str(self.THHLDRAGE)+') out of range (7-7, 1-1, 5-5, 3-3, 6-6, 8-8, 9-9, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_THHSPAN(self.THHSPAN): reason.append('THHSPAN ('+str(self.THHSPAN)+') out of range (2-2, 0-0, 1-1)')
if not MDF_Unit_validator.is_valid_THHRACE(self.THHRACE): reason.append('THHRACE ('+str(self.THHRACE)+') out of range (02-02, 03-03, 01-01, 00-00, 06-06, 07-07, 04-04, 05-05)')
if not MDF_Unit_validator.is_valid_PAOC(self.PAOC): reason.append('PAOC ('+str(self.PAOC)+') out of range (1-1, 3-3, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_TP18(self.TP18): reason.append('TP18 ('+str(self.TP18)+') out of range (0-0, 1-1)')
if not MDF_Unit_validator.is_valid_TP60(self.TP60): reason.append('TP60 ('+str(self.TP60)+') out of range (0-0, 1-1)')
if not MDF_Unit_validator.is_valid_TP65(self.TP65): reason.append('TP65 ('+str(self.TP65)+') out of range (0-0, 1-1)')
if not MDF_Unit_validator.is_valid_TP75(self.TP75): reason.append('TP75 ('+str(self.TP75)+') out of range (0-0, 1-1)')
if not MDF_Unit_validator.is_valid_PAC(self.PAC): reason.append('PAC ('+str(self.PAC)+') out of range (1-1, 3-3, 2-2, 0-0, 4-4)')
if not MDF_Unit_validator.is_valid_HHSEX(self.HHSEX): reason.append('HHSEX ('+str(self.HHSEX)+') out of range (2-2, 0-0, 1-1)')
return ', '.join(reason)
def SparkSQLRow(self):
"""Return a SparkSQL Row object for this object."""
from pyspark.sql import Row
return Row(
schema_type_code=safe_str(self.SCHEMA_TYPE_CODE),
schema_build_id=safe_str(self.SCHEMA_BUILD_ID),
tabblkst=safe_str(self.TABBLKST),
tabblkcou=safe_str(self.TABBLKCOU),
tabtractce=safe_str(self.TABTRACTCE),
tabblkgrpce=safe_str(self.TABBLKGRPCE),
tabblk=safe_str(self.TABBLK),
rtype=safe_str(self.RTYPE),
gqtype=safe_str(self.GQTYPE),
ten=safe_str(self.TEN),
vacs=safe_str(self.VACS),
hhsize=safe_str(self.HHSIZE),
hht=safe_str(self.HHT),
hht2=safe_str(self.HHT2),
cplt=safe_str(self.CPLT),
upart=safe_str(self.UPART),
multg=safe_str(self.MULTG),
thhldrage=safe_str(self.THHLDRAGE),
thhspan=safe_str(self.THHSPAN),
thhrace=safe_str(self.THHRACE),
paoc=safe_str(self.PAOC),
tp18=safe_str(self.TP18),
tp60=safe_str(self.TP60),
tp65=safe_str(self.TP65),
tp75=safe_str(self.TP75),
pac=safe_str(self.PAC),
hhsex=safe_str(self.HHSEX),
)
@staticmethod
def parse_line(line):
# Read a line and return it as a dictionary.
inst: MDF_Unit = MDF_Unit()
inst.parse_column_specified(line)
assert inst.validate(), f'A line is invalid!! line: {line}, validate_reason: {inst.validate_reason()}'
row = inst.SparkSQLRow()
return row
@staticmethod
def parse_piped_line(line):
# Read a pipe-delimited line and return it as a dictionary.
inst: MDF_Unit = MDF_Unit()
inst.parse_pipe_delimited(line)
assert inst.validate(), f'A line is invalid!! line: {line}, validate_reason: {inst.validate_reason()}'
row = inst.SparkSQLRow()
return row
SPEC_CLASS_OBJECTS = [MDF_Person(),MDF_Unit()]
null = None
SPEC_DICT = {"tables": {"MDF_Person": {"name": "MDF_Person", "variables": [{"name": "SCHEMA_TYPE_CODE", "vtype": "CHAR", "position": "1", "desc": "Schema Type Code", "column": null, "width": 3, "ranges": [{"a": "MPD", "b": "MPD"}]}, {"name": "SCHEMA_BUILD_ID", "vtype": "CHAR", "position": "2", "desc": "Schema Build ID", "column": null, "width": 5, "ranges": []}, {"name": "TABBLKST", "vtype": "CHAR", "position": "3", "desc": "2020 Tabulation State (FIPS)", "column": null, "width": 2, "ranges": [{"a": "44", "b": "51"}, {"a": "72", "b": "72"}, {"a": "08", "b": "13"}, {"a": "53", "b": "56"}, {"a": "01", "b": "02"}, {"a": "04", "b": "06"}, {"a": "15", "b": "42"}]}, {"name": "TABBLKCOU", "vtype": "CHAR", "position": "4", "desc": "2020 Tabulation County (FIPS)", "column": null, "width": 3, "ranges": [{"a": "001", "b": "840"}]}, {"name": "TABTRACTCE", "vtype": "CHAR", "position": "5", "desc": "2020 Tabulation Census Tract", "column": null, "width": 6, "ranges": [{"a": "000100", "b": "998999"}]}, {"name": "TABBLKGRPCE", "vtype": "CHAR", "position": "6", "desc": "2020 Census Block Group", "column": null, "width": 1, "ranges": [{"a": "0", "b": "9"}]}, {"name": "TABBLK", "vtype": "CHAR", "position": "7", "desc": "2020 Block Number", "column": null, "width": 4, "ranges": [{"a": "0001", "b": "9999"}]}, {"name": "EPNUM", "vtype": "INT", "position": "8", "desc": "Privacy Edited Person Number", "column": null, "width": 9, "ranges": [{"a": "0", "b": "999999999"}]}, {"name": "RTYPE", "vtype": "CHAR", "position": "9", "desc": "Record Type", "column": null, "width": 1, "ranges": [{"a": "5", "b": "5"}, {"a": "3", "b": "3"}]}, {"name": "GQTYPE", "vtype": "CHAR", "position": "10", "desc": "Group Quarters Type", "column": null, "width": 3, "ranges": [{"a": "106", "b": "106"}, {"a": "103", "b": "103"}, {"a": "102", "b": "102"}, {"a": "104", "b": "104"}, {"a": "602", "b": "602"}, {"a": "105", "b": "105"}, {"a": "301", "b": "301"}, {"a": "401", "b": "401"}, {"a": "402", "b": "402"}, {"a": "403", "b": "403"}, {"a": "203", "b": "203"}, {"a": "997", "b": "997"}, {"a": "501", "b": "501"}, {"a": "601", "b": "601"}, {"a": "706", "b": "706"}, {"a": "801", "b": "801"}, {"a": "201", "b": "201"}, {"a": "704", "b": "704"}, {"a": "701", "b": "701"}, {"a": "904", "b": "904"}, {"a": "405", "b": "405"}, {"a": "802", "b": "802"}, {"a": "202", "b": "202"}, {"a": "903", "b": "903"}, {"a": "900", "b": "900"}, {"a": "901", "b": "901"}, {"a": "101", "b": "101"}, {"a": "000", "b": "000"}, {"a": "404", "b": "404"}]}, {"name": "RELSHIP", "vtype": "CHAR", "position": "11", "desc": "Edited Relationship", "column": null, "width": 2, "ranges": [{"a": "25", "b": "25"}, {"a": "32", "b": "32"}, {"a": "23", "b": "23"}, {"a": "20", "b": "20"}, {"a": "26", "b": "26"}, {"a": "30", "b": "30"}, {"a": "34", "b": "34"}, {"a": "37", "b": "37"}, {"a": "33", "b": "33"}, {"a": "36", "b": "36"}, {"a": "24", "b": "24"}, {"a": "38", "b": "38"}, {"a": "21", "b": "21"}, {"a": "35", "b": "35"}, {"a": "31", "b": "31"}, {"a": "22", "b": "22"}, {"a": "29", "b": "29"}, {"a": "28", "b": "28"}, {"a": "27", "b": "27"}]}, {"name": "QSEX", "vtype": "CHAR", "position": "12", "desc": "Edited Sex", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "1", "b": "1"}]}, {"name": "QAGE", "vtype": "INT", "position": "13", "desc": "Edited Age", "column": null, "width": 3, "ranges": [{"a": "0", "b": "115"}]}, {"name": "CENHISP", "vtype": "CHAR", "position": "14", "desc": "Hispanic Origin", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "1", "b": "1"}]}, {"name": "CENRACE", "vtype": "CHAR", "position": "15", "desc": "Census Race", "column": null, "width": 2, "ranges": [{"a": "14", "b": "14"}, {"a": "16", "b": "16"}, {"a": "09", "b": "09"}, {"a": "11", "b": "11"}, {"a": "01", "b": "01"}, {"a": "12", "b": "12"}, {"a": "20", "b": "20"}, {"a": "17", "b": "17"}, {"a": "06", "b": "06"}, {"a": "15", "b": "15"}, {"a": "26", "b": "26"}, {"a": "30", "b": "30"}, {"a": "36", "b": "36"}, {"a": "45", "b": "45"}, {"a": "46", "b": "46"}, {"a": "55", "b": "55"}, {"a": "61", "b": "61"}, {"a": "18", "b": "18"}, {"a": "27", "b": "27"}, {"a": "03", "b": "03"}, {"a": "10", "b": "10"}, {"a": "13", "b": "13"}, {"a": "23", "b": "23"}, {"a": "54", "b": "54"}, {"a": "07", "b": "07"}, {"a": "33", "b": "33"}, {"a": "53", "b": "53"}, {"a": "22", "b": "22"}, {"a": "31", "b": "31"}, {"a": "41", "b": "41"}, {"a": "48", "b": "48"}, {"a": "50", "b": "50"}, {"a": "25", "b": "25"}, {"a": "28", "b": "28"}, {"a": "29", "b": "29"}, {"a": "32", "b": "32"}, {"a": "34", "b": "34"}, {"a": "52", "b": "52"}, {"a": "59", "b": "59"}, {"a": "02", "b": "02"}, {"a": "47", "b": "47"}, {"a": "37", "b": "37"}, {"a": "19", "b": "19"}, {"a": "40", "b": "40"}, {"a": "08", "b": "08"}, {"a": "21", "b": "21"}, {"a": "56", "b": "56"}, {"a": "39", "b": "39"}, {"a": "38", "b": "38"}, {"a": "44", "b": "44"}, {"a": "42", "b": "42"}, {"a": "49", "b": "49"}, {"a": "57", "b": "57"}, {"a": "63", "b": "63"}, {"a": "51", "b": "51"}, {"a": "04", "b": "04"}, {"a": "24", "b": "24"}, {"a": "58", "b": "58"}, {"a": "60", "b": "60"}, {"a": "62", "b": "62"}, {"a": "35", "b": "35"}, {"a": "05", "b": "05"}, {"a": "43", "b": "43"}]}, {"name": "LIVE_ALONE", "vtype": "CHAR", "position": "16", "desc": "Person Living Alone", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}]}, "MDF_Unit": {"name": "MDF_Unit", "variables": [{"name": "SCHEMA_TYPE_CODE", "vtype": "CHAR", "position": "1", "desc": "Schema Type Code", "column": null, "width": 3, "ranges": [{"a": "MUD", "b": "MUD"}]}, {"name": "SCHEMA_BUILD_ID", "vtype": "CHAR", "position": "2", "desc": "Schema Build ID", "column": null, "width": 5, "ranges": []}, {"name": "TABBLKST", "vtype": "CHAR", "position": "3", "desc": "2020 Tabulation State (FIPS)", "column": null, "width": 2, "ranges": [{"a": "44", "b": "51"}, {"a": "72", "b": "72"}, {"a": "08", "b": "13"}, {"a": "53", "b": "56"}, {"a": "01", "b": "02"}, {"a": "04", "b": "06"}, {"a": "15", "b": "42"}]}, {"name": "TABBLKCOU", "vtype": "CHAR", "position": "4", "desc": "2020 Tabulation County (FIPS)", "column": null, "width": 3, "ranges": [{"a": "001", "b": "840"}]}, {"name": "TABTRACTCE", "vtype": "CHAR", "position": "5", "desc": "2020 Tabulation Census Tract", "column": null, "width": 6, "ranges": [{"a": "000100", "b": "998999"}]}, {"name": "TABBLKGRPCE", "vtype": "CHAR", "position": "6", "desc": "2020 Census Block Group", "column": null, "width": 1, "ranges": [{"a": "0", "b": "9"}]}, {"name": "TABBLK", "vtype": "CHAR", "position": "7", "desc": "2020 Block Number", "column": null, "width": 4, "ranges": [{"a": "0001", "b": "9999"}]}, {"name": "RTYPE", "vtype": "CHAR", "position": "8", "desc": "Record Type", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "4", "b": "4"}]}, {"name": "GQTYPE", "vtype": "CHAR", "position": "9", "desc": "Group Quarters Type", "column": null, "width": 3, "ranges": [{"a": "106", "b": "106"}, {"a": "103", "b": "103"}, {"a": "102", "b": "102"}, {"a": "104", "b": "104"}, {"a": "602", "b": "602"}, {"a": "105", "b": "105"}, {"a": "301", "b": "301"}, {"a": "401", "b": "401"}, {"a": "402", "b": "402"}, {"a": "403", "b": "403"}, {"a": "203", "b": "203"}, {"a": "997", "b": "997"}, {"a": "501", "b": "501"}, {"a": "601", "b": "601"}, {"a": "706", "b": "706"}, {"a": "801", "b": "801"}, {"a": "201", "b": "201"}, {"a": "704", "b": "704"}, {"a": "701", "b": "701"}, {"a": "904", "b": "904"}, {"a": "405", "b": "405"}, {"a": "802", "b": "802"}, {"a": "202", "b": "202"}, {"a": "903", "b": "903"}, {"a": "900", "b": "900"}, {"a": "901", "b": "901"}, {"a": "101", "b": "101"}, {"a": "000", "b": "000"}, {"a": "404", "b": "404"}]}, {"name": "TEN", "vtype": "CHAR", "position": "10", "desc": "Tenure", "column": null, "width": 1, "ranges": [{"a": "1", "b": "1"}, {"a": "3", "b": "3"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "VACS", "vtype": "CHAR", "position": "11", "desc": "Vacancy Status", "column": null, "width": 1, "ranges": [{"a": "7", "b": "7"}, {"a": "1", "b": "1"}, {"a": "5", "b": "5"}, {"a": "3", "b": "3"}, {"a": "6", "b": "6"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "HHSIZE", "vtype": "CHAR", "position": "12", "desc": "Population Count", "column": null, "width": 1, "ranges": [{"a": "7", "b": "7"}, {"a": "1", "b": "1"}, {"a": "5", "b": "5"}, {"a": "3", "b": "3"}, {"a": "6", "b": "6"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "HHT", "vtype": "CHAR", "position": "13", "desc": "Household/Family Type", "column": null, "width": 1, "ranges": [{"a": "7", "b": "7"}, {"a": "1", "b": "1"}, {"a": "5", "b": "5"}, {"a": "3", "b": "3"}, {"a": "6", "b": "6"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "HHT2", "vtype": "CHAR", "position": "14", "desc": "Household/Family Type (Includes Cohabiting)", "column": null, "width": 2, "ranges": [{"a": "02", "b": "02"}, {"a": "03", "b": "03"}, {"a": "09", "b": "09"}, {"a": "01", "b": "01"}, {"a": "00", "b": "00"}, {"a": "10", "b": "10"}, {"a": "11", "b": "11"}, {"a": "06", "b": "06"}, {"a": "07", "b": "07"}, {"a": "04", "b": "04"}, {"a": "12", "b": "12"}, {"a": "08", "b": "08"}, {"a": "05", "b": "05"}]}, {"name": "CPLT", "vtype": "CHAR", "position": "15", "desc": "Couple Type", "column": null, "width": 1, "ranges": [{"a": "1", "b": "1"}, {"a": "5", "b": "5"}, {"a": "3", "b": "3"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "UPART", "vtype": "CHAR", "position": "16", "desc": "Presence and Type of Unmarried Partner Household", "column": null, "width": 1, "ranges": [{"a": "1", "b": "1"}, {"a": "5", "b": "5"}, {"a": "3", "b": "3"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "MULTG", "vtype": "CHAR", "position": "17", "desc": "Multigenerational Household", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}, {"name": "THHLDRAGE", "vtype": "CHAR", "position": "18", "desc": "Age of Householder", "column": null, "width": 1, "ranges": [{"a": "7", "b": "7"}, {"a": "1", "b": "1"}, {"a": "5", "b": "5"}, {"a": "3", "b": "3"}, {"a": "6", "b": "6"}, {"a": "8", "b": "8"}, {"a": "9", "b": "9"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "THHSPAN", "vtype": "CHAR", "position": "19", "desc": "Hispanic Householder", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}, {"name": "THHRACE", "vtype": "CHAR", "position": "20", "desc": "Race of Householder", "column": null, "width": 2, "ranges": [{"a": "02", "b": "02"}, {"a": "03", "b": "03"}, {"a": "01", "b": "01"}, {"a": "00", "b": "00"}, {"a": "06", "b": "06"}, {"a": "07", "b": "07"}, {"a": "04", "b": "04"}, {"a": "05", "b": "05"}]}, {"name": "PAOC", "vtype": "CHAR", "position": "21", "desc": "Presence and Age of Own Children Under 18", "column": null, "width": 1, "ranges": [{"a": "1", "b": "1"}, {"a": "3", "b": "3"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "TP18", "vtype": "CHAR", "position": "22", "desc": "Presence of People Under 18 Years in Household", "column": null, "width": 1, "ranges": [{"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}, {"name": "TP60", "vtype": "CHAR", "position": "23", "desc": "Presence of People 60 Years and Over in Household", "column": null, "width": 1, "ranges": [{"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}, {"name": "TP65", "vtype": "CHAR", "position": "24", "desc": "Presence of People 65 Years and Over in Household", "column": null, "width": 1, "ranges": [{"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}, {"name": "TP75", "vtype": "CHAR", "position": "25", "desc": "Presence of People 75 Years and Over in Household", "column": null, "width": 1, "ranges": [{"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}, {"name": "PAC", "vtype": "CHAR", "position": "26", "desc": "Presence and Age of Children Under 18", "column": null, "width": 1, "ranges": [{"a": "1", "b": "1"}, {"a": "3", "b": "3"}, {"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "4", "b": "4"}]}, {"name": "HHSEX", "vtype": "CHAR", "position": "27", "desc": "Sex of Householder", "column": null, "width": 1, "ranges": [{"a": "2", "b": "2"}, {"a": "0", "b": "0"}, {"a": "1", "b": "1"}]}]}}}
| 79.631293
| 12,366
| 0.575339
| 8,924
| 58,529
| 3.680188
| 0.039444
| 0.062359
| 0.06851
| 0.051154
| 0.848121
| 0.795628
| 0.780982
| 0.760276
| 0.753091
| 0.7164
| 0
| 0.083115
| 0.199115
| 58,529
| 734
| 12,367
| 79.739782
| 0.617515
| 0.083138
| 0
| 0.604101
| 1
| 0.029968
| 0.183611
| 0.011044
| 0
| 0
| 0
| 0
| 0.006309
| 1
| 0.118297
| false
| 0.003155
| 0.003155
| 0.009464
| 0.326498
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
563d121504f7979fc5590a3987a6ef2a51541bda
| 206
|
py
|
Python
|
transform/__init__.py
|
johnpeterflynn/surface-texture-inpainting-net
|
b2de05eaa47c9bcca53b9aee12b6012ac2c05156
|
[
"MIT"
] | null | null | null |
transform/__init__.py
|
johnpeterflynn/surface-texture-inpainting-net
|
b2de05eaa47c9bcca53b9aee12b6012ac2c05156
|
[
"MIT"
] | null | null | null |
transform/__init__.py
|
johnpeterflynn/surface-texture-inpainting-net
|
b2de05eaa47c9bcca53b9aee12b6012ac2c05156
|
[
"MIT"
] | null | null | null |
from .color_normalization import *
from .coords_normalization import *
from .random_rotation import *
from .random_linear_transformation import *
from .add_self_loops import *
from .move_to_origin import *
| 29.428571
| 43
| 0.825243
| 27
| 206
| 5.962963
| 0.555556
| 0.310559
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116505
| 206
| 6
| 44
| 34.333333
| 0.884615
| 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
|
567d667c0724b2491abcdb4513fb1bd8bfe4a739
| 651
|
py
|
Python
|
runtime/bindings/python/src/openvino/offline_transformations_pybind/__init__.py
|
chccc1994/openvino
|
41f7893ae81d186d15c1754b179bf32a66d03bcf
|
[
"Apache-2.0"
] | 1
|
2020-11-19T15:53:18.000Z
|
2020-11-19T15:53:18.000Z
|
runtime/bindings/python/src/openvino/offline_transformations_pybind/__init__.py
|
thomas-yanxin/openvino
|
031e998a15ec738c64cc2379d7f30fb73087c272
|
[
"Apache-2.0"
] | 40
|
2020-11-17T10:09:20.000Z
|
2022-02-21T13:14:20.000Z
|
runtime/bindings/python/src/openvino/offline_transformations_pybind/__init__.py
|
thomas-yanxin/openvino
|
031e998a15ec738c64cc2379d7f30fb73087c272
|
[
"Apache-2.0"
] | 4
|
2021-09-29T20:44:49.000Z
|
2021-10-20T13:02:12.000Z
|
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.pyopenvino.offline_transformations_pybind import apply_moc_transformations
from openvino.pyopenvino.offline_transformations_pybind import apply_pot_transformations
from openvino.pyopenvino.offline_transformations_pybind import apply_low_latency_transformation
from openvino.pyopenvino.offline_transformations_pybind import apply_pruning_transformation
from openvino.pyopenvino.offline_transformations_pybind import generate_mapping_file
from openvino.pyopenvino.offline_transformations_pybind import apply_make_stateful_transformation
| 59.181818
| 97
| 0.894009
| 76
| 651
| 7.315789
| 0.434211
| 0.129496
| 0.23741
| 0.31295
| 0.753597
| 0.753597
| 0.753597
| 0.753597
| 0.273381
| 0
| 0
| 0.011438
| 0.059908
| 651
| 10
| 98
| 65.1
| 0.897059
| 0.144393
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 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
|
3b28713403a5a461efdc03c6e7427230866ff704
| 4,311
|
py
|
Python
|
cycles.py
|
samtx/rankine
|
81f33e98d4d98d5783351330d971f3a2463b34ea
|
[
"MIT"
] | 2
|
2015-10-29T19:59:31.000Z
|
2017-10-21T08:21:40.000Z
|
cycles.py
|
samtx/rankine
|
81f33e98d4d98d5783351330d971f3a2463b34ea
|
[
"MIT"
] | null | null | null |
cycles.py
|
samtx/rankine
|
81f33e98d4d98d5783351330d971f3a2463b34ea
|
[
"MIT"
] | 2
|
2015-11-21T17:20:40.000Z
|
2019-01-20T14:20:24.000Z
|
from .components import Boiler, Turbine, Condenser, Pump, connect_flow
from .thermodynamics import Cycle, State
def ideal_rankine(**kwargs):
fluid = kwargs.get('fluid','Water')
p_hi = kwargs.get('p_hi',None) * 1e6 # MPa
p_lo = kwargs.get('p_lo',None) * 1e6 # MPa
turb_eff = kwargs.get('turb_eff',1.0)
pump_eff = kwargs.get('pump_eff',1.0)
T_0 = kwargs.get('T_0', 25) + 273.15 # deg C
p_0 = kwargs.get('p_0', 101.3) * 1e3 # kPa
dead = State(p=p_0, T=T_0, fluid=fluid)
cycle = Cycle(fluid=fluid, dead=dead)
turb = Turbine(p_hi=p_hi, p_lo=p_lo, eff=turb_eff, fluid=fluid, cycle=cycle)
turb.compute()
cond = Condenser(inflow=turb.outflow, p=p_lo, fluid=fluid, cycle=cycle)
cond.compute()
pump = Pump(inflow=cond.outflow, p_hi=p_hi, eff=pump_eff, fluid=fluid, cycle=cycle)
pump.compute()
boil = Boiler(inflow=pump.outflow, outflow=turb.inflow, fluid=fluid, cycle=cycle)
boil.compute()
cycle.flow_exergy()
# Define cycle properties
cycle.wnet = turb.work + pump.work
cycle.qnet = boil.heat + cond.heat
cycle.en_eff = cycle.wnet / boil.heat
cycle.bwr = -pump.work / turb.work
cycle.ex_eff = cycle.wnet / boil.delta_ef # cycle exergetic eff
return cycle
def rankine_superheated(**kwargs):
fluid = kwargs.get('fluid','Water')
p_hi = kwargs.get('p_hi',None) * 1e6 # MPa
p_lo = kwargs.get('p_lo',None) * 1e6 # MPa
T_hi = kwargs.get('T_hi',None) + 273.15 # deg C
turb_eff = kwargs.get('turb_eff',1.0)
pump_eff = kwargs.get('pump_eff',1.0)
T_0 = kwargs.get('T_0', 25) + 273.15 # deg C
p_0 = kwargs.get('p_0', 101.3) * 1e3 # kPa
dead = State(p=p_0, T=T_0, fluid=fluid)
cycle = Cycle(fluid=fluid, dead=dead)
turb = Turbine(p_hi=p_hi, p_lo=p_lo, T_hi=T_hi, eff=turb_eff, fluid=fluid, cycle=cycle)
turb.compute()
cond = Condenser(inflow=turb.outflow, p=p_lo, fluid=fluid, cycle=cycle)
cond.compute()
pump = Pump(inflow=cond.outflow, p_hi=p_hi, eff=pump_eff, fluid=fluid, cycle=cycle)
pump.compute()
boil = Boiler(inflow=pump.outflow, outflow=turb.inflow, fluid=fluid, cycle=cycle)
boil.compute()
cycle.flow_exergy()
# Define cycle properties
cycle.wnet = turb.work + pump.work
cycle.qnet = boil.heat + cond.heat
cycle.en_eff = cycle.wnet / boil.heat
cycle.bwr = -pump.work / turb.work
cycle.ex_eff = cycle.wnet / boil.delta_ef # cycle exergetic eff
return cycle
def rankine_reheated(**kwargs):
fluid = kwargs.get('fluid','Water')
p_hi = kwargs.get('p_hi',None) * 1e6 # MPa
p_mid = kwargs.get('p_mid',None) * 1e6 # MPa
p_lo = kwargs.get('p_lo',None) * 1e6 # MPa
T_hi = kwargs.get('T_hi',None) + 273.15 # deg C
T_mid = kwargs.get('T_mid',None) + 273.15 # deg C
hp_turb_eff = kwargs.get('hp_turb_eff',1.0)
lp_turb_eff = kwargs.get('lp_turb_eff',1.0)
pump_eff = kwargs.get('pump_eff',1.0)
T_0 = kwargs.get('T_0', 25) + 273.15 # deg C
p_0 = kwargs.get('p_0', 101.3) * 1e3 # kPa
dead = State(p=p_0, T=T_0, fluid=fluid)
cycle = Cycle(fluid=fluid, dead=dead)
# high pressure turbine
hp_turb = Turbine(p_hi=p_hi, p_lo=p_mid, T_hi=T_hi, eff=hp_turb_eff, name='HP Turb', fluid=fluid, cycle=cycle)
hp_turb.compute()
lp_boil = Boiler(inflow=hp_turb.outflow, p=p_mid, T_hi=T_mid, name='LP Boil', fluid=fluid, cycle=cycle)
lp_boil.compute()
lp_turb = Turbine(p_hi=p_mid, p_lo=p_lo, T_hi=T_mid, eff=lp_turb_eff, name='LP Turb', fluid=fluid, cycle=cycle)
lp_turb.compute()
cond = Condenser(inflow=lp_turb.outflow, p=p_lo, fluid=fluid, cycle=cycle)
cond.compute()
pump = Pump(inflow=cond.outflow, p_hi=p_hi, eff=pump_eff, fluid=fluid, cycle=cycle)
pump.compute()
hp_boil = Boiler(inflow=pump.outflow, outflow=hp_turb.inflow, name='HP Boil', fluid=fluid, cycle=cycle)
hp_boil.compute()
cycle.flow_exergy()
# Define cycle properties
cycle.wnet = hp_turb.work + lp_turb.work + pump.work
cycle.qnet = hp_boil.heat +lp_boil.heat + cond.heat
cycle.en_eff = cycle.wnet / (hp_boil.heat +lp_boil.heat)
cycle.bwr = -pump.work / (hp_turb.work + lp_turb.work)
cycle.ex_eff = cycle.wnet / (hp_boil.delta_ef + lp_boil.delta_ef) # cycle exergetic eff
return cycle
| 39.916667
| 115
| 0.657388
| 733
| 4,311
| 3.6794
| 0.091405
| 0.086763
| 0.09455
| 0.126066
| 0.865406
| 0.794957
| 0.746385
| 0.731183
| 0.716722
| 0.695958
| 0
| 0.02876
| 0.193459
| 4,311
| 107
| 116
| 40.28972
| 0.746908
| 0.05312
| 0
| 0.709302
| 0
| 0
| 0.044368
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.034884
| false
| 0
| 0.023256
| 0
| 0.093023
| 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
|
3b40feb35606b363c8a3c739555f87bf4edef46d
| 223
|
py
|
Python
|
common/constants/loginconstants.py
|
cosee/realworld-demo-ui-test
|
309c5aad0be1978ef819ed14c3c15ead09ab819b
|
[
"Apache-2.0"
] | null | null | null |
common/constants/loginconstants.py
|
cosee/realworld-demo-ui-test
|
309c5aad0be1978ef819ed14c3c15ead09ab819b
|
[
"Apache-2.0"
] | null | null | null |
common/constants/loginconstants.py
|
cosee/realworld-demo-ui-test
|
309c5aad0be1978ef819ed14c3c15ead09ab819b
|
[
"Apache-2.0"
] | null | null | null |
LOGIN_URL = "/login"
XPATH_EMAIL_INPUT = "//form//input[contains(@placeholder,'Email')]"
XPATH_PASSWORD_INPUT = "//form//input[contains(@placeholder,'Password')]"
XPATH_SUBMIT = "//form//button[contains(@type,'submit')]"
| 31.857143
| 73
| 0.717489
| 26
| 223
| 5.923077
| 0.461538
| 0.116883
| 0.181818
| 0.285714
| 0.428571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.06278
| 223
| 6
| 74
| 37.166667
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0.623318
| 0.596413
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.25
| 0
| 0
| 0
| 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
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
8ed4646f2ce029befda740af9792d273cb3c8479
| 179
|
py
|
Python
|
tonic/agents/__init__.py
|
Eyalcohenx/tonic
|
afc15c6fa23fed4f696f68f0acf961964b0172dc
|
[
"MIT"
] | 350
|
2020-08-06T13:49:11.000Z
|
2022-03-24T08:53:59.000Z
|
tonic/agents/__init__.py
|
Eyalcohenx/tonic
|
afc15c6fa23fed4f696f68f0acf961964b0172dc
|
[
"MIT"
] | 12
|
2020-08-07T02:21:58.000Z
|
2021-05-20T11:50:44.000Z
|
tonic/agents/__init__.py
|
Eyalcohenx/tonic
|
afc15c6fa23fed4f696f68f0acf961964b0172dc
|
[
"MIT"
] | 35
|
2020-08-06T16:53:40.000Z
|
2021-12-17T06:01:09.000Z
|
from .agent import Agent
from .basic import Constant, NormalRandom, OrnsteinUhlenbeck, UniformRandom
__all__ = [Agent, Constant, NormalRandom, OrnsteinUhlenbeck, UniformRandom]
| 29.833333
| 75
| 0.821229
| 17
| 179
| 8.411765
| 0.529412
| 0.27972
| 0.517483
| 0.699301
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111732
| 179
| 5
| 76
| 35.8
| 0.899371
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
d94a83adc661b7d95524dc4e2c6dbb2bf6999999
| 168
|
py
|
Python
|
itm-413/fiddle/randrange.py
|
bradyhouse/iit
|
7d1e91864467f56fa6dc901a83e97977630132b3
|
[
"MIT"
] | 1
|
2018-05-02T11:45:25.000Z
|
2018-05-02T11:45:25.000Z
|
itm-413/fiddle/randrange.py
|
bradyhouse/iit
|
7d1e91864467f56fa6dc901a83e97977630132b3
|
[
"MIT"
] | null | null | null |
itm-413/fiddle/randrange.py
|
bradyhouse/iit
|
7d1e91864467f56fa6dc901a83e97977630132b3
|
[
"MIT"
] | null | null | null |
import os
import random
print 'random.randrange(0,10):'
print random.randrange(0,10)
print 'random.randrange(0,1000,10):'
print random.randrange(0,1000,10)
os._exit(1)
| 21
| 36
| 0.761905
| 29
| 168
| 4.37931
| 0.344828
| 0.346457
| 0.629921
| 0.661417
| 0.787402
| 0.787402
| 0.787402
| 0.527559
| 0.527559
| 0
| 0
| 0.135484
| 0.077381
| 168
| 8
| 37
| 21
| 0.683871
| 0
| 0
| 0
| 0
| 0
| 0.301775
| 0.301775
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.285714
| null | null | 0.571429
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 9
|
d983cfef197f83dae564ab0b4a52a7ba3ac721b3
| 9,786
|
py
|
Python
|
lib/instagram.py
|
jsmnkk/api
|
e35ebd62ccd24e11d3a3b9944dfdd614d2940392
|
[
"MIT"
] | null | null | null |
lib/instagram.py
|
jsmnkk/api
|
e35ebd62ccd24e11d3a3b9944dfdd614d2940392
|
[
"MIT"
] | null | null | null |
lib/instagram.py
|
jsmnkk/api
|
e35ebd62ccd24e11d3a3b9944dfdd614d2940392
|
[
"MIT"
] | 1
|
2021-12-26T15:40:02.000Z
|
2021-12-26T15:40:02.000Z
|
from flask import jsonify
def insta1(json_data):
if json_data:
json_data_ = json_data
try:
json_result = json_data_['items'][0]
user_metadata = json_result['user']
location_data = json_result['location']
caption_data = json_result['caption']
caption_edited = json_result['caption_is_edited']
media_count = json_result['carousel_media_count']
media_data = json_result['carousel_media']
media_result = []
for i in media_data:
if 'video_versions' in i:
typ = 'video'
media_data_ = i['video_versions']
else:
typ = 'image'
media_data_ = i['image_versions2']['candidates']
width = i['original_width']
height = i['original_height']
media_result.append({
'type':typ,
'url':media_data_[0]['url']
})
location = location_data['name']
owner = {
'username':user_metadata['username'],
'full_name':user_metadata['full_name'],
'verified':user_metadata['is_verified']
}
caption = caption_data['text']
results = dict(
status = True,
caption = caption,
caption_edited = caption_edited,
owner = owner,
location = location,
media_result = media_result
)
return results
except Exception as e:
print(e)
return {'status': False}
def insta2(json_data):
if json_data:
json_data_ = json_data
try:
json_result = json_data_
type_name = json_result['graphql']['shortcode_media']['__typename']
if type_name == 'GraphVideo':
result_url = json_result['graphql']['shortcode_media']['video_url']
view_count = json_result['graphql']['shortcode_media']['video_view_count']
caption = json_result['graphql']['shortcode_media']['edge_media_to_caption']['edges'][0]['node']['text']
caption_edited = json_result['graphql']['shortcode_media']['caption_is_edited']
owner = json_result['graphql']['shortcode_media']['owner']
owner_verifed = owner['is_verified']
owner_username = owner['username']
owner_name = owner['full_name']
video_duration = json_result['graphql']['shortcode_media']['video_duration']
loc = json_result['graphql']['shortcode_media']['location']
if loc == None:
location = "null"
else:
location = loc['name']
ac_caption = json_result['graphql']['shortcode_media']['accessibility_caption']
if not ac_caption == None:
accessibility_caption = ac_caption,
else:
accessibility_caption = "null"
media_url = []
media_url.append(dict(
type = 'video',
url = result_url
))
results = dict(
status = True,
caption = caption,
caption_edited = caption_edited,
owner = dict(
username = owner_username,
full_name = owner_name,
verified = owner_verifed
),
location = location,
media_result = media_url
)
elif type_name == 'GraphSidecar':
caption = json_result['graphql']['shortcode_media']['edge_media_to_caption']['edges'][0]['node']['text']
caption_edited = json_result['graphql']['shortcode_media']['caption_is_edited']
owner = json_result['graphql']['shortcode_media']['owner']
owner_verifed = owner['is_verified']
owner_username = owner['username']
owner_name = owner['full_name']
loc = json_result['graphql']['shortcode_media']['location']
if loc == None:
location = "null"
else:
location = loc['name']
media = json_result['graphql']['shortcode_media']['edge_sidecar_to_children']['edges']
media_result = []
for i in media:
node = i['node']
type_name_ = node['__typename']
if type_name_ == 'GraphVideo':
result_url = node['video_url']
view_count = node['video_view_count']
ac_caption = node['accessibility_caption']
if not ac_caption == None:
accessibility_caption = ac_caption,
else:
accessibility_caption = "null"
media_result.append(dict(
type= 'video',
url = result_url
))
else:
result_url = node['display_url']
ac_caption = node['accessibility_caption']
if not ac_caption == None:
accessibility_caption = ac_caption,
else:
accessibility_caption = "null"
media_result.append(dict(
type='image',
url= result_url
))
results = dict(
status = True,
caption = caption,
caption_edited = caption_edited,
owner = dict(
username = owner_username,
full_name = owner_name,
verified = owner_verifed
),
location = location,
media_result = media_result
)
else:
result_url = json_result['graphql']['shortcode_media']['display_url']
caption = json_result['graphql']['shortcode_media']['edge_media_to_caption']['edges'][0]['node']['text']
caption_edited = json_result['graphql']['shortcode_media']['caption_is_edited']
owner = json_result['graphql']['shortcode_media']['owner']
owner_verifed = owner['is_verified']
owner_username = owner['username']
owner_name = owner['full_name']
loc = json_result['graphql']['shortcode_media']['location']
if loc == None:
location = "null"
else:
location = loc['name']
ac_caption = json_result['graphql']['shortcode_media']['accessibility_caption']
if not ac_caption == None:
accessibility_caption = ac_caption,
else:
accessibility_caption = "null"
media_result = []
media_result.append(dict(
type = 'image',
url = result_url
))
results = dict(
status = True,
caption = caption,
caption_edited = caption_edited,
owner = dict(
username = owner_username,
full_name = owner_name,
verified = owner_verifed
),
location = location,
media_result = media_result
)
return (results)
except Exception as e:
print(e)
return {'status': False}
def instatv1(json_data):
if json_data:
json_data_ = json_data
if True:
json_result = json_data_['items'][0]
user_metadata = json_result['user']
caption_data = json_result['caption']
caption_edited = json_result['caption_is_edited']
media_data_ = json_result['video_versions']
width = json_result['original_width']
height = json_result['original_height']
like_count = json_result['like_count']
video_duration = json_result['video_duration']
view_count = json_result['view_count']
media_result = {
'url':media_data_[0]['url'],
'width':width,
'height':height
}
owner = {
'username':user_metadata['username'],
'full_name':user_metadata['full_name'],
'verified':user_metadata['is_verified']
}
caption = caption_data['text']
results = dict(
status = True,
caption = caption,
caption_edited = caption_edited,
owner = owner,
like_count = like_count,
video_duration = video_duration,
view_count = view_count,
media_result = media_result
)
return results
| 44.481818
| 124
| 0.461271
| 800
| 9,786
| 5.3
| 0.1
| 0.089623
| 0.080189
| 0.122642
| 0.806368
| 0.791509
| 0.746462
| 0.703774
| 0.703774
| 0.695755
| 0
| 0.002036
| 0.447885
| 9,786
| 219
| 125
| 44.684932
| 0.782713
| 0
| 0
| 0.711628
| 0
| 0
| 0.153131
| 0.017874
| 0
| 0
| 0
| 0
| 0
| 1
| 0.013953
| false
| 0
| 0.004651
| 0
| 0.04186
| 0.009302
| 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
|
79773928b83d9314070e90e7e5792ba543c6480e
| 2,424
|
py
|
Python
|
2017/aoc_01.py
|
justanotherdot/advent-linguist
|
4dfd4ef483ddbd40fb8cf7a1719705186d4ed823
|
[
"MIT"
] | null | null | null |
2017/aoc_01.py
|
justanotherdot/advent-linguist
|
4dfd4ef483ddbd40fb8cf7a1719705186d4ed823
|
[
"MIT"
] | 4
|
2016-12-06T03:23:27.000Z
|
2019-04-07T21:50:04.000Z
|
2017/aoc_01.py
|
justanotherdot/advent-linguist
|
4dfd4ef483ddbd40fb8cf7a1719705186d4ed823
|
[
"MIT"
] | null | null | null |
# Input.
s = '36743676522426214741687639282183216978128565594112364817283598621384839756628424146779311928318383597235968644687665159591573413233616717112157752469191845757712928347624726438516211153946892241449523148419426259291788938621886334734497823163281389389853675932246734153563861233894952657625868415432316155487242813798425779743561987563734944962846865263722712768674838244444385768568489842989878163655771847362656153372265945464128668412439248966939398765446171855144544285463517258749813731314365947372548811434646381595273172982466142248474238762554858654679415418693478512641864168398722199638775667744977941183772494538685398862344164521446115925528534491788728448668455349588972443295391385389551783289417349823383324748411689198219329996666752251815562522759374542652969147696419669914534586732436912798519697722586795746371697338416716842214313393228587413399534716394984183943123375517819622837972796431166264646432893478557659387795573234889141897313158457637142238315327877493994933514112645586351127139429281675912366669475931711974332271368287413985682374943195886455927839573986464555141679291998645936683639162588375974549467767623463935561847869527383395278248952314792112113126231246742753119748113828843917812547224498319849947517745625844819175973986843636628414965664466582172419197227695368492433353199233558872319529626825788288176275546566474824257336863977574347328469153319428883748696399544974133392589823343773897313173336568883385364166336362398636684459886283964242249228938383219255513996468586953519638111599935229115228837559242752925943653623682985576323929415445443378189472782454958232341986626791182861644112974418239286486722654442144851173538756859647218768134572858331849543266169672745221391659363674921469481143686952478771714585793322926824623482923579986434741714167134346384551362664177865452895348948953472328966995731169672573555621939584872187999325322327893336736611929752613241935211664248961527687778371971259654541239471766714469122213793348414477789271187324629397292446879752673'
d = {}
swapped_in_last = False
for i, c in enumerate(s):
k = int(c)
# Edge cases.
if i == 0 and c == s[-1]:
d[k] = d.get(k, 0) + 1
swapped_in_last = True
if i == len(s) - 2 and swapped_in_last:
break
if i < len(s) - 1 and s[i+1] == c:
d[k] = d.get(k, 0) + 1
total = 0
for k, n in d.items():
total += k*n
print(total)
| 101
| 2,036
| 0.914604
| 77
| 2,424
| 28.714286
| 0.376623
| 0.012212
| 0.017639
| 0.005427
| 0.008141
| 0.008141
| 0.008141
| 0
| 0
| 0
| 0
| 0.891998
| 0.056518
| 2,424
| 23
| 2,037
| 105.391304
| 0.07477
| 0.007426
| 0
| 0.125
| 0
| 0
| 0.845129
| 0.845129
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.0625
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
8de32f2e52c69064e70a8a07809f500fc985b8e4
| 141
|
py
|
Python
|
doiListSingleFile.py
|
LechMadeyski/PhD19MarekSosnicki
|
9ea8af436e451f47062a132abc02f21b00403876
|
[
"Apache-2.0"
] | 2
|
2021-03-23T18:23:27.000Z
|
2021-06-22T20:01:59.000Z
|
doiListSingleFile.py
|
LechMadeyski/AutomatedSearchHelper
|
9ea8af436e451f47062a132abc02f21b00403876
|
[
"Apache-2.0"
] | null | null | null |
doiListSingleFile.py
|
LechMadeyski/AutomatedSearchHelper
|
9ea8af436e451f47062a132abc02f21b00403876
|
[
"Apache-2.0"
] | null | null | null |
def doiList():
return [
"10.1016/j.jksuci.2019.05.004", # ScienceDirect good example
"10.1016/j.eswa.2019.04.070"
]
| 20.142857
| 68
| 0.58156
| 20
| 141
| 4.1
| 0.8
| 0.146341
| 0.170732
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 0.255319
| 141
| 6
| 69
| 23.5
| 0.495238
| 0.184397
| 0
| 0
| 0
| 0
| 0.482143
| 0.482143
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0
| 0.2
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
|
0
| 7
|
30dd6d35b6556b83d4b34506f8ec8bdd308549f0
| 13,658
|
py
|
Python
|
Bayes Classifier/bayes_cost.py
|
prash030/pattern_recognition_projects
|
9ef2631a5d054d23616e4955a6343380a6cea7d6
|
[
"Apache-2.0"
] | null | null | null |
Bayes Classifier/bayes_cost.py
|
prash030/pattern_recognition_projects
|
9ef2631a5d054d23616e4955a6343380a6cea7d6
|
[
"Apache-2.0"
] | null | null | null |
Bayes Classifier/bayes_cost.py
|
prash030/pattern_recognition_projects
|
9ef2631a5d054d23616e4955a6343380a6cea7d6
|
[
"Apache-2.0"
] | null | null | null |
# bayes_cost.py
# Copyright (c) Prasanth "Prash" Ganesan
# Author email: <prasganesan.pg@gmail.com>
# Program to classify the classes in data using Bayes classifier
from pylab import *
# Function for counting number of classes to use in finding prior
def count(C,data):
num=0
for i in range(len(data)):
if data[i,-1] == C:
num+=1
return num
# Bayesian and MAP classification function
def bayesian_map(data, griddata, method): # Assumes D=2; method = 1 for MAP, 2 for Bayesian with uniform cost and 3 for bayesian with given cost matrix
data = array(data)
Y = array(data[:,2])
Xgrid = griddata # should have two columns
# Find the prior
Classes = np.unique(Y)
C = []
for i in range(len(Classes)):
C.append(count(Classes[i],data))
prior = []
for i in range(len(Classes)):
prior.append(C[i]/len(data))
if sum(prior) != 1:
print("Error: Prior doesn't sum to 1, check your computation")
return 0
# covariance matrix of each class
for i in range(len(Classes)):
row = np.where(Y == Classes[i])
row = array(row)
row = np.transpose(row)
for j in range(len(row)):
if j==0:
X = data[row[j],:-1]
else:
X = np.vstack((X,data[row[j],:-1]))
mu_x = sum(X[:,0])/len(X)
mu_y = sum(X[:,1])/len(X)
var_x = sum(np.square(X[:,0]-mu_x))/(len(X)-1)
var_y = sum(np.square(X[:,1]-mu_y))/(len(X)-1)
covar_xy = sum((array(X[:,0])-mu_x) * (array(X[:,1])-mu_y))/(len(X)-1)
covmatrix = array([[var_x, covar_xy], [covar_xy,var_y]])
mu = np.hstack((mu_x,mu_y))
D = data.shape[1] - 1
# class conditionals
if i==0:
N = np.exp(-0.5*(np.dot(np.dot((Xgrid-mu),(np.linalg.pinv(covmatrix))),(np.transpose(Xgrid-mu)))))/((pow((2*np.pi),(D/2)))*(pow(np.linalg.det(covmatrix),0.5)))
N = np.diag(N)
else:
N0 = np.exp(-0.5*(np.dot(np.dot((Xgrid-mu),(np.linalg.pinv(covmatrix))),(np.transpose(Xgrid-mu)))))/((pow((2*3.14),(D/2)))*(pow(np.linalg.det(covmatrix),0.5)))
N = np.vstack((N,np.diag(N0)))
N = np.transpose(N)
# Do computations for bayesian and MAP
if method == 1:
print("MAP classification")
for i in range(N.shape[1]):
if i==0:
post = N[:,i]*prior[i]
else:
post = np.vstack((post,N[:,i]*prior[i]))
post = np.transpose(post)
# Now classify according to MAP
label = []
for i in range(len(Xgrid)):
if post[i,0] > post[i,1]:
label.append(0)
else:
label.append(1)
label = array(label)
elif method == 2:
print("Bayesain with uniform cost")
cost_uni = 1 - np.identity(len(Classes))
Risk = np.dot(N,cost_uni)
for i in range(Risk.shape[1]):
if i==0:
post = Risk[:,i]*prior[i]
else:
post = np.vstack((post,Risk[:,i]*prior[i]))
post = np.transpose(post)
# Now classify according to bayesian min risk
label = []
for i in range(len(Xgrid)):
temp = np.where(post[i,:] == min(post[i,:]))
label.append(temp[0]+1)
label = array(label)
elif method == 3:
print("Bayesain with non-uniform cost matrix")
cost_nonuni = array([[-0.2,0.07,0.07,0.07],[0.07,-0.15,0.07,0.07],[0.07,0.07,-0.05,0.07],[0.03,0.03,0.03,0.03]])
Risk = np.dot(N,cost_nonuni)
for i in range(Risk.shape[1]):
if i==0:
post = Risk[:,i]*prior[i]
else:
post = np.vstack((post,Risk[:,i]*prior[i]))
post = np.transpose(post)
# Now classify according to bayesian min risk
label = []
for i in range(len(Xgrid)):
temp = np.where(post[i,:] == min(post[i,:]))
label.append(temp[0]+1)
label = array(label)
else:
print("Method has to be 1, 2 or 3")
return 0
return label
# Bayesian with increased prior for class 1
def bayesian_map_prior(data, griddata, method): # Assumes D=2; method = 1 for MAP, 2 for Bayesian with uniform cost and 3 for bayesian with given cost matrix
data = array(data)
Y = array(data[:,2])
Xgrid = griddata # should have two columns
# Find the prior
Classes = np.unique(Y)
C = []
for i in range(len(Classes)):
C.append(count(Classes[i],data))
prior = []
for i in range(len(Classes)):
prior.append(C[i]/len(data))
# Increasing prior of class 1 here
a = min(prior)/2
prior[0] = prior[0]-a
prior[1] = prior[1]+a
if sum(prior) != 1:
print("Error: Prior doesn't sum to 1, check your computation")
return 0
# covariance matrix of each class
for i in range(len(Classes)):
row = np.where(Y == Classes[i])
row = array(row)
row = np.transpose(row)
for j in range(len(row)):
if j==0:
X = data[row[j],:-1]
else:
X = np.vstack((X,data[row[j],:-1]))
mu_x = sum(X[:,0])/len(X)
mu_y = sum(X[:,1])/len(X)
var_x = sum(np.square(X[:,0]-mu_x))/(len(X)-1)
var_y = sum(np.square(X[:,1]-mu_y))/(len(X)-1)
covar_xy = sum((array(X[:,0])-mu_x) * (array(X[:,1])-mu_y))/(len(X)-1)
covmatrix = array([[var_x, covar_xy], [covar_xy,var_y]])
mu = np.hstack((mu_x,mu_y))
D = data.shape[1] - 1
# class conditionals
if i==0:
N = np.exp(-0.5*(np.dot(np.dot((Xgrid-mu),(np.linalg.pinv(covmatrix))),(np.transpose(Xgrid-mu)))))/((pow((2*np.pi),(D/2)))*(pow(np.linalg.det(covmatrix),0.5)))
N = np.diag(N)
else:
N0 = np.exp(-0.5*(np.dot(np.dot((Xgrid-mu),(np.linalg.pinv(covmatrix))),(np.transpose(Xgrid-mu)))))/((pow((2*3.14),(D/2)))*(pow(np.linalg.det(covmatrix),0.5)))
N = np.vstack((N,np.diag(N0)))
N = np.transpose(N)
# Do computations for bayesian and MAP
if method == 1:
print("MAP classification")
for i in range(N.shape[1]):
if i==0:
post = N[:,i]*prior[i]
else:
post = np.vstack((post,N[:,i]*prior[i]))
post = np.transpose(post)
# Now classify according to MAP
label = []
for i in range(len(Xgrid)):
if post[i,0] > post[i,1]:
label.append(0)
else:
label.append(1)
label = array(label)
elif method == 2:
print("Bayesain with uniform cost and increased prior")
cost_uni = 1 - np.identity(len(Classes))
Risk = np.dot(N,cost_uni)
for i in range(Risk.shape[1]):
if i==0:
post = Risk[:,i]*prior[i]
else:
post = np.vstack((post,Risk[:,i]*prior[i]))
post = np.transpose(post)
# Now classify according to bayesian min risk
label = []
for i in range(len(Xgrid)):
temp = np.where(post[i,:] == min(post[i,:]))
label.append(temp[0]+1)
label = array(label)
elif method == 3:
print("Bayesain with non-uniform cost matrix and increased prior")
cost_nonuni = array([[-0.2,0.07,0.07,0.07],[0.07,-0.15,0.07,0.07],[0.07,0.07,-0.05,0.07],[0.03,0.03,0.03,0.03]])
Risk = np.dot(N,cost_nonuni)
for i in range(Risk.shape[1]):
if i==0:
post = Risk[:,i]*prior[i]
else:
post = np.vstack((post,Risk[:,i]*prior[i]))
post = np.transpose(post)
# Now classify according to bayesian min risk
label = []
for i in range(len(Xgrid)):
temp = np.where(post[i,:] == min(post[i,:]))
label.append(temp[0]+1)
label = array(label)
else:
print("Method has to be 1, 2 or 3")
return 0
return label
# Function to create grid and output the class labels
def gridpts(data, traverserow,traversecol,res,method,priorflag):
xgrid=[]
ygrid=[]
if traverserow == 1:
for col in range(int(min(data[:,1])-1)*res,int(max(data[:,1])+1)*res,1):
for row in range(int(min(data[:,0])-1)*res,int(max(data[:,0])+1)*res,1):
xgrid.append(row/res)
ygrid.append(col/res)
elif traversecol==1:
for row in range(int(min(data[:,0])-1)*res,int(max(data[:,0])+1)*res,1):
for col in range(int(min(data[:,1])-1)*res,int(max(data[:,1])+1)*res,1):
xgrid.append(row/res)
ygrid.append(col/res)
else:
print("The traverse flags are wrong. One should be zero and the other should be 1")
return 0
xgrid=array(xgrid)
ygrid=array(ygrid)
griddata = np.transpose(np.vstack((xgrid,ygrid)))
if priorflag==1:
label = bayesian_map(data, griddata, method)
else:
label = bayesian_map_prior(data, griddata, method)
# Find the boundaries
k12 = 0
for i in range(len(griddata)-1):
if (label[i+1]-label[i] != 0) and (griddata[i,0] != max(xgrid)) and (griddata[i,1] != max(ygrid)):
if k12==0:
Cbound = griddata[i,:]
else:
Cbound = np.vstack((Cbound,griddata[i,:]))
k12 = 1
return(griddata,label,Cbound)
# MAIN
# Program for bayesian classifier using uniform cost
# import csv file
data = np.genfromtxt("nuts_bolts.csv",delimiter=',')
# Testing - Apply the classifier for all the grid points
resolution = 100 # Change the resolution herer
[griddata,label,Cbound] = gridpts(data,0,1,resolution,2,1)
[_,_,Cbound2] = gridpts(data,1,0,resolution,2,1)
# Plot the data, regions and boundaries
for i in range(len(griddata)):
if label[i]==1:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="yellow", edgecolor="yellow")
elif label[i]==2:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="green", edgecolor="green")
elif label[i]==3:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="orange", edgecolor="orange")
elif label[i]==4:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="red", edgecolor="red")
for i in range(0,len(data)):
if data[i,2]==1:
plt.scatter(data[i,0], data[i,1], s=50, c="yellow")
elif data[i,2]==2:
plt.scatter(data[i,0], data[i,1], s=50, c="green")
elif data[i,2]==3:
plt.scatter(data[i,0], data[i,1], s=50, c="orange")
elif data[i,2]==4:
plt.scatter(data[i,0], data[i,1], s=50, c="red")
plt.scatter(Cbound[:,0], Cbound[:,1], c='black')
plt.scatter(Cbound2[:,0], Cbound2[:,1], c='black')
fig1 = plt.gcf()
plt.show()
fig1.savefig('bayes_cost_uni.png', dpi=100)
# Repeat for non-uniform cost matrix
[griddata,label,Cbound] = gridpts(data,0,1,resolution,3,1)
[_,_,Cbound2] = gridpts(data,1,0,resolution,3,1)
# Plot everything
for i in range(len(griddata)):
if label[i]==1:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="yellow", edgecolor="yellow")
elif label[i]==2:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="green", edgecolor="green")
elif label[i]==3:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="orange", edgecolor="orange")
elif label[i]==4:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="red", edgecolor="red")
for i in range(0,len(data)):
if data[i,2]==1:
plt.scatter(data[i,0], data[i,1], s=50, c="yellow")
elif data[i,2]==2:
plt.scatter(data[i,0], data[i,1], s=50, c="green")
elif data[i,2]==3:
plt.scatter(data[i,0], data[i,1], s=50, c="orange")
elif data[i,2]==4:
plt.scatter(data[i,0], data[i,1], s=50, c="red")
plt.scatter(Cbound[:,0], Cbound[:,1], c='black')
plt.scatter(Cbound2[:,0], Cbound2[:,1], c='black')
fig1 = plt.gcf()
plt.show()
fig1.savefig('bayes_cost_nonuni.png', dpi=100)
# With increased prior
# plot for non-uniform cost and incresed prior
[griddata,label,Cbound] = gridpts(data,0,1,resolution,3,2)
[_,_,Cbound2] = gridpts(data,1,0,resolution,3,2)
# Plot the data
for i in range(len(griddata)):
if label[i]==1:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="yellow", edgecolor="yellow")
elif label[i]==2:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="green", edgecolor="green")
elif label[i]==3:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="orange", edgecolor="orange")
elif label[i]==4:
plt.scatter(griddata[i,0], griddata[i,1],s=30, c="red", edgecolor="red")
for i in range(0,len(data)):
if data[i,2]==1:
plt.scatter(data[i,0], data[i,1], s=50, c="yellow")
elif data[i,2]==2:
plt.scatter(data[i,0], data[i,1], s=50, c="green")
elif data[i,2]==3:
plt.scatter(data[i,0], data[i,1], s=50, c="orange")
elif data[i,2]==4:
plt.scatter(data[i,0], data[i,1], s=50, c="red")
plt.scatter(Cbound[:,0], Cbound[:,1], c='black')
plt.scatter(Cbound2[:,0], Cbound2[:,1], c='black')
fig1 = plt.gcf()
plt.show()
fig1.savefig('bayes_cost_nonuni_incprior.png', dpi=100)
| 37.01355
| 172
| 0.533241
| 2,106
| 13,658
| 3.430199
| 0.093542
| 0.025609
| 0.021595
| 0.03959
| 0.83015
| 0.82309
| 0.810908
| 0.797896
| 0.792082
| 0.780177
| 0
| 0.047746
| 0.286938
| 13,658
| 368
| 173
| 37.11413
| 0.694014
| 0.105286
| 0
| 0.83959
| 0
| 0
| 0.061632
| 0.004318
| 0
| 0
| 0
| 0
| 0
| 1
| 0.013652
| false
| 0
| 0.003413
| 0
| 0.044369
| 0.037543
| 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
|
30e2c669aea132682b58ee5f3cc04e381f85a8cb
| 11,184
|
py
|
Python
|
rlpyt/envs/mazeworld/mazeworld/envs/mazeworld_env.py
|
Improbable-AI/curiosity_baselines
|
42dca92b2fb66c0790a72206bf48595d3b5b487f
|
[
"MIT"
] | 5
|
2021-02-19T01:35:22.000Z
|
2022-03-29T20:48:34.000Z
|
rlpyt/envs/mazeworld/mazeworld/envs/mazeworld_env.py
|
Improbable-AI/curiosity_baselines
|
42dca92b2fb66c0790a72206bf48595d3b5b487f
|
[
"MIT"
] | null | null | null |
rlpyt/envs/mazeworld/mazeworld/envs/mazeworld_env.py
|
Improbable-AI/curiosity_baselines
|
42dca92b2fb66c0790a72206bf48595d3b5b487f
|
[
"MIT"
] | 2
|
2021-04-17T09:11:56.000Z
|
2022-03-24T04:21:17.000Z
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from gym import spaces
from pycolab.examples import (better_scrolly_maze,
deepmind_maze,
deepmind_5room,
deepmind_5room_randomfixed,
deepmind_5room_bouncing,
deepmind_5room_brownian,
deepmind_8room,
deepmind_8room_v1,
deepmind_5room_moveable,
deepmind_5room_moveable_v1
)
from pycolab import cropping
from . import pycolab_env
class MazeWorld(pycolab_env.PyColabEnv):
"""Custom maze world game.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b', 'c', 'd', 'e', '@']
self.state_layer_chars = ['P', '#'] + self.objects
super(MazeWorld, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
act_null_value=4,
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return better_scrolly_maze.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_5room(pycolab_env.PyColabEnv):
"""Deepmind World Discovery Models experiment 1.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_5room, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_5room.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_5room_randomfixed(pycolab_env.PyColabEnv):
"""Deepmind World Discovery Models experiment 2.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_5room_randomfixed, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_5room_randomfixed.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_5room_bouncing(pycolab_env.PyColabEnv):
"""Deepmind World Discovery Models experiment 3.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b', 'c']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_5room_bouncing, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_5room_bouncing.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_5room_brownian(pycolab_env.PyColabEnv):
"""Deepmind World Discovery Models experiment 4.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_5room_brownian, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_5room_brownian.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_maze(pycolab_env.PyColabEnv):
"""Deepmind World Discovery Models experiment 5.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b', 'c', 'd', 'e']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_maze, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
act_null_value=4,
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_maze.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_8room(pycolab_env.PyColabEnv):
"""An eight room environment with many fixed objects.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_8room, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
act_null_value=4,
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_8room.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_8room_v1(pycolab_env.PyColabEnv):
"""An eight room environment with one fixed object.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['a']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_8room_v1, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
act_null_value=4,
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_8room_v1.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_5room_moveable(pycolab_env.PyColabEnv):
"""A 5 room environment with an affectable object.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['e', 'b']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_5room_moveable, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
act_null_value=4,
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_5room_moveable.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
class DeepmindMazeWorld_5room_moveable_v1(pycolab_env.PyColabEnv):
"""A 5 room environment with an affectable object that has stochastic movement.
"""
def __init__(self,
level=0,
max_iterations=500,
obs_type='mask',
default_reward=0.):
self.level = level
self.objects = ['e', 'b']
self.state_layer_chars = ['#'] + self.objects # each char will produce a layer in the disentangled state
super(DeepmindMazeWorld_5room_moveable_v1, self).__init__(
max_iterations=max_iterations,
obs_type=obs_type,
default_reward=default_reward,
action_space=spaces.Discrete(4 + 1), # left, right, up, down, no action
act_null_value=4,
resize_scale=17)
def make_game(self):
self._croppers = self.make_croppers()
return deepmind_5room_moveable_v1.make_game(self.level)
def make_croppers(self):
return [cropping.ScrollingCropper(rows=5, cols=5, to_track=['P'], scroll_margins=(None, None), pad_char=' ')]
| 37.783784
| 117
| 0.607207
| 1,289
| 11,184
| 4.961986
| 0.089992
| 0.042214
| 0.037523
| 0.025016
| 0.904784
| 0.904784
| 0.904784
| 0.904784
| 0.845059
| 0.845059
| 0
| 0.020534
| 0.290236
| 11,184
| 295
| 118
| 37.911864
| 0.78521
| 0.122675
| 0
| 0.758929
| 0
| 0
| 0.010674
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.133929
| false
| 0
| 0.035714
| 0.044643
| 0.303571
| 0.004464
| 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
|
30e3e842c1ef94d2ce3c6c2b9b53ca78e4c57ae2
| 450
|
py
|
Python
|
harness/determined/common/experimental/__init__.py
|
winding-lines/determined
|
231e1ac1df9d77cabc09b724ca2f8070eac0da73
|
[
"Apache-2.0"
] | 1
|
2021-12-18T06:39:09.000Z
|
2021-12-18T06:39:09.000Z
|
harness/determined/common/experimental/__init__.py
|
winding-lines/determined
|
231e1ac1df9d77cabc09b724ca2f8070eac0da73
|
[
"Apache-2.0"
] | 5
|
2020-10-28T20:46:27.000Z
|
2021-06-25T19:20:48.000Z
|
harness/determined/common/experimental/__init__.py
|
winding-lines/determined
|
231e1ac1df9d77cabc09b724ca2f8070eac0da73
|
[
"Apache-2.0"
] | null | null | null |
from determined.common.experimental.checkpoint import Checkpoint
from determined.common.experimental.determined import Determined
from determined.common.experimental.experiment import ExperimentReference
from determined.common.experimental.session import Session
from determined.common.experimental.trial import TrialReference, TrialSortBy, TrialOrderBy
from determined.common.experimental.model import Model, ModelOrderBy, ModelSortBy, ModelVersion
| 64.285714
| 95
| 0.884444
| 47
| 450
| 8.468085
| 0.361702
| 0.211055
| 0.301508
| 0.482412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.064444
| 450
| 6
| 96
| 75
| 0.945368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
eb5e2eed53c0d66b8e61c08816589b9e781ccab5
| 39,475
|
py
|
Python
|
Trajectory_Optimization_Algorithm/traj_optimization.py
|
ut-ims-robotics/skywalker
|
9aec216509fd31affa139c5d92bee0c9756000c4
|
[
"BSD-3-Clause"
] | null | null | null |
Trajectory_Optimization_Algorithm/traj_optimization.py
|
ut-ims-robotics/skywalker
|
9aec216509fd31affa139c5d92bee0c9756000c4
|
[
"BSD-3-Clause"
] | null | null | null |
Trajectory_Optimization_Algorithm/traj_optimization.py
|
ut-ims-robotics/skywalker
|
9aec216509fd31affa139c5d92bee0c9756000c4
|
[
"BSD-3-Clause"
] | null | null | null |
import time
import autograd.numpy as np # Thinly-wrapped version of Numpy
from autograd import grad
import autograd
from scipy.linalg import block_diag
import matplotlib.pyplot as plt
import bernstein_coeff_order10_arbitinterval
from scipy.optimize import minimize
from scipy.linalg import block_diag
from scipy.optimize import LinearConstraint
from scipy.optimize import BFGS
from mpl_toolkits.mplot3d import Axes3D
import csv
import scipy.io as io
def obj_fun(c):
global xe,ye,ze
global f
c_q1 = c[0:nvar]
c_q2 = c[nvar:2*nvar]
c_q3 = c[2*nvar:3*nvar]
c_q4 = c[3*nvar:4*nvar]
c_q5 = c[4*nvar:5*nvar]
c_q6 = c[5*nvar:6*nvar]
c_x = c[6*nvar:7*nvar]
c_y = c[7*nvar:8*nvar]
c_phi = c[8*nvar:9*nvar]
q_1 = np.dot(P, c_q1)
q_2 = np.dot(P, c_q2)
q_3 = np.dot(P, c_q3)
q_4 = np.dot(P, c_q4)
q_5 = np.dot(P, c_q5)
q_6 = np.dot(P, c_q6)
q_1_dot = np.dot(Pdot, c_q1)
q_2_dot = np.dot(Pdot, c_q2)
q_3_dot = np.dot(Pdot, c_q3)
q_4_dot = np.dot(Pdot, c_q4)
q_5_dot = np.dot(Pdot, c_q5)
q_6_dot = np.dot(Pdot, c_q6)
q_1_ddot = np.dot(Pddot, c_q1)
q_2_ddot = np.dot(Pddot, c_q2)
q_3_ddot = np.dot(Pddot, c_q3)
q_4_ddot = np.dot(Pddot, c_q4)
q_5_ddot = np.dot(Pddot, c_q5)
q_6_ddot = np.dot(Pddot, c_q6)
xo = np.dot(P, c_x)
yo = np.dot(P, c_y)
phi_base = np.dot(P, c_phi)
x_base_vel = np.dot(Pdot, c_x)
y_base_vel = np.dot(Pdot, c_y)
x_base_acc = np.dot(Pddot, c_x)
y_base_acc = np.dot(Pddot, c_y)
eq_nonhol = x_base_vel*np.sin(phi_base)-y_base_vel*np.cos(phi_base)
x_e_l = -0.0996*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) - 0.0997*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + 0.0997*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 0.3922*(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - 0.3922*(6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3) + 0.0996*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) - 2.60237444818813e-17*np.sin(q_1)*np.sin(q_2) - 0.1333*np.sin(q_1) + 0.425*np.cos(q_1)*np.cos(q_2)
y_e_l = -0.0996*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) + 0.0997*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) - 0.0997*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) - 0.3922*(np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) - 0.3922*(-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3) + 0.0996*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) + 0.425*np.sin(q_1)*np.cos(q_2) + 2.60237444818813e-17*np.sin(q_2)*np.cos(q_1) + 0.1333*np.cos(q_1)
z_e_l = -0.0996*((-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.sin(q_4) + (1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.cos(q_4))*np.sin(q_5) - 0.0997*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) + 0.0997*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 0.0996*(6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17)*np.cos(q_5) - 0.3922*np.sin(q_2)*np.cos(q_3) - 0.425*np.sin(q_2) - 0.3922*np.sin(q_3)*np.cos(q_2) + 0.1625
tr = (-(((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.cos(q_5) + (6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.sin(q_5))*np.sin(q_6) + (-6.12323399573677e-17*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) + 1.0*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 1.0*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) + 6.12323399573677e-17*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) + 6.12323399573677e-17*np.sin(q_1))*np.cos(q_6))*np.sin(phi_base) + ((((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.cos(q_5) + (6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.sin(q_5))*np.cos(q_6) + (-6.12323399573677e-17*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) + 1.0*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 1.0*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) + 6.12323399573677e-17*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) + 6.12323399573677e-17*np.sin(q_1))*np.sin(q_6))*np.cos(phi_base) + (-((((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.cos(q_5) + (-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.sin(q_5))*np.sin(q_6) + (-6.12323399573677e-17*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) - 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 6.12323399573677e-17*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) - 6.12323399573677e-17*np.cos(q_1))*np.cos(q_6))*np.cos(phi_base) + (((((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.cos(q_5) + (-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.sin(q_5))*np.cos(q_6) + (-6.12323399573677e-17*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) - 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 6.12323399573677e-17*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) - 6.12323399573677e-17*np.cos(q_1))*np.sin(q_6))*np.sin(phi_base) - 1.0*((-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.sin(q_4) + (1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.cos(q_4))*np.sin(q_5) - 6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) + 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 1.0*(6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17)*np.cos(q_5) + 2.29584502165847e-49
ax1 = -0.5*(((-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.sin(q_4) + (1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.cos(q_4))*np.cos(q_5) + (6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17)*np.sin(q_5))*np.sin(q_6) - 0.5*(-1.0*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) - 6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) + 1.0*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) - 3.74939945665464e-33*np.sin(q_1))*np.sin(phi_base) - 0.5*(-1.0*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) - 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) + 3.74939945665464e-33*np.cos(q_1))*np.cos(phi_base) + 0.5*(-6.12323399573677e-17*((-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.sin(q_4) + (1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.cos(q_4))*np.sin(q_5) + 1.0*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 1.0*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17*(6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17)*np.cos(q_5) - 3.74939945665464e-33)*np.cos(q_6)
ax2 = -0.5*(((-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.sin(q_4) + (1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.cos(q_4))*np.cos(q_5) + (6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17)*np.sin(q_5))*np.cos(q_6) + 0.5*(-1.0*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) - 6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) + 1.0*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) - 3.74939945665464e-33*np.sin(q_1))*np.cos(phi_base) + 0.5*(-1.0*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) - 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) + 3.74939945665464e-33*np.cos(q_1))*np.sin(phi_base) - 0.5*(-6.12323399573677e-17*((-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.sin(q_4) + (1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.cos(q_4))*np.sin(q_5) + 1.0*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 1.0*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17*(6.12323399573677e-17*(-1.0*np.sin(q_2)*np.sin(q_3) + 1.0*np.cos(q_2)*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*(1.0*np.sin(q_2)*np.cos(q_3) + 1.0*np.sin(q_3)*np.cos(q_2))*np.sin(q_4) + 6.12323399573677e-17)*np.cos(q_5) - 3.74939945665464e-33)*np.sin(q_6)
ax3 = -0.5*(-(((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.cos(q_5) + (6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.sin(q_5))*np.sin(q_6) + (-6.12323399573677e-17*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) + 1.0*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 1.0*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) + 6.12323399573677e-17*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) + 6.12323399573677e-17*np.sin(q_1))*np.cos(q_6))*np.cos(phi_base) + 0.5*((((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.cos(q_5) + (6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.sin(q_5))*np.cos(q_6) + (-6.12323399573677e-17*((-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + ((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4))*np.sin(q_5) + 1.0*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 1.0*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) + 6.12323399573677e-17*(6.12323399573677e-17*(-(6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) - 6.12323399573677e-17*((6.12323399573677e-17*np.sin(q_1)*np.sin(q_2) - np.cos(q_1)*np.cos(q_2))*np.cos(q_3) + (6.12323399573677e-17*np.sin(q_1)*np.cos(q_2) + np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4) - 1.0*np.sin(q_1))*np.cos(q_5) + 6.12323399573677e-17*np.sin(q_1))*np.sin(q_6))*np.sin(phi_base) - 0.5*(-((((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.cos(q_5) + (-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.sin(q_5))*np.sin(q_6) + (-6.12323399573677e-17*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) - 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 6.12323399573677e-17*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) - 6.12323399573677e-17*np.cos(q_1))*np.cos(q_6))*np.sin(phi_base) + 0.5*(((((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.cos(q_5) + (-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.sin(q_5))*np.cos(q_6) + (-6.12323399573677e-17*(((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.cos(q_4) + ((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.sin(q_4))*np.sin(q_5) - 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 1.0*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 6.12323399573677e-17*(-6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.sin(q_3) + (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.cos(q_3))*np.sin(q_4) + 6.12323399573677e-17*((np.sin(q_1)*np.sin(q_2) - 6.12323399573677e-17*np.cos(q_1)*np.cos(q_2))*np.cos(q_3) - (-np.sin(q_1)*np.cos(q_2) - 6.12323399573677e-17*np.sin(q_2)*np.cos(q_1))*np.sin(q_3))*np.cos(q_4) + 1.0*np.cos(q_1))*np.cos(q_5) - 6.12323399573677e-17*np.cos(q_1))*np.sin(q_6))*np.cos(phi_base)
xe = (np.cos(phi_base)*(x_e_l+xc)-np.sin(phi_base)*(y_e_l+yc) ) + xo
ye = (np.sin(phi_base)*(x_e_l+xc)+np.cos(phi_base)*(y_e_l+yc) ) + yo
ze = z_e_l+zc
eq_x = xe-xf_traj
eq_y = ye-yf_traj
eq_z = ze-zf_traj
tr_g = tr-tr_des
#print "tr_g:", tr_g
#print "tr:", tr
ax1_g = ax1-ax1_des
#print "ax1_g:", ax1_g
ax2_g = ax2-ax2_des
#print "ax2_g:", ax2_g
ax3_g = ax3-ax3_des
#print "ax3_g:", ax3_g
eq_q1_boundary = q_1[0]-q_1[-1]
eq_q2_boundary = q_2[0]-q_2[-1]
eq_q3_boundary = q_3[0]-q_3[-1]
eq_q4_boundary = q_4[0]-q_4[-1]
eq_q5_boundary = q_5[0]-q_5[-1]
eq_q6_boundary = q_6[0]-q_6[-1]
eq_q1dot_boundary = q_1_dot[0]-q_1_dot[-1]
eq_q2dot_boundary = q_2_dot[0]-q_2_dot[-1]
eq_q3dot_boundary = q_3_dot[0]-q_3_dot[-1]
eq_q4dot_boundary = q_4_dot[0]-q_4_dot[-1]
eq_q5dot_boundary = q_5_dot[0]-q_5_dot[-1]
eq_q6dot_boundary = q_6_dot[0]-q_6_dot[-1]
eq_q1ddot_boundary = q_1_ddot[0]-q_1_ddot[-1]
eq_q2ddot_boundary = q_2_ddot[0]-q_2_ddot[-1]
eq_q3ddot_boundary = q_3_ddot[0]-q_3_ddot[-1]
eq_q4ddot_boundary = q_4_ddot[0]-q_4_ddot[-1]
eq_q5ddot_boundary = q_5_ddot[0]-q_5_ddot[-1]
eq_q6ddot_boundary = q_6_ddot[0]-q_6_ddot[-1]
eq_xdot_boundary = x_base_vel[0]-x_base_vel[-1]
eq_ydot_boundary = y_base_vel[0]-y_base_vel[-1]
eq_xddot_boundary = x_base_acc[0]-x_base_acc[-1]
eq_yddot_boundary = y_base_acc[0]-y_base_acc[-1]
eq_x_boundary = xo[0]-xo[-1]
eq_y_boundary = yo[0]-yo[-1]
eq = np.hstack(( tr_g,ax1_g, ax2_g, ax3_g, eq_nonhol, eq_x, eq_y, eq_z, eq_q1_boundary, eq_q2_boundary, eq_q3_boundary, eq_q4_boundary, eq_q5_boundary, eq_q6_boundary, eq_q1dot_boundary, eq_q2dot_boundary, eq_q3dot_boundary, eq_q4dot_boundary, eq_q5dot_boundary, eq_q6dot_boundary, eq_q1ddot_boundary, eq_q2ddot_boundary, eq_q3ddot_boundary, eq_q4ddot_boundary, eq_q5ddot_boundary, eq_q6ddot_boundary, eq_x_boundary, eq_y_boundary, eq_xdot_boundary, eq_ydot_boundary, eq_xddot_boundary, eq_yddot_boundary ))
joint_limit_1 = np.hstack(( q_1-theta_max[0]*np.ones(num_horizon), -q_1+theta_min[0]*np.ones(num_horizon) ))
joint_limit_2 = np.hstack(( q_2-theta_max[1]*np.ones(num_horizon), -q_2+theta_min[1]*np.ones(num_horizon) ))
joint_limit_3 = np.hstack(( q_3-theta_max[2]*np.ones(num_horizon), -q_3+theta_min[2]*np.ones(num_horizon) ))
joint_limit_4 = np.hstack(( q_4-theta_max[3]*np.ones(num_horizon), -q_4+theta_min[3]*np.ones(num_horizon) ))
joint_limit_5 = np.hstack(( q_5-theta_max[4]*np.ones(num_horizon), -q_5+theta_min[4]*np.ones(num_horizon) ))
joint_limit_6 = np.hstack(( q_6-theta_max[5]*np.ones(num_horizon), -q_6+theta_min[5]*np.ones(num_horizon) ))
joint_limit = np.hstack(( joint_limit_1, joint_limit_2, joint_limit_3, joint_limit_4, joint_limit_5, joint_limit_6 ))
joint_constraints = np.log(1+np.exp(joint_limit) )
joint_constraints_cost = np.sum( joint_constraints )
f = 0.0001*(np.sum(q_1_ddot**2)+np.sum(q_2_ddot**2)+np.sum(q_3_ddot**2)+np.sum(q_4_ddot**2)+np.sum(q_5_ddot**2)+np.sum(q_6_ddot**2)+w_2*(np.sum(x_base_vel**2)+np.sum(y_base_vel**2)))+200*np.sum(eq**2)+0.001*joint_constraints_cost
return f
maxiter = 600
numdof_manipulator = 6
theta_min = np.array([-np.pi, -np.pi, -np.pi, -np.pi, -np.pi, -np.pi])
theta_max = np.array([np.pi, np.pi, np.pi, np.pi, np.pi, np.pi])
################# base motion penalty
w_2 = 100
#############################33
## Ellipses not centered at the origin
## we add offsets to the x and y terms to translate (or "move") the ellipse to the correct location
## x = x_center +a*np.cos(t)
# y = y_center +b*np.cos(t)
# a is the radius along the x-axis
# b is the radius along the y-axis
tot_time = np.linspace(0.0, 20 , 100)
omega = 2*np.pi/tot_time[-1]
num_horizon = len(tot_time)
x_center = 0.1
y_center = 0.4
z_center = 1.5
#z_center = 1.4
###Results
rad_x = 0.8
rad_y = 0.0
rad_z = 0.3
xc = -0.26235
yc = 0.1
zc = 0.842
t = tot_time[-1]/len(tot_time)
xf_traj = x_center+rad_x*np.cos(omega*tot_time) ## semi-major axis
#print "xf_traj:",xf_traj
yf_traj = y_center+rad_y*np.sin(omega*tot_time) ## semi-minor axis
#print "yf_traj:",yf_traj
zf_traj = z_center+rad_z*np.sin(omega*tot_time)
#print "zf_traj:",zf_traj
R_des = np.array([[-1.0000000, 0.0000000, 0.0000000], [0.0000000, 0.0000000, 1.0000000], [0.0000000, 1.0000000, 0.0000000]])
tr_des = R_des[0,0]+R_des[1,1]+R_des[2,2]
ax1_des = 0.5*(R_des[2,1]-R_des[1,2])
ax2_des = 0.5*(R_des[0,2]-R_des[2,0])
ax3_des = 0.5*(R_des[1,0]-R_des[0,1])
print "ax3_des: ",ax3_des
tr_des_n = np.zeros(len(xf_traj))
#print "tr_des_n:",type(tr_des_n)
ax1_des_n = np.zeros(len(xf_traj))
ax2_des_n = np.zeros(len(xf_traj))
ax3_des_n = np.zeros(len(xf_traj))
for i in range(len(xf_traj)):
tr_des_n[i] = tr_des
ax1_des_n[i]= ax1_des
ax2_des_n[i]= ax2_des
ax3_des_n[i]= ax3_des
print "tr_des_n: ",tr_des_n
P, Pdot, Pddot = bernstein_coeff_order10_arbitinterval.bernstein_coeff_order10_new(10, tot_time[0], tot_time[-1], tot_time.reshape(len(tot_time),1))
nvar = np.shape(P)[1]
num = np.shape(P)[0]
num_dof = 9
x_guess = np.zeros(num_dof*nvar)
obj_grad = grad(obj_fun)
A_lin = block_diag(P, P, P, P, P, P)
A_lin = np.hstack(( A_lin, np.zeros(( np.shape(A_lin)[0], 3*nvar )) ))
b_lin_ub = np.hstack(( theta_max[0]*np.ones(num), theta_max[1]*np.ones(num), theta_max[2]*np.ones(num), theta_max[3]*np.ones(num), theta_max[4]*np.ones(num), theta_max[5]*np.ones(num) ))
b_lin_lb = np.hstack(( theta_min[0]*np.ones(num), theta_min[1]*np.ones(num), theta_min[2]*np.ones(num), theta_min[3]*np.ones(num), theta_min[4]*np.ones(num), theta_min[5]*np.ones(num) ))
linear_constraint = LinearConstraint(A_lin, b_lin_lb, b_lin_ub)
opts = {'maxiter':maxiter}
np.cost = []
def log_cost(x):
np.cost.append(f)
start = time.time()
sol = minimize(obj_fun, method='SLSQP', x0=x_guess, jac=obj_grad, constraints=[linear_constraint], options = opts, callback=log_cost )
print time.time()-start
x_sol = sol['x']
###
c_q1 = x_sol[0:nvar]
c_q2 = x_sol[nvar:2*nvar]
c_q3 = x_sol[2*nvar:3*nvar]
c_q4 = x_sol[3*nvar:4*nvar]
c_q5 = x_sol[4*nvar:5*nvar]
c_q6 = x_sol[5*nvar:6*nvar]
c_x = x_sol[6*nvar:7*nvar]
c_y = x_sol[7*nvar:8*nvar]
c_phi = x_sol[8*nvar:9*nvar]
q1 = np.dot(P, c_q1)
q2 = np.dot(P, c_q2)
q3 = np.dot(P, c_q3)
q4 = np.dot(P, c_q4)
q5 = np.dot(P, c_q5)
q6 = np.dot(P, c_q6)
x_base = np.dot(P, c_x)
y_base = np.dot(P, c_y)
phi_base = np.dot(P, c_phi)
xdot_base = np.dot(Pdot, c_x)
ydot_base = np.dot(Pdot, c_y)
phidot_base = np.dot(Pdot, c_phi)
##############################################
j_f = open('joint_angles.csv', 'w')
jointsangles = csv.writer(j_f, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
for i in range(len(q1)):
jointsangles.writerow([q1[i],q2[i],q3[i],q4[i],q5[i],q6[i]])
vel_base = np.sign(xdot_base)*np.sqrt(xdot_base**2+ydot_base**2)
f = open('x_vel.csv', 'w')
#f = open('xyphi.csv', 'w')
writer_x = csv.writer(f, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
for i in range (len(vel_base)):
writer_x.writerow([vel_base[i]])
#writer_x.writerow([x_base[i],y_base[i],phi_base[i]])
f1 = open('phi_vel.csv', 'w')
writer_phi = csv.writer(f1, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
for i in range (len(phidot_base)):
writer_phi.writerow([phidot_base[i]])
########## Desired Tajectory
traj = open('translation.csv', 'w')
traj_p = csv.writer(traj, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
for i in range(len(xf_traj)):
traj_p.writerow([xf_traj[i],yf_traj[i],zf_traj[i]])
init_pose = open('intial_pose.csv', 'w')
init_pose_1 = csv.writer(init_pose, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
for i in range(len(xf_traj)):
init_pose_1.writerow([x_base[i],y_base[i],phi_base[i]])
##########
#xe = [x._value for x in xe]
#ye = [x._value for x in ye]
#ze = [x._value for x in ze]
# plt.figure(1)
# plt.plot(q1, '-r', linewidth = 3.0)
# plt.plot(q2, '-g', linewidth = 3.0)
# plt.plot(q3, '-b', linewidth = 3.0)
# plt.plot(q4, '-k', linewidth = 3.0)
# plt.plot(q5, '-c', linewidth = 3.0)
# plt.plot(q6, '-m', linewidth = 3.0)
#print (f_1)
#np.cost = [x._value for x in np.cost]
#print np.cost
print type (xe)
print "xe:",xe
print "ye:",ye
print "ze:",ze
print "x_base:",x_base
print "y_base:",y_base
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot(xe, ye, ze, color="blue", linewidth=2.5, label='Trajector')
ax.plot(xf_traj, yf_traj, zf_traj, color="red", linewidth=1.5, label='Desired Trajectory')
ax.plot(x_base, y_base)
ax.legend()
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
plt.show()
| 112.144886
| 9,408
| 0.666903
| 9,841
| 39,475
| 2.449751
| 0.026928
| 0.166335
| 0.196864
| 0.092044
| 0.831301
| 0.797038
| 0.760785
| 0.751037
| 0.748092
| 0.746557
| 0
| 0.225435
| 0.062597
| 39,475
| 351
| 9,409
| 112.464387
| 0.426062
| 0.026143
| 0
| 0.031963
| 0
| 0
| 0.004573
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.063927
| null | null | 0.041096
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 12
|
eb7d4aed08dfd1b0449bd059255676062b1d6fb5
| 20,204
|
py
|
Python
|
swamp/parsers/tests/test_phaser_parser.py
|
rigdenlab/SWAMP
|
3e93ab27f4acf0124f7cb2d78a151cc3352b9c6e
|
[
"BSD-3-Clause"
] | 2
|
2020-02-15T11:06:34.000Z
|
2020-04-10T08:48:49.000Z
|
swamp/parsers/tests/test_phaser_parser.py
|
rigdenlab/SWAMP
|
3e93ab27f4acf0124f7cb2d78a151cc3352b9c6e
|
[
"BSD-3-Clause"
] | 15
|
2020-02-04T10:56:07.000Z
|
2021-02-12T09:11:03.000Z
|
swamp/parsers/tests/test_phaser_parser.py
|
rigdenlab/SWAMP
|
3e93ab27f4acf0124f7cb2d78a151cc3352b9c6e
|
[
"BSD-3-Clause"
] | 4
|
2020-02-04T13:25:09.000Z
|
2022-03-23T13:44:17.000Z
|
import os
import unittest
from swamp.utils import create_tempfile
from swamp.parsers.phaserparser import PhaserParser
class PhaserParserTestCase(unittest.TestCase):
def test_1(self):
file_contents = """REMARK TITLE [no title set]
REMARK ENSEMBLE PDB_1 EULER 49.90 83.52 180.06 FRAC -0.288 -0.526 -0.158
CRYST1 73.330 73.330 163.520 90.00 90.00 90.00 P 41 2 2 8
SCALE1 0.013637 -0.000000 -0.000000 0.00000
SCALE2 0.000000 0.013637 -0.000000 0.00000
SCALE3 0.000000 0.000000 0.006115 0.00000
ATOM 1 N ALA A 1 14.378 -30.428 -13.824 1.00 61.34 N
ATOM 210 CB ALA A 42 2.780 -38.569 -12.366 1.00 77.20 C
END
"""
stdout_contents = """******************************************************************************************
*** Phaser Module: PREPROCESSOR 2.8.3 ***
******************************************************************************************
COMPOSITION BY ASU
COMPOSITION PROTEIN MW 34738.3 NUM 1
ELLG HIRES ON
ENSEMBLE PDB_1 PDB &
"/data1/filo/results/SWAMP_benchmarking/SWAMP_0/swamp_mr/search_461/run_1/searchmodels/searchmodel_1_polyala.pdb" RMS &
0.1
ENSEMBLE PDB_1 DISABLE CHECK ON
HKLIN "/data1/filo/results/SWAMP_benchmarking/3zux.mtz"
JOBS 1
KEYWORDS ON
LABIN F = FP SIGF = SIGFP
MUTE ON
ROOT "3zux_phaser"
SEARCH ENSEMBLE PDB_1
SGALT BASE P 4w 2c
SGALT SELECT LIST
SGALT TEST P 41 2 2
XYZOUT ON
KILL TIME 1440
CPU Time: 0 days 0 hrs 0 mins 0.76 secs ( 0.76 secs)
Finished: Mon Feb 17 02:38:52 2020
"""
fname = create_tempfile(content=file_contents)
self.addCleanup(os.remove, fname)
parser = PhaserParser(stdout=stdout_contents, fname=fname)
parser.parse()
self.assertEqual('NA', parser.LLG)
self.assertTrue(parser.error)
def test_2(self):
file_contents = """REMARK TITLE [no title set]
REMARK Log-Likelihood Gain: 70.197
REMARK RFZ=3.0 TFZ=5.6 PAK=0 LLG=70 TFZ==6.0 LLG=70 TFZ==5.9 PAK=0 LLG=70 RFZ==3.5 TFZ==5.9
REMARK ENSEMBLE PDB_1 EULER 49.90 83.52 180.06 FRAC -0.288 -0.526 -0.158
CRYST1 73.330 73.330 163.520 90.00 90.00 90.00 P 41 2 2 8
SCALE1 0.013637 -0.000000 -0.000000 0.00000
SCALE2 0.000000 0.013637 -0.000000 0.00000
SCALE3 0.000000 0.000000 0.006115 0.00000
ATOM 1 N ALA A 1 14.378 -30.428 -13.824 1.00 61.34 N
ATOM 210 CB ALA A 42 2.780 -38.569 -12.366 1.00 77.20 C
END
"""
stdout_contents = """******************************************************************************************
*** Phaser Module: PREPROCESSOR 2.8.3 ***
******************************************************************************************
COMPOSITION BY ASU
COMPOSITION PROTEIN MW 34738.3 NUM 1
ELLG HIRES ON
ENSEMBLE PDB_1 PDB &
"/data1/filo/results/SWAMP_benchmarking/SWAMP_0/swamp_mr/search_461/run_1/searchmodels/searchmodel_1_polyala.pdb" RMS &
0.1
ENSEMBLE PDB_1 DISABLE CHECK ON
HKLIN "/data1/filo/results/SWAMP_benchmarking/3zux.mtz"
JOBS 1
KEYWORDS ON
LABIN F = FP SIGF = SIGFP
MUTE ON
ROOT "3zux_phaser"
SEARCH ENSEMBLE PDB_1
SGALT BASE P 4w 2c
SGALT SELECT LIST
SGALT TEST P 41 2 2
XYZOUT ON
KILL TIME 1440
CPU Time: 0 days 0 hrs 0 mins 0.76 secs ( 0.76 secs)
Finished: Mon Feb 17 02:38:52 2020
--------------
MONOMERIC ELLG
--------------
Expected LLG (eLLG)
-------------------
eLLG: eLLG of ensemble alone
eLLG RMSD frac-scat Ensemble
5.29275 1.077 0.08194 PDB_1
Resolution for eLLG target
--------------------------
eLLG-reso: Resolution to achieve target eLLG (225)
eLLG-reso Ensemble
> 2.20(all) PDB_1
Resolution for eLLG target: data collection
-------------------------------------------
eLLG-reso: Resolution to achieve target eLLG (225) with perfect data
eLLG-reso Ensemble
>1.2A PDB_1
** Solution #1 written to MTZ file: 3zux_phaser.1.mtz
Solution #1 annotation (history):
SOLU SET RFZ=3.0 TFZ=5.6 PAK=0 LLG=70 TFZ==6.0 LLG=70 TFZ==5.9 PAK=0 LLG=70 TFZ==5.9
SOLU SPAC P 41 2 2
SOLU 6DIM ENSE PDB_1 EULER 49.9 83.5 180.1 FRAC -0.29 -0.53 -0.16 BFAC -1.68 #TFZ==5.9
SOLU ENSEMBLE PDB_1 VRMS DELTA -0.3997 #RMSD 1.08 1.08 0.95 0.79 #VRMS 0.87 0.87 0.71 0.48
Annotation shown below for a maximum of a further 9 solutions
See SOL file for any additional solutions
Solution #2 annotation (history):
SOLU SET RFZ=2.8 TFZ=5.3 PAK=0 LLG=67 LLG=67 PAK=0 LLG=67
SOLU SPAC P 41 2 2
SOLU 6DIM ENSE PDB_1 EULER 241.6 60.7 143.4 FRAC -0.06 -0.40 -0.31 BFAC -1.80
SOLU ENSEMBLE PDB_1 VRMS DELTA -0.3997 #RMSD 1.08 1.08 0.95 0.79 #VRMS 0.87 0.87 0.71 0.48
Solution #3 annotation (history):
SOLU SET RFZ=3.0 TFZ=5.5 PAK=0 LLG=64 LLG=65 PAK=0 LLG=65
SOLU SPAC P 41 2 2
SOLU 6DIM ENSE PDB_1 EULER 49.6 79.0 184.1 FRAC -0.19 0.01 -0.16 BFAC 0.11
SOLU ENSEMBLE PDB_1 VRMS DELTA -0.3997 #RMSD 1.08 1.08 0.95 0.79 #VRMS 0.87 0.87 0.71 0.48
Solution #4 annotation (history):
SOLU SET RFZ=2.8 TFZ=5.7 PAK=0 LLG=63 LLG=63 PAK=0 LLG=63
SOLU SPAC P 41 2 2
SOLU 6DIM ENSE PDB_1 EULER 64.6 62.5 142.9 FRAC 0.05 0.38 -0.24 BFAC 0.22
SOLU ENSEMBLE PDB_1 VRMS DELTA -0.3997 #RMSD 1.08 1.08 0.95 0.79 #VRMS 0.87 0.87 0.71 0.48
Solution #5 annotation (history):
SOLU SET RFZ=3.0 TFZ=4.6 PAK=0 LLG=62 LLG=63 PAK=0 LLG=63
SOLU SPAC P 41 2 2
SOLU 6DIM ENSE PDB_1 EULER 49.9 87.8 177.8 FRAC -0.18 0.07 -0.14 BFAC 1.12
SOLU ENSEMBLE PDB_1 VRMS DELTA -0.3997 #RMSD 1.08 1.08 0.95 0.79 #VRMS 0.87 0.87 0.71 0.48
Solution #6 annotation (history):
SOLU SET RFZ=3.0 TFZ=4.9 PAK=8 LLG=63 LLG=63 PAK=8 LLG=63
SOLU SPAC P 41 2 2
SOLU 6DIM ENSE PDB_1 EULER 316.7 83.0 181.1 FRAC -0.06 0.07 -0.13 BFAC -0.01
SOLU ENSEMBLE PDB_1 VRMS DELTA -0.3997 #RMSD 1.08 1.08 0.95 0.79 #VRMS 0.87 0.87 0.71 0.48
"""
fname = create_tempfile(content=file_contents)
self.addCleanup(os.remove, fname)
parser = PhaserParser(stdout=stdout_contents, fname=fname)
parser.parse()
self.assertEqual('70.197', parser.LLG)
self.assertEqual('5.29275', parser.eLLG)
self.assertEqual('5.9', parser.TFZ)
self.assertEqual('3.5', parser.RFZ)
self.assertEqual('-0.3997', parser.VRMS)
self.assertTupleEqual(('70.197', '5.9', '3.5', '5.29275', '-0.3997'), parser.summary)
def test_3(self):
file_contents = """REMARK TITLE [no title set]
REMARK PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.1 TFZ=7.4 PAK=39 LLG=318 TFZ==10.2
REMARK ENSEMBLE FIX EULER 0.00 0.00 0.00 FRAC -0.000 -0.000 0.000
REMARK ENSEMBLE PDB_idealhelix EULER 16.22 122.55 39.80 FRAC -0.159 0.068 -0.027
REMARK ENSEMBLE PDB_idealhelix EULER 14.97 62.84 219.41 FRAC -0.247 0.202 -0.328
REMARK ENSEMBLE PDB_idealhelix EULER 139.16 107.74 52.50 FRAC 0.095 -0.076 -0.109
REMARK ENSEMBLE PDB_idealhelix EULER 72.15 80.04 213.17 FRAC -0.040 -0.258 -0.353
CRYST1 49.754 72.560 95.775 90.00 90.00 90.00 P 21 21 21 16
SCALE1 0.020099 -0.000000 -0.000000 0.00000
SCALE2 0.000000 0.013782 -0.000000 0.00000
SCALE3 0.000000 0.000000 0.010441 0.00000
ATOM 1 N ALA A 1 -3.826 13.790 -31.009 1.00 32.20 N
"""
stdout_contents = """"******************************************************************************************
*** Phaser Module: PREPROCESSOR 2.8.3 ***
******************************************************************************************
COMPOSITION BY ASU
COMPOSITION PROTEIN MW 34738.3 NUM 1
ELLG HIRES ON
ENSEMBLE PDB_1 PDB &
"/data1/filo/results/SWAMP_benchmarking/SWAMP_0/swamp_mr/search_461/run_1/searchmodels/searchmodel_1_polyala.pdb" RMS &
0.1
ENSEMBLE PDB_1 DISABLE CHECK ON
HKLIN "/data1/filo/results/SWAMP_benchmarking/3zux.mtz"
JOBS 1
KEYWORDS ON
LABIN F = FP SIGF = SIGFP
MUTE ON
ROOT "3zux_phaser"
SEARCH ENSEMBLE PDB_1
SGALT BASE P 4w 2c
SGALT SELECT LIST
SGALT TEST P 41 2 2
XYZOUT ON
KILL TIME 1440
CPU Time: 0 days 0 hrs 0 mins 0.76 secs ( 0.76 secs)
Finished: Mon Feb 17 02:38:52 2020
--------------
MONOMERIC ELLG
--------------
Expected LLG (eLLG)
-------------------
eLLG: eLLG of ensemble alone
eLLG RMSD frac-scat Ensemble
12.0 0.305 0.04195 PDB_idealhelix
Resolution for eLLG target
--------------------------
eLLG-reso: Resolution to achieve target eLLG (225)
eLLG-reso Ensemble
> 2.10(all) PDB_idealhelix
Resolution for eLLG target: data collection
-------------------------------------------
eLLG-reso: Resolution to achieve target eLLG (225) with perfect data
eLLG-reso Ensemble
>1.2A PDB_idealhelix
------------
OUTPUT FILES
------------
No files output
CPU Time: 0 days 3 hrs 10 mins 25.44 secs ( 11425.44 secs)
Finished: Thu Mar 12 04:02:50 2020
******************************************************************************************
*** Phaser Module: AUTOMATED MOLECULAR REPLACEMENT 2.8.3 ***
******************************************************************************************
** No solutions after final packing
** Solution reverts to previous partial solution
** Only packing solutions retained
** 34 solution(s) retained of 34
** Number of solutions = 34
** Solution TOP LLG = 317.6
** Solution TOP TFZ = 10.2
CPU Time: 0 days 3 hrs 10 mins 25.44 secs ( 11425.44 secs)
Finished: Thu Mar 12 04:02:50 2020
******************************************************************************************
*** Phaser Module: AUTOMATED MOLECULAR REPLACEMENT 2.8.3 ***
******************************************************************************************
** Sorry - No solution with all components
You may find a solution with a different search or selection strategy
** Solutions written to SOL file: 5hxc_phaser.sol
** Pdb and/or Mtz files have been written with results for 1 of these solutions
** Partial Solution #1 written to PDB file: 5hxc_phaser.1.pdb
** Partial Solution #1 written to PDB (ensemble) file: 5hxc_phaser.1.1.pdb
** Partial Solution #1 written to PDB (ensemble) file: 5hxc_phaser.1.2.pdb
** Partial Solution #1 written to PDB (ensemble) file: 5hxc_phaser.1.3.pdb
** Partial Solution #1 written to PDB (ensemble) file: 5hxc_phaser.1.4.pdb
** Partial Solution #1 written to PDB (ensemble) file: 5hxc_phaser.1.5.pdb
Partial Solution #1 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.1
TFZ=7.4 PAK=39 LLG=318 TFZ==10.2
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 72.2 80.0 213.2 FRAC -0.04 -0.26 -0.35 BFAC 7.09 #TFZ==10.2
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Annotation shown below for a maximum of a further 9 solutions
See SOL file for any additional solutions
Partial Solution #2 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.2
TFZ=8.2 PAK=39 LLG=314 TFZ==8.9
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 277.0 43.6 223.4 FRAC -0.04 -0.20 -0.34 BFAC 8.82 #TFZ==8.9
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #3 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.0
TFZ=6.8 PAK=39 LLG=314 TFZ==8.9
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 340.6 51.2 202.6 FRAC -0.06 -0.24 -0.38 BFAC 8.91 #TFZ==8.9
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #4 annotation (history):
SOLU SET PAK=0 RFZ=4.3 TFZ=5.4 PAK=38 LLG=156 RFZ=3.4 TFZ=7.1 PAK=38 LLG=208 TFZ==7.3 RFZ=4.0 TFZ=8.5 PAK=38
RFZ=3.1 TFZ=7.3 PAK=38 LLG=313 TFZ==9.9
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.3 62.2 219.9 FRAC -0.24 0.20 -0.33 BFAC 6.17
SOLU 6DIM ENSE PDB_idealhelix EULER 275.9 114.0 38.4 FRAC -0.14 0.10 -0.05 BFAC 6.88 #TFZ==7.3
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.09 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 72.3 80.2 213.1 FRAC -0.04 -0.26 -0.35 BFAC 7.51 #TFZ==9.9
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #5 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.2
TFZ=6.8 PAK=39 LLG=311 TFZ==9.1
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 146.3 109.4 22.0 FRAC 0.06 0.22 -0.08 BFAC 10.29 #TFZ==9.1
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #6 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=2.9
TFZ=7.8 PAK=39 LLG=310 TFZ==8.6
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 58.1 99.6 52.4 FRAC 0.01 0.22 -0.10 BFAC 9.77 #TFZ==8.6
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #7 annotation (history):
SOLU SET PAK=0 RFZ=4.3 TFZ=5.4 PAK=38 LLG=156 RFZ=3.4 TFZ=7.1 PAK=38 LLG=208 TFZ==7.3 RFZ=4.0 TFZ=8.5 PAK=38
RFZ=3.0 TFZ=6.4 PAK=38 LLG=309 TFZ==8.6
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.3 62.2 219.9 FRAC -0.24 0.20 -0.33 BFAC 6.17
SOLU 6DIM ENSE PDB_idealhelix EULER 275.9 114.0 38.4 FRAC -0.14 0.10 -0.05 BFAC 6.88 #TFZ==7.3
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.09 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 340.5 51.2 202.5 FRAC -0.06 -0.24 -0.38 BFAC 9.53 #TFZ==8.6
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #8 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.1
TFZ=6.3 PAK=39 LLG=309 TFZ==8.6
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 46.4 51.7 229.8 FRAC 0.17 0.14 -0.24 BFAC 13.49 #TFZ==8.6
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #9 annotation (history):
SOLU SET PAK=0 RFZ=4.3 TFZ=5.4 PAK=38 LLG=156 RFZ=3.4 TFZ=7.1 PAK=38 LLG=208 TFZ==7.3 RFZ=4.0 TFZ=8.5 PAK=38
RFZ=3.2 TFZ=8.0 PAK=38 LLG=308 TFZ==8.5
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.3 62.2 219.9 FRAC -0.24 0.20 -0.33 BFAC 6.17
SOLU 6DIM ENSE PDB_idealhelix EULER 275.9 114.0 38.4 FRAC -0.14 0.10 -0.05 BFAC 6.88 #TFZ==7.3
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.09 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 277.1 43.5 223.6 FRAC -0.04 -0.20 -0.34 BFAC 9.78 #TFZ==8.5
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
Partial Solution #10 annotation (history):
SOLU SET PAK=0 RFZ=4.2 TFZ=5.0 PAK=0 LLG=142 RFZ=3.8 TFZ=7.4 PAK=39 LLG=211 TFZ==9.4 RFZ=4.0 TFZ=8.5 PAK=39 RFZ=3.0
TFZ=6.7 PAK=39 LLG=307 TFZ==8.3
SOLU SPAC P 21 21 21
SOLU 6DIM ENSE FIX EULER 0.0 0.0 0.0 FRAC -0.00 -0.00 0.00 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 16.2 122.6 39.8 FRAC -0.16 0.07 -0.03 BFAC 6.98
SOLU 6DIM ENSE PDB_idealhelix EULER 15.0 62.8 219.4 FRAC -0.25 0.20 -0.33 BFAC 5.62 #TFZ==9.4
SOLU 6DIM ENSE PDB_idealhelix EULER 139.2 107.7 52.5 FRAC 0.10 -0.08 -0.11 BFAC 0.00
SOLU 6DIM ENSE PDB_idealhelix EULER 215.3 51.2 243.3 FRAC -0.00 -0.24 -0.39 BFAC 10.13 #TFZ==8.3
SOLU ENSEMBLE FIX VRMS DELTA +0.0010 #RMSD 0.10 #VRMS 0.11
CPU Time: 0 days 3 hrs 10 mins 25.60 secs ( 11425.60 secs)
Finished: Thu Mar 12 04:02:50 2020
--------
ADVISORY
--------
The correlation corrected RmsD of ensemble "PDB_idealhelix" is 0.305 but the largest RmsD
assigned to models in the ensemble is only 0.100. Is this intentional?
eLLG indicates that placement of a single copy of ensemble "PDB_idealhelix" will be very
difficult
eLLG indicates that best placement of ensemble "PDB_idealhelix" will definitely be correct
in the context of already correctly placed components
The top solution from a FTF did not pack
The top solution from a TF rescoring did not pack
--------
WARNINGS
--------
------------------------------------------------------------------------------------------
Warning: Patterson Pathology in NMOL analysis, possible coiled coil or other regular
structure, view Patterson (TNCS PATT MAPS ON)
------------------------------------------------------------------------------------------
CPU Time: 0 days 3 hrs 10 mins 25.60 secs ( 11425.60 secs)
Finished: Thu Mar 12 04:02:50 2020
"""
fname = create_tempfile(content=file_contents)
self.addCleanup(os.remove, fname)
parser = PhaserParser(stdout=stdout_contents, fname=fname)
parser.parse()
self.assertEqual('318', parser.LLG)
self.assertEqual('12.0', parser.eLLG)
self.assertEqual('10.2', parser.TFZ)
self.assertEqual('3.1', parser.RFZ)
self.assertEqual('+0.0010', parser.VRMS)
self.assertTupleEqual(('318', '10.2', '3.1', '12.0', '+0.0010'), parser.summary)
if __name__ == '__main__':
unittest.main()
| 46.127854
| 147
| 0.610127
| 3,883
| 20,204
| 3.139068
| 0.106361
| 0.025843
| 0.055132
| 0.056608
| 0.815571
| 0.786529
| 0.775781
| 0.774715
| 0.767741
| 0.739191
| 0
| 0.213374
| 0.224312
| 20,204
| 437
| 148
| 46.23341
| 0.564382
| 0
| 0
| 0.662162
| 0
| 0.272973
| 0.917591
| 0.084389
| 0
| 0
| 0
| 0
| 0.037838
| 1
| 0.008108
| false
| 0
| 0.010811
| 0
| 0.021622
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
eba9cfc69f4b711893d0b6111843b3e60d0fb233
| 47
|
py
|
Python
|
pbs_util/test_email.py
|
Clyde-fare/pbs_util
|
1c1ed93773a9a020f9216056d2ae49cc0cd589d1
|
[
"BSD-3-Clause"
] | 1
|
2015-08-24T02:48:00.000Z
|
2015-08-24T02:48:00.000Z
|
pbs_util/test_email.py
|
Clyde-fare/pbs_util
|
1c1ed93773a9a020f9216056d2ae49cc0cd589d1
|
[
"BSD-3-Clause"
] | null | null | null |
pbs_util/test_email.py
|
Clyde-fare/pbs_util
|
1c1ed93773a9a020f9216056d2ae49cc0cd589d1
|
[
"BSD-3-Clause"
] | null | null | null |
import send_email
send_email.send('testing')
| 9.4
| 26
| 0.787234
| 7
| 47
| 5
| 0.571429
| 0.514286
| 0.742857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106383
| 47
| 4
| 27
| 11.75
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.152174
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
69128431e80b12590cf8b4bdf18b0693e6555e33
| 1,490
|
py
|
Python
|
venv/lib/python2.7/site-packages/pychart/afm/Helvetica_Light.py
|
Christian-Castro/castro_odoo8
|
8247fdb20aa39e043b6fa0c4d0af509462ab3e00
|
[
"Unlicense"
] | 1
|
2019-12-19T01:53:13.000Z
|
2019-12-19T01:53:13.000Z
|
venv/lib/python2.7/site-packages/pychart/afm/Helvetica_Light.py
|
Christian-Castro/castro_odoo8
|
8247fdb20aa39e043b6fa0c4d0af509462ab3e00
|
[
"Unlicense"
] | null | null | null |
venv/lib/python2.7/site-packages/pychart/afm/Helvetica_Light.py
|
Christian-Castro/castro_odoo8
|
8247fdb20aa39e043b6fa0c4d0af509462ab3e00
|
[
"Unlicense"
] | null | null | null |
# AFM font Helvetica-Light (path: /usr/share/fonts/afms/adobe/phvl8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["Helvetica-Light"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 333, 278, 556, 556, 889, 667, 222, 333, 333, 389, 660, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 660, 660, 660, 500, 800, 667, 667, 722, 722, 611, 556, 778, 722, 278, 500, 667, 556, 833, 722, 778, 611, 778, 667, 611, 556, 722, 611, 889, 611, 611, 611, 333, 278, 333, 660, 500, 222, 556, 611, 556, 611, 556, 278, 611, 556, 222, 222, 500, 222, 833, 556, 556, 611, 611, 333, 500, 278, 556, 500, 722, 500, 500, 500, 333, 222, 333, 660, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 556, 556, 167, 556, 556, 556, 556, 222, 389, 556, 389, 389, 500, 500, 500, 500, 556, 556, 278, 500, 650, 500, 222, 389, 389, 556, 1000, 1000, 500, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 500, 333, 333, 500, 333, 333, 333, 1000, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 1000, 500, 334, 500, 500, 500, 500, 556, 778, 1000, 334, 500, 500, 500, 500, 500, 889, 500, 500, 500, 222, 500, 500, 222, 556, 944, 500, )
| 248.333333
| 1,296
| 0.62349
| 287
| 1,490
| 3.236934
| 0.167247
| 0.620022
| 0.833154
| 0.994618
| 0.397201
| 0.322928
| 0.322928
| 0.297094
| 0.297094
| 0.264801
| 0
| 0.628713
| 0.186577
| 1,490
| 5
| 1,297
| 298
| 0.137789
| 0.11745
| 0
| 0
| 0
| 0
| 0.011442
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 10
|
692a297ddb5c02b2820fd4730b0e705829df9621
| 14,516
|
py
|
Python
|
common/sock_rsa_double.py
|
nigelliyang/ccwt_client
|
4efb8f2c790145b5f547e350d24413bb8b1bd9ed
|
[
"Apache-2.0"
] | null | null | null |
common/sock_rsa_double.py
|
nigelliyang/ccwt_client
|
4efb8f2c790145b5f547e350d24413bb8b1bd9ed
|
[
"Apache-2.0"
] | null | null | null |
common/sock_rsa_double.py
|
nigelliyang/ccwt_client
|
4efb8f2c790145b5f547e350d24413bb8b1bd9ed
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2018/12/6 0:17 By xycfree
# @Descript:
import json
import re
import struct
import websocket
# 设置交易所及交易对,70行处需要手动修改交易所及交易对,BITFINEX:BTCUSD
exchange_symbol = "BITFINEX:BTCUSD"
def write_msg(message):
data = struct.pack('B', 129) # 写入第一个字节 10000001
# 写入包长度
msg_len = len(message)
if msg_len <= 125:
data += struct.pack('B', msg_len)
elif msg_len <= (2 ** 16 - 1):
data += struct.pack('!BH', 126, msg_len)
elif msg_len <= (2 ** 64 - 1):
data += struct.pack('!BQ', 127, msg_len)
else:
print('to long message')
return
data += bytes(message, encoding='utf-8')
print(data)
return data
def on_message(ws, message):
# 服务器有数据更新时,主动推送过来的数据
message = message.decode('utf-8') if isinstance(message, bytes) else message
print("接收数据: {}".format(message))
if len(message) < 20:
pass
else:
mess = re.sub(r'~m~\d+~m~', '', message)
try:
mess = json.loads(mess)
except Exception as e:
print(e)
print(mess)
with open('rsa_double.txt', mode='a+', encoding='utf-8') as f:
f.write(mess)
f.write('\n')
def on_error(ws, error):
# 程序报错时,就会触发on_error事件
print("异常错误: {}".format(error))
def on_close(ws):
print("Connection closed ……")
def on_open(ws):
# 连接到服务器之后就会触发on_open事件,这里用于send数据
print('on_open')
reqs = [
json.dumps({"m":"chart_create_session","p":["cs_yD7aPrM9Eav2",""]}),
json.dumps({"m":"quote_create_session","p":["qs_CiWdgz2rquIv"]}),
json.dumps({"m":"quote_set_fields","p":["qs_CiWdgz2rquIv","ch","chp","current_session","description","local_description","language","exchange","fractional","is_tradable","lp","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","update_mode","volume"]}),
json.dumps({"m":"quote_add_symbols","p":["qs_CiWdgz2rquIv",exchange_symbol,{"flags":["force_permission"]}]}),
json.dumps({"m":"quote_fast_symbols","p":["qs_CiWdgz2rquIv",exchange_symbol]}),
json.dumps({"m":"switch_timezone","p":["cs_yD7aPrM9Eav2","Asia/Shanghai"]}),
# 以下一行的交易对 BITFINEX:BTCUSD,需要修改;
'{"m":"resolve_symbol","p":["cs_yD7aPrM9Eav2","symbol_1","={\\"symbol\\":\\"BITFINEX:BTCUSD\\",\\"adjustment\\":\\"splits\\"}"]}',
json.dumps({"m":"create_series","p":["cs_yD7aPrM9Eav2","s1","s1","symbol_1","45",300]}),
json.dumps({"m":"create_study","p":["cs_yD7aPrM9Eav2","st1","st1","s1","Volume@tv-basicstudies-81",{"length":20,"col_prev_close":False}]}),
json.dumps({"m":"create_study","p":["cs_yD7aPrM9Eav2","st2","st1","s1","StrategyScript@tv-scripting-101!",{"text":"2sMXFZEjEcAEL0TdZuTIQA==_Ms0NAfB4PBEpsMEJL29vRZnweB9M0oyj4eO625LXy1/T6EnFjvZPYvO5V7QS+6mdXgxFthk3XpTftMC3l23+JkK6NWfL1g13DydoA5L7gSC/Vi3LAFTxx8QJMWo/u4rLgfdiZDJC1o/JWj6J0iBXmk3XiVdZroPx0NDoGSNzORqMQziSTldq7Nt/4bJB5NBzuBrtCbWd7j66GAOnTRJB7vG4SGWbkFqOv4wRbFAoOkSoMyC1/6ZeflXdWcyZGk0YPsxpcp9JOOU4dEgnHHXI+sZCCjuIv5IK+lmtwnXPhlPRyiRpqQjUDOHMQZqlO4vlmqgOuxKDeJ57tyFGaiIIuIChwStgOg4CN24pCf0SMy8wEW4rax1Y/MvlHb9qQ9HpS18ka1nGdbrGc3UHFQ25kudgsPE9wC4KiZVXSCarniMhyV6tTXt+boAH8g8U4BPaSSCNAr+lh2WNYHl/ddZJ9JaZWod/VIlPo732Ili2DZg1neeIK3O3TMTKMROB5THzE6yQnrE5GrVxY2h291GSdjt5a04ayWwpzZizvGG/e4Pug/8UWsydpjifVmhwF7purE3EdNDrXxG56uKu8Xh3RZF5A68HFcIzpXYSyefNxcfN0MsTfHnoAY8BgRZ7PRKYk+tw8y0xV2gxNwC8ucs98r5wHt/19PgjCfdLh896hEW16MOo8GhEdMyWgvT/K+t6uc5FqnF9bnrjJh1WeIHfMDOzFyejuG5iQtfIvlF8Gk5Hf4vVB7RvdJ5hYT4NBkYxRs/YRkueaw+nr8htP9kyh7JrplzXgdtscFPVopMDZ4S4L6GHnVHQxOqz0TcPKG5lXjYCYOH5YxnxBrDw++gbcoMOUe/cl2RhSlxwpHReSTkgCpBXw991x6bIq+PhrNNYbR79HszkpGjt+YRNlrJk73aYrf1ThW3NRqU+UUlgQK6KylxsIgLnnISs4BjbYyABs1tstP8eOv8ef1LKHONtJSJ9xZBRkiRYbbR8r2GNhhJr9QPCVr8Dh5lFC46GsL14bnki/9sd/Jz9WrbuF3dkH0ngbSKMm3FWf/vgRfHv/2bPSSfRguRdmancr1mkzzpkb836J7I5XZJ/eW8w9sKbndIUHrN6KQsL3oP265uk/TohiMK15rir7BJppelzOO/48VmsIveIhDevQ/xnjVFFqvVRaOpkAQPzFXuA2hhN6tVH+D16tSAHa/9oeqk55jwkQzz6IUJLQdHNo4M+7usUWVPctSQyRF1bFOPdUXkUS5mVTWk6xBKKlmVrGS3qBVPxIsFYuj9N5zZ67ZDPwTPNIU1OMEMr24qc1ckzS1hoFtO+l4BQg2d/2KrLIf0EJKEIs3vICQ==","pineId":"PUB;2187","pineVersion":"-1","in_0":{"v":6,"f":True,"t":"integer"},"in_1":{"v":200,"f":True,"t":"integer"},"in_2":{"v":True,"f":True,"t":"bool"},"in_3":{"v":True,"f":True,"t":"bool"},"in_4":{"v":1,"f":True,"t":"integer"},"in_5":{"v":False,"f":True,"t":"bool"},"in_6":{"v":False,"f":True,"t":"bool"},"in_7":{"v":0,"f":True,"t":"integer"},"in_8":{"v":"fixed","f":True,"t":"text"},"in_9":{"v":1,"f":True,"t":"float"},"in_10":{"v":100000,"f":True,"t":"float"},"in_11":{"v":"NONE","f":True,"t":"text"},"in_12":{"v":0,"f":True,"t":"integer"},"in_13":{"v":"percent","f":True,"t":"text"},"in_14":{"v":0,"f":True,"t":"float"}}]}),
json.dumps({"m":"create_study","p":["cs_yD7aPrM9Eav2","st3","st1","s1","RSI@tv-basicstudies-81",{"length":14,"source":"close"}]}),
# '{"m":"quote_create_session","p":["qs_cYic7cSheeMW"]}',
# '{"m":"quote_add_symbols","p":["qs_cYic7cSheeMW","BITFINEX:BTCUSD",{"flags":["force_permission"]}]}',
# '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st4","st1","s1","ESD@tv-scripting-101!",{"text":"WGl55Gc/tbDhxqE0Sd3ToA==_YMmxzJDP/iyAhzIO4g0ZJKV6ytpyksGXDXR08MYNKe8xzjywJ+tCoD4k0gmsAqFZlb/B/DJ3ky1VfawnRN/8ZTPt+j0G7XoEPBAXVDpMtOyn2NdaIqgbIpholgHJ1xItlSv4nZHTzLqC40eWypnCbn+LpNydbAFHpYICB96gIAnMsFmuRD3VGQAUTnygHsaT9rN78lA3i+PR86C1ditNUWFhROycV6VFGdBCTENuR2wLQGQvzC9634qEFDoMvcqGyqCUvU00O+CnBD2tT9a55CQq1pw=","pineId":"TV_DIVIDENDS","pineVersion":"2.0"}]}',
# '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st5","st1","s1","ESD@tv-scripting-101!",{"text":"sfKNX/tKLjp7L7FtVgmYXg==_z+3RKkf/RqO+wVT0vRe9xjdf+jQNDEzfVUnKgAJ8UIQVc8CtKEeU3OYuwetrsoJGUQbQO6hKOm2aL2r3D2XmjaKB9UoLV7DR/3ly5ab8iU+cTEBFh+7DAgcr7mOnQ99tTXt31jQA/AZ27rof8Kq0Hi6MRcGfyvAQiba9bDnKSKiXnCj4HpV/MaLaG/6vieOqFg6a429ZzD3p9hIX2oEIXpIJjHpWwe8csyz0K9AUjiC5y/bu2E0Rek7UVwBVDS7pMOJXEJcJNOPlFdRDiGcvUKgJJERtCxq1gNu+hkHYIVthDa7FUIxoepryRSRlwvKqMumeGvOWUlMewHHJWKWBLRwim9jyVRRrwQ5vYNF6k9lwZ0rAaKNIqpnLgZP4lkOLzafcnjvGOp9/rk1XTaQkVZwbBNvakKegKQ==","pineId":"TV_EARNINGS","pineVersion":"2.0"}]}',
# '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st6","st1","s1","ESD@tv-scripting-101!",{"text":"trOzbbylgCYupam1bHdZXA==_EaZ3Cmxj0Rcu994IpoTzq1hz0of0vj3v9QrqeWWETpqXANkwIRiBufkSTlvEGZe2lUTfotOkiMkpGiDFtPmKgbKyhmNn1bsPm5KMCgWf+WVhyM06LKhpm84grDwUBMOrauaxZ9kBy7TIRibaf/S3ov2god437NRrOGMaFl1wBPApJK7LrJi1Uh3P71rShB+o1W0TIZ2/Tp+2sVg6Kt3Ker/OnlZKMbbIMA2hz4AbTgiRue6RhsuLzF9j1SgILzi1vC1AXIIWleVmzMIQeap+s3pJQvnW8dB3J3fE0VkCH6+y+S5z37wk4AaNH/Ki7UqWeAitpEedZ9HX5QTpC+6fa/s=","pineId":"TV_SPLITS","pineVersion":"2.0"}]}',
# '{"m":"request_more_tickmarks","p":["cs_yD7aPrM9Eav2","s1",10]}',
# '{"m":"request_more_data","p":["cs_yD7aPrM9Eav2","s1",162]}',
# '{"m":"quote_fast_symbols","p":["qs_cYic7cSheeMW","BITFINEX:BTCUSD"]}',
# '{"m":"switch_protocol","p":["protobuf"]}',
]
# reqs = [
# '{"m":"chart_create_session","p":["cs_yD7aPrM9Eav2",""]}',
# '{"m":"quote_create_session","p":["qs_CiWdgz2rquIv"]}',
# '{"m":"quote_set_fields","p":["qs_CiWdgz2rquIv","ch","chp","current_session","description","local_description","language","exchange","fractional","is_tradable","lp","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","update_mode","volume"]}',
# '{"m":"quote_add_symbols","p":["qs_CiWdgz2rquIv","BITFINEX:BTCUSD",{"flags":["force_permission"]}]}',
# '{"m":"quote_fast_symbols","p":["qs_CiWdgz2rquIv","BITFINEX:BTCUSD"]}',
# '{"m":"switch_timezone","p":["cs_yD7aPrM9Eav2","Asia/Shanghai"]}',
# '{"m":"resolve_symbol","p":["cs_yD7aPrM9Eav2","symbol_1","={\\"symbol\\":\\"BITFINEX:BTCUSD\\",\\"adjustment\\":\\"splits\\"}"]}',
# '{"m":"create_series","p":["cs_yD7aPrM9Eav2","s1","s1","symbol_1","45",300]}',
# '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st1","st1","s1","Volume@tv-basicstudies-81",{"length":20,"col_prev_close":False}]}',
# '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st2","st1","s1","StrategyScript@tv-scripting-101!",{"text":"2sMXFZEjEcAEL0TdZuTIQA==_Ms0NAfB4PBEpsMEJL29vRZnweB9M0oyj4eO625LXy1/T6EnFjvZPYvO5V7QS+6mdXgxFthk3XpTftMC3l23+JkK6NWfL1g13DydoA5L7gSC/Vi3LAFTxx8QJMWo/u4rLgfdiZDJC1o/JWj6J0iBXmk3XiVdZroPx0NDoGSNzORqMQziSTldq7Nt/4bJB5NBzuBrtCbWd7j66GAOnTRJB7vG4SGWbkFqOv4wRbFAoOkSoMyC1/6ZeflXdWcyZGk0YPsxpcp9JOOU4dEgnHHXI+sZCCjuIv5IK+lmtwnXPhlPRyiRpqQjUDOHMQZqlO4vlmqgOuxKDeJ57tyFGaiIIuIChwStgOg4CN24pCf0SMy8wEW4rax1Y/MvlHb9qQ9HpS18ka1nGdbrGc3UHFQ25kudgsPE9wC4KiZVXSCarniMhyV6tTXt+boAH8g8U4BPaSSCNAr+lh2WNYHl/ddZJ9JaZWod/VIlPo732Ili2DZg1neeIK3O3TMTKMROB5THzE6yQnrE5GrVxY2h291GSdjt5a04ayWwpzZizvGG/e4Pug/8UWsydpjifVmhwF7purE3EdNDrXxG56uKu8Xh3RZF5A68HFcIzpXYSyefNxcfN0MsTfHnoAY8BgRZ7PRKYk+tw8y0xV2gxNwC8ucs98r5wHt/19PgjCfdLh896hEW16MOo8GhEdMyWgvT/K+t6uc5FqnF9bnrjJh1WeIHfMDOzFyejuG5iQtfIvlF8Gk5Hf4vVB7RvdJ5hYT4NBkYxRs/YRkueaw+nr8htP9kyh7JrplzXgdtscFPVopMDZ4S4L6GHnVHQxOqz0TcPKG5lXjYCYOH5YxnxBrDw++gbcoMOUe/cl2RhSlxwpHReSTkgCpBXw991x6bIq+PhrNNYbR79HszkpGjt+YRNlrJk73aYrf1ThW3NRqU+UUlgQK6KylxsIgLnnISs4BjbYyABs1tstP8eOv8ef1LKHONtJSJ9xZBRkiRYbbR8r2GNhhJr9QPCVr8Dh5lFC46GsL14bnki/9sd/Jz9WrbuF3dkH0ngbSKMm3FWf/vgRfHv/2bPSSfRguRdmancr1mkzzpkb836J7I5XZJ/eW8w9sKbndIUHrN6KQsL3oP265uk/TohiMK15rir7BJppelzOO/48VmsIveIhDevQ/xnjVFFqvVRaOpkAQPzFXuA2hhN6tVH+D16tSAHa/9oeqk55jwkQzz6IUJLQdHNo4M+7usUWVPctSQyRF1bFOPdUXkUS5mVTWk6xBKKlmVrGS3qBVPxIsFYuj9N5zZ67ZDPwTPNIU1OMEMr24qc1ckzS1hoFtO+l4BQg2d/2KrLIf0EJKEIs3vICQ==","pineId":"PUB;2187","pineVersion":"-1","in_0":{"v":6,"f":True,"t":"integer"},"in_1":{"v":200,"f":True,"t":"integer"},"in_2":{"v":True,"f":True,"t":"bool"},"in_3":{"v":True,"f":True,"t":"bool"},"in_4":{"v":1,"f":True,"t":"integer"},"in_5":{"v":False,"f":True,"t":"bool"},"in_6":{"v":False,"f":True,"t":"bool"},"in_7":{"v":0,"f":True,"t":"integer"},"in_8":{"v":"fixed","f":True,"t":"text"},"in_9":{"v":1,"f":True,"t":"float"},"in_10":{"v":100000,"f":True,"t":"float"},"in_11":{"v":"NONE","f":True,"t":"text"},"in_12":{"v":0,"f":True,"t":"integer"},"in_13":{"v":"percent","f":True,"t":"text"},"in_14":{"v":0,"f":True,"t":"float"}}]}',
# '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st3","st1","s1","RSI@tv-basicstudies-81",{"length":14,"source":"close"}]}',
#
# # '{"m":"quote_create_session","p":["qs_cYic7cSheeMW"]}',
# # '{"m":"quote_add_symbols","p":["qs_cYic7cSheeMW","BITFINEX:BTCUSD",{"flags":["force_permission"]}]}',
# # '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st4","st1","s1","ESD@tv-scripting-101!",{"text":"WGl55Gc/tbDhxqE0Sd3ToA==_YMmxzJDP/iyAhzIO4g0ZJKV6ytpyksGXDXR08MYNKe8xzjywJ+tCoD4k0gmsAqFZlb/B/DJ3ky1VfawnRN/8ZTPt+j0G7XoEPBAXVDpMtOyn2NdaIqgbIpholgHJ1xItlSv4nZHTzLqC40eWypnCbn+LpNydbAFHpYICB96gIAnMsFmuRD3VGQAUTnygHsaT9rN78lA3i+PR86C1ditNUWFhROycV6VFGdBCTENuR2wLQGQvzC9634qEFDoMvcqGyqCUvU00O+CnBD2tT9a55CQq1pw=","pineId":"TV_DIVIDENDS","pineVersion":"2.0"}]}',
# # '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st5","st1","s1","ESD@tv-scripting-101!",{"text":"sfKNX/tKLjp7L7FtVgmYXg==_z+3RKkf/RqO+wVT0vRe9xjdf+jQNDEzfVUnKgAJ8UIQVc8CtKEeU3OYuwetrsoJGUQbQO6hKOm2aL2r3D2XmjaKB9UoLV7DR/3ly5ab8iU+cTEBFh+7DAgcr7mOnQ99tTXt31jQA/AZ27rof8Kq0Hi6MRcGfyvAQiba9bDnKSKiXnCj4HpV/MaLaG/6vieOqFg6a429ZzD3p9hIX2oEIXpIJjHpWwe8csyz0K9AUjiC5y/bu2E0Rek7UVwBVDS7pMOJXEJcJNOPlFdRDiGcvUKgJJERtCxq1gNu+hkHYIVthDa7FUIxoepryRSRlwvKqMumeGvOWUlMewHHJWKWBLRwim9jyVRRrwQ5vYNF6k9lwZ0rAaKNIqpnLgZP4lkOLzafcnjvGOp9/rk1XTaQkVZwbBNvakKegKQ==","pineId":"TV_EARNINGS","pineVersion":"2.0"}]}',
# # '{"m":"create_study","p":["cs_yD7aPrM9Eav2","st6","st1","s1","ESD@tv-scripting-101!",{"text":"trOzbbylgCYupam1bHdZXA==_EaZ3Cmxj0Rcu994IpoTzq1hz0of0vj3v9QrqeWWETpqXANkwIRiBufkSTlvEGZe2lUTfotOkiMkpGiDFtPmKgbKyhmNn1bsPm5KMCgWf+WVhyM06LKhpm84grDwUBMOrauaxZ9kBy7TIRibaf/S3ov2god437NRrOGMaFl1wBPApJK7LrJi1Uh3P71rShB+o1W0TIZ2/Tp+2sVg6Kt3Ker/OnlZKMbbIMA2hz4AbTgiRue6RhsuLzF9j1SgILzi1vC1AXIIWleVmzMIQeap+s3pJQvnW8dB3J3fE0VkCH6+y+S5z37wk4AaNH/Ki7UqWeAitpEedZ9HX5QTpC+6fa/s=","pineId":"TV_SPLITS","pineVersion":"2.0"}]}',
# # '{"m":"request_more_tickmarks","p":["cs_yD7aPrM9Eav2","s1",10]}',
# # '{"m":"request_more_data","p":["cs_yD7aPrM9Eav2","s1",162]}',
# # '{"m":"quote_fast_symbols","p":["qs_cYic7cSheeMW","BITFINEX:BTCUSD"]}',
# # '{"m":"switch_protocol","p":["protobuf"]}',
# ]
for req in reqs:
# _req = json.dumps(req, ensure_ascii=False)
_req = req
# send_req = req
_req_len = len(_req)
send_req = '~m~' + str(_req_len) + '~m~' + _req
# print('发送: {}'.format(send_req))
ws.send(send_req)
if __name__ == "__main__":
sock_adress = "wss://data.tradingview.com/socket.io/websocket?from=chart%2FrP0mQCuj%2F&date=2018_12_20-19_52"
cookie = "__utmc=226258911; __utmz=226258911.1545358476.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); km_lv=x; sessionid=8togr3m4llxfq1megba6bfduhzo9ky2q; png=cef7e9b2-2ce7-4382-b898-51f6c723782d; etg=cef7e9b2-2ce7-4382-b898-51f6c723782d; cachec=cef7e9b2-2ce7-4382-b898-51f6c723782d; tv_ecuid=cef7e9b2-2ce7-4382-b898-51f6c723782d; km_ni=bingpoli%40gmail.com; km_ai=bingpoli%40gmail.com; __utma=226258911.196369246.1545358476.1545360446.1545373147.3; _sp_id.cf1a=a25b6ccb-1c8e-4770-9efc-c4f2e23548cb.1545358476.3.1545375560.1545360776.1a8655b8-295a-4f4b-8e9a-062d84370d48; kvcd=1545375560495"
socket_key = "IKCDm3xUHYihgLkjnobp5A=="
headers = ["Accept-Encoding:gzip, deflate, br",
"Accept-Language:zh-CN,zh;q=0.9",
"Cache-Control:no-cache",
"Connection:Upgrade",
"Cookie:{}".format(cookie),
"Host:data.tradingview.com",
"Origin:https://cn.tradingview.com",
"Pragma:no-cache",
"Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits",
"Sec-WebSocket-Key:{}".format(socket_key),
"Sec-WebSocket-Version:13",
"Upgrade:websocket",
"User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
]
# websocket.enableTrace(True)
websocket.enableTrace(False)
ws = websocket.WebSocketApp(sock_adress, header=headers,
on_message=on_message,
on_error=on_error,
on_close=on_close)
ws.on_open = on_open
ws.run_forever(ping_timeout=30)
| 94.25974
| 2,133
| 0.718035
| 1,426
| 14,516
| 7.145161
| 0.287518
| 0.014722
| 0.017666
| 0.015311
| 0.792914
| 0.780351
| 0.769555
| 0.743841
| 0.732947
| 0.732947
| 0
| 0.106556
| 0.091003
| 14,516
| 153
| 2,134
| 94.875817
| 0.665176
| 0.523422
| 0
| 0.02381
| 0
| 0.059524
| 0.538036
| 0.355581
| 0
| 1
| 0
| 0
| 0
| 1
| 0.059524
| false
| 0.02381
| 0.047619
| 0
| 0.130952
| 0.095238
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
15c7f04c4d22c73a5d16ff18715cb6c95c5d8148
| 13,287
|
py
|
Python
|
selected_cols.py
|
launis/areadata
|
8cf0e30ec489ce9655fcd9829284d1ec70e7360d
|
[
"BSD-3-Clause"
] | null | null | null |
selected_cols.py
|
launis/areadata
|
8cf0e30ec489ce9655fcd9829284d1ec70e7360d
|
[
"BSD-3-Clause"
] | null | null | null |
selected_cols.py
|
launis/areadata
|
8cf0e30ec489ce9655fcd9829284d1ec70e7360d
|
[
"BSD-3-Clause"
] | null | null | null |
def selected_cols(largeset = False, parties=True, pnroalue = True):
if largeset==True:
numeric_features = ['Miehet, 2018 (HE) osuudesta asukkaat',
'Naiset, 2018 (HE) osuudesta asukkaat',
'Asuntojen keskipinta-ala, 2018 (RA) osuus total',
'Talotyypit yhteensä 2019 Neliöhinta (EUR/m2) osuus total',
'Asumisväljyys, 2018 (TE) osuus total',
'Asukkaiden keski-ikä, 2018 (HE) osuus total',
'Postinumeroalueen pinta-ala osuus area_code',
'Perusasteen suorittaneet, 2018 (KO) osuudesta asukkaat',
'Ammatillisen tutkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Ylioppilastutkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Alemman korkeakoulututkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Ylemmän korkeakoulututkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Asukkaiden mediaanitulot, 2017 (HR) osuudesta asukkaat',
'Asukkaiden ostovoimakertymä, 2017 (HR) osuudesta asukkaat osuus total',
'Kesämökit yhteensä, 2018 (RA) osuudesta asukkaat',
'Pientaloasunnot, 2018 (RA) osuudesta asukkaat',
'Työlliset, 2017 (PT) osuudesta asukkaat',
'Työttömät, 2017 (PT) osuudesta asukkaat',
'Opiskelijat, 2017 (PT) osuudesta asukkaat',
'A Maatalous, metsätalous ja kalatalous, 2017 (TP) osuudesta asukkaat',
'B Kaivostoiminta ja louhinta, 2017 (TP) osuudesta asukkaat',
'C Teollisuus, 2017 (TP) osuudesta asukkaat',
'D Sähkö-, kaasu- ja lämpöhuolto, jäähdytysliiketoiminta, 2017 (TP) osuudesta asukkaat',
'E Vesihuolto, viemäri- ja jätevesihuolto ja muu ympäristön puhtaanapito, 2017 (TP) osuudesta asukkaat',
'F Rakentaminen, 2017 (TP) osuudesta asukkaat',
'G Tukku- ja vähittäiskauppa; moottoriajoneuvojen ja moottoripyörien korjaus, 2017 (TP) osuudesta asukkaat',
'H Kuljetus ja varastointi, 2017 (TP) osuudesta asukkaat',
'I Majoitus- ja ravitsemistoiminta, 2017 (TP) osuudesta asukkaat',
'J Informaatio ja viestintä, 2017 (TP) osuudesta asukkaat',
'K Rahoitus- ja vakuutustoiminta, 2017 (TP) osuudesta asukkaat',
'L Kiinteistöalan toiminta, 2017 (TP) osuudesta asukkaat',
'M Ammatillinen, tieteellinen ja tekninen toiminta, 2017 (TP) osuudesta asukkaat',
'N Hallinto- ja tukipalvelutoiminta, 2017 (TP) osuudesta asukkaat',
'O Julkinen hallinto ja maanpuolustus; pakollinen sosiaalivakuutus, 2017 (TP) osuudesta asukkaat',
'P Koulutus, 2017 (TP) osuudesta asukkaat',
'Q Terveys- ja sosiaalipalvelut, 2017 (TP) osuudesta asukkaat',
'R Taiteet, viihde ja virkistys, 2017 (TP) osuudesta asukkaat',
'S Muu palvelutoiminta, 2017 (TP) osuudesta asukkaat',
'T Kotitalouksien toiminta työnantajina; kotitalouksien eriyttämätön toiminta tavaroiden ja palveluiden tuottamiseksi omaan käyttöön, 2017 (TP) osuudesta asukkaat',
'U Kansainvälisten organisaatioiden ja toimielinten toiminta, 2017 (TP) osuudesta asukkaat',
'Ravintolat osuudesta asukkaat',
'Myymälät osuudesta asukkaat',
'Nuorten yksinasuvien taloudet, 2018 (TE) osuudesta taloudet',
'Lapsettomat nuorten parien taloudet, 2018 (TE) osuudesta taloudet',
'Lapsitaloudet, 2018 (TE) osuudesta taloudet',
'Teini-ikäisten lasten taloudet, 2018 (TE) osuudesta taloudet',
'Aikuisten taloudet, 2018 (TE) osuudesta taloudet',
'Eläkeläisten taloudet, 2018 (TE) osuudesta taloudet',
'Omistusasunnoissa asuvat taloudet, 2018 (TE) osuudesta taloudet',
'Vuokra-asunnoissa asuvat taloudet, 2018 (TE) osuudesta taloudet',
'Alimpaan tuloluokkaan kuuluvat taloudet, 2017 (TR) osuudesta taloudet',
'Keskimmäiseen tuloluokkaan kuuluvat taloudet, 2017 (TR) osuudesta taloudet',
'Ylimpään tuloluokkaan kuuluvat taloudet, 2017 (TR) osuudesta taloudet',
'1.1.3 Kirkollisvero Yhteensä Saajien lukumäärä osuudesta verotetut',
'11. Yrittäjätulot yhteensä Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.10 Muut veronalaiset sosiaalietuudet Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.6 Tapaturma- ym. muut päivärahat Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.7 Päivä- ja äitiyspäivärahat Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.8 Lapsen kotihoidon tuki Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.9 Kuntoutusraha ja -avustus Yhteensä Saajien lukumäärä osuudesta verotetut',
'5.1.3 Vuokratulo Yhteensä Saajien lukumäärä osuudesta verotetut',
'11.5.1.1 Asuntolainan korkomenot (TVL 58 § 2 mom.) Yhteensä Summa, euroa osuus total',
'14.12 Opintolainavähennys Yhteensä Summa, euroa osuus total',
'14.7 Kotitalousvähennys Yhteensä Summa, euroa osuus total',
'2. Tulot yhteensä Yhteensä Summa, euroa osuus total',
'1.1 Tuloverot yhteensä Yhteensä Summa, euroa osuus total',
'4.1.C Autoetu Yhteensä Summa, euroa osuus total',
'4.2 Työmatkakulujen perusteella palkkatulosta vähennettävä määrä (TVL 93 §) Yhteensä Summa, euroa osuus total',
'5. Pääomatulot yhteensä Yhteensä Summa, euroa osuus total',
'Ruotsinkielisten osuus väestöstä, %, 2019',
'Taajama-aste, %, 2018',
'Ulkomaan kansalaisten osuus väestöstä, %, 2019',
'Kuntien välinen muuttovoitto/-tappio, henkilöä, 2019 osuudesta asukkaat nollatta',
'etaisyys osuus area_code','tkalue',
'Tuloveroprosentti']
else:
numeric_features = ['Miehet, 2018 (HE) osuudesta asukkaat',
'Asuntojen keskipinta-ala, 2018 (RA) osuus total',
'Talotyypit yhteensä 2019 Neliöhinta (EUR/m2) osuus total',
'Asumisväljyys, 2018 (TE) osuus total',
'Asukkaiden keski-ikä, 2018 (HE) osuus total',
'Postinumeroalueen pinta-ala osuus area_code',
'Perusasteen suorittaneet, 2018 (KO) osuudesta asukkaat',
'Ammatillisen tutkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Ylioppilastutkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Alemman korkeakoulututkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Ylemmän korkeakoulututkinnon suorittaneet, 2018 (KO) osuudesta asukkaat',
'Asukkaiden ostovoimakertymä, 2017 (HR) osuudesta asukkaat osuus total',
'Kerrostaloasunnot, 2018 (RA) osuudesta asukkaat',
'Kesämökit yhteensä, 2018 (RA) osuudesta asukkaat',
'Pientaloasunnot, 2018 (RA) osuudesta asukkaat',
'Työlliset, 2017 (PT) osuudesta asukkaat',
'Työttömät, 2017 (PT) osuudesta asukkaat',
'Opiskelijat, 2017 (PT) osuudesta asukkaat',
'A Maatalous, metsätalous ja kalatalous, 2017 (TP) osuudesta asukkaat',
'J Informaatio ja viestintä, 2017 (TP) osuudesta asukkaat',
'K Rahoitus- ja vakuutustoiminta, 2017 (TP) osuudesta asukkaat',
'O Julkinen hallinto ja maanpuolustus; pakollinen sosiaalivakuutus, 2017 (TP) osuudesta asukkaat',
'P Koulutus, 2017 (TP) osuudesta asukkaat',
'Q Terveys- ja sosiaalipalvelut, 2017 (TP) osuudesta asukkaat',
'R Taiteet, viihde ja virkistys, 2017 (TP) osuudesta asukkaat',
'Ravintolat osuudesta asukkaat',
'Myymälät osuudesta asukkaat',
'Nuorten yksinasuvien taloudet, 2018 (TE) osuudesta taloudet',
'Lapsettomat nuorten parien taloudet, 2018 (TE) osuudesta taloudet',
'Lapsitaloudet, 2018 (TE) osuudesta taloudet',
'Aikuisten taloudet, 2018 (TE) osuudesta taloudet',
'Eläkeläisten taloudet, 2018 (TE) osuudesta taloudet',
'Omistusasunnoissa asuvat taloudet, 2018 (TE) osuudesta taloudet',
'Vuokra-asunnoissa asuvat taloudet, 2018 (TE) osuudesta taloudet',
'Alimpaan tuloluokkaan kuuluvat taloudet, 2017 (TR) osuudesta taloudet',
'Keskimmäiseen tuloluokkaan kuuluvat taloudet, 2017 (TR) osuudesta taloudet',
'Ylimpään tuloluokkaan kuuluvat taloudet, 2017 (TR) osuudesta taloudet',
'1.1.3 Kirkollisvero Yhteensä Saajien lukumäärä osuudesta verotetut',
'11. Yrittäjätulot yhteensä Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.6 Tapaturma- ym. muut päivärahat Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.7 Päivä- ja äitiyspäivärahat Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.8 Lapsen kotihoidon tuki Yhteensä Saajien lukumäärä osuudesta verotetut',
'4.2.9 Kuntoutusraha ja -avustus Yhteensä Saajien lukumäärä osuudesta verotetut',
'5.1.3 Vuokratulo Yhteensä Saajien lukumäärä osuudesta verotetut',
'11.5.1.1 Asuntolainan korkomenot (TVL 58 § 2 mom.) Yhteensä Summa, euroa osuus total',
'14.12 Opintolainavähennys Yhteensä Summa, euroa osuus total',
'14.7 Kotitalousvähennys Yhteensä Summa, euroa osuus total',
'1.1 Tuloverot yhteensä Yhteensä Summa, euroa osuus total',
'4.1.C Autoetu Yhteensä Summa, euroa osuus total',
'4.2 Työmatkakulujen perusteella palkkatulosta vähennettävä määrä (TVL 93 §) Yhteensä Summa, euroa osuus total',
'5. Pääomatulot yhteensä Yhteensä Summa, euroa osuus total',
'Ruotsinkielisten osuus väestöstä, %, 2019',
'Taajama-aste, %, 2018',
'Ulkomaan kansalaisten osuus väestöstä, %, 2019',
'Kuntien välinen muuttovoitto/-tappio, henkilöä, 2019 osuudesta asukkaat nollatta',
'etaisyys osuus area_code', 'tkalue',
'Tuloveroprosentti']
col_puolueet = ['Ääniosuus KD',
'Ääniosuus KESK',
'Ääniosuus KOK',
'Ääniosuus PS',
'Ääniosuus RKP',
'Ääniosuus SDP',
'Ääniosuus VAS',
'Ääniosuus VIHR',
'Äänestysosuus']
if not pnroalue:
not_in_kunta = ['Myymälät osuudesta asukkaat', 'Postinumeroalueen pinta-ala osuus area_code', 'Kuntien välinen muuttovoitto/-tappio, henkilöä, 2019 osuudesta asukkaat nollatta', 'etaisyys osuus area_code', 'tkalue', 'Ravintolat osuudesta asukkaat']
removeset = set(not_in_kunta)
numeric_features[:] = [x for x in numeric_features if x not in removeset]
categorical_features=[]
if parties:
numeric_features = numeric_features + col_puolueet
return(numeric_features, categorical_features)
| 83.566038
| 261
| 0.540905
| 1,098
| 13,287
| 6.529144
| 0.229508
| 0.151765
| 0.058586
| 0.089831
| 0.816571
| 0.805691
| 0.799275
| 0.790208
| 0.790208
| 0.790208
| 0
| 0.057833
| 0.392263
| 13,287
| 159
| 262
| 83.566038
| 0.829474
| 0
| 0
| 0.736842
| 0
| 0.019737
| 0.615765
| 0.00655
| 0
| 0
| 0
| 0
| 0
| 1
| 0.006579
| false
| 0
| 0
| 0
| 0.006579
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
c60a2cc1c22fe56343cd87594edf7ff1c366f8f2
| 16,161
|
py
|
Python
|
src/nti/recipes/zodb/tests/test_relstorage.py
|
NextThought/nti.recipes.zodb
|
6cf9c4faeacc59083c200dd6cdba813dfdfd9390
|
[
"Apache-2.0"
] | null | null | null |
src/nti/recipes/zodb/tests/test_relstorage.py
|
NextThought/nti.recipes.zodb
|
6cf9c4faeacc59083c200dd6cdba813dfdfd9390
|
[
"Apache-2.0"
] | 8
|
2019-11-05T17:05:49.000Z
|
2020-10-06T15:26:06.000Z
|
src/nti/recipes/zodb/tests/test_relstorage.py
|
NextThought/nti.recipes.zodb
|
6cf9c4faeacc59083c200dd6cdba813dfdfd9390
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, division
__docformat__ = "restructuredtext en"
import textwrap
import unittest
from hamcrest import is_not
from hamcrest import assert_that
from hamcrest import contains_string
from nti.recipes.zodb.relstorage import Databases
from . import default_buildout
def setup_buildout_environment(**extra_options):
return default_buildout(
default_sections=dict(
relstorages_opts={
'sql_user': 'BAZ',
'pack-gc': 'true'
},
relstorages_users_storage_opts={
'sql_user': 'FOO',
'pack-gc': 'false'
},
),
**extra_options
)
class TestDatabases(unittest.TestCase):
def setUp(self):
self.buildout = setup_buildout_environment()
def test_parse(self):
buildout = self.buildout
buildout['environment'] = {
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
'cache_servers': 'cache',
'compress': 'true',
}
Databases(buildout, 'relstorages',
{'storages': 'Users Users_1 Sessions',
'enable-persistent-cache': 'true'})
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('shared-blob-dir false'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('FOO'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('pack-gc false'))
assert_that(buildout['relstorages_users_1_storage']['client_zcml'],
contains_string('BAZ'))
assert_that(buildout['relstorages_users_1_storage']['client_zcml'],
contains_string('pack-gc true'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('cache-local-dir /caches/data_cache/Users.cache'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('cache-local-mb 300'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('cache-servers cache'))
def test_parse_no_environment(self):
# No verification, just sees if it runs
buildout = self.buildout
Databases(buildout, 'relstorages', {
'storages': 'Users Users_1 Sessions',
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
'relstorage-name-prefix': 'zzz',
'cache_servers': 'cache',
'enable-persistent-cache': 'true',
'compress': 'none',
'pool_timeout': '42',
})
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('shared-blob-dir false'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('FOO'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('pack-gc false'))
assert_that(buildout['relstorages_users_1_storage']['client_zcml'],
contains_string('BAZ'))
assert_that(buildout['relstorages_users_1_storage']['client_zcml'],
contains_string('pack-gc true'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('cache-local-dir /caches/data_cache/Users.cache'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('cache-local-mb 300'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('cache-servers cache'))
assert_that(buildout['relstorages_users_storage']['client_zcml'],
contains_string('name zzzUsers'))
expected = """\
<zodb Users>
cache-size 100000
database-name Users
pool-size 60
pool-timeout 42
<relstorage Users>
<mysql>
# This comment preserves whitespace
db Users
host host
passwd passwd
user FOO
</mysql>
blob-dir /data/Users.blobs
cache-local-dir /caches/data_cache/Users.cache
cache-local-mb 300
cache-prefix Users
commit-lock-timeout 60
keep-history false
name zzzUsers
pack-gc false
shared-blob-dir false
cache-module-name memcache
cache-servers cache
</relstorage>
</zodb>"""
self.assertEqual(
buildout['relstorages_users_storage']['client_zcml'],
expected
)
def test_parse_no_environment_extra_args(self):
buildout = self.buildout
buildout['relstorages_sessions_storage_opts'] = {
'sql_adapter_extra_args': textwrap.dedent(
"""
driver gevent mysqldb
"""
)
}
Databases(buildout, 'relstorages',
{'storages': 'Sessions',
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
'relstorage-name-prefix': 'zzz',
'cache_servers': 'cache',
'enable-persistent-cache': 'true',
'compress': 'true'})
expected = """\
<zodb Sessions>
cache-size 100000
database-name Sessions
pool-size 60
<zlibstorage Sessions>
<relstorage Sessions>
<mysql>
# This comment preserves whitespace
db Sessions
driver gevent mysqldb
host host
passwd passwd
user BAZ
</mysql>
blob-dir /data/Sessions.blobs
cache-local-dir /caches/data_cache/Sessions.cache
cache-local-mb 300
cache-prefix Sessions
commit-lock-timeout 60
keep-history false
name zzzSessions
pack-gc true
shared-blob-dir false
cache-module-name memcache
cache-servers cache
</relstorage>
</zlibstorage>
</zodb>"""
self.assertEqual(
expected,
buildout['relstorages_sessions_storage']['client_zcml'],
)
def test_parse_postgres_with_dsn(self):
buildout = self.buildout
buildout['environment'] = {
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
}
buildout['relstorages_sessions_storage_opts'] = {
'sql_adapter': 'postgresql',
'sql_user': '${environment:sql_user}',
'sql_passwd': '${environment:sql_passwd}',
'sql_host': '${environment:sql_host}',
'sql_db': 'sessions',
'sql_adapter_args': textwrap.dedent(
"""
dsn dbname=${:sql_db} user=${:sql_user} password=${:sql_passwd} host=${:sql_host}
"""
),
}
Databases(buildout, 'relstorages', {
'storages': 'Sessions',
})
expected = """\
<zodb Sessions>
cache-size 100000
database-name Sessions
pool-size 60
<zlibstorage Sessions>
<relstorage Sessions>
<postgresql>
# This comment preserves whitespace
dsn dbname=sessions user=user password=passwd host=host
</postgresql>
blob-dir /data/Sessions.blobs
cache-local-dir /caches/data_cache/Sessions.cache
cache-local-mb 300
cache-prefix Sessions
commit-lock-timeout 60
keep-history false
name Sessions
pack-gc true
shared-blob-dir false
</relstorage>
compress false
</zlibstorage>
</zodb>"""
self.assertEqual(
expected,
buildout['relstorages_sessions_storage']['client_zcml']
)
def test_parse_postgres_auto_dsn(self):
# If no DSN is provided in sql_adapter_args, then one is created from the parts
# that are present. Leave out password and host to test skipping those;
# specify a port to test quoting.
buildout = self.buildout
buildout['relstorages_sessions_storage_opts'] = {
'sql_adapter': 'postgresql',
'sql_adapter_extra_args': textwrap.dedent("""
sql_port 5433
""")
}
Databases(buildout, 'relstorages', {
'storages': 'Sessions',
})
expected = """\
<zodb Sessions>
cache-size 100000
database-name Sessions
pool-size 60
<zlibstorage Sessions>
<relstorage Sessions>
<postgresql>
# This comment preserves whitespace
dsn dbname='Sessions' user='BAZ' port=5433
</postgresql>
blob-dir /data/Sessions.blobs
cache-local-dir /caches/data_cache/Sessions.cache
cache-local-mb 300
cache-prefix Sessions
commit-lock-timeout 60
keep-history false
name Sessions
pack-gc true
shared-blob-dir false
</relstorage>
compress false
</zlibstorage>
</zodb>"""
self.assertEqual(
expected,
buildout['relstorages_sessions_storage']['client_zcml']
)
def test_parse_override_defaults_local(self):
buildout = self.buildout
buildout['environment'] = {
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
}
# If this one isn't present, then
# the one from the most specific section isn't found at all.
# That's ok, this is the one that's documented.
buildout['relstorages_opts']['pool_timeout'] = '64s'
buildout['relstorages_sessions_storage_opts'] = {
'pool_size': 13,
'pool_timeout': 54, # This one is actually found
'commit_lock_timeout': 42,
}
Databases(buildout, 'relstorages', {
'storages': 'Sessions',
})
expected = """\
<zodb Sessions>
cache-size 100000
database-name Sessions
pool-size 13
pool-timeout 54
<zlibstorage Sessions>
<relstorage Sessions>
<mysql>
# This comment preserves whitespace
db Sessions
host host
passwd passwd
user BAZ
</mysql>
blob-dir /data/Sessions.blobs
cache-local-dir /caches/data_cache/Sessions.cache
cache-local-mb 300
cache-prefix Sessions
commit-lock-timeout 42
keep-history false
name Sessions
pack-gc true
shared-blob-dir false
</relstorage>
compress false
</zlibstorage>
</zodb>"""
self.assertEqual(
expected,
buildout['relstorages_sessions_storage']['client_zcml']
)
def test_parse_override_defaults_part(self):
buildout = self.buildout
buildout['environment'] = {
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
}
Databases(buildout, 'relstorages', {
'storages': 'Sessions',
'pool_size': 13,
'commit_lock_timeout': 42,
'cache_size': 345,
})
expected = """\
<zodb Sessions>
cache-size 345
database-name Sessions
pool-size 13
<zlibstorage Sessions>
<relstorage Sessions>
<mysql>
# This comment preserves whitespace
db Sessions
host host
passwd passwd
user BAZ
</mysql>
blob-dir /data/Sessions.blobs
cache-local-dir /caches/data_cache/Sessions.cache
cache-local-mb 300
cache-prefix Sessions
commit-lock-timeout 42
keep-history false
name Sessions
pack-gc true
shared-blob-dir false
</relstorage>
compress false
</zlibstorage>
</zodb>"""
self.assertEqual(
expected,
buildout['relstorages_sessions_storage']['client_zcml']
)
def test_parse_no_secondary_cache(self):
# No verification, just sees if it runs
buildout = self.buildout
Databases(buildout, 'relstorages',
{'storages': 'Users Users_1 Sessions',
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host',
'enable-persistent-cache': 'true'})
assert_that(buildout['relstorages_users_storage']['client_zcml'],
is_not(contains_string('cache-servers')))
def test_parse_no_secondary_cache_legacy(self):
# No verification, just sees if it runs
buildout = setup_buildout_environment()
buildout['environment'] = {
'sql_user': 'user',
'sql_passwd': 'passwd',
'sql_host': 'host'
}
Databases(buildout, 'relstorages', {
'storages': 'Users Users_1 Sessions',
'enable-persistent-cache': 'true'
})
assert_that(buildout['relstorages_users_storage']['client_zcml'],
is_not(contains_string('cache-servers')))
maxDiff = None
def test_parse_sqlite(self):
buildout = setup_buildout_environment(relstorages_opts={'sql_adapter': 'sqlite3'})
buildout['relstorages_sessions_storage_opts'] = {
'sql_adapter_extra_args': textwrap.dedent(
"""
driver gevent sqlite
<pragmas>
synchronous off
</pragmas>
"""
)
}
Databases(buildout, 'relstorages', {
'storages': 'Users Sessions',
'write-zodbconvert': 'true',
})
self.assertEqual(
buildout['relstorages_opts']['sql_adapter'],
'sqlite3')
self.assertEqual(
buildout['relstorages_users_storage']['sql_adapter'],
'sqlite3'
)
expected = """\
<zodb Users>
cache-size 100000
database-name Users
pool-size 60
<zlibstorage Users>
<relstorage Users>
<sqlite3>
# This comment preserves whitespace
data-dir /data/relstorages_users_storage
</sqlite3>
blob-dir /data/Users.blobs
cache-local-dir /caches/data_cache/Users.cache
cache-local-mb 300
cache-prefix Users
commit-lock-timeout 60
keep-history false
name Users
pack-gc false
shared-blob-dir true
</relstorage>
compress false
</zlibstorage>
</zodb>"""
self.assertEqual(
expected,
buildout['relstorages_users_storage']['client_zcml'],
)
expected = """\
<zodb Sessions>
cache-size 100000
database-name Sessions
pool-size 60
<zlibstorage Sessions>
<relstorage Sessions>
<sqlite3>
# This comment preserves whitespace
data-dir /data/relstorages_sessions_storage
driver gevent sqlite
<pragmas>
synchronous off
</pragmas>
</sqlite3>
blob-dir /data/Sessions.blobs
cache-local-dir /caches/data_cache/Sessions.cache
cache-local-mb 300
cache-prefix Sessions
commit-lock-timeout 60
keep-history false
name Sessions
pack-gc true
shared-blob-dir true
</relstorage>
compress false
</zlibstorage>
</zodb>"""
self.assertEqual(
buildout['relstorages_sessions_storage']['client_zcml'],
expected
)
self.assertEqual(
[x.strip() for x in
buildout['relstorages_sessions_storage']['client_zcml'].splitlines() if x.strip()],
[x.strip() for x in expected.splitlines() if x.strip()])
assert_that(buildout['zodb_conf']['input'],
contains_string('data-dir /data/relstorages_sessions_storage'))
assert_that(buildout['sessions_to_relstorage_conf']['input'],
contains_string('data-dir /data/relstorages_sessions_storage'))
assert_that(buildout['sessions_from_relstorage_conf']['input'],
contains_string('data-dir /data/relstorages_sessions_storage'))
| 30.207477
| 97
| 0.58536
| 1,611
| 16,161
| 5.673495
| 0.113594
| 0.095624
| 0.052079
| 0.060284
| 0.828884
| 0.786652
| 0.745405
| 0.72779
| 0.72779
| 0.702188
| 0
| 0.013571
| 0.306974
| 16,161
| 534
| 98
| 30.264045
| 0.8025
| 0.030939
| 0
| 0.761589
| 0
| 0
| 0.537211
| 0.114636
| 0
| 0
| 0
| 0
| 0.075055
| 1
| 0.02649
| false
| 0.030905
| 0.01766
| 0.002208
| 0.050773
| 0.002208
| 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
|
c6530ec3c1fa6e94107ba9d193115ef424b06e74
| 9,780
|
py
|
Python
|
hopfield.py
|
h-mayorquin/hopfield_sequences
|
ca502821450589abcf195ff25b94c766becc8e6c
|
[
"MIT"
] | null | null | null |
hopfield.py
|
h-mayorquin/hopfield_sequences
|
ca502821450589abcf195ff25b94c766becc8e6c
|
[
"MIT"
] | null | null | null |
hopfield.py
|
h-mayorquin/hopfield_sequences
|
ca502821450589abcf195ff25b94c766becc8e6c
|
[
"MIT"
] | null | null | null |
import numpy as np
import collections
class Hopfield():
"""
The hopfield network in the simplest case of AMIT book in attractor neural network
"""
def __init__(self, n_dim=3, T=0, prng=np.random):
self.prng = prng
self.n_dim = n_dim
self.s = np.sign(prng.normal(size=n_dim))
self.h = np.zeros(n_dim)
# Noise parameters
self.T = T
self.sigma = T / (2 * np.sqrt(2)) # Check page 67 of Amit to see where does this comes from
self.list_of_patterns = None
self.w = None
self.m = None
self.state_distance = None
def train(self, list_of_patterns, normalize=True):
"""
Implements the Hebbian learning rule
:param list_of_patterns: This is a list with the desired parameters for equilibrum
normalize: normalizes the w matrix by its dimension
:return: w the weight matrix.
"""
self.list_of_patterns = list_of_patterns
self.w = np.zeros((self.n_dim, self.n_dim))
for pattern in list_of_patterns:
self.w += np.outer(pattern, pattern)
if normalize:
self.w *= (1.0 / self.n_dim)
# zeros in the diagonal
self.w[np.diag_indices_from(self.w)] = 0
def generate_random_patterns(self, n_store):
list_of_patterns = [np.sign(self.prng.normal(size=self.n_dim)) for i in range(n_store)]
return list_of_patterns
def update_sync(self):
"""
Updates the network state of all the neurons at the same time
"""
if self.sigma < 0.001:
noise = 0
else:
noise = self.prng.normal(0, scale=self.sigma, size=self.n_dim)
# Linear part
self.h = np.dot(self.w, self.s) + noise
# Non-linear part
# self.state = sigmoid_logistic(self.state)
self.s = np.sign(self.h)
def update_async(self):
"""
Updates the network state one neuron at a time
"""
# Generate random number
i = self.prng.randint(self.n_dim, size=1)[0]
# Linear
# self.state = np.dot(self.state, self.w[i, ...])
if self.sigma < 0.001:
noise = 0
else:
noise = self.prng.normal(loc=self.sigma)
self.h[i] = np.dot(self.w[i, ...], self.s) + noise
# Non-linear
self.s[i] = np.sign(self.h[i])
def calculate_overlap(self):
self.m = np.mean(self.s * self.list_of_patterns, axis=1)
return self.m
def calculate_state_distance(self):
"""
Calcualtes the distance between the state and
all the patterns
:return: A state distance vector with the distance between
the actual state of the system and all the stored patterns
"""
self.state_distance = np.ones(len(self.list_of_patterns))
for index, pattern in enumerate(self.list_of_patterns):
self.state_distance[index] = np.linalg.norm(self.s - pattern)
return self.state_distance
class HopfieldSequence():
"""
The hopfield as a sequence
"""
def __init__(self, n_dim=3, tau=10, g_delay=1.0, T=0, prng=np.random):
self.prng = prng
self.n_dim = n_dim
self.tau = tau
self.g_delay = g_delay
self.s = np.sign(prng.normal(size=n_dim))
self.h = np.zeros(n_dim)
# Noise parameters
self.T = T
self.sigma = T / (2 * np.sqrt(2)) # Check page 67 of Amit to see where does this comes from
self.list_of_patterns = None
self.w = None
self.w_delay = None
self.m = None
self.state_distance = None
aux = [np.zeros(n_dim) for i in range(self.tau)]
self.s_history = collections.deque(aux, maxlen=self.tau)
def train(self, list_of_patterns, normalize=True):
"""
Implements the Hebbian learning rule
:param list_of_patterns: This is a list with the desired parameters for equilibrum
normalize: normalizes the w matrix by its dimension
:return: w the weight matrix.
"""
self.list_of_patterns = list_of_patterns
self.w = np.zeros((self.n_dim, self.n_dim))
for pattern in list_of_patterns:
self.w += np.outer(pattern, pattern)
if normalize:
self.w *= (1.0 / self.n_dim)
# zeros in the diagonal
self.w[np.diag_indices_from(self.w)] = 0
def train_delays(self, list_of_patterns, normalize=True):
self.list_of_patterns_sequence = list_of_patterns
self.w_delay = np.zeros((self.n_dim, self.n_dim))
for index in range(len(list_of_patterns) - 1):
pattern1 = list_of_patterns[index + 1]
pattern2 = list_of_patterns[index]
self.w_delay += np.outer(pattern1, pattern2)
if normalize:
self.w_delay *= (1.0 / self.n_dim)
# zeros in the diagonal
self.w_delay[np.diag_indices_from(self.w_delay)] = 0
def generate_random_patterns(self, n_store):
list_of_patterns = [np.sign(self.prng.normal(size=self.n_dim)) for i in range(n_store)]
return list_of_patterns
def update_sync(self):
"""
Updates the network state of all the neurons at the same time
"""
if self.sigma < 0.001:
noise = 0
else:
noise = self.prng.normal(0, scale=self.sigma, size=self.n_dim)
# Linear part
self.h = np.dot(self.w, self.s) + \
self.g_delay * np.dot(self.w_delay, self.s_history.pop()) + noise
# Non-linear part
# self.state = sigmoid_logistic(self.state)
self.s = np.sign(self.h)
self.s_history.appendleft(np.copy(self.s))
def update_async_random_sequence(self):
random_sequence = self.prng.choice(self.n_dim, size=self.n_dim, replace=False)
for i in random_sequence:
self.update_async_one(i)
self.s_history.appendleft(np.copy(self.s))
def update_async(self, i=None):
"""
Updates the network state one neuron at a time
"""
# Generate random number
if i is None:
i = self.prng.randint(self.n_dim, size=1)[0]
if self.sigma < 0.001:
noise = 0
else:
noise = self.prng.normal(loc=self.sigma)
self.h[i] = np.dot(self.w[i, ...], self.s) \
+ self.g_delay * np.dot(self.w_delay[i, ...], self.s_history[-1]) + noise
# Non-linear
self.s[i] = np.sign(self.h[i])
self.s_history.appendleft(np.copy(self.s))
def calculate_overlap(self):
self.m = np.mean(self.s * self.list_of_patterns, axis=1)
return self.m
def calculate_state_distance(self):
"""
Calcualtes the distance between the state and
all the patterns
:return: A state distance vector with the distance between
the actual state of the system and all the stored patterns
"""
self.state_distance = np.ones(len(self.list_of_patterns))
for index, pattern in enumerate(self.list_of_patterns):
self.state_distance[index] = np.linalg.norm(self.s - pattern)
return self.state_distance
class HopfieldDiff():
def __init__(self, n_dim=3, tau_m=20.0, dt=0.1, T=0, prng=np.random):
self.prng = prng
self.tau_m = tau_m
self.dt = dt
self.n_dim = n_dim
self.s = np.sign(prng.normal(size=n_dim))
self.h = np.zeros(n_dim)
# Noise parameters
self.T = T
self.sigma = T / (2 * np.sqrt(2)) # Check page 67 of Amit to see where does this comes from
self.list_of_patterns = None
self.w = None
self.m = None
self.state_distance = None
def train(self, list_of_patterns, normalize=True):
"""
Implements the Hebbian learning rule
:param list_of_patterns: This is a list with the desired parameters for equilibrum
normalize: normalizes the w matrix by its dimension
:return: w the weight matrix.
"""
self.list_of_patterns = list_of_patterns
self.w = np.zeros((self.n_dim, self.n_dim))
for pattern in list_of_patterns:
self.w += np.outer(pattern, pattern)
if normalize:
self.w *= (1.0 / self.n_dim)
# zeros in the diagonal
self.w[np.diag_indices_from(self.w)] = 0
def generate_random_patterns(self, n_store):
list_of_patterns = [np.sign(self.prng.normal(size=self.n_dim)) for i in range(n_store)]
return list_of_patterns
def update(self):
"""
Updates the network state of all the neurons at the same time
"""
if self.sigma < 0.001:
noise = np.zeros(self.n_dim)
else:
noise = self.prng.normal(0, scale=self.sigma, size=self.n_dim)
aux = np.sign(np.dot(self.w, self.s))
self.s += (self.dt / self.tau_m) * (aux - self.s + noise)
def calculate_state_distance(self):
"""
Calcualtes the distance between the state and
all the patterns
:return: A state distance vector with the distance between
the actual state of the system and all the stored patterns
"""
n_patterns = len(self.list_of_patterns)
self.state_distance = np.ones((2, n_patterns))
for index, pattern in enumerate(self.list_of_patterns):
self.state_distance[0, index] = np.linalg.norm(self.s - pattern)
self.state_distance[1, index] = np.linalg.norm(self.s + pattern)
return self.state_distance
def calculate_overlap(self):
self.m = np.mean(self.s * self.list_of_patterns, axis=1)
return self.m
| 29.546828
| 100
| 0.600204
| 1,423
| 9,780
| 3.97681
| 0.104708
| 0.027567
| 0.096483
| 0.063615
| 0.866231
| 0.858986
| 0.843082
| 0.8217
| 0.815692
| 0.805796
| 0
| 0.01205
| 0.295706
| 9,780
| 331
| 101
| 29.546828
| 0.809524
| 0.216871
| 0
| 0.720497
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.136646
| false
| 0
| 0.012422
| 0
| 0.223602
| 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
|
d672d935a24d0c14b46a69a864fcaddfb22f49ee
| 334,406
|
py
|
Python
|
skidl/libs/msp430_sklib.py
|
arjenroodselaar/skidl
|
0bf801bd3b74e6ef94bd9aa1b68eef756b568276
|
[
"MIT"
] | 700
|
2016-08-16T21:12:50.000Z
|
2021-10-10T02:15:18.000Z
|
skidl/libs/msp430_sklib.py
|
0dvictor/skidl
|
458709a10b28a864d25ae2c2b44c6103d4ddb291
|
[
"MIT"
] | 118
|
2016-08-16T20:51:05.000Z
|
2021-10-10T08:07:18.000Z
|
skidl/libs/msp430_sklib.py
|
0dvictor/skidl
|
458709a10b28a864d25ae2c2b44c6103d4ddb291
|
[
"MIT"
] | 94
|
2016-08-25T14:02:28.000Z
|
2021-09-12T05:17:08.000Z
|
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib
SKIDL_lib_version = '0.0.1'
msp430 = SchLib(tool=SKIDL).add_parts(*[
Part(name='MSP430AFE221IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430AFE231IPW', 'MSP430AFE251IPW'],pins=[
Pin(num='1',name='A0.0+',func=Pin.PASSIVE,do_erc=True),
Pin(num='2',name='A0.0-',func=Pin.PASSIVE,do_erc=True),
Pin(num='3',name='(AVSS)',func=Pin.PASSIVE,do_erc=True),
Pin(num='4',name='(AVSS)',func=Pin.PASSIVE,do_erc=True),
Pin(num='5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='6',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='Vref',func=Pin.PASSIVE,do_erc=True),
Pin(num='8',name='(AVSS)',func=Pin.PASSIVE,do_erc=True),
Pin(num='9',name='(AVSS)',func=Pin.PASSIVE,do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='20',name='URXD0/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='21',name='TMS/SVSOUT/SIMO0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA2/SMCLK/TACLK/SVSIN/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TCK/TA2/SOMI0/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='TDI/TDO/TA1/UCLK0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='XT2IN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TCLK/TDI/TA0/STE0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='XT2OUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='17',name='SDCLK/TA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='SD0DO/TA0/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='UTXD0/P1.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430AFE222IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430AFE232IPW', 'MSP430AFE252IPW'],pins=[
Pin(num='1',name='A0.0+',func=Pin.PASSIVE,do_erc=True),
Pin(num='2',name='A0.0-',func=Pin.PASSIVE,do_erc=True),
Pin(num='3',name='A1.0+',func=Pin.PASSIVE,do_erc=True),
Pin(num='4',name='A1.0-',func=Pin.PASSIVE,do_erc=True),
Pin(num='5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='6',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='Vref',func=Pin.PASSIVE,do_erc=True),
Pin(num='8',name='(AVSS)',func=Pin.PASSIVE,do_erc=True),
Pin(num='9',name='(AVSS)',func=Pin.PASSIVE,do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='20',name='URXD0/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='21',name='TMS/SVSOUT/SIMO0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA2/SMCLK/TACLK/SVSIN/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TCK/TA2/SOMI0/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='TDI/TDO/TA1/UCLK0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='XT2IN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TCLK/TDI/TA0/STE0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='XT2OUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='17',name='SDCLK/TA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='SD0DO/TA0/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='SD1DO/UTXD0/P1.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430AFE223IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430AFE233IPW', 'MSP430AFE253IPW'],pins=[
Pin(num='1',name='A0.0+',func=Pin.PASSIVE,do_erc=True),
Pin(num='2',name='A0.0-',func=Pin.PASSIVE,do_erc=True),
Pin(num='3',name='A1.0+',func=Pin.PASSIVE,do_erc=True),
Pin(num='4',name='A1.0-',func=Pin.PASSIVE,do_erc=True),
Pin(num='5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='6',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='Vref',func=Pin.PASSIVE,do_erc=True),
Pin(num='8',name='A2.0+',func=Pin.PASSIVE,do_erc=True),
Pin(num='9',name='A2.0-',func=Pin.PASSIVE,do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='20',name='SD2DO/URXD0/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='21',name='TMS/SVSOUT/SIMO0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA2/SMCLK/TACLK/SVSIN/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TCK/TA2/SOMI0/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='TDI/TDO/TA1/UCLK0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='XT2IN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TCLK/TDI/TA0/STE0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='XT2OUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='17',name='SDCLK/TA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='SD0DO/TA0/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='SD1DO/UTXD0/P1.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1101AIDGV',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin TVSOP, 4KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1111AIDGV', 'MSP430F1121AIDGV'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/CAOUT/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/CA0/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/CA1/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1101AIDW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin SOWB, 4KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1111AIDW', 'MSP430F1121AIDW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/CAOUT/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/CA0/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/CA1/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1101AIPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin TSSOP, 4KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1111AIPW', 'MSP430F1121AIPW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/CAOUT/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/CA0/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/CA1/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1101AIRGE',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin QFN, 4KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1111AIRGE', 'MSP430F1121AIRGE'],pins=[
Pin(num='2',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='4',name='XIN',do_erc=True),
Pin(num='5',name='~RST~/NMI',do_erc=True),
Pin(num='6',name='P2.0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P2.1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.2/CAOUT/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.3/CA0/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.4/CA1/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TEST',do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1122IDW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin SOWB, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1132IDW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/A0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/A1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/A2/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/A3/VREF-/VeREF-/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/A4/VREF+/VeREF+/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1122IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin TSSOP, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1132IPW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/A0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/A1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/A2/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/A3/VREF-/VeREF-/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/A4/VREF+/VeREF+/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1122IRHB',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='32pin QFN, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1132IRHB'],pins=[
Pin(num='1',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='3',name='XIN',do_erc=True),
Pin(num='5',name='~RST~/NMI',do_erc=True),
Pin(num='6',name='P2.0/A0/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P2.1/A1/INCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.2/A2/TA0',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='P2.5/Rosc',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P2.3/A3/VREF-/VeREF-/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.4/A4/VREF+/VeREF+/TA2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TEST',do_erc=True)]),
Part(name='MSP430F1222IDW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='28pin SOWB, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1232IDW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='INCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/VeREF+/VREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/A5/STE0',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/SIMO0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/SOMI0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCLK0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.4/UTXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.5/URXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/VeREF-/VREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1222IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='28pin TSSOP, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1232IPW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='INCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/VeREF+/VREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/A5/STE0',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/SIMO0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/SOMI0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCLK0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.4/UTXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.5/URXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/VeREF-/VREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F1222IRHB',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='32pin QFN, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F1232IRHB'],pins=[
Pin(num='1',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='3',name='XIN',do_erc=True),
Pin(num='5',name='~RST~/NMI',do_erc=True),
Pin(num='6',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='INCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/A5/STE0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/SIMO0',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P3.2/SOMI0',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCLK0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.4/UTXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.5/URXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA1/VeREF-/VREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA2/VeREF+/VREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TEST',do_erc=True)]),
Part(name='MSP430F122IDW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='28pin SOWB, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F123IDW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='ACLK/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='INCLK/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/CAOUT/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/CA1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/STE0',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/SIMO0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/SOMI0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCLK0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.4/UTXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.5/URXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/CA0/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F122IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='28pin TSSOP, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F123IPW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='XIN',do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='ACLK/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='INCLK/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/CAOUT/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/CA1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/STE0',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/SIMO0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/SOMI0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCLK0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.4/UTXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.5/URXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/CA0/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F122IRHB',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='32pin QFN, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F123IRHB'],pins=[
Pin(num='1',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='3',name='XIN',do_erc=True),
Pin(num='5',name='~RST~/NMI',do_erc=True),
Pin(num='6',name='ACLK/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='INCLK/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0/CAOUT/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/STE0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/SIMO0',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P3.2/SOMI0',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCLK0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.4/UTXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.5/URXD0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA1/CA0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA2/CA1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TEST',do_erc=True)]),
Part(name='MSP430F2001IN',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2011IN'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='CA0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA1/TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CA2/TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CA3/CAOUT/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA4/SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA5/TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CA6/TA1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='CA7/CAOUT/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2001IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin TSSOP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2011IPW'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='CA0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA1/TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CA2/TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CA3/CAOUT/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA4/SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA5/TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CA6/TA1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='CA7/CAOUT/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2001IRSA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='16pin QFN, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2011IRSA'],pins=[
Pin(num='1',name='CA0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='CA1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CA3/CAOUT/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CA4/TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA5/TMS/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA6/TDI/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CA7/TDO/TDI/CAOUT/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='TEST/SBWTCK',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='VCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2002IN',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2012IN'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='A0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A1/TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='A2/TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/A3/VREF-/VeREF-/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/A4/VREF+/VeREF+/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0/A5/SCLK/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA1/A6/SDO/SCL/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='A7/SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2002IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin TSSOP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2012IPW'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='A0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A1/TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='A2/TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/A3/VREF-/VeREF-/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/A4/VREF+/VeREF+/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0/A5/SCLK/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA1/A6/SDO/SCL/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='A7/SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2002IRSA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='16pin QFN, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2012IRSA'],pins=[
Pin(num='1',name='A0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='A1/TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A2/TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='ADC10CLK/A3/VREF-/VeREF-/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='SMCLK/A4/VREF+/VeREF+/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TA0/A5/SCLK/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA1/A6/SDO/SCL/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='A7/SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2003IN',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2013IN'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TACLK/ACLK/A0+/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0/A0-/A4+/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA1/A1+/A4-/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='VREF/A1-/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/A2+/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0/A2-/SCLK/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA1/A3+/SDO/SCL/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='A3-/SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2003IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin TSSOP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2013IPW'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TACLK/ACLK/A0+/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0/A0-/A4+/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA1/A1+/A4-/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='VREF/A1-/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/A2+/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0/A2-/SCLK/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA1/A3+/SDO/SCL/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='A3-/SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2003IRSA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='16pin QFN, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2013IRSA'],pins=[
Pin(num='1',name='TACLK/ACLK/A0+/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0/A0-/A4+/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA1/A1+/A4-/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VREF/A1-/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='SMCLK/A2+/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TA0/A2-/SCLK/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA1/A3+/SDO/SCL/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='A3-/SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2101IDGV',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin TVSOP, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2111IDGV', 'MSP430F2121IDGV', 'MSP430F2131IDGV'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/CA5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='P2.7/XOUT/CA7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P2.6/XIN/CA6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/ACLK/CA2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/INCLK/CA3',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/CAOUT/TA0/CA4',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/TA1/CA0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA2/CA1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/TCLK/TDI/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2101IDW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin SOWB, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2111IDW', 'MSP430F2121IDW', 'MSP430F2131IDW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/CA5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='P2.7/XOUT/CA7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P2.6/XIN/CA6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/ACLK/CA2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/INCLK/CA3',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/CAOUT/TA0/CA4',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/TA1/CA0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA2/CA1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/TCLK/TDI/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2101IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin TSSOP, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2111IPW', 'MSP430F2121IPW', 'MSP430F2131IPW'],pins=[
Pin(num='1',name='TEST',do_erc=True),
Pin(num='2',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.5/CA5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='P2.7/XOUT/CA7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P2.6/XIN/CA6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI',do_erc=True),
Pin(num='8',name='P2.0/ACLK/CA2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/INCLK/CA3',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/CAOUT/TA0/CA4',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.3/TA1/CA0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA2/CA1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1/TCLK/TDI/P1.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2101IRGE',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin QFN, 8KB + 256B Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2111IRGE', 'MSP430F2121IRGE', 'MSP430F2131IRGE'],pins=[
Pin(num='2',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='P2.7/XOUT/CA7',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P2.6/XIN/CA6',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='~RST~/NMI',do_erc=True),
Pin(num='6',name='P2.0/ACLK/CA2',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P2.1/INCLK/CA3',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.2/CAOUT/TA0/CA4',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.3/TA1/CA0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA1/TCLK/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P2.4/TA2/CA1',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TEST',do_erc=True),
Pin(num='13',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P2.5/CA5',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2112IPW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='28pin TSSOP, 8KB + 256B Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2122IPW', 'MSP430F2132IPW'],pins=[
Pin(num='1',name='SBWTCK/TEST',do_erc=True),
Pin(num='2',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='CA5/Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='CA7/XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA6/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CA2/ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='CA3/TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='CAOUT/CA4/TA0.0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='CA1/TA0.2/A4/VREF+/VeREF+/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='CAOUT/TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA1.0/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P3.6/A6/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P3.7/A7/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA0.2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='CA0/TA0.1/A3/VREF-/VeREF-/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2112IRHB',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='32pin QFN, 8KB + 256B Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2122IRHB', 'MSP430F2132IRHB'],pins=[
Pin(num='1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='CA7/XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA6/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='~RST~/NMI/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA2/ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA3/TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CAOUT/CA4/TA0.0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='CAOUT/TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA1.0/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='CA5/Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.6/A6/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.7/A7/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='CA0/TA0.1/A3/VREF-/VeREF-/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA0.2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='CA1/TA0.2/A4/VREF+/VeREF+/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F2112IRTV',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='32pin QFN, 8KB + 256B Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2122IRTV', 'MSP430F2132IRTV'],pins=[
Pin(num='1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='CA7/XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA6/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='~RST~/NMI/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA2/ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA3/TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CAOUT/CA4/TA0.0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='CAOUT/TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA1.0/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='CA5/Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P3.6/A6/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P3.7/A7/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='CA0/TA0.1/A3/VREF-/VeREF-/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA0.2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='CA1/TA0.2/A4/VREF+/VeREF+/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F2232IDA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='38pin TSSOP, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2252IDA', 'MSP430F2272IDA'],pins=[
Pin(num='1',name='SBWTCK/TEST',do_erc=True),
Pin(num='2',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.3/TB0/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2/A4/VREF+/VeREF+/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.4/TB1/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.5/TB2/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P4.6/TBOUTH/A15',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TA1/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA1/A3/VREF-/VeREF-/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2232IRHA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='40pin QFN, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2252IRHA', 'MSP430F2272IRHA'],pins=[
Pin(num='1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='6',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.5/TB2/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.6/TBOUTH/A15',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TA1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TA2/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA1/VREF-/VeREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P4.3/TB0/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P4.4/TB1/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='P1.0/TACLK/ADC10CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2232IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='49ball BGA, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2252IYFF', 'MSP430F2272IYFF'],pins=[
Pin(num='A1',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D1',name='SBWTCK/TEST',do_erc=True),
Pin(num='E1',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='A2',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C2',name='ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='TA2/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='G2',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='C3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D3',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E3',name='TA1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='F3',name='TA1/VREF-/VeREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='TA2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D4',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E4',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F4',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C5',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E5',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='B6',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D6',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='F6',name='P4.5/TB2/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C7',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D7',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='P4.3/TB0/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='P4.4/TB1/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='P4.6/TBOUTH/A15',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2234IDA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='38pin TSSOP, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2254IDA', 'MSP430F2274IDA'],pins=[
Pin(num='1',name='SBWTCK/TEST',do_erc=True),
Pin(num='2',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='ACLK/A0/OA0I0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TAINCLK/SMCLK/A1/OA0O/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/A2/OA0I1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.3/TB0/A12/OA0O',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2/A4/VREF+/VeREF+/OA1I0/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.4/TB1/A13/OA1O',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.5/TB2/A14/OA0I3',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P4.6/TBOUTH/A15/OA1I3',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='P3.6/A6/OA0I2',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TA1/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P3.7/A7/OA1I2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA1/A3/VREF-/VeREF-/OA1I1/OA1O/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2234IRHA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='40pin QFN, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2254IRHA', 'MSP430F2274IRHA'],pins=[
Pin(num='1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='~RST~/NMI/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='ACLK/A0/OA0I0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TAINCLK/SMCLK/A1/OA0O/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0/A2/OA0I1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.5/TB2/A14/OA0I3',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.6/TBOUTH/A15/OA1I3',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='P3.6/A6/OA0I2',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TA1/TDI/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='P3.7/A7/OA1I2',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TA2/TDI/TDO/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA1/A3/VREF-/VeREF-/OA1I1/OA1O/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P4.3/TB0/A12/OA0O',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA2/A4/VREF+/VeREF+/OA1I0/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P4.4/TB1/A13/OA1O',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2234IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='49ball BGA, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2254IYFF', 'MSP430F2274IYFF'],pins=[
Pin(num='A1',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D1',name='SBWTCK/TEST',do_erc=True),
Pin(num='E1',name='TA0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='A2',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C2',name='ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='TA2/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='G2',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='C3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D3',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E3',name='TA1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='F3',name='TA1/VREF-/VeREF-/OA1I1/OA1O/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='TA2/VREF+/VeREF+/OA1I0/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='ACLK/A0/OA0I0/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='TAINCLK/SMCLK/OA0O/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D4',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E4',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F4',name='P3.6/A6/OA0I2',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='P3.7/A7/OA1I2',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='TA0/OA0I1/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C5',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E5',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='B6',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D6',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='F6',name='P4.5/TB2/A14/OA0I3',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C7',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D7',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='P4.3/TB0/A12/OA0O',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='P4.4/TB1/A13/OA1O',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='P4.6/TBOUTH/A15/OA1I3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F2330IRHA',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='40pin QFN, 32KB + 256B Flash Memory, 2KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2350IRHA', 'MSP430F2370IRHA'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XIN/CA6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='XOUT/CA7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='P4.4/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='P4.5/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='ACLK/CA2/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='P4.6/TBOUTH/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TAINCLK/CA3/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0/CAOUT/CA4/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TDO/TDI',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA1/CA0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TDI/TCLK',do_erc=True),
Pin(num='16',name='TA2/CA1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TMS',do_erc=True),
Pin(num='17',name='ROSC/CA5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TCK',do_erc=True),
Pin(num='18',name='P3.0/UCB0STE/UCA0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='~RST~/NMI',do_erc=True),
Pin(num='19',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='P4.3/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430F2330IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='49ball BGA, 32KB + 256B Flash Memory, 2KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F2350IYFF', 'MSP430F2370IYFF'],pins=[
Pin(num='A1',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='B1',name='VSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C1',name='TCK',do_erc=True),
Pin(num='D1',name='TDI/TCLK',do_erc=True),
Pin(num='E1',name='TDO/TDI',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='P4.5/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='P4.4/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='A2',name='XIN/CA6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='~RST~/NMI',do_erc=True),
Pin(num='D2',name='TMS',do_erc=True),
Pin(num='E2',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='P4.6/TBOUTH/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='G2',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='XOUT/CA7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='B3',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F3',name='P4.3/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='C5',name='ACLK/CA2/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F5',name='P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='B6',name='TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='TA0/CAOUT/CA4/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='D6',name='TA2/CA1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='P3.0/UCB0STE/UCA0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='F6',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='C7',name='TAINCLK/CA3/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='TA1/CA0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='ROSC/CA5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5217IRGC',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64pin QFN, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5219IRGC'],pins=[
Pin(num='1',name='P6.0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P6.4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P6.5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P6.6/CB6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P6.7/CB7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='DVIO',func=Pin.PWRIN,do_erc=True),
Pin(num='50',name='P7.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='51',name='P7.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='P7.3/TB0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='P7.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='63',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='P7.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='64',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='55',name='BSLEN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='~RST~/NMI',do_erc=True),
Pin(num='17',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='27',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA2CLK/SMCLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='49',name='P7.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='59',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F5217IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64ball BGA, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5219IYFF'],pins=[
Pin(num='A1',name='P6.1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B1',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='P7.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='P7.3/TB0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='P7.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='BSLEN',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='P7.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='G2',name='P7.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='H2',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='P6.7/CB7',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='B3',name='P6.5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P6.3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='E3',name='~RST~/NMI',do_erc=True),
Pin(num='F3',name='P7.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='H3',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='P6.4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='P6.6/CB6',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='SBWTCK/TEST',do_erc=True),
Pin(num='F4',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='C5',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F5',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='H5',name='DVIO',func=Pin.PWRIN,do_erc=True),
Pin(num='A6',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='D6',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='H6',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A7',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='B7',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='C7',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='TA2CLK/SMCLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='C8',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F8',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='G8',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='H8',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5227IRGC',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64pin QFN, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5229IRGC'],pins=[
Pin(num='1',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='DVIO',func=Pin.PWRIN,do_erc=True),
Pin(num='50',name='P7.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='51',name='P7.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='P7.3/TB0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='P7.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='63',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='P7.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='64',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='55',name='BSLEN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='~RST~/NMI',do_erc=True),
Pin(num='17',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='27',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA2CLK/SMCLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='49',name='P7.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='59',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F5227IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64ball BGA, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5229IYFF'],pins=[
Pin(num='A1',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B1',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='P7.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='P7.3/TB0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='P7.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='BSLEN',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='P7.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='G2',name='P7.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='H2',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='B3',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='E3',name='~RST~/NMI',do_erc=True),
Pin(num='F3',name='P7.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='H3',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='SBWTCK/TEST',do_erc=True),
Pin(num='F4',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='C5',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F5',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='H5',name='DVIO',func=Pin.PWRIN,do_erc=True),
Pin(num='A6',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='D6',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='H6',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A7',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='B7',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='C7',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='TA2CLK/SMCLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='C8',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F8',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='G8',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='H8',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5232IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430F2534, 48pin QFN, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5234IRGZ'],pins=[
Pin(num='1',name='P6.3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='10',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='VCORE',func=Pin.PASSIVE,do_erc=True),
Pin(num='22',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P6.0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='~RST~/NMI',do_erc=True),
Pin(num='47',name='P6.1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='P6.2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5237IRGC',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64pin QFN, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5239IRGC'],pins=[
Pin(num='1',name='P6.0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P6.4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P6.5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P6.6/CB6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P6.7/CB7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='50',name='P7.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='51',name='P7.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='P7.3/TB0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='P7.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='63',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='P7.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='64',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='~RST~/NMI',do_erc=True),
Pin(num='17',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='27',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='SMCLK/TA2CLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='49',name='P7.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='59',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F5242IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430F2544, 48pin QFN, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5244IRGZ'],pins=[
Pin(num='1',name='P6.3/A3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.4/A4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.5/A5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='10',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='VCORE',func=Pin.PASSIVE,do_erc=True),
Pin(num='22',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P6.0/A0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='~RST~/NMI',do_erc=True),
Pin(num='47',name='P6.1/A1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='P6.2/A2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1CLK/CBOUT/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5247IRGC',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64pin QFN, 128KB Flash Memory, 8KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5249IRGC'],pins=[
Pin(num='1',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='50',name='P7.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='51',name='P7.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='P7.3/TB0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='P7.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='63',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='P7.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='64',name='~RSTDVCC~/SBWTDIO',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='~RST~/NMI',do_erc=True),
Pin(num='17',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='27',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='SMCLK/TA2CLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='49',name='P7.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='59',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F5304IPT',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin LQFN, 8KB Flash Memory, 6KB RAM',ref_prefix='U',num_units=1,do_erc=True,pins=[
Pin(num='1',name='P6.0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='LDOI',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='LDOO',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5304IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin QFN, 8KB Flash Memory, 6KB RAM',ref_prefix='U',num_units=1,do_erc=True,pins=[
Pin(num='1',name='P6.0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='LDOI',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='LDOO',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5308IPT',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin LQFN, 32KB Flash Memory, 6KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5309IPT', 'MSP430F5310IPT'],pins=[
Pin(num='1',name='P6.0/A0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/A1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/A2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/A3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='LDOI',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='LDOO',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5308IRGC',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64pin QFN, 32KB Flash Memory, 6KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5309IRGC', 'MSP430F5310IRGC'],pins=[
Pin(num='1',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='50',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='LDOI',func=Pin.PWRIN,do_erc=True),
Pin(num='63',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='LDOO',func=Pin.PWROUT,do_erc=True),
Pin(num='64',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='15',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='17',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='SMCLK/TA2CLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='49',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='59',name='SBWTCK/TEST',do_erc=True)]),
Part(name='MSP430F5308IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin QFN, 32KB Flash Memory, 6KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5309IRGZ', 'MSP430F5310IRGZ'],pins=[
Pin(num='1',name='P6.0/A0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/A1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/A2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/A3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='LDOI',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='LDOO',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5308IZQE',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='80ball BGA, 32KB Flash Memory, 6KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5309IZQE', 'MSP430F5310IZQE'],pins=[
Pin(num='A1',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='J1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B2',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='B3',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='D3',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='E3',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F3',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G3',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J3',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='SBWTCK/TEST',do_erc=True),
Pin(num='B4',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='E4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='J4',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='C5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='CBOUT/TA1CLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='H5',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='J5',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='LDOO',func=Pin.PWROUT,do_erc=True),
Pin(num='C6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='D6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G6',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='H6',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='SMCLK/TA2CLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='LDOI',func=Pin.PWRIN,do_erc=True),
Pin(num='C7',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G7',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='B8',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C8',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='H8',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='J8',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B9',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C9',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D9',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='F9',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='G9',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J9',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5333IPZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='100pin VQFP, 256KB Flash Memory, 18KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5335IPZ'],pins=[
Pin(num='1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P7.6/CB10/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P7.7/CB11/A15',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='50',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='70',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='80',name='LDOI',func=Pin.BIDIR,do_erc=True),
Pin(num='90',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='51',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='71',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='81',name='LDOO',func=Pin.BIDIR,do_erc=True),
Pin(num='91',name='TEST/SBWTCK',do_erc=True),
Pin(num='12',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='72',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='92',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='63',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='73',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='83',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='93',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='64',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='74',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='84',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='94',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='35',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='55',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='65',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='75',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='85',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='95',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='ADC12CLK/DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='36',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='66',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='76',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='86',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='96',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='67',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='77',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='87',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='97',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='68',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='88',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='98',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='39',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='49',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='59',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='69',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='79',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='89',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='99',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='100',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5333IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 256KB Flash Memory, 18KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5335IZQW'],pins=[
Pin(num='A1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/CB11/A15',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='ADC12CLK/DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/CB10/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='TEST/SBWTCK',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='LDOO',func=Pin.BIDIR,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='LDOI',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5336IPZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='100pin VQFP, 256KB Flash Memory, 18KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5338IPZ'],pins=[
Pin(num='1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.6/CB6/A6/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.7/CB7/A7/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P7.6/CB10/A14/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P7.7/CB11/A15/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='50',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='60',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='70',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='80',name='LDOI',func=Pin.BIDIR,do_erc=True),
Pin(num='90',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='51',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='61',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='71',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='81',name='LDOO',func=Pin.BIDIR,do_erc=True),
Pin(num='91',name='TEST/SBWTCK',do_erc=True),
Pin(num='12',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='52',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='62',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='72',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='92',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='53',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='63',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='73',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='83',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='93',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='54',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='64',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='74',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='84',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='94',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='35',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='55',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='65',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='75',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='85',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='95',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='ADC12CLK/DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='36',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='56',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='66',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='76',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='86',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='96',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='57',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='67',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='77',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='87',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='97',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='58',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='68',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='88',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='98',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='39',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='49',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='59',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='69',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='79',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='89',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='99',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='100',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5336IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 128KB Flash Memory, 18KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5338IZQW'],pins=[
Pin(num='A1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/CB6/A6/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/CB11/A15/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='ADC12CLK/DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/CB7/A7/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/CB10/A14/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='TEST/SBWTCK',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='LDOO',func=Pin.BIDIR,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='LDOI',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5340IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430F5340, 48pin QFN, 128KB Flash Memory, 10KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5341IRGZ', 'MSP430F5342IRGZ'],pins=[
Pin(num='1',name='P6.3/A3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.4/A4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.5/A5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P5.0/A8/VREF+/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.1/A9/VREF-/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='10',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='41',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='VCORE',func=Pin.PASSIVE,do_erc=True),
Pin(num='22',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='42',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='PM_NONE/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='PM_NONE/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='P5.7/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='47',name='P6.1/A1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='48',name='P6.2/A2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='TA1CLK/CBOUT/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5358IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 512KB Flash Memory, 66KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5359IZQW'],pins=[
Pin(num='A1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/CB6/A6/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/CB11/A15/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='P5.6/ADC12CLK/DMAE0',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2.2/P2MAP2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2.5/P2MAP5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/CB7/A7/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/CB10/A14/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2.1/P2MAP1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2.4/P2MAP4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2.6/P2MAP6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2.7/P2MAP7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='P5.0/VREF+/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='P5.1/VREF-/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2.0/P2MAP0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2.3/P2MAP3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='P1.0/TA0CLK/ACLK',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='P1.1/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='TEST/SBWTCK',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='P1.3/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='P1.2/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='P1.5/TA0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='P1.4/TA0.3',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='P5.7/RTCCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='P1.6/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='P3.0/TA1CLK/CBOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='P1.7/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='P3.4/TA2CLK/SMCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='LDOO',func=Pin.BIDIR,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4/UCB2CLK/UCA2STE',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1/UCB2STE/UCA2CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='P4.0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='P3.6/TA2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='P3.5/TA2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='LDOI',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='P4.2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='P3.7/TA2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6/UCB2SOMI/UCB2SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3/UCA2RXD/UCA2SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='P4.6/TB0.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='P4.5/TB0.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='P4.1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5/UCB2SIMO/UCB2SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2/UCA2TXD/UCA2SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='P4.7/TB0OUTH/SVMOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='P4.4/TB0.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='P4.3/TB0.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5500IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin QFN, 32KB Flash Memory, 4 + 2KB SRAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5501IRGZ', 'MSP430F5502IRGZ', 'MSP430F5503IRGZ'],pins=[
Pin(num='1',name='P6.0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1CLK/CBOUT/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='VBUS',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='VUSB',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.PASSIVE,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='V18',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='PUR',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5504IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin QFN, 32KB Flash Memory, 4 + 2KB SRAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5505IRGZ', 'MSP430F5506IRGZ', 'MSP430F5507IRGZ'],pins=[
Pin(num='1',name='P6.0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1CLK/CBOUT/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='VBUS',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='VUSB',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.PASSIVE,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='V18',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='PUR',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5508IRGZ',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='48pin QFN, 32KB Flash Memory, 4 + 2KB SRAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5509IRGZ', 'MSP430F5510IRGZ'],pins=[
Pin(num='1',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P5.0/A8/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P5.1/A9/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='20',name='TA1CLK/CBOUT/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='21',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='41',name='VBUS',func=Pin.PWRIN,do_erc=True),
Pin(num='12',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='22',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='42',name='VUSB',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='VCORE',func=Pin.PASSIVE,do_erc=True),
Pin(num='23',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='43',name='V18',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='44',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='45',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='46',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='37',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='47',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='38',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='48',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='19',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='PUR',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5524IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='64ball BGA, 128KB Flash Memory, 8 + 2KB SRAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5526IYFF', 'MSP430F5528IYFF'],pins=[
Pin(num='A1',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P5.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='P5.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='VUSB',func=Pin.PWROUT,do_erc=True),
Pin(num='G1',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='A2',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='E2',name='V18',func=Pin.NOCONNECT,do_erc=True),
Pin(num='F2',name='VBUS',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='PUR',func=Pin.BIDIR,do_erc=True),
Pin(num='H2',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='A3',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='B3',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='D3',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='E3',name='SBWTCK/TEST',do_erc=True),
Pin(num='F3',name='P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='PM_UCA1RXD/PM_UCA1SOMI/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='H3',name='PM_UCA1TXD/PM_UCA1SIMO/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='B4',name='P5.0/A8/VREF+/VeREF+',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='PM_UCB1CLK/PM_UCA1STE/P4.3',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='PM_UCB1SOMI/PM_UCB1SCL/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='PM_UCB1SIMO/PM_UCB1SDA/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='P5.4/XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='P5.1/A9/VREF-/VeREF-',func=Pin.BIDIR,do_erc=True),
Pin(num='C5',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='E5',name='TA1.1/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F5',name='PM_UCB1STE/PM_UCA1CLK/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='UCA0RXD/UCA0SOMI/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='H5',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='A6',name='P5.5/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='B6',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='D6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='TA2.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='F6',name='RTCCLK/DMAE0/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='UCA0TXD/UCA0SIMO/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='H6',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='A7',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='B7',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='C7',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='TA1CLK/CBOUT/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='TA2CLK/SMCLK/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='TA2.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='UCB0CLK/UCA0STE/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='UCB0SOMI/UCB0SCL/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='C8',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='TA1.0/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='TA1.2/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F8',name='TA2.1/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='G8',name='UCB0SIMO/UCB0SDA/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H8',name='UCB0STE/UCA0CLK/P2.7',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5630IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 256KB Flash Memory, 16 + 2KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5631IZQW', 'MSP430F5632IZQW'],pins=[
Pin(num='A1',name='P6.4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/CB6',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/CB8',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/CB11',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/CB7',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/CB10',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/CB9',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='SBWTCK/TEST',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='VUSB',func=Pin.BIDIR,do_erc=True),
Pin(num='B9',name='V18',func=Pin.NOCONNECT,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='VBUS',func=Pin.BIDIR,do_erc=True),
Pin(num='B10',name='PUR',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5633IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 256KB Flash Memory, 16 + 2KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5634IZQW', 'MSP430F5635IZQW'],pins=[
Pin(num='A1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/CB6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/CB11/A15',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='ADC12CLK/DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/CB7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/CB10/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='SBWTCK/TEST',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='VUSB',func=Pin.BIDIR,do_erc=True),
Pin(num='B9',name='V18',func=Pin.NOCONNECT,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='VBUS',func=Pin.BIDIR,do_erc=True),
Pin(num='B10',name='PUR',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5636IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 256KB Flash Memory, 16 + 2KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5637IZQW', 'MSP430F5638IZQW'],pins=[
Pin(num='A1',name='P6.4/CB4/A4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/CB6/A6/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/CB8/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/CB11/A15/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='H1',name='ADC12CLK/DMAE0/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/CB2/A2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/CB5/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/CB7/A7/DAC1',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/CB10/A14/DAC0',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/CB1/A1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/CB9/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/CB0/A0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/CB3/A3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='SBWTCK/TEST',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='TA1CLK/CBOUT/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.BIDIR,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='TA2CLK/SMCLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='VUSB',func=Pin.BIDIR,do_erc=True),
Pin(num='B9',name='V18',func=Pin.NOCONNECT,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='VBUS',func=Pin.BIDIR,do_erc=True),
Pin(num='B10',name='PUR',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='TB0OUTH/SVMOUT/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430F5658IZQW',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='113ball BGA, 512KB Flash Memory, 66KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430F5659IZQW'],pins=[
Pin(num='A1',name='P6.4/A4/CB4',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='P6.6/A6/DAC0/CB6',func=Pin.BIDIR,do_erc=True),
Pin(num='C1',name='P7.4/A12/CB8',func=Pin.BIDIR,do_erc=True),
Pin(num='D1',name='P7.7/A15/DAC1/CB11',func=Pin.BIDIR,do_erc=True),
Pin(num='E1',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F1',name='XIN',do_erc=True),
Pin(num='G1',name='XOUT',func=Pin.OUTPUT,do_erc=True),
Pin(num='H1',name='DMAE0/ADC12CLK/P5.6',func=Pin.BIDIR,do_erc=True),
Pin(num='J1',name='P2MAP2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='K1',name='P2MAP5/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L1',name='DVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='M1',name='DVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='A2',name='P6.2/A2/CB2',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='P6.5/A5/CB5',func=Pin.BIDIR,do_erc=True),
Pin(num='C2',name='P6.7/A7/DAC1/CB7',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='P7.6/A14/DAC0/CB10',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='AVCC1',func=Pin.PWRIN,do_erc=True),
Pin(num='F2',name='AVSS1',func=Pin.PWRIN,do_erc=True),
Pin(num='G2',name='AVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H2',name='P2MAP1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J2',name='P2MAP4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='K2',name='P2MAP6/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L2',name='P2MAP7/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='M2',name='VCORE',func=Pin.PWRIN,do_erc=True),
Pin(num='A3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='B3',name='P6.1/A1/CB1',func=Pin.BIDIR,do_erc=True),
Pin(num='C3',name='P7.5/A13/CB9',func=Pin.BIDIR,do_erc=True),
Pin(num='L3',name='P5.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='A4',name='PJ.1/TDI/TCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='P6.0/A0/CB0',func=Pin.BIDIR,do_erc=True),
Pin(num='D4',name='VREF+/VeREF+/P5.0',func=Pin.BIDIR,do_erc=True),
Pin(num='E4',name='VREF-/VeREF-/P5.1',func=Pin.BIDIR,do_erc=True),
Pin(num='F4',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G4',name='P2MAP0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='H4',name='P2MAP3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='L4',name='P5.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M4',name='P5.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='DVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B5',name='PJ.0/TDO',func=Pin.BIDIR,do_erc=True),
Pin(num='D5',name='P6.3/A3/CB3',func=Pin.BIDIR,do_erc=True),
Pin(num='E5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J5',name='P5.5',func=Pin.BIDIR,do_erc=True),
Pin(num='L5',name='ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M5',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='DVCC3',func=Pin.PWRIN,do_erc=True),
Pin(num='B6',name='TEST/SBWTCK',do_erc=True),
Pin(num='D6',name='PJ.3/TCK',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H6',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='J6',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='L6',name='TA0.4/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M6',name='TA0.3/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='VBAK',func=Pin.PASSIVE,do_erc=True),
Pin(num='B7',name='P7.3/XT2OUT',func=Pin.BIDIR,do_erc=True),
Pin(num='D7',name='RTCCLK/P5.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='PJ.2/TMS',func=Pin.BIDIR,do_erc=True),
Pin(num='H7',name='TA1.0/P3.1',func=Pin.BIDIR,do_erc=True),
Pin(num='J7',name='TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L7',name='CBOUT/TA1CLK/P3.0',func=Pin.BIDIR,do_erc=True),
Pin(num='M7',name='TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A8',name='AVSS3',func=Pin.PWRIN,do_erc=True),
Pin(num='B8',name='P7.2/XT2IN',func=Pin.BIDIR,do_erc=True),
Pin(num='D8',name='VBAT',func=Pin.PASSIVE,do_erc=True),
Pin(num='E8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='F8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='G8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='H8',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J8',name='SMCLK/TA2CLK/P3.4',func=Pin.BIDIR,do_erc=True),
Pin(num='L8',name='TA1.2/P3.3',func=Pin.BIDIR,do_erc=True),
Pin(num='M8',name='TA1.1/P3.2',func=Pin.BIDIR,do_erc=True),
Pin(num='A9',name='VUSB',func=Pin.PASSIVE,do_erc=True),
Pin(num='D9',name='P9.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E9',name='P9.4/UCB2CLK/UCA2STE',func=Pin.BIDIR,do_erc=True),
Pin(num='F9',name='P9.1/UCB2STE/UCA2CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='G9',name='P8.6/UCB1SOMI/UCB1SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='H9',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='J9',name='TB0.0/P4.0',func=Pin.BIDIR,do_erc=True),
Pin(num='L9',name='TA2.1/P3.6',func=Pin.BIDIR,do_erc=True),
Pin(num='M9',name='TA2.0/P3.5',func=Pin.BIDIR,do_erc=True),
Pin(num='A10',name='VBUS',func=Pin.PASSIVE,do_erc=True),
Pin(num='B10',name='PUR',func=Pin.BIDIR,do_erc=True),
Pin(num='L10',name='TB0.2/P4.2',func=Pin.BIDIR,do_erc=True),
Pin(num='M10',name='TA2.2/P3.7',func=Pin.BIDIR,do_erc=True),
Pin(num='A11',name='PU.1/DM',func=Pin.BIDIR,do_erc=True),
Pin(num='B11',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C11',name='P9.6/UCB2SOMI/UCB2SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='D11',name='P9.3/UCA2RXD/UCA2SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='E11',name='P9.0',func=Pin.BIDIR,do_erc=True),
Pin(num='F11',name='P8.5/UCB1SIMO/UCB1SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='G11',name='P8.4/UCB1CLK/UCA1STE',func=Pin.BIDIR,do_erc=True),
Pin(num='H11',name='P8.2/UCA1TXD/UCA1SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='J11',name='P8.0/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K11',name='TB0.6/P4.6',func=Pin.BIDIR,do_erc=True),
Pin(num='L11',name='TB0.5/P4.5',func=Pin.BIDIR,do_erc=True),
Pin(num='M11',name='TB0.1/P4.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A12',name='PU.0/DP',func=Pin.BIDIR,do_erc=True),
Pin(num='B12',name='VSSU',func=Pin.PWRIN,do_erc=True),
Pin(num='C12',name='P9.5/UCB2SIMO/UCB2SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='D12',name='P9.2/UCA2TXD/UCA2SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='E12',name='P8.7',func=Pin.BIDIR,do_erc=True),
Pin(num='F12',name='DVCC2',func=Pin.PWRIN,do_erc=True),
Pin(num='G12',name='DVSS2',func=Pin.PWRIN,do_erc=True),
Pin(num='H12',name='P8.3/UCA1RXD/UCA1SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='J12',name='P8.1/UCB1STE/UCA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='K12',name='SVMOUT/TB0OUTH/P4.7',func=Pin.BIDIR,do_erc=True),
Pin(num='L12',name='TB0.4/P4.4',func=Pin.BIDIR,do_erc=True),
Pin(num='M12',name='TB0.3/P4.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430FR5720IRGE',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin QFN, 16KB FRAM Memory, 1KB SRAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430FR5724IRGE', 'MSP430FR5728IRGE', 'MSP430FR5730IRGE', 'MSP430FR5734IRGE', 'MSP430FR5738IRGE'],pins=[
Pin(num='1',name='TA0.1/DMAE0/RTCCLK/CD0/VeREF-/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.2/TA1CLK/CDOUT/CD1/VeREF+/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA1.1/TA0CLK/CDOUT/CD2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA1.2/UCB0STE/CD3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TB0.1/UCA0STE/CD4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TB0.2/UCA0CLK/CD5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='PJ.0/TDO/TB0OUTH/SMCLK/CD6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='PJ.1/TDI/TCLK/MCLK/CD7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='PJ.2/TMS/ACLK/CD8',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='PJ.3/TCK/CD9',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVCC',do_erc=True),
Pin(num='11',name='TEST/SBWTCK',do_erc=True),
Pin(num='21',name='PJ.4/XIN',do_erc=True),
Pin(num='12',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='22',name='PJ.5/XOUT',do_erc=True),
Pin(num='13',name='TB0CLK/UCA0TXD/UCA0SIMO/ACLK/P2.0',do_erc=True),
Pin(num='23',name='AVSS',do_erc=True),
Pin(num='14',name='TB0.0/UCA0RXD/UCA0SOMI/P2.1',do_erc=True),
Pin(num='24',name='AVCC',do_erc=True),
Pin(num='15',name='UCB0CLK/P2.2',do_erc=True),
Pin(num='16',name='TA0.0/UCB0SIMO/UCB0SDA/P1.6',do_erc=True),
Pin(num='17',name='TA1.0/UCB0SOMI/UCB0SCL/P1.7',do_erc=True),
Pin(num='18',name='VCORE',do_erc=True),
Pin(num='19',name='DVSS',do_erc=True)]),
Part(name='MSP430FR5722IRGE',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='24pin QFN, 16KB FRAM Memory, 1KB SRAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430FR5726IRGE', 'MSP430FR5732IRGE', 'MSP430FR5736IRGE'],pins=[
Pin(num='1',name='TA0.1/DMAE0/RTCCLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.2/TA1CLK/CDOUT/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA1.1/TA0CLK/CDOUT/CD2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA1.2/UCB0STE/CD3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TB0.1/UCA0STE/CD4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TB0.2/UCA0CLK/CD5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='PJ.0/TDO/TB0OUTH/SMCLK/CD6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='PJ.1/TDI/TCLK/MCLK/CD7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='PJ.2/TMS/ACLK/CD8',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='PJ.3/TCK/CD9',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVCC',do_erc=True),
Pin(num='11',name='TEST/SBWTCK',do_erc=True),
Pin(num='21',name='PJ.4/XIN',do_erc=True),
Pin(num='12',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='22',name='PJ.5/XOUT',do_erc=True),
Pin(num='13',name='TB0CLK/UCA0TXD/UCA0SIMO/ACLK/P2.0',do_erc=True),
Pin(num='23',name='AVSS',do_erc=True),
Pin(num='14',name='TB0.0/UCA0RXD/UCA0SOMI/P2.1',do_erc=True),
Pin(num='24',name='AVCC',do_erc=True),
Pin(num='15',name='UCB0CLK/P2.2',do_erc=True),
Pin(num='16',name='TA0.0/UCB0SIMO/UCB0SDA/P1.6',do_erc=True),
Pin(num='17',name='TA1.0/UCB0SOMI/UCB0SCL/P1.7',do_erc=True),
Pin(num='18',name='VCORE',do_erc=True),
Pin(num='19',name='DVSS',do_erc=True)]),
Part(name='MSP430G2001IN14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2101IN14', 'MSP430G2201IN14'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0.1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2001IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2201, 14pin TSSOP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2101IPW14', 'MSP430G2201IPW14'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0.1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2001IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2201, 16pin QFN, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2101IRSA16', 'MSP430G2201IRSA16'],pins=[
Pin(num='1',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0.1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2102IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2202IN20', 'MSP430G2302IN20', 'MSP430G2402IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/TCK/TA0.2/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='SDO/SCL/TDI/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2102IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2402, 14pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2202IPW14', 'MSP430G2302IPW14', 'MSP430G2402IPW14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/TCK/TA0.2/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='SDO/SCL/TDI/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2102IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2402, 20pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2202IPW20', 'MSP430G2302IPW20', 'MSP430G2402IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/TCK/TA0.2/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='SDO/SCL/TDI/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2102IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2402, 16pin QFN, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2202IRSA16', 'MSP430G2302IRSA16', 'MSP430G2402IRSA16'],pins=[
Pin(num='1',name='TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/SCLK/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='SDO/SCL/TDI/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='SDI/SDA/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2111IN14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2211IN14'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='CA0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CA2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/ADC10CLK/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA4/SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA5/TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CA6/TA0.1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='CA7/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2111IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2211, 14pin TSSOP, 1KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2211IPW14'],pins=[
Pin(num='1',name='VCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='CA0/TA0CLK/ACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CA1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CA2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/ADC10CLK/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='CA4/SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='CA5/TA0.0/TMS/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='CA6/TA0.1/TDI/TCLK/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='CA7/TDO/TDI/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='VSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2111IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2211, 16pin QFN, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2211IRSA16'],pins=[
Pin(num='1',name='ACLK/TA0CLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TCK/SMCLK/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TDI/TCLK/TA0.1/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDO/TDI/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2112IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2212IN20', 'MSP430G2312IN20', 'MSP430G2412IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/TA0.2/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/SDI/SDA/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2112IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2412, 14pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2212IPW14', 'MSP430G2312IPW14', 'MSP430G2412IPW14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/TA0.2/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDO/TDI/SDI/SDA/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2112IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2412, 20pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2212IPW20', 'MSP430G2312IPW20', 'MSP430G2412IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/TA0.2/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/SDI/SDA/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2112IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2412, 16pin QFN, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2212IRSA16', 'MSP430G2312IRSA16', 'MSP430G2412IRSA16'],pins=[
Pin(num='1',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TCK/SMCLK/TA0.2/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/SCLK/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDO/TDI/SDI/SDA/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2113IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2513, 20pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2213IPW20', 'MSP430G2313IPW20', 'MSP430G2413IPW20', 'MSP430G2513IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='UCA0RXD/UCA0SOMI/TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='UCA0TXD/UCA0SIMO/TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/UCB0CLK/UCA0STE/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/UCB0SOMI/UCB0SCL/TA0.1/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2121IN14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2221IN14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='ACLK/TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/SDO/SCL/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDI/TDO/SDI/SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2121IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2221, 14pin TSSOP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2221IPW14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='ACLK/TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/SDO/SCL/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDI/TDO/SDI/SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2121IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2221, 16pin QFN, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2221IRSA16'],pins=[
Pin(num='1',name='ACLK/TACLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/SCLK/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TDI/SDO/SCL/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/TDO/SDI/SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2131IN14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='14pin PDIP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2231IN14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='ACLK/TACLK/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/SDO/SCL/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDI/TDO/SDI/SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2131IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2231, 14pin PDIP, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2231IPW14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='ACLK/TACLK/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/SDO/SCL/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDI/TDO/SDI/SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2131IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2231, 16pin QFN, 2KB Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2231IRSA16'],pins=[
Pin(num='1',name='ACLK/TACLK/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TCK/SMCLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/SCLK/TA0.0/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TDI/SDO/SCL/TCLK/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/TDO/SDI/SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2132IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2232IN20', 'MSP430G2332IN20', 'MSP430G2432IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='A0/ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='A2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/VREF+/VeREF+/A4/SMCLK/TA0.2/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/A5/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='SDO/SCL/TDI/TCLK/A6/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='SDI/SDA/TDO/TDI/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2132IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2432, 14pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2232IPW14', 'MSP430G2332IPW14', 'MSP430G2432IPW14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='ACLK/A0/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='A2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='SMCLK/TCK/A4/VREF+/VeREF+/TA0.2/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/A5/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='SDO/SCL/TDI/TCLK/A6/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='SDI/SDA/TDO/TDI/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2132IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2432, 20pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2232IPW20', 'MSP430G2332IPW20', 'MSP430G2432IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='A0/ACLK/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='A2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/VREF+/VeREF+/A4/SMCLK/TA0.2/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/A5/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='SDO/SCL/TDI/TCLK/A6/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='SDI/SDA/TDO/TDI/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2132IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2432, 16pin QFN, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2232IRSA16', 'MSP430G2332IRSA16', 'MSP430G2432IRSA16'],pins=[
Pin(num='1',name='ACLK/A0/TA0CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='A1/TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='A2/TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='SMCLK/TCK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/SCLK/A5/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='SDO/SCL/TDI/TCLK/A6/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='SDI/SDA/TDO/TDI/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2152IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2252IN20', 'MSP430G2352IN20', 'MSP430G2452IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/CA1/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/CA2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/CAOUT/CA3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/TA0.2/VREF+/VeREF+/CA4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/CA5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/SDI/SDA/CAOUT/CA7/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2152IPW14',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2452, 14pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2252IPW14', 'MSP430G2352IPW14', 'MSP430G2452IPW14'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/CA1/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/CA2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/CAOUT/CA3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/TA0.2/VREF+/VeREF+/CA4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/CA5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TDO/TDI/SDI/SDA/CAOUT/CA7/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='11',name='SBWTCK/TEST',do_erc=True),
Pin(num='12',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2152IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2452, 20pin TSSOP, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2252IPW20', 'MSP430G2352IPW20', 'MSP430G2452IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/CA1/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/CA2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/CAOUT/CA3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/TA0.2/VREF+/VeREF+/CA4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/SCLK/TA0.0/CA5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/SDO/SCL/CA6/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/SDI/SDA/CAOUT/CA7/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2152IRSA16',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2452, 16pin QFN, 8KB Flash Memory, 256B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2252IRSA16', 'MSP430G2352IRSA16', 'MSP430G2452IRSA16'],pins=[
Pin(num='1',name='TA0CLK/ACLK/A0/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.0/A1/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.1/A2/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='ADC10CLK/CAOUT/VREF-/VeREF-/A3/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TCK/SMCLK/TA0.2/VREF+/VeREF+/A4/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TMS/TA0.0/SCLK/A5/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TDI/TCLK/TA0.1/SDO/SCL/A6/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TDO/TDI/CAOUT/SDI/SDA/A7/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='10',name='SBWTCK/TEST',do_erc=True),
Pin(num='11',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='15',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='16',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2153IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2253IN20', 'MSP430G2353IN20', 'MSP430G2453IN20', 'MSP430G2553IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='UCA0RXD/UCA0SOMI/TA0.0/CA1/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='UCA0TXD/UCA0SIMO/TA0.1/CA2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/VREF-/VeREF-/CA3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/CA4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/UCB0CLK/UCA0STE/TA0.0/CA5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/UCB0SOMI/UCB0SCL/TA0.1/CA6/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/CAOUT/CA7/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2153IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2553, 20pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2253IPW20', 'MSP430G2353IPW20', 'MSP430G2453IPW20', 'MSP430G2553IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='UCA0RXD/UCA0SOMI/TA0.0/CA1/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='UCA0TXD/UCA0SIMO/TA0.1/CA2/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/VREF-/VeREF-/CA3/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/CA4/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/UCB0CLK/UCA0STE/TA0.0/CA5/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/UCB0SOMI/UCB0SCL/TA0.1/CA6/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/CAOUT/CA7/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2153IPW28',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2553, 28pin TQFP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2253IPW28', 'MSP430G2353IPW28', 'MSP430G2453IPW28', 'MSP430G2553IPW28'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/A0/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/A1/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/A2/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/CAOUT/VREF-/VeREF-/A3/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/A4/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/A5/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P3.7/TA1CLK/CAOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/A6/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TDO/TDI/CAOUT/UCB0SIMO/UCB0SDA/A7/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='15',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SBWTCK/TEST',do_erc=True),
Pin(num='16',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2153IRHB32',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2553, 32pin QFN, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2253IRHB32', 'MSP430G2353IRHB32', 'MSP430G2453IRHB32', 'MSP430G2553IRHB32'],pins=[
Pin(num='1',name='TA0.0/UCA0RXD/UCA0SOMI/A1/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.1/UCA0TXD/UCA0SIMO/A2/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='ADC10CLK/CAOUT/VREF-/VeREF-/A3/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/A4/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TMS/TA0.0/UCB0CLK/UCA0STE/A5/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.7/TA1CLK/CAOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/A6/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA0CLK/ACLK/A0/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDO/TDI/CAOUT/UCB0SIMO/UCB0SDA/A7/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='14',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='SBWTCK/TEST',do_erc=True),
Pin(num='15',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='18',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='AVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2203IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 8KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2303IN20', 'MSP430G2403IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2203IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2403, 20pin TSSOP, 8KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2303IPW20', 'MSP430G2403IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2203IPW28',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2403, 28pin TSSOP, 8KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2303IPW28', 'MSP430G2403IPW28'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P3.7/TA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TDO/TDI/UCB0SIMO/UCB0SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='15',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='TEST/SBWTCK',do_erc=True),
Pin(num='16',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2203IRHB32',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2403, 32pin QFN, 8KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2303IRHB32', 'MSP430G2403IRHB32'],pins=[
Pin(num='1',name='TA0.0/UCA0RXD/UCA0SOMI/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.1/UCA0TXD/UCA0SIMO/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TCK/SMCLK/UCB0STE/UCA0CLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TMS/TA0.0/UCB0CLK/UCA0STE/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.7/TA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDO/TDI/UCB0SIMO/UCB0SDA/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='14',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TEST/SBWTCK',do_erc=True),
Pin(num='15',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='18',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='AVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2210ID',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='8pin PDIP, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,do_erc=True,pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='14',name='TA0.1/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True)]),
Part(name='MSP430G2213IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2313IN20', 'MSP430G2413IN20', 'MSP430G2513IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='UCA0RXD/UCA0SOMI/TA0.0/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='UCA0TXD/UCA0SIMO/TA0.1/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/UCB0CLK/UCA0STE/TA0.0/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/UCB0SOMI/UCB0SCL/TA0.1/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/CAOUT/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2213IPW28',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2513, 28pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2313IPW28', 'MSP430G2413IPW28', 'MSP430G2513IPW28'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P3.7/TA1CLK/CAOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TDO/TDI/CAOUT/UCB0SIMO/UCB0SDA/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='15',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='SBWTCK/TEST',do_erc=True),
Pin(num='16',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2213IRHB32',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2513, 32pin QFN, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2313IRHB32', 'MSP430G2413IRHB32', 'MSP430G2513IRHB32'],pins=[
Pin(num='1',name='TA0.0/UCA0RXD/UCA0SOMI/CA1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.1/UCA0TXD/UCA0SIMO/CA2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='CAOUT/CA3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TCK/SMCLK/UCB0STE/UCA0CLK/CA4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TMS/TA0.0/UCB0CLK/UCA0STE/CA5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.7/TA1CLK/CAOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/CA6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA0CLK/ACLK/CA0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDO/TDI/CAOUT/UCB0SIMO/UCB0SDA/CA7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='14',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='SBWTCK/TEST',do_erc=True),
Pin(num='15',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='18',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='AVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2230ID',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='8pin SOIC, 2KB + 256B Flash Memory, 128B RAM',ref_prefix='U',num_units=1,fplist=['SOIC-8*'],do_erc=True,pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0.1/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/SCLK/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='TA0.1/SDO/SCL/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='SDI/SDA/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='7',name='TEST/SBWTCK',do_erc=True)]),
Part(name='MSP430G2233IN20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='20pin PDIP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2333IN20', 'MSP430G2433IN20', 'MSP430G2533IN20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2233IPW20',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2533, 20pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2333IPW20', 'MSP430G2433IPW20', 'MSP430G2533IPW20'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P2.0/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P2.1/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P2.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='P2.3/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P2.4/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P2.5/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='TDO/TDI/UCB0SIMO/UCB0SDA/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='17',name='TEST/SBWTCK',do_erc=True),
Pin(num='18',name='P2.7/XOUT',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P2.6/XIN/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2233IPW28',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2533, 28pin TSSOP, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2333IPW28', 'MSP430G2433IPW28', 'MSP430G2533IPW28'],pins=[
Pin(num='1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='TA0.0/UCA0RXD/UCA0SOMI/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TA0.1/UCA0TXD/UCA0SIMO/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TMS/TA0.0/UCB0CLK/UCA0STE/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P3.7/TA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='TDO/TDI/UCB0SIMO/UCB0SDA/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='15',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='TEST/SBWTCK',do_erc=True),
Pin(num='16',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2233IRHB32',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2533, 32pin QFN, 16KB Flash Memory, 512B RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2333IRHB32', 'MSP430G2433IRHB32', 'MSP430G2533IRHB32'],pins=[
Pin(num='1',name='TA0.0/UCA0RXD/UCA0SOMI/A1/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='2',name='TA0.1/UCA0TXD/UCA0SIMO/A2/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='ADC10CLK/VREF-/VeREF-/A3/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/A4/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='5',name='TMS/TA0.0/UCB0CLK/UCA0STE/A5/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='P3.1/TA1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='P3.0/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TA1.0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA1.1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P3.7/TA1CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='11',name='TA1.1/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='TDI/TCLK/TA0.1/UCB0SOMI/UCB0SCL/A6/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA0CLK/ACLK/CA0/A0/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.2/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='TDO/TDI/UCB0SIMO/UCB0SDA/A7/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.3/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='14',name='P3.4/TA0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='TEST/SBWTCK',do_erc=True),
Pin(num='15',name='TA1.0/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='TA1.2/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='TA0.1/XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='TA1.2/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='18',name='P3.5/TA0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P3.6/TA0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='AVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2444IDA38',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2744, 38pin TSSOP, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2544IDA38', 'MSP430G2744IDA38'],pins=[
Pin(num='1',name='SBWTCK/TEST',do_erc=True),
Pin(num='2',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='Rosc/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='8',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.3/A12/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/A5/UCB0STE/UCA0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.4/A13/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.5/A14/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P4.6/A15/TBOUTH',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA1/VREF-/VeREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2444IRHA40',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430G2744, 40pin QFN, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2544IRHA40', 'MSP430G2744IRHA40'],pins=[
Pin(num='1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='6',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/UCB0STE/UCA0CLK/A5',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.5/TB2/A14',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.6/TBOUTH/A15',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='SMCLK/TCK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA1/VREF-/VeREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P4.3/TB0/A12',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P4.4/TB1/A13',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVCC',func=Pin.PWRIN,do_erc=True)]),
Part(name='MSP430G2444IYFF',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='49ball BGA, 32KB + 256B Flash Memory, 1KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2544IYFF', 'MSP430G2744IYFF'],pins=[
Pin(num='A1',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='B1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C1',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D1',name='SBWTCK/TEST',do_erc=True),
Pin(num='E1',name='TMS/TA0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='F1',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='G1',name='TA2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='A2',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='B2',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C2',name='ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='D2',name='TDO/TDI/TA2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='E2',name='TA1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='F2',name='TACLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='G2',name='TA0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='A3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='B3',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='C3',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D3',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E3',name='TDI/TCLK/TA1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='F3',name='TA1/VREF-/VeREF-/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='G3',name='TA2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='A4',name='ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='B4',name='TAINCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='C4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D4',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E4',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F4',name='P3.6/A6',func=Pin.BIDIR,do_erc=True),
Pin(num='G4',name='P3.7/A7',func=Pin.BIDIR,do_erc=True),
Pin(num='A5',name='TA0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='B5',name='P3.0/A5/UCB0STE/UCA0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='C5',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='D5',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='E5',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='F5',name='P4.7/TBCLK',func=Pin.BIDIR,do_erc=True),
Pin(num='G5',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='A6',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='B6',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='C6',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D6',name='P4.0/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='E6',name='P4.2/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='F6',name='P4.5/A14/TB2',func=Pin.BIDIR,do_erc=True),
Pin(num='G6',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='A7',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='B7',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='C7',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='D7',name='P4.1/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='E7',name='P4.3/A12/TB0',func=Pin.BIDIR,do_erc=True),
Pin(num='F7',name='P4.4/A13/TB1',func=Pin.BIDIR,do_erc=True),
Pin(num='G7',name='P4.6/A15/TBOUTH',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2755IDA38',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430F2955, 38pin TSSOP, 56KB Flash Memory, 4KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2855IDA38', 'MSP430G2955IDA38'],pins=[
Pin(num='1',name='SBWTCK/TEST',do_erc=True),
Pin(num='2',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='TA1.0/ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='6',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='8',name='TA1CLK/ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='TA0INCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='TA0.0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.3/A12/CA3/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA0.2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.0/A5/UCB0STE/UCA0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.4/A13/CA4/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA0CLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.5/A14/CA5/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='23',name='P4.6/A15/CA6/TB0OUTH',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='24',name='P4.7/CA7/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='25',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='26',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TMS/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.0/CA0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='P3.6/A6/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='TDI/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='18',name='P4.1/CA1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='P3.7/A7/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='TDO/TDI/TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='19',name='P4.2/CA2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA0.1/VREF−/VeREF−/A3/P2.3',func=Pin.BIDIR,do_erc=True)]),
Part(name='MSP430G2755IRHA40',dest=TEMPLATE,tool=SKIDL,keywords='MSP430 MIXED SIGNAL MICROCONTROLLER',description='MSP430F2955, 40pin QFN, 56KB Flash Memory, 4KB RAM',ref_prefix='U',num_units=1,do_erc=True,aliases=['MSP430G2855IRHA40', 'MSP430G2955IRHA40'],pins=[
Pin(num='1',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='XOUT/P2.7',func=Pin.BIDIR,do_erc=True),
Pin(num='3',name='XIN/P2.6',func=Pin.BIDIR,do_erc=True),
Pin(num='4',name='DVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='5',name='~RST~/NMI/SBWTDIO',do_erc=True),
Pin(num='6',name='TA1CLK/ACLK/A0/P2.0',func=Pin.BIDIR,do_erc=True),
Pin(num='7',name='TA0INCLK/SMCLK/A1/P2.1',func=Pin.BIDIR,do_erc=True),
Pin(num='8',name='TA0.0/A2/P2.2',func=Pin.BIDIR,do_erc=True),
Pin(num='9',name='P3.0/A5/UCB0STE/UCA0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='10',name='P3.1/UCB0SIMO/UCB0SDA',func=Pin.BIDIR,do_erc=True),
Pin(num='20',name='P4.5/A14/CA5/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='30',name='TA0.0/P1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='40',name='TA1.0/ROSC/P2.5',func=Pin.BIDIR,do_erc=True),
Pin(num='11',name='P3.2/UCB0SOMI/UCB0SCL',func=Pin.BIDIR,do_erc=True),
Pin(num='21',name='P4.6/A15/CA6/TB0OUTH',func=Pin.BIDIR,do_erc=True),
Pin(num='31',name='TA0.1/P1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='12',name='P3.3/UCB0CLK/UCA0STE',func=Pin.BIDIR,do_erc=True),
Pin(num='22',name='P4.7/CA7/TB0CLK',func=Pin.BIDIR,do_erc=True),
Pin(num='32',name='TA0.2/P1.3',func=Pin.BIDIR,do_erc=True),
Pin(num='13',name='AVSS',func=Pin.PWRIN,do_erc=True),
Pin(num='23',name='P3.4/UCA0TXD/UCA0SIMO',func=Pin.BIDIR,do_erc=True),
Pin(num='33',name='TCK/SMCLK/P1.4',func=Pin.BIDIR,do_erc=True),
Pin(num='14',name='AVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='24',name='P3.5/UCA0RXD/UCA0SOMI',func=Pin.BIDIR,do_erc=True),
Pin(num='34',name='TMS/TA0.0/P1.5',func=Pin.BIDIR,do_erc=True),
Pin(num='15',name='P4.0/CA0/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='25',name='P3.6/A6/TA1.1',func=Pin.BIDIR,do_erc=True),
Pin(num='35',name='TDI/TA0.1/P1.6',func=Pin.BIDIR,do_erc=True),
Pin(num='16',name='P4.1/CA1/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='26',name='P3.7/A6/TA1.2',func=Pin.BIDIR,do_erc=True),
Pin(num='36',name='TDO/TDI/TA0.2/P1.7',func=Pin.BIDIR,do_erc=True),
Pin(num='17',name='P4.2/CA2/TB0.2',func=Pin.BIDIR,do_erc=True),
Pin(num='27',name='TA0.1/VREF−/VeREF−/A3/P2.3',func=Pin.BIDIR,do_erc=True),
Pin(num='37',name='SBWTCK/TEST',do_erc=True),
Pin(num='18',name='P4.3/A12/CA3/TB0.0',func=Pin.BIDIR,do_erc=True),
Pin(num='28',name='TA0.2/VREF+/VeREF+/A4/P2.4',func=Pin.BIDIR,do_erc=True),
Pin(num='38',name='DVCC',func=Pin.PWRIN,do_erc=True),
Pin(num='19',name='P4.4/A13/CA4/TB0.1',func=Pin.BIDIR,do_erc=True),
Pin(num='29',name='TA0CLK/ADC10CLK/P1.0',func=Pin.BIDIR,do_erc=True),
Pin(num='39',name='DVCC',func=Pin.PWRIN,do_erc=True)])])
| 78.223626
| 315
| 0.602035
| 58,980
| 334,406
| 3.332859
| 0.015022
| 0.108586
| 0.195455
| 0.245834
| 0.968836
| 0.968485
| 0.968154
| 0.967264
| 0.965392
| 0.964268
| 0
| 0.078714
| 0.16858
| 334,406
| 4,274
| 316
| 78.241928
| 0.628284
| 0
| 0
| 0.814841
| 0
| 0
| 0.218133
| 0.047957
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.007257
| 0.000234
| 0
| 0.000234
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
d68f03f56ad519c4aa6b74951dc4b7d0ef9592e5
| 13,041
|
py
|
Python
|
src/genie/libs/parser/junos/tests/ShowChassisPower/cli/equal/golden_output_expected.py
|
balmasea/genieparser
|
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
|
[
"Apache-2.0"
] | 204
|
2018-06-27T00:55:27.000Z
|
2022-03-06T21:12:18.000Z
|
src/genie/libs/parser/junos/tests/ShowChassisPower/cli/equal/golden_output_expected.py
|
balmasea/genieparser
|
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
|
[
"Apache-2.0"
] | 468
|
2018-06-19T00:33:18.000Z
|
2022-03-31T23:23:35.000Z
|
src/genie/libs/parser/junos/tests/ShowChassisPower/cli/equal/golden_output_expected.py
|
balmasea/genieparser
|
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
|
[
"Apache-2.0"
] | 309
|
2019-01-16T20:21:07.000Z
|
2022-03-30T12:56:41.000Z
|
expected_output = {
'power-usage-information': {
'power-usage-item': [
{
'name': 'PSM 0',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '489.25',
'str-zone': 'Lower',
'str-dc-current': '9.50',
'str-dc-voltage': '51.50',
'str-dc-load': '23.30'
}
}, {
'name': 'PSM 1',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '489.25',
'str-zone': 'Lower',
'str-dc-current': '9.50',
'str-dc-voltage': '51.50',
'str-dc-load': '23.30'
}
}, {
'name': 'PSM 2',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '504.56',
'str-zone': 'Lower',
'str-dc-current': '9.75',
'str-dc-voltage': '51.75',
'str-dc-load': '24.03'
}
}, {
'name': 'PSM 3',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '491.62',
'str-zone': 'Lower',
'str-dc-current': '9.50',
'str-dc-voltage': '51.75',
'str-dc-load': '23.41'
}
}, {
'name': 'PSM 4',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Lower',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 5',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Lower',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 6',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Lower',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 7',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Lower',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 8',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Lower',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 9',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '309.00',
'str-zone': 'Upper',
'str-dc-current': '6.00',
'str-dc-voltage': '51.50',
'str-dc-load': '14.71'
}
}, {
'name': 'PSM 10',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '307.50',
'str-zone': 'Upper',
'str-dc-current': '6.00',
'str-dc-voltage': '51.25',
'str-dc-load': '14.64'
}
}, {
'name': 'PSM 11',
'state': 'Online',
'dc-input-detail2': {
'dc-input-status':
'OK (INP0 feed expected, INP0 feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '309.00',
'str-zone': 'Upper',
'str-dc-current': '6.00',
'str-dc-voltage': '51.50',
'str-dc-load': '14.71'
}
}, {
'name': 'PSM 12',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Upper',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 13',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Upper',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 14',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Upper',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 15',
'state': 'Unknown',
'dc-input-detail2': {
'dc-input-status': 'Not ready'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Upper',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 16',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Upper',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}, {
'name': 'PSM 17',
'state': 'Present',
'dc-input-detail2': {
'dc-input-status':
'Check (No feed expected, No feed connected)'
},
'pem-capacity-detail': {
'capacity-actual': '2100',
'capacity-max': '2500'
},
'dc-output-detail2': {
'str-dc-power': '0.00',
'str-zone': 'Upper',
'str-dc-current': '0.00',
'str-dc-voltage': '0.00',
'str-dc-load': '0.00'
}
}
],
'power-usage-system': {
'power-usage-zone-information': [{
'str-zone': 'Upper',
'capacity-actual': '6300',
'capacity-max': '7500',
'capacity-allocated': '3332',
'capacity-remaining': '2968',
'capacity-actual-usage': '925.50'
}, {
'str-zone': 'Lower',
'capacity-actual': '8400',
'capacity-max': '10000',
'capacity-allocated': '6294',
'capacity-remaining': '2106',
'capacity-actual-usage': '1974.69'
}],
'capacity-sys-actual':
'14700',
'capacity-sys-max':
'17500',
'capacity-sys-remaining':
'5074'
}
}
}
| 36.838983
| 66
| 0.323902
| 1,016
| 13,041
| 4.156496
| 0.091535
| 0.085247
| 0.046886
| 0.041677
| 0.883258
| 0.883258
| 0.876865
| 0.870945
| 0.86242
| 0.86242
| 0
| 0.083896
| 0.522889
| 13,041
| 353
| 67
| 36.943343
| 0.594825
| 0
| 0
| 0.688385
| 0
| 0
| 0.370064
| 0.008818
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
d6981c0625c3487f178fcc8ada4d7286e1cdcf0d
| 12,317
|
py
|
Python
|
tests/integration/commands/test_transfer.py
|
real-digital/esque
|
0b779fc308ce8bce45c1903f36c33664b2e832e7
|
[
"MIT"
] | 29
|
2019-05-10T21:12:38.000Z
|
2021-08-24T08:09:49.000Z
|
tests/integration/commands/test_transfer.py
|
real-digital/esque
|
0b779fc308ce8bce45c1903f36c33664b2e832e7
|
[
"MIT"
] | 103
|
2019-05-17T07:21:41.000Z
|
2021-12-02T08:29:00.000Z
|
tests/integration/commands/test_transfer.py
|
real-digital/esque
|
0b779fc308ce8bce45c1903f36c33664b2e832e7
|
[
"MIT"
] | 2
|
2019-05-28T06:45:14.000Z
|
2019-11-21T00:33:15.000Z
|
import time
from typing import Tuple
import pytest
from click.testing import CliRunner
from confluent_kafka.avro import AvroConsumer, AvroProducer
from confluent_kafka.cimpl import Consumer
from confluent_kafka.cimpl import Producer as ConfluentProducer
from confluent_kafka.cimpl import TopicPartition
from pytest_cases import fixture
from esque.cli.commands import esque
from esque.config import Config
from tests.utils import (
produce_avro_test_messages,
produce_binary_test_messages,
produce_text_test_messages,
produce_text_test_messages_with_headers,
)
@fixture
def target_topic_consumer(unittest_config: Config, target_topic: Tuple[str, int]) -> Consumer:
consumer = Consumer(
{
"group.id": "asdf",
"enable.auto.commit": False,
"enable.partition.eof": False,
**unittest_config.create_confluent_config(),
}
)
consumer.assign([TopicPartition(topic=target_topic[0], partition=i, offset=0) for i in range(target_topic[1])])
yield consumer
consumer.close()
@fixture
def target_topic_avro_consumer(unittest_config: Config, target_topic: Tuple[str, int]) -> AvroConsumer:
consumer = AvroConsumer(
{
"group.id": "asdf",
"enable.auto.commit": False,
"enable.partition.eof": False,
**unittest_config.create_confluent_config(include_schema_registry=True),
}
)
consumer.assign([TopicPartition(topic=target_topic[0], partition=i, offset=0) for i in range(target_topic[1])])
yield consumer
consumer.close()
@pytest.mark.integration
def test_transfer_plain_text_message_using_cli_pipe(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
):
expected_messages = produce_text_test_messages(topic_name=source_topic[0], producer=producer)
result1 = non_interactive_cli_runner.invoke(
esque, args=["consume", "--stdout", "--number", "10", source_topic[0]], catch_exceptions=False
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "--stdin", target_topic[0]], input=result1.output, catch_exceptions=False
)
actual_messages = {
(msg.key().decode(), msg.value().decode(), msg.partition())
for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_plain_text_message_with_headers_using_cli_pipe(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
):
expected_messages = produce_text_test_messages_with_headers(topic_name=source_topic[0], producer=producer)
result1 = non_interactive_cli_runner.invoke(
esque, args=["consume", "--stdout", "--number", "10", source_topic[0]], catch_exceptions=False
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "--stdin", target_topic[0]], input=result1.output, catch_exceptions=False
)
actual_messages = {
(msg.key().decode(), msg.value().decode(), msg.partition(), tuple(msg.headers() or []))
for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition, tuple(msg.headers)) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_binary_message_using_cli_pipe(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner,
):
expected_messages = produce_binary_test_messages(topic_name=source_topic[0], producer=producer)
result1 = non_interactive_cli_runner.invoke(
esque, args=["consume", "--stdout", "--binary", "--number", "10", source_topic[0]], catch_exceptions=False
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "--stdin", "--binary", target_topic[0]], input=result1.output, catch_exceptions=False
)
actual_messages = {
(msg.key(), msg.value(), msg.partition()) for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_plain_text_message_using_file(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
tmpdir_factory,
):
output_directory = tmpdir_factory.mktemp("output_directory")
expected_messages = produce_text_test_messages(topic_name=source_topic[0], producer=producer)
non_interactive_cli_runner.invoke(
esque, args=["consume", "-d", str(output_directory), "--number", "10", source_topic[0]], catch_exceptions=False
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "-d", str(output_directory), target_topic[0]], catch_exceptions=False
)
actual_messages = {
(msg.key().decode(), msg.value().decode(), msg.partition())
for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_plain_text_message_with_headers_using_file(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
tmpdir_factory,
):
output_directory = tmpdir_factory.mktemp("output_directory")
expected_messages = produce_text_test_messages_with_headers(topic_name=source_topic[0], producer=producer)
non_interactive_cli_runner.invoke(
esque, args=["consume", "-d", str(output_directory), "--number", "10", source_topic[0]], catch_exceptions=False
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "-d", str(output_directory), target_topic[0]], catch_exceptions=False
)
actual_messages = {
(msg.key().decode(), msg.value().decode(), msg.partition(), tuple((msg.headers() or [])))
for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition, tuple(msg.headers)) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_binary_message_using_file(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
tmpdir_factory,
):
output_directory = tmpdir_factory.mktemp("output_directory")
expected_messages = produce_binary_test_messages(topic_name=source_topic[0], producer=producer)
non_interactive_cli_runner.invoke(
esque,
args=["consume", "-d", str(output_directory), "--binary", "--number", "10", source_topic[0]],
catch_exceptions=False,
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "-d", str(output_directory), "--binary", target_topic[0]], catch_exceptions=False
)
actual_messages = {
(msg.key(), msg.value(), msg.partition()) for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_avro_message_using_file(
avro_producer: AvroProducer,
target_topic_avro_consumer: AvroConsumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
tmpdir_factory,
):
output_directory = tmpdir_factory.mktemp("output_directory")
expected_messages = produce_avro_test_messages(topic_name=source_topic[0], avro_producer=avro_producer)
non_interactive_cli_runner.invoke(
esque,
args=["consume", "-d", str(output_directory), "--avro", "--number", "10", source_topic[0]],
catch_exceptions=False,
)
non_interactive_cli_runner.invoke(
esque, args=["produce", "-d", str(output_directory), "--avro", target_topic[0]], catch_exceptions=False
)
actual_messages = set()
start = time.monotonic()
while len(actual_messages) < 10:
msg = target_topic_avro_consumer.poll(timeout=2)
if msg is not None:
actual_messages.add((msg.key()["key"], msg.value()["value"], msg.partition()))
elif time.monotonic() - start >= 20:
raise TimeoutError("Timeout reading data from topic")
expected_messages = {(msg.key["key"], msg.value["value"], msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_avro_with_single_command(
avro_producer: AvroProducer,
target_topic_avro_consumer: AvroConsumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
):
expected_messages = produce_avro_test_messages(topic_name=source_topic[0], avro_producer=avro_producer)
non_interactive_cli_runner.invoke(
esque,
args=[
"transfer",
"--from-topic",
source_topic[0],
"--to-topic",
target_topic[0],
"--avro",
"--number",
"10",
"--first",
],
catch_exceptions=False,
)
actual_messages = set()
start = time.monotonic()
while len(actual_messages) < 10:
msg = target_topic_avro_consumer.poll(timeout=2)
if msg is not None:
actual_messages.add((msg.key()["key"], msg.value()["value"], msg.partition()))
elif time.monotonic() - start >= 20:
raise TimeoutError("Timeout reading data from topic")
expected_messages = {(msg.key["key"], msg.value["value"], msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_binary_with_single_command(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
):
expected_messages = produce_binary_test_messages(topic_name=source_topic[0], producer=producer)
non_interactive_cli_runner.invoke(
esque,
args=[
"transfer",
"--from-topic",
source_topic[0],
"--to-topic",
target_topic[0],
"--binary",
"--number",
"10",
"--first",
],
catch_exceptions=False,
)
actual_messages = {
(msg.key(), msg.value(), msg.partition()) for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
@pytest.mark.integration
def test_transfer_plain_with_single_command(
producer: ConfluentProducer,
target_topic_consumer: Consumer,
source_topic: Tuple[str, int],
target_topic: Tuple[str, int],
non_interactive_cli_runner: CliRunner,
):
expected_messages = produce_text_test_messages_with_headers(topic_name=source_topic[0], producer=producer)
non_interactive_cli_runner.invoke(
esque,
args=["transfer", "--from-topic", source_topic[0], "--to-topic", target_topic[0], "--number", "10", "--first"],
catch_exceptions=False,
)
actual_messages = {
(msg.key().decode(), msg.value().decode(), msg.partition())
for msg in target_topic_consumer.consume(10, timeout=20)
}
expected_messages = {(msg.key, msg.value, msg.partition) for msg in expected_messages}
assert expected_messages == actual_messages
| 36.767164
| 119
| 0.697978
| 1,477
| 12,317
| 5.52742
| 0.085308
| 0.064674
| 0.056222
| 0.076066
| 0.942185
| 0.927242
| 0.923934
| 0.91879
| 0.915728
| 0.903479
| 0
| 0.010344
| 0.18373
| 12,317
| 334
| 120
| 36.877246
| 0.801671
| 0
| 0
| 0.735192
| 0
| 0
| 0.055695
| 0
| 0
| 0
| 0
| 0
| 0.034843
| 1
| 0.041812
| false
| 0
| 0.041812
| 0
| 0.083624
| 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
|
d6dbd79fa4f2fa2158206baf21b2d85a969a955a
| 911
|
py
|
Python
|
Algorithms/sectorR7/1.py
|
sa501428/playground
|
26c4145e6afed1fbf12031ef9b7404e92b48d16d
|
[
"MIT"
] | null | null | null |
Algorithms/sectorR7/1.py
|
sa501428/playground
|
26c4145e6afed1fbf12031ef9b7404e92b48d16d
|
[
"MIT"
] | null | null | null |
Algorithms/sectorR7/1.py
|
sa501428/playground
|
26c4145e6afed1fbf12031ef9b7404e92b48d16d
|
[
"MIT"
] | null | null | null |
#
from collections import Counter
z = 'AACTGTACACCCAAGTCATTTGTCAACCTGGCCCTCACTAACTGAGGGCCAACAGCCACGTCCAACTGACACTCGTTGATGCCCTGCTCTGAACATGGTTAGGGGCCCTGAGCTGATCGGTCCTCGTTCTCGCGAACTGGAACCTAAGAATTGTCCCTTTGACCATATTGCTGGGGAGCGTGATTTCATCTTAGAAGTATAGATAAAGACTAACTTTCGTCTTGCACAGCGAGCTGTCTAACGCGCTACTCGAGACAAGATAGATAATTCCTAGAGTTCCTGTATAAAATGCAACAGCGCTCGGTAACATACCCCTTAATGCATGCGTCGGGCAGACGATCCTAGGACTATTATTCCACGAAAGTGTAGGTCCTGTCTACTGGTTATATTGCGTAGACCTGCGACTCCTCATTTGGCTCAAATGGTGTGTAGAACTTTCAGAGTATAGATTCGGCGTGTAGGTAAACTAATATCACCCCGATTCACTCTCACTAATTAACGGTCGTCAGTTGACCACTGTCGCGACATAAGGTCGTGATACACCCACGTTCTGGCACGTCGCTTGTGACTCCCATCGCCTCTTACGGCTGATTTGAATGGGCGTTAAGGCCCCGTTGGCACATGGACAGGTTCTTGAACTCTCCCAATGCCACTAAGTGTATACGCGTTTTCCCATACGCCCGGGATTCACCGTTCCTTATCAGCGCAGGGCGAACACTAGGGCAACGGTTATATGCCTTTGAGGTCAAGGGGATATACAAGTAACCTCTCTCGACCACTAGTATCCGTGACGTGCCGAGCTGATCGTTCTTAAATTAGGCTCTTGCTCACCTAGACGGAATACCTACCGC'
print Counter(z)
| 130.142857
| 857
| 0.980241
| 9
| 911
| 99.222222
| 0.777778
| 0.017917
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013172
| 911
| 6
| 858
| 151.833333
| 0.993326
| 0
| 0
| 0
| 0
| 0
| 0.935165
| 0.935165
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 0.333333
| 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
| 1
| 1
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 9
|
d6f83f64d29f5262babe5d244d6066a8cb2100ed
| 147
|
py
|
Python
|
NodeDefender/mqtt/command/icpe/sys/__init__.py
|
CTSNE/NodeDefender
|
24e19f53a27d3b53e599cba8b1448f8f16c0bd5e
|
[
"MIT"
] | 4
|
2016-09-23T17:51:05.000Z
|
2017-03-14T02:52:26.000Z
|
NodeDefender/mqtt/command/icpe/sys/__init__.py
|
CTSNE/NodeDefender
|
24e19f53a27d3b53e599cba8b1448f8f16c0bd5e
|
[
"MIT"
] | 1
|
2016-09-22T11:32:33.000Z
|
2017-11-14T10:00:24.000Z
|
NodeDefender/mqtt/command/icpe/sys/__init__.py
|
CTSNE/NodeDefender
|
24e19f53a27d3b53e599cba8b1448f8f16c0bd5e
|
[
"MIT"
] | 4
|
2016-10-09T19:05:16.000Z
|
2020-05-14T04:00:30.000Z
|
import NodeDefender.mqtt.command.icpe.sys.network
import NodeDefender.mqtt.command.icpe.sys.info
import NodeDefender.mqtt.command.icpe.sys.service
| 36.75
| 49
| 0.857143
| 21
| 147
| 6
| 0.428571
| 0.428571
| 0.52381
| 0.690476
| 0.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0.040816
| 147
| 3
| 50
| 49
| 0.893617
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 9
|
ba3be962d6456c3da31d8a774c7cc88bf4a0b584
| 130
|
py
|
Python
|
algorithm/common/prediction.py
|
pitpalac36/Fraud-Detector
|
463a737da9b2c11a5c7bd11f5a5ecbc5586d80e7
|
[
"MIT"
] | null | null | null |
algorithm/common/prediction.py
|
pitpalac36/Fraud-Detector
|
463a737da9b2c11a5c7bd11f5a5ecbc5586d80e7
|
[
"MIT"
] | null | null | null |
algorithm/common/prediction.py
|
pitpalac36/Fraud-Detector
|
463a737da9b2c11a5c7bd11f5a5ecbc5586d80e7
|
[
"MIT"
] | null | null | null |
def predict(lr, sample):
return lr.predict(sample.reshape(1, -1))
def predict2(lr, sample):
return lr.predict([sample])
| 18.571429
| 44
| 0.676923
| 19
| 130
| 4.631579
| 0.421053
| 0.181818
| 0.318182
| 0.363636
| 0.659091
| 0.659091
| 0
| 0
| 0
| 0
| 0
| 0.027523
| 0.161538
| 130
| 6
| 45
| 21.666667
| 0.779817
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 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
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
ba7d190dc2f433b116b955c83f53fb206725642e
| 1,447
|
py
|
Python
|
forms/migrations/0057_add_monitor_code.py
|
CodeForAfrica/gmmp
|
d7ffe2dac16bd57e81bb3555ddea9df1fe7e9ebf
|
[
"Apache-2.0"
] | 4
|
2020-01-05T09:14:19.000Z
|
2022-02-17T03:22:09.000Z
|
forms/migrations/0057_add_monitor_code.py
|
CodeForAfrica/gmmp
|
d7ffe2dac16bd57e81bb3555ddea9df1fe7e9ebf
|
[
"Apache-2.0"
] | 68
|
2019-12-23T02:19:55.000Z
|
2021-04-23T06:13:36.000Z
|
forms/migrations/0057_add_monitor_code.py
|
CodeForAfrica/gmmp
|
d7ffe2dac16bd57e81bb3555ddea9df1fe7e9ebf
|
[
"Apache-2.0"
] | 2
|
2020-11-07T12:23:21.000Z
|
2021-11-07T18:21:31.000Z
|
# Generated by Django 2.2.16 on 2020-09-17 11:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forms', '0056_allow_blank_and_none'),
]
operations = [
migrations.AddField(
model_name='internetnewssheet',
name='monitor_code',
field=models.CharField(default='', max_length=255, verbose_name='Monitor Code'),
preserve_default=False,
),
migrations.AddField(
model_name='newspapersheet',
name='monitor_code',
field=models.CharField(default='', max_length=255, verbose_name='Monitor Code'),
preserve_default=False,
),
migrations.AddField(
model_name='radiosheet',
name='monitor_code',
field=models.CharField(default='', max_length=255, verbose_name='Monitor Code'),
preserve_default=False,
),
migrations.AddField(
model_name='televisionsheet',
name='monitor_code',
field=models.CharField(default='', max_length=255, verbose_name='Monitor Code'),
preserve_default=False,
),
migrations.AddField(
model_name='twittersheet',
name='monitor_code',
field=models.CharField(default='', max_length=255, verbose_name='Monitor Code'),
preserve_default=False,
),
]
| 32.886364
| 92
| 0.595715
| 140
| 1,447
| 5.95
| 0.321429
| 0.132053
| 0.180072
| 0.162065
| 0.705882
| 0.705882
| 0.705882
| 0.705882
| 0.705882
| 0.705882
| 0
| 0.034047
| 0.289565
| 1,447
| 43
| 93
| 33.651163
| 0.776265
| 0.03179
| 0
| 0.675676
| 1
| 0
| 0.155826
| 0.01787
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.027027
| 0
| 0.108108
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
bae5061a3b630aec83e72f5faed365554449f01b
| 16,725
|
py
|
Python
|
fixture/contact.py
|
arseny-tsyro/python_training
|
187fe19166502297484c6876de7d46a0e7c80ba2
|
[
"Apache-2.0"
] | null | null | null |
fixture/contact.py
|
arseny-tsyro/python_training
|
187fe19166502297484c6876de7d46a0e7c80ba2
|
[
"Apache-2.0"
] | null | null | null |
fixture/contact.py
|
arseny-tsyro/python_training
|
187fe19166502297484c6876de7d46a0e7c80ba2
|
[
"Apache-2.0"
] | null | null | null |
__author__ = 'Arseniy'
from model.contact import Contact
from selenium.webdriver.support.select import Select
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def load_home_page(self):
wd = self.app.wd
if len(wd.find_elements_by_link_text("Last name")) > 0:
return
wd.find_element_by_link_text("home").click()
def select_by_index(self, index):
wd = self.app.wd
wd.find_elements_by_name("selected[]")[index].click()
def select_by_id(self, id):
wd = self.app.wd
wd.find_element_by_css_selector("input[value='%s']" % id).click()
def open_contact_to_edit_by_index(self, index):
wd = self.app.wd
self.load_home_page()
# go to edit page
wd.find_elements_by_css_selector('img[alt="Edit"]')[index].click()
def open_contact_to_edit_by_id(self, id):
wd = self.app.wd
self.load_home_page()
# go to edit page
for row in wd.find_elements_by_name("entry"):
cells = row.find_elements_by_tag_name("td")
row_id = cells[0].find_element_by_name("selected[]").get_attribute("value")
if id == row_id:
cells[7].find_element_by_css_selector('img[alt="Edit"]').click()
break
def open_contact_view_by_index(self, index):
wd = self.app.wd
self.load_home_page()
wd.find_elements_by_css_selector('img[alt="Details"]')[index].click()
def open_contact_view_by_id(self, id):
wd = self.app.wd
self.load_home_page()
for row in wd.find_elements_by_name("entry"):
cells = row.find_elements_by_tag_name("td")
row_id = cells[0].find_element_by_name("selected[]").get_attribute("value")
if id == row_id:
cells[6].find_element_by_css_selector('img[alt="Details"]').click()
break
def create(self, contact):
wd = self.app.wd
# go to new contact page
wd.find_element_by_link_text("add new").click()
# fill in names
wd.find_element_by_name("firstname").click()
wd.find_element_by_name("firstname").clear()
wd.find_element_by_name("firstname").send_keys(contact.firstname)
wd.find_element_by_name("middlename").click()
wd.find_element_by_name("middlename").clear()
wd.find_element_by_name("middlename").send_keys(contact.middlename)
wd.find_element_by_name("lastname").click()
wd.find_element_by_name("lastname").clear()
wd.find_element_by_name("lastname").send_keys(contact.lastname)
wd.find_element_by_name("nickname").click()
wd.find_element_by_name("nickname").clear()
wd.find_element_by_name("nickname").send_keys(contact.nickname)
wd.find_element_by_name("title").click()
wd.find_element_by_name("title").clear()
wd.find_element_by_name("title").send_keys(contact.title)
# fill in company data
wd.find_element_by_name("company").click()
wd.find_element_by_name("company").clear()
wd.find_element_by_name("company").send_keys(contact.company)
wd.find_element_by_name("address").click()
wd.find_element_by_name("address").clear()
wd.find_element_by_name("address").send_keys(contact.address)
# fill in telephone numbers
wd.find_element_by_name("home").click()
wd.find_element_by_name("home").clear()
wd.find_element_by_name("home").send_keys(contact.home_num)
wd.find_element_by_name("mobile").click()
wd.find_element_by_name("mobile").clear()
wd.find_element_by_name("mobile").send_keys(contact.mobile_num)
wd.find_element_by_name("work").click()
wd.find_element_by_name("work").clear()
wd.find_element_by_name("work").send_keys(contact.work_num)
wd.find_element_by_name("fax").click()
wd.find_element_by_name("fax").clear()
wd.find_element_by_name("fax").send_keys(contact.fax_num)
# fill in emails
wd.find_element_by_name("email2").click()
wd.find_element_by_name("email2").clear()
wd.find_element_by_name("email2").send_keys(contact.email2)
wd.find_element_by_name("email3").click()
wd.find_element_by_name("email3").clear()
wd.find_element_by_name("email3").send_keys(contact.email3)
wd.find_element_by_name("homepage").click()
wd.find_element_by_name("homepage").clear()
wd.find_element_by_name("homepage").send_keys(contact.homepage)
# fill in dates
if not wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[17]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form/select[1]//option[17]").click()
if not wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[4]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form/select[2]//option[4]").click()
wd.find_element_by_name("byear").click()
wd.find_element_by_name("byear").clear()
wd.find_element_by_name("byear").send_keys(contact.byear)
if not wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[16]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form/select[3]//option[16]").click()
if not wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[12]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form/select[4]//option[12]").click()
wd.find_element_by_name("ayear").click()
wd.find_element_by_name("ayear").clear()
wd.find_element_by_name("ayear").send_keys(contact.ayear)
# fill in additional info
wd.find_element_by_name("address2").click()
wd.find_element_by_name("address2").clear()
wd.find_element_by_name("address2").send_keys(contact.address2)
wd.find_element_by_name("phone2").click()
wd.find_element_by_name("phone2").clear()
wd.find_element_by_name("phone2").send_keys(contact.phone2)
wd.find_element_by_name("notes").click()
wd.find_element_by_name("notes").clear()
wd.find_element_by_name("notes").send_keys(contact.notes)
# submit
wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click()
self.load_home_page()
self.contact_cache = None
def edit_first(self, contact):
self.edit_by_index(0, contact)
def edit_by_index(self, index, contact):
wd = self.app.wd
self.load_home_page()
self.open_contact_to_edit_by_index(index)
# edit data
self.edit(contact)
# submit changes
wd.find_element_by_xpath("//div[@id='content']/form[1]/input[22]").click()
self.load_home_page()
self.contact_cache = None
def edit_by_id(self, id, contact):
wd = self.app.wd
self.load_home_page()
self.open_contact_to_edit_by_id(id)
# edit data
self.edit(contact)
# submit changes
wd.find_element_by_xpath("//div[@id='content']/form[1]/input[22]").click()
self.load_home_page()
self.contact_cache = None
def edit(self, contact):
wd = self.app.wd
if contact.firstname:
wd.find_element_by_name("firstname").click()
wd.find_element_by_name("firstname").clear()
wd.find_element_by_name("firstname").send_keys(contact.firstname)
if contact.middlename:
wd.find_element_by_name("middlename").click()
wd.find_element_by_name("middlename").clear()
wd.find_element_by_name("middlename").send_keys(contact.middlename)
if contact.lastname:
wd.find_element_by_name("lastname").click()
wd.find_element_by_name("lastname").clear()
wd.find_element_by_name("lastname").send_keys(contact.lastname)
if contact.nickname:
wd.find_element_by_name("nickname").click()
wd.find_element_by_name("nickname").clear()
wd.find_element_by_name("nickname").send_keys(contact.nickname)
if contact.company:
wd.find_element_by_name("company").click()
wd.find_element_by_name("company").clear()
wd.find_element_by_name("company").send_keys(contact.company)
if contact.title:
wd.find_element_by_name("title").click()
wd.find_element_by_name("title").clear()
wd.find_element_by_name("title").send_keys(contact.title)
if contact.address:
wd.find_element_by_name("address").click()
wd.find_element_by_name("address").clear()
wd.find_element_by_name("address").send_keys(contact.address)
if contact.home_num:
wd.find_element_by_name("home").click()
wd.find_element_by_name("home").clear()
wd.find_element_by_name("home").send_keys(contact.home_num)
if contact.mobile_num:
wd.find_element_by_name("mobile").click()
wd.find_element_by_name("mobile").clear()
wd.find_element_by_name("mobile").send_keys(contact.mobile_num)
if contact.work_num:
wd.find_element_by_name("work").click()
wd.find_element_by_name("work").clear()
wd.find_element_by_name("work").send_keys(contact.work_num)
if contact.fax_num:
wd.find_element_by_name("fax").click()
wd.find_element_by_name("fax").clear()
wd.find_element_by_name("fax").send_keys(contact.fax_num)
if contact.email:
wd.find_element_by_name("email").click()
wd.find_element_by_name("email").clear()
wd.find_element_by_name("email").send_keys(contact.email)
if contact.email2:
wd.find_element_by_name("email2").click()
wd.find_element_by_name("email2").clear()
wd.find_element_by_name("email2").send_keys(contact.email2)
if contact.email3:
wd.find_element_by_name("email3").click()
wd.find_element_by_name("email3").clear()
wd.find_element_by_name("email3").send_keys(contact.email3)
if contact.homepage:
wd.find_element_by_name("homepage").click()
wd.find_element_by_name("homepage").clear()
wd.find_element_by_name("homepage").send_keys(contact.homepage)
if not wd.find_element_by_xpath("//div[@id='content']/form[1]/select[1]//option[19]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form[1]/select[1]//option[19]").click()
if not wd.find_element_by_xpath("//div[@id='content']/form[1]/select[2]//option[10]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form[1]/select[2]//option[10]").click()
if contact.byear:
wd.find_element_by_name("byear").click()
wd.find_element_by_name("byear").clear()
wd.find_element_by_name("byear").send_keys(contact.byear)
if not wd.find_element_by_xpath("//div[@id='content']/form[1]/select[3]//option[7]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form[1]/select[3]//option[7]").click()
if not wd.find_element_by_xpath("//div[@id='content']/form[1]/select[4]//option[9]").is_selected():
wd.find_element_by_xpath("//div[@id='content']/form[1]/select[4]//option[9]").click()
if contact.ayear:
wd.find_element_by_name("ayear").click()
wd.find_element_by_name("ayear").clear()
wd.find_element_by_name("ayear").send_keys(contact.ayear)
if contact.address2:
wd.find_element_by_name("address2").click()
wd.find_element_by_name("address2").clear()
wd.find_element_by_name("address2").send_keys(contact.address2)
if contact.phone2:
wd.find_element_by_name("phone2").click()
wd.find_element_by_name("phone2").clear()
wd.find_element_by_name("phone2").send_keys(contact.phone2)
if contact.notes:
wd.find_element_by_name("notes").click()
wd.find_element_by_name("notes").clear()
wd.find_element_by_name("notes").send_keys(contact.notes)
def delete_first(self):
self.delete_by_index(0)
def delete_by_index(self, index):
wd = self.app.wd
self.select_by_index(index)
# submit deletion
wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click()
# accept and close dialogue window
wd.switch_to_alert().accept()
self.load_home_page()
self.contact_cache = None
def delete_by_id(self, id):
wd = self.app.wd
self.select_by_id(id)
# submit deletion
wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click()
# accept and close dialogue window
wd.switch_to_alert().accept()
self.load_home_page()
self.contact_cache = None
def add_to_group(self, contact, group):
wd = self.app.wd
self.load_home_page()
self.select_by_id(contact.id)
select = Select(wd.find_element_by_name("to_group"))
select.select_by_visible_text(group.name.strip())
wd.find_element_by_name("add").click()
def remove_from_group(self, contact, group):
wd = self.app.wd
self.load_home_page()
select = Select(wd.find_element_by_name("group"))
select.select_by_visible_text(group.name.strip())
self.select_by_id(contact.id)
wd.find_element_by_name("remove").click()
def count(self):
wd = self.app.wd
self.load_home_page()
return len(wd.find_elements_by_name("selected[]"))
contact_cache = None
def get_contact_list(self):
if self.contact_cache is None:
wd = self.app.wd
self.load_home_page()
self.contact_cache = []
for row in wd.find_elements_by_name("entry"):
cells = row.find_elements_by_tag_name("td")
last_name = cells[1].text
first_name = cells[2].text
id = cells[0].find_element_by_tag_name("input").get_attribute("value")
all_emails = cells[4].text
all_phones = cells[5].text
self.contact_cache.append(Contact(id=id, firstname=first_name, lastname=last_name,
all_phones_from_home_page=all_phones,
all_emails_from_home_page=all_emails))
return list(self.contact_cache)
def get_contact_info_from_edit_page(self, index):
wd = self.app.wd
self.open_contact_to_edit_by_index(index)
id = wd.find_element_by_name("id").get_attribute("value")
firstname = wd.find_element_by_name("firstname").get_attribute("value")
lastname = wd.find_element_by_name("lastname").get_attribute("value")
home_num = wd.find_element_by_name("home").get_attribute("value")
mobile_num = wd.find_element_by_name("mobile").get_attribute("value")
work_num = wd.find_element_by_name("work").get_attribute("value")
phone2 = wd.find_element_by_name("phone2").get_attribute("value")
email = wd.find_element_by_name("email").get_attribute("value")
email2 = wd.find_element_by_name("email2").get_attribute("value")
email3 = wd.find_element_by_name("email3").get_attribute("value")
return Contact(id=id, firstname=firstname, lastname=lastname,
home_num=home_num, mobile_num=mobile_num,
work_num=work_num, phone2=phone2,
email=email, email2=email2, email3=email3)
def get_contact_from_view_page(self, index):
wd = self.app.wd
self.open_contact_view_by_index(index)
text = wd.find_element_by_id("content").text
home_num = re.search("H: (.*)", text).group(1)
mobile_num = re.search("M: (.*)", text).group(1)
work_num = re.search("W: (.*)", text).group(1)
phone2 = re.search("P: (.*)", text).group(1)
return Contact(home_num=home_num, mobile_num=mobile_num,
work_num=work_num, phone2=phone2)
def get_text_from_view_page(self, index):
wd = self.app.wd
self.open_contact_view_by_index(index)
return wd.find_element_by_id("content").text
def get_text_from_view_page_by_id(self, id):
wd = self.app.wd
self.open_contact_view_by_id(id)
return wd.find_element_by_id("content").text
| 46.587744
| 108
| 0.638924
| 2,331
| 16,725
| 4.240669
| 0.062205
| 0.100759
| 0.214365
| 0.239757
| 0.853617
| 0.836115
| 0.798786
| 0.738897
| 0.708245
| 0.675569
| 0
| 0.0099
| 0.220927
| 16,725
| 358
| 109
| 46.717877
| 0.748734
| 0.019312
| 0
| 0.598706
| 0
| 0
| 0.126122
| 0.058788
| 0
| 0
| 0
| 0
| 0
| 1
| 0.07767
| false
| 0
| 0.009709
| 0
| 0.116505
| 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
|
242977075403643fb7167dc9e8cea6a4c6cc8ff5
| 3,910
|
py
|
Python
|
Leetcode/Python/_1700.py
|
Xrenya/algorithms
|
aded82cacde2f4f2114241907861251e0e2e5638
|
[
"MIT"
] | 1
|
2021-11-28T15:03:32.000Z
|
2021-11-28T15:03:32.000Z
|
Leetcode/Python/_1700.py
|
Xrenya/algorithms
|
aded82cacde2f4f2114241907861251e0e2e5638
|
[
"MIT"
] | null | null | null |
Leetcode/Python/_1700.py
|
Xrenya/algorithms
|
aded82cacde2f4f2114241907861251e0e2e5638
|
[
"MIT"
] | null | null | null |
class Solution:
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
hashStudent = {0:0, 1:0}
for student in students:
hashStudent[student] += 1
for sandwich in sandwiches:
if hashStudent[sandwich] == 0:
break
else:
hashStudent[sandwich] -= 1
return sum(hashStudent.values())
class Solution:
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
hashStudent = {0:0, 1:0}
hashSandwich = {0:0, 1:0}
for student in students:
hashStudent[student] += 1
for sandwich in sandwiches:
hashSandwich[sandwich] += 1
while True:
if students[0] != sandwiches[0]:
students.append(students.pop(0))
if hashSandwich[sandwiches[0]] > 0 and hashStudent[sandwiches[0]] == 0:
break
else:
students.pop(0)
firstS = sandwiches.pop(0)
hashSandwich[firstS] -= 1
hashStudent[firstS] -= 1
if len(students) == 0:
break
return hashStudent[0] + hashStudent[1]
class Solution:
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
count = 0
hashStudent = {0:0, 1:0}
hashSandwich = {0:0, 1:0}
for student in students:
hashStudent[student] += 1
for sandwich in sandwiches:
hashSandwich[sandwich] += 1
flag = True
while flag:
if students[0] != sandwiches[0]:
students.append(students.pop(0))
if hashSandwich[sandwiches[0]] > 0 and hashStudent[sandwiches[0]] == 0:
break
else:
students.pop(0)
firstS = sandwiches.pop(0)
hashSandwich[firstS] -= 1
hashStudent[firstS] -= 1
if len(students) == 0:
break
return hashStudent[0] + hashStudent[1]
class Solution:
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
count = 0
hashStudent = {0:0, 1:0}
hashSandwich = {0:0, 1:0}
for student in students:
hashStudent[student] += 1
for sandwich in sandwiches:
hashSandwich[sandwich] += 1
flag = True
while flag:
if students[0] != sandwiches[0]:
students.append(students.pop(0))
if hashSandwich[sandwiches[0]] > 0 and hashStudent[sandwiches[0]] == 0:
flag = False
break
else:
students.pop(0)
firstS = sandwiches.pop(0)
hashSandwich[firstS] -= 1
hashStudent[firstS] -= 1
if len(students) == 0:
flag = False
break
return hashStudent[0] + hashStudent[1]
class Solution:
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
count = 0
hashStudent = collections.Counter(students)
hashSandwich = collections.Counter(sandwiches)
while True:
if students[0] != sandwiches[0]:
students.append(students.pop(0))
if hashSandwich[sandwiches[0]] > 0 and hashStudent[sandwiches[0]] == 0:
break
else:
students.pop(0)
firstS = sandwiches.pop(0)
hashSandwich[firstS] -= 1
hashStudent[firstS] -= 1
if len(students) == 0:
break
return hashStudent[0] + hashStudent[1]
| 34.298246
| 87
| 0.488235
| 371
| 3,910
| 5.145553
| 0.09434
| 0.015715
| 0.050288
| 0.014667
| 0.915663
| 0.915663
| 0.915663
| 0.915663
| 0.915663
| 0.915663
| 0
| 0.04183
| 0.413043
| 3,910
| 113
| 88
| 34.60177
| 0.789978
| 0
| 0
| 0.94898
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.05102
| false
| 0
| 0
| 0
| 0.153061
| 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
|
2449a2db0f98cca476cc614c1796ef1e9e116549
| 100
|
py
|
Python
|
neighbors/__init__.py
|
DanielCastriani/machine-learning-algorithms
|
5a1f361b283a751af0cb0157e28bfda2fb38d656
|
[
"MIT"
] | 3
|
2020-12-31T04:53:05.000Z
|
2021-12-20T14:43:34.000Z
|
neighbors/__init__.py
|
DanielCastriani/machine-learning-algorithms
|
5a1f361b283a751af0cb0157e28bfda2fb38d656
|
[
"MIT"
] | null | null | null |
neighbors/__init__.py
|
DanielCastriani/machine-learning-algorithms
|
5a1f361b283a751af0cb0157e28bfda2fb38d656
|
[
"MIT"
] | null | null | null |
from neighbors.knn_classifier import KNNClassifier
from neighbors.knn_regressor import KNNRegressor
| 33.333333
| 50
| 0.9
| 12
| 100
| 7.333333
| 0.666667
| 0.295455
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 100
| 2
| 51
| 50
| 0.956522
| 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
|
79f9da13f93de264ecce9c02d00bc3ef8830e5dd
| 31,023
|
py
|
Python
|
tensorflow_model_analysis/slicer/auto_slicing_util_test.py
|
Mikehem/tfx
|
e803ea6778d8550ec77dcc92bc8172f1a3a90f38
|
[
"Apache-2.0"
] | null | null | null |
tensorflow_model_analysis/slicer/auto_slicing_util_test.py
|
Mikehem/tfx
|
e803ea6778d8550ec77dcc92bc8172f1a3a90f38
|
[
"Apache-2.0"
] | null | null | null |
tensorflow_model_analysis/slicer/auto_slicing_util_test.py
|
Mikehem/tfx
|
e803ea6778d8550ec77dcc92bc8172f1a3a90f38
|
[
"Apache-2.0"
] | null | null | null |
# Lint as: python3
# Copyright 2020 Google LLC
#
# 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
#
# https://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.
"""Tests for auto slicing utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
from pandas._testing import assert_frame_equal
import tensorflow as tf
from tensorflow_model_analysis.metrics import metric_types
from tensorflow_model_analysis.proto import metrics_for_slice_pb2
from tensorflow_model_analysis.slicer import auto_slicing_util
from tensorflow_model_analysis.slicer import slicer_lib
from google.protobuf import text_format
from tensorflow_metadata.proto.v0 import statistics_pb2
class AutoSlicingUtilTest(tf.test.TestCase):
def _get_metrics(self):
return [
text_format.Parse(
"""
slice_key {
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.8 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.8 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.8 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 1500 }
lower_bound { value: 1500 }
upper_bound { value: 1500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 1500 }
upper_bound { value: 1500 }
t_distribution_value {
sample_mean { value: 1500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 1500 }
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'age'
bytes_value: '[1.0, 6.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.4 }
lower_bound { value: 0.3737843 }
upper_bound { value: 0.6262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.3737843 }
upper_bound { value: 0.6262157 }
t_distribution_value {
sample_mean { value: 0.4 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.4 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500 }
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'age'
bytes_value: '[6.0, 12.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.79 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.79 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.79 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'age'
bytes_value: '[12.0, 18.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.9 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.9 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.9 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'country'
bytes_value: 'USA'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.9 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.9 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.9 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'country'
bytes_value: 'USA'
}
single_slice_keys {
column: 'age'
bytes_value: '[12.0, 18.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.9 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.9 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.9 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice())
]
def test_partition_slices_without_metric_sub_key(self):
metrics = self._get_metrics()
result = auto_slicing_util.partition_slices(
metrics,
metric_key=metric_types.MetricKey(name='accuracy'),
comparison_type='LOWER')
self.assertCountEqual([s.slice_key for s in result[0]],
[(('age', '[1.0, 6.0)'),)])
self.assertCountEqual([s.slice_key for s in result[1]],
[(('age', '[6.0, 12.0)'),),
(('age', '[12.0, 18.0)'),), (('country', 'USA'),),
(('country', 'USA'), ('age', '[12.0, 18.0)'))])
result = auto_slicing_util.partition_slices(
metrics,
metric_key=metric_types.MetricKey(name='accuracy'),
comparison_type='HIGHER')
self.assertCountEqual([s.slice_key for s in result[0]],
[(('age', '[12.0, 18.0)'),), (('country', 'USA'),),
(('country', 'USA'), ('age', '[12.0, 18.0)'))])
self.assertCountEqual([s.slice_key for s in result[1]],
[(('age', '[1.0, 6.0)'),), (('age', '[6.0, 12.0)'),)])
def test_partition_slices_with_metric_sub_key(self):
metrics = self._get_metrics()
# Set sub_key.
for metric in metrics:
for kv in metric.metric_keys_and_values:
kv.key.sub_key.MergeFrom(metric_types.SubKey(class_id=0).to_proto())
result = auto_slicing_util.partition_slices(
metrics,
metric_key=metric_types.MetricKey(
name='accuracy', sub_key=metric_types.SubKey(class_id=0)),
comparison_type='LOWER')
self.assertCountEqual([s.slice_key for s in result[0]],
[(('age', '[1.0, 6.0)'),)])
self.assertCountEqual([s.slice_key for s in result[1]],
[(('age', '[6.0, 12.0)'),),
(('age', '[12.0, 18.0)'),), (('country', 'USA'),),
(('country', 'USA'), ('age', '[12.0, 18.0)'))])
result = auto_slicing_util.partition_slices(
metrics,
metric_key=metric_types.MetricKey(
name='accuracy', sub_key=metric_types.SubKey(class_id=0)),
comparison_type='HIGHER')
self.assertCountEqual([s.slice_key for s in result[0]],
[(('age', '[12.0, 18.0)'),), (('country', 'USA'),),
(('country', 'USA'), ('age', '[12.0, 18.0)'))])
self.assertCountEqual([s.slice_key for s in result[1]],
[(('age', '[1.0, 6.0)'),), (('age', '[6.0, 12.0)'),)])
def test_find_top_slices(self):
input_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'), ('country', 'USA')),
num_examples=500.0,
slice_metric=0.91,
base_metric=0.8,
p_value=0.000011,
effect_size=0.91,
raw_slice_metrics=None)
]
self.assertCountEqual(
auto_slicing_util.find_top_slices(
input_slices, rank_by='EFFECT_SIZE', prune_subset_slices=False), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'), ('country', 'USA')),
num_examples=500.0,
slice_metric=0.91,
base_metric=0.8,
p_value=0.000011,
effect_size=0.91,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
])
self.assertCountEqual(
auto_slicing_util.find_top_slices(
input_slices, rank_by='EFFECT_SIZE', prune_subset_slices=True), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
])
self.assertCountEqual(
auto_slicing_util.find_top_slices(input_slices, rank_by='PVALUE'), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
])
self.assertCountEqual(
auto_slicing_util.find_top_slices(
input_slices, min_num_examples=1000, rank_by='EFFECT_SIZE'), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
])
def test_revert_slice_keys_for_transformed_features(self):
statistics = text_format.Parse(
"""
datasets{
num_examples: 1500
features {
path { step: 'country' }
type: STRING
string_stats {
unique: 10
}
}
features {
path { step: 'age' }
type: INT
num_stats {
common_stats {
num_non_missing: 1500
min_num_values: 1
max_num_values: 1
}
min: 1
max: 18
histograms {
buckets {
low_value: 1
high_value: 6.0
sample_count: 500
}
buckets {
low_value: 6.0
high_value: 12.0
sample_count: 500
}
buckets {
low_value: 12.0
high_value: 18.0
sample_count: 500
}
type: QUANTILES
}
}
}
}
""", statistics_pb2.DatasetFeatureStatisticsList())
slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('transformed_age', 1),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('transformed_age', 2),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('country', 'USA'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
expected_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '(1.0, 6.0]'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '(6.0, 12.0]'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('country', 'USA'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
actual = auto_slicing_util.revert_slice_keys_for_transformed_features(
slices, statistics)
self.assertEqual(actual, expected_slices)
def test_remove_subset_slices(self):
input_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'), ('country', 'USA')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'), ('country', 'UK')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'), ('country', 'UK'), ('sex', 'M')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
expected_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'), ('country', 'UK')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
self.assertCountEqual(
auto_slicing_util.remove_subset_slices(input_slices), expected_slices)
self.assertCountEqual(auto_slicing_util.remove_subset_slices([]), [])
def test_is_significant_slice(self):
self.assertEqual(
auto_slicing_util._is_significant_slice(0.8, 0.001, 100, 0.9, 0.001,
1000, 'LOWER', 0.01)[0], True)
# Test zero std. deviation for overall dataset.
with self.assertRaises(AssertionError):
self.assertEqual(
auto_slicing_util._is_significant_slice(0.8, 0.001, 100, 0.9, 0, 1000,
'LOWER', 0.01)[0], True)
# Test zero std. deviation for slice.
with self.assertRaises(AssertionError):
auto_slicing_util._is_significant_slice(0.8, 0, 100, 0.9, 0, 1000,
'LOWER', 0.01)
def test_get_slices_as_dataframe(self):
input_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('native-country', 'United-States'),),
num_examples=29170,
slice_metric=0.09,
base_metric=0.087,
p_value=0,
effect_size=0.46,
raw_slice_metrics=text_format.Parse(
"""
slice_key {
single_slice_keys {
column: "native-country"
bytes_value: "United-States"
}
}
metric_keys_and_values {
key { name: "false_positives" }
value {
bounded_value {
lower_bound { value: 1754.6514199722158 }
upper_bound { value: 2092.488580027784 }
value { value: 1923.57 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 1754.6514199722158 }
upper_bound { value: 2092.488580027784 }
t_distribution_value {
sample_mean { value: 1923.57 }
sample_standard_deviation { value: 85.13110418664061 }
sample_degrees_of_freedom { value: 99 }
unsampled_value { value: 1943.0 }
}
}
}
}
metric_keys_and_values {
key { name: "false_negatives" }
value {
bounded_value {
lower_bound { value: 3595.413107983637 }
upper_bound { value: 4195.886892016363 }
value { value: 3895.65 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 3595.413107983637 }
upper_bound { value: 4195.886892016363 }
t_distribution_value {
sample_mean { value: 3895.65 }
sample_standard_deviation { value: 151.31253252729257 }
sample_degrees_of_freedom { value: 99 }
unsampled_value { value: 3935.0 }
}
}
}
}""", metrics_for_slice_pb2.MetricsForSlice())),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[58.0, 90.0)'),),
num_examples=2999,
slice_metric=0.09,
base_metric=0.0875,
p_value=7.8,
effect_size=0.98,
raw_slice_metrics=text_format.Parse(
"""
slice_key {
single_slice_keys {
column: "age"
bytes_value: "[58.0, 90.0)"
}
}
metric_keys_and_values {
key { name: "false_positives" }
value {
bounded_value {
lower_bound { value: 167.54646972321814 }
upper_bound { value: 236.37353027678188 }
value { value: 201.96 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 167.54646972321814 }
upper_bound { value: 236.37353027678188 }
t_distribution_value {
sample_mean { value: 201.96 }
sample_standard_deviation { value: 17.343632837435358 }
sample_degrees_of_freedom { value: 99 }
unsampled_value { value: 204.0 }
}
}
}
}
metric_keys_and_values {
key { name: "false_negatives" }
value {
bounded_value {
lower_bound { value: 486.4402337348782 }
upper_bound { value: 610.479766265122 }
value { value: 548.46 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 486.4402337348782 }
upper_bound { value: 610.479766265122 }
t_distribution_value {
sample_mean { value: 548.46 }
sample_standard_deviation { value: 31.256544914589938 }
sample_degrees_of_freedom { value: 99 }
unsampled_value { value: 554.0 }
}
}
}
}""", metrics_for_slice_pb2.MetricsForSlice()))
]
additional_metric_keys = [
metric_types.MetricKey('false_positives'),
metric_types.MetricKey('false_negatives')
]
expected_dataframe_data = [{
'Slice': slicer_lib.stringify_slice_key(input_slices[0].slice_key),
'Size': input_slices[0].num_examples,
'Slice metric': input_slices[0].slice_metric,
'Base metric': input_slices[0].base_metric,
'P-Value': input_slices[0].p_value,
'Effect size': input_slices[0].effect_size,
str(additional_metric_keys[0]): 1923.57,
str(additional_metric_keys[1]): 3895.65
}, {
'Slice': slicer_lib.stringify_slice_key(input_slices[1].slice_key),
'Size': input_slices[1].num_examples,
'Slice metric': input_slices[1].slice_metric,
'Base metric': input_slices[1].base_metric,
'P-Value': input_slices[1].p_value,
'Effect size': input_slices[1].effect_size,
str(additional_metric_keys[0]): 201.96,
str(additional_metric_keys[1]): 548.46
}]
expected_dataframe_column_labels = [
'Slice', 'Size', 'Slice metric', 'Base metric', 'P-Value',
'Effect size',
str(additional_metric_keys[0]),
str(additional_metric_keys[1])
]
expected_dataframe = pd.DataFrame(
expected_dataframe_data, columns=expected_dataframe_column_labels)
expected_dataframe.set_index('Slice', inplace=True)
actual_dataframe = auto_slicing_util.get_slices_as_dataframe(
input_slices, additional_metric_keys)
assert_frame_equal(actual_dataframe, expected_dataframe)
if __name__ == '__main__':
tf.test.main()
| 36.454759
| 80
| 0.496793
| 3,082
| 31,023
| 4.695003
| 0.095717
| 0.029026
| 0.044575
| 0.067173
| 0.818037
| 0.808086
| 0.762059
| 0.741811
| 0.70387
| 0.680926
| 0
| 0.083388
| 0.406634
| 31,023
| 850
| 81
| 36.497647
| 0.702684
| 0.022403
| 0
| 0.723684
| 0
| 0
| 0.066478
| 0
| 0
| 0
| 0
| 0
| 0.055263
| 1
| 0.021053
| false
| 0
| 0.031579
| 0.002632
| 0.057895
| 0.002632
| 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
|
035bbbcac13f11224ec90a3411b8f76e396690cd
| 52
|
py
|
Python
|
RhyAn/component_filter/__init__.py
|
kaveenr/rhyan
|
5d603023e0fafa11079f3bbd3a48c9cbe8babb8f
|
[
"Apache-2.0"
] | null | null | null |
RhyAn/component_filter/__init__.py
|
kaveenr/rhyan
|
5d603023e0fafa11079f3bbd3a48c9cbe8babb8f
|
[
"Apache-2.0"
] | null | null | null |
RhyAn/component_filter/__init__.py
|
kaveenr/rhyan
|
5d603023e0fafa11079f3bbd3a48c9cbe8babb8f
|
[
"Apache-2.0"
] | 2
|
2019-11-04T05:59:07.000Z
|
2020-09-21T20:25:46.000Z
|
from .FundementalBandPass import FundementalBandPass
| 52
| 52
| 0.923077
| 4
| 52
| 12
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057692
| 52
| 1
| 52
| 52
| 0.979592
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 1
| 1
| 0
| 1
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 7
|
cefa1b3d3fad012ee64c295f5f4bffbc78f33546
| 15,742
|
py
|
Python
|
tests/functional/test_tables.py
|
davidesner/sapi-python-client
|
0f16fa30cb93e6dc99b16e983c139f9c3abee67e
|
[
"MIT"
] | 3
|
2017-07-13T13:17:37.000Z
|
2017-11-08T19:01:29.000Z
|
tests/functional/test_tables.py
|
davidesner/sapi-python-client
|
0f16fa30cb93e6dc99b16e983c139f9c3abee67e
|
[
"MIT"
] | 45
|
2017-07-13T07:49:51.000Z
|
2021-08-19T15:43:39.000Z
|
tests/functional/test_tables.py
|
davidesner/sapi-python-client
|
0f16fa30cb93e6dc99b16e983c139f9c3abee67e
|
[
"MIT"
] | 5
|
2017-07-14T05:50:49.000Z
|
2021-12-28T17:01:29.000Z
|
import os
import unittest
import tempfile
import csv
import warnings
from requests import exceptions
from kbcstorage.tables import Tables
from kbcstorage.buckets import Buckets
class TestTables(unittest.TestCase):
def setUp(self):
self.tables = Tables(os.getenv('KBC_TEST_API_URL'),
os.getenv('KBC_TEST_TOKEN'))
self.buckets = Buckets(os.getenv('KBC_TEST_API_URL'),
os.getenv('KBC_TEST_TOKEN'))
try:
self.buckets.delete('in.c-py-test-tables', force=True)
except exceptions.HTTPError as e:
if e.response.status_code != 404:
raise
self.buckets.create(name='py-test-tables', stage='in')
# https://github.com/boto/boto3/issues/454
warnings.simplefilter("ignore", ResourceWarning)
def tearDown(self):
try:
self.buckets.delete('in.c-py-test-tables', force=True)
except exceptions.HTTPError as e:
if e.response.status_code != 404:
raise
def test_create_table_minimal(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual('in.c-py-test-tables', table_info['bucket']['id'])
def test_create_table_primary_key(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
writer.writerow({'col1': 'pong', 'col2': 'ping'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables',
primary_key=['col1', 'col2'])
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual('in.c-py-test-tables', table_info['bucket']['id'])
with self.subTest():
self.assertEqual(['col1', 'col2'], table_info['primaryKey'])
def test_table_detail(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual('some-table', table_info['name'])
with self.subTest():
self.assertTrue('in.c-py-test-tables.some-table' in table_info['uri'])
with self.subTest():
self.assertEqual([], table_info['primaryKey'])
with self.subTest():
self.assertEqual(['col1', 'col2'], table_info['columns'])
with self.subTest():
self.assertTrue('created' in table_info)
with self.subTest():
self.assertTrue('lastImportDate' in table_info)
with self.subTest():
self.assertTrue('lastChangeDate' in table_info)
with self.subTest():
self.assertTrue('rowsCount' in table_info)
with self.subTest():
self.assertTrue('metadata' in table_info)
with self.subTest():
self.assertTrue('bucket' in table_info)
with self.subTest():
self.assertTrue('columnMetadata' in table_info)
def test_delete_table(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
table_info = self.tables.detail(table_id)
self.assertEqual(table_id, table_info['id'])
self.tables.delete(table_id)
try:
self.tables.detail('some-totally-non-existent-table')
except exceptions.HTTPError as e:
if e.response.status_code != 404:
raise
def test_invalid_create(self):
try:
self.tables.detail('some-totally-non-existent-table')
except exceptions.HTTPError as e:
if e.response.status_code != 404:
raise
def test_import_table_incremental(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual(1, table_info['rowsCount'])
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
self.tables.load(table_id=table_id, file_path=path,
is_incremental=True)
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual(2, table_info['rowsCount'])
def test_import_table_no_incremental(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual(1, table_info['rowsCount'])
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
self.tables.load(table_id=table_id, file_path=path,
is_incremental=False)
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual(1, table_info['rowsCount'])
def test_table_preview(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
contents = self.tables.preview(table_id=table_id)
lines = contents.split('\n')
self.assertEqual(['', '"col1","col2"', '"foo","bar"', '"ping","pong"'],
sorted(lines))
def test_table_export(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
result = self.tables.export(table_id=table_id)
self.assertIsNotNone(result)
def test_table_export_file_plain(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
temp_path = tempfile.TemporaryDirectory()
local_path = self.tables.export_to_file(table_id=table_id,
path_name=temp_path.name,
is_gzip=False)
with open(local_path, mode='rt') as file:
lines = file.readlines()
self.assertEqual(['"col1","col2"\n', '"foo","bar"\n',
'"ping","pong"\n'],
sorted(lines))
def test_table_export_file_gzip(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
temp_path = tempfile.TemporaryDirectory()
local_path = self.tables.export_to_file(table_id=table_id,
path_name=temp_path.name,
is_gzip=True)
with open(local_path, mode='rt') as file:
lines = file.readlines()
self.assertEqual(['"col1","col2"\n', '"foo","bar"\n',
'"ping","pong"\n'],
sorted(lines))
def test_table_export_sliced(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path,
bucket_id='in.c-py-test-tables')
table_info = self.tables.detail(table_id)
with self.subTest():
self.assertEqual(table_id, table_info['id'])
with self.subTest():
self.assertEqual(1, table_info['rowsCount'])
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'foo', 'col2': 'bar'})
os.close(file)
self.tables.load(table_id=table_id, file_path=path,
is_incremental=True)
temp_path = tempfile.TemporaryDirectory()
local_path = self.tables.export_to_file(table_id=table_id,
path_name=temp_path.name)
with open(local_path, mode='rt') as file:
lines = file.readlines()
self.assertEqual(['"col1","col2"\n', '"foo","bar"\n',
'"ping","pong"\n'],
sorted(lines))
def test_table_columns(self):
file, path = tempfile.mkstemp(prefix='sapi-test')
with open(path, 'w') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=['col1', 'col2', 'col3', 'col4'],
lineterminator='\n', delimiter=',',
quotechar='"')
writer.writeheader()
writer.writerow({'col1': 'ping', 'col2': 'pong', 'col3': 'king', 'col4': 'kong'})
os.close(file)
table_id = self.tables.create(name='some-table', file_path=path, bucket_id='in.c-py-test-tables')
temp_path = tempfile.TemporaryDirectory()
local_path = self.tables.export_to_file(table_id=table_id,
path_name=temp_path.name,
is_gzip=False,
columns=['col3', 'col2'])
with open(local_path, mode='rt') as file:
lines = file.readlines()
self.assertEqual(['"col3","col2"\n', '"king","pong"\n'], sorted(lines))
| 47.70303
| 105
| 0.523695
| 1,653
| 15,742
| 4.84876
| 0.08046
| 0.042795
| 0.05053
| 0.064005
| 0.8801
| 0.863755
| 0.85577
| 0.851653
| 0.821709
| 0.809981
| 0
| 0.010803
| 0.335536
| 15,742
| 329
| 106
| 47.848024
| 0.755449
| 0.002541
| 0
| 0.805195
| 0
| 0
| 0.107707
| 0.00586
| 0
| 0
| 0
| 0
| 0.11039
| 1
| 0.048701
| false
| 0
| 0.035714
| 0
| 0.087662
| 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
|
30326caa783e4d732322132751dcd968674908dd
| 69,081
|
py
|
Python
|
tests/test_merge.py
|
airbus/decomon
|
f3668fbd8edd0def4e23aa0634eebfec58349c35
|
[
"MIT"
] | 11
|
2021-11-03T12:09:50.000Z
|
2022-02-20T21:42:13.000Z
|
tests/test_merge.py
|
airbus/decomon
|
f3668fbd8edd0def4e23aa0634eebfec58349c35
|
[
"MIT"
] | 1
|
2022-02-18T13:40:46.000Z
|
2022-02-18T13:40:46.000Z
|
tests/test_merge.py
|
airbus/decomon
|
f3668fbd8edd0def4e23aa0634eebfec58349c35
|
[
"MIT"
] | null | null | null |
# Test unit for decomon with Dense layers
from __future__ import absolute_import
import pytest
import numpy as np
from decomon.layers.decomon_layers import to_monotonic
from decomon.layers.decomon_merge_layers import (
DecomonConcatenate,
DecomonAverage,
DecomonMaximum,
DecomonMinimum,
DecomonAdd,
DecomonSubtract,
DecomonMultiply,
DecomonDot,
)
from tensorflow.keras.layers import Concatenate, Average, Maximum, Minimum, Add, Subtract, Input, Multiply, Dot
from . import (
get_tensor_decomposition_1d_box,
get_standart_values_1d_box,
assert_output_properties_box,
assert_output_properties_box_linear,
get_standard_values_multid_box,
get_tensor_decomposition_multid_box,
)
import tensorflow.python.keras.backend as K
from numpy.testing import assert_almost_equal
from tensorflow.keras.models import Model
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonAdd_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonAdd(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
y_ = y0_ + y1_
z_ = z0_
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float{}".format(32))
K.set_epsilon(eps)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonAverage_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonAverage(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
z_ = z0_
y_ = (y0_ + y1_) / 2.0
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float{}".format(32))
K.set_epsilon(eps)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonSubstract_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonSubtract(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
y_ = y0_ - y1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
z_ = z0_
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float{}".format(32))
K.set_epsilon(eps)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonMaximum_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonMaximum(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = np.maximum(y0_, y1_)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float{}".format(32))
K.set_epsilon(eps)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonMinimum_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonMinimum(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = np.minimum(y0_, y1_)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_epsilon(eps)
K.set_floatx("float32")
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonConcatenate_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonConcatenate(axis=-1, dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = np.concatenate([y0_, y1_], -1)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_epsilon(eps)
K.set_floatx("float32")
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonAdd_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonAdd(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = y0_ + y1_
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_epsilon(eps)
K.set_floatx("float32")
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonSubstract_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonSubtract(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = y0_ - y1_
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float32")
K.set_epsilon(eps)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonAverage_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonAverage(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = (y0_ + y1_) / 2.0
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_epsilon(eps)
K.set_floatx("float32")
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonMaximum_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonMaximum(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = np.maximum(y0_, y1_)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_epsilon(eps)
K.set_floatx("float32")
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonMinimum_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonMinimum(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = np.minimum(y0_, y1_)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float32")
K.set_epsilon(eps)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonConcatenate_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonConcatenate(dc_decomp=False, mode=mode, axis=-1)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = np.concatenate([y0_, y1_], -1)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_epsilon(eps)
K.set_floatx("float32")
### to monotonic
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7])
def test_DecomonAdd_1D_box_to_monotonic(n0):
ref_op = Add()
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = inputs_0_[1] + inputs_1_[1]
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
def test_DecomonAverage_1D_box_to_monotonic(n0):
ref_op = Average()
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = (inputs_0_[1] + inputs_1_[1]) / 2.0
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="average"
)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7])
def test_DecomonSubtract_1D_box_to_monotonic(n0):
ref_op = Subtract()
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = inputs_0_[1] - inputs_1_[1]
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="substract"
)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
def test_DecomonMaximum_1D_box_to_monotonic(n0):
ref_op = Maximum()
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.maximum(inputs_0_[1], inputs_1_[1])
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="maximum"
)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
def test_DecomonMinimum_1D_box_to_monotonic(n0):
ref_op = Minimum()
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.minimum(inputs_0_[1], inputs_1_[1])
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="maximum"
)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
def test_DecomonConcatenate_1D_box_to_monotonic(n0):
ref_op = Concatenate(axis=-1)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.concatenate([inputs_0_[1], inputs_1_[1]], -1)
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="maximum"
)
#### to_monotonic multiD
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonAdd_multiD_box_to_monotonic(n0):
ref_op = Add()
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = y0 + y1
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonSubstract_multiD_box_to_monotonic(n0):
ref_op = Subtract()
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = y0 - y1
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="substract"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonAverage_multiD_box_to_monotonic(n0):
ref_op = Average()
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = (y0 + y1) / 2.0
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="average"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonMaximum_multiD_box_to_monotonic(n0):
ref_op = Maximum()
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.maximum(y0, y1)
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="maximum"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonMinimum_multiD_box_to_monotonic(n0):
ref_op = Minimum()
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.minimum(y0, y1)
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="minimum"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonConcatenate_multiD_box_to_monotonic(n0):
ref_op = Concatenate(axis=-1)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.concatenate([y0, y1], -1)
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="concatenate"
)
# other operators: Multiply, Dot
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(2, "hybrid", 32),
(3, "hybrid", 32),
(4, "hybrid", 32),
(5, "hybrid", 32),
(6, "hybrid", 32),
(7, "hybrid", 32),
(8, "hybrid", 32),
(9, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(2, "forward", 32),
(3, "forward", 32),
(4, "forward", 32),
(5, "forward", 32),
(6, "forward", 32),
(7, "forward", 32),
(8, "forward", 32),
(9, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(2, "ibp", 32),
(3, "ibp", 32),
(4, "ibp", 32),
(5, "ibp", 32),
(6, "ibp", 32),
(7, "ibp", 32),
(8, "ibp", 32),
(9, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(2, "hybrid", 64),
(3, "hybrid", 64),
(4, "hybrid", 64),
(5, "hybrid", 64),
(6, "hybrid", 64),
(7, "hybrid", 64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64),
(4, "ibp", 64),
(5, "ibp", 64),
(6, "ibp", 64),
(7, "ibp", 64),
(8, "ibp", 64),
(9, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(2, "hybrid", 16),
(3, "hybrid", 16),
(4, "hybrid", 16),
(5, "hybrid", 16),
(6, "hybrid", 16),
(7, "hybrid", 16),
(8, "hybrid", 16),
(9, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(2, "forward", 16),
(3, "forward", 16),
(4, "forward", 16),
(5, "forward", 16),
(6, "forward", 16),
(7, "forward", 16),
(8, "forward", 16),
(9, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
(2, "ibp", 16),
(3, "ibp", 16),
(4, "ibp", 16),
(5, "ibp", 16),
(6, "ibp", 16),
(7, "ibp", 16),
(8, "ibp", 16),
(9, "ibp", 16),
],
)
def test_DecomonMultiply_1D_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonMultiply(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = y0_ * y1_
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float32")
K.set_epsilon(eps)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7])
def test_DecomonMultiply_1D_box_to_monotonic(n0):
ref_op = Multiply()
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, 1), dc_decomp=False)[0]
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = y0 * y1
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
@pytest.mark.parametrize(
"n0, mode, floatx",
[
(0, "hybrid", 32),
(1, "hybrid", 32),
(0, "forward", 32),
(1, "forward", 32),
(0, "ibp", 32),
(1, "ibp", 32),
(0, "hybrid", 64),
(1, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(0, "hybrid", 16),
(1, "hybrid", 16),
(0, "forward", 16),
(1, "forward", 16),
(0, "ibp", 16),
(1, "ibp", 16),
],
)
def test_DecomonMultiply_multiD_box(n0, mode, floatx):
K.set_floatx("float{}".format(floatx))
eps = K.epsilon()
decimal = 5
if floatx == 16:
K.set_epsilon(1e-2)
decimal = 2
decomon_op = DecomonMultiply(dc_decomp=False, mode=mode)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1
x0_, y0_, z0_, u_c0_, W_u0_, b_u0_, l_c0_, W_l0_, b_l0_ = inputs_0_
x1_, y1_, z1_, u_c1_, W_u1_, b_u1_, l_c1_, W_l1_, b_l1_ = inputs_1_
if mode == "hybrid":
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
if mode == "forward":
output_decomon = decomon_op([z0, W_u0, b_u0, W_l0, b_l0] + [z1, W_u1, b_u1, W_l1, b_l1])
if mode == "ibp":
output_decomon = decomon_op([u_c0, l_c0] + [u_c1, l_c1])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
y_ = y0_ * y1_
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
u_, w_u_, b_u_, l_, w_l_, b_l_ = [None] * 6
z_ = z0_
if mode == "hybrid":
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
if mode == "forward":
z_, w_u_, b_u_, w_l_, b_l_ = output_
if mode == "ibp":
u_, l_ = output_
assert_output_properties_box(
inputs_0_[0], y_, None, None, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add", decimal=decimal
)
K.set_floatx("float32")
K.set_epsilon(eps)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonMultiply_multiD_box_to_monotonic(n0):
ref_op = Multiply()
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[1]), dc_decomp=False)[0]
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = y0 * y1
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
"""
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7])
def test_DecomonDot_1D_box(n0):
decomon_op = DecomonDot(axes=(-1, -1), dc_decomp=False)
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
output_decomon = decomon_op(inputs_0[2:] + inputs_1[2:])
model = Model(inputs_0[2:] + inputs_1[2:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[2:] + inputs_1_[2:])
z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
y_ = np.dot(y0, y1)
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
@pytest.mark.parametrize("n0", [0, 1, 2, 3, 4, 5, 6, 7])
def test_DecomonDot_1D_box_to_monotonic(n0):
ref_op = Dot(axes=(-1, -1))
inputs_0 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_1 = get_tensor_decomposition_1d_box(dc_decomp=False)
inputs_0_ = get_standart_values_1d_box(n0, dc_decomp=False)
inputs_1_ = get_standart_values_1d_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)
output_decomon = decomon_op(inputs_0[1:] + inputs_1[1:])
model = Model(inputs_0[1:] + inputs_1[1:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[1:] + inputs_1_[1:])
y_, z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonDot_multiD_box(n0):
decomon_op = DecomonDot(axes=(-1, -1), dc_decomp=False)
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
output_decomon = decomon_op(inputs_0[1:] + inputs_1[1:])
model = Model(inputs_0[1:] + inputs_1[1:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[1:] + inputs_1_[1:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
y_, z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
@pytest.mark.parametrize("n0", [0, 1])
def test_DecomonDot_multiD_box_to_monotonic(n0):
ref_op = Dot(axes=(1, 1))
inputs_0 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_1 = get_tensor_decomposition_multid_box(n0, dc_decomp=False)
inputs_0_ = get_standard_values_multid_box(n0, dc_decomp=False)
inputs_1_ = get_standard_values_multid_box(n0, dc_decomp=False)
x0, y0, z0, u_c0, W_u0, b_u0, l_c0, W_l0, b_l0 = inputs_0_
x1, y1, z1, u_c1, W_u1, b_u1, l_c1, W_l1, b_l1 = inputs_1_
ref_op([inputs_0[0], inputs_1[0]])
decomon_op = to_monotonic(ref_op, input_dim=(2, x0.shape[-1]), dc_decomp=False)
output_decomon = decomon_op(inputs_0[1:] + inputs_1[1:])
model = Model(inputs_0[1:] + inputs_1[1:], output_decomon)
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
output_ = model.predict(inputs_0_[1:] + inputs_1_[1:])
# output_ = K.function(inputs_0[1:]+inputs_1[1:], output_decomon)(inputs_0_[1:]+inputs_1_[1:])
y_, z_, u_, w_u_, b_u_, l_, w_l_, b_l_ = output_
assert_output_properties_box_linear(
inputs_0_[0], y_, z_[:, 0], z_[:, 1], u_, w_u_, b_u_, l_, w_l_, b_l_, name="add"
)
"""
| 32.786426
| 117
| 0.558084
| 10,980
| 69,081
| 3.095264
| 0.011384
| 0.072089
| 0.061202
| 0.043253
| 0.982228
| 0.965162
| 0.964603
| 0.962955
| 0.960248
| 0.960248
| 0
| 0.099218
| 0.259275
| 69,081
| 2,106
| 118
| 32.801994
| 0.56496
| 0.053995
| 0
| 0.92303
| 0
| 0
| 0.083226
| 0
| 0
| 0
| 0
| 0
| 0.018788
| 1
| 0.01697
| false
| 0
| 0.006061
| 0
| 0.02303
| 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
|
306d18afcc2fc0a52260aff5a384c869c2927b14
| 36
|
py
|
Python
|
oanda_bot/__init__.py
|
ibaris/oanda-bot-python
|
cedafb259b899fd0b096dabb50b7cb6420f096cc
|
[
"MIT"
] | 27
|
2020-07-17T09:41:50.000Z
|
2022-03-19T01:35:35.000Z
|
oanda_bot/__init__.py
|
ibaris/oanda-bot-python
|
cedafb259b899fd0b096dabb50b7cb6420f096cc
|
[
"MIT"
] | 9
|
2020-09-03T08:42:01.000Z
|
2022-01-13T03:02:03.000Z
|
oanda_bot/__init__.py
|
ibaris/oanda-bot-python
|
cedafb259b899fd0b096dabb50b7cb6420f096cc
|
[
"MIT"
] | 12
|
2020-10-25T03:09:08.000Z
|
2021-10-13T08:27:01.000Z
|
from oanda_bot.oanda_bot import Bot
| 18
| 35
| 0.861111
| 7
| 36
| 4.142857
| 0.571429
| 0.551724
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 36
| 1
| 36
| 36
| 0.90625
| 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
|
307a66e72c99191625379c1af397fda39a4d39a3
| 4,344
|
py
|
Python
|
cases/migrations/0004_auto_20190523_1053.py
|
johngriebel/APDIncidentReports
|
491b91bcc7eef9a32bda05ad3236b14748ba3b50
|
[
"MIT"
] | null | null | null |
cases/migrations/0004_auto_20190523_1053.py
|
johngriebel/APDIncidentReports
|
491b91bcc7eef9a32bda05ad3236b14748ba3b50
|
[
"MIT"
] | 16
|
2019-05-23T03:25:01.000Z
|
2022-02-10T08:54:24.000Z
|
cases/migrations/0004_auto_20190523_1053.py
|
johngriebel/APDIncidentReports
|
491b91bcc7eef9a32bda05ad3236b14748ba3b50
|
[
"MIT"
] | null | null | null |
# Generated by Django 2.2.1 on 2019-05-23 14:53
import datetime
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cases', '0003_auto_20180406_1304'),
]
operations = [
migrations.RemoveField(
model_name='incident',
name='damaged_amount_currency',
),
migrations.RemoveField(
model_name='incident',
name='stolen_amount_currency',
),
migrations.AddField(
model_name='address',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='address',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='city',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='city',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='incident',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='incident',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='incidentfile',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='incidentfile',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='incidentinvolvedparty',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='incidentinvolvedparty',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='offense',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='offense',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='officer',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='officer',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='state',
name='created_timestamp',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='state',
name='updated_timestamp',
field=models.DateTimeField(auto_now=True),
),
migrations.AlterField(
model_name='incident',
name='damaged_amount',
field=models.PositiveIntegerField(null=True),
),
migrations.AlterField(
model_name='incident',
name='report_datetime',
field=models.DateTimeField(default=datetime.datetime.now),
),
migrations.AlterField(
model_name='incident',
name='stolen_amount',
field=models.PositiveIntegerField(null=True),
),
]
| 34.204724
| 93
| 0.587247
| 390
| 4,344
| 6.338462
| 0.151282
| 0.076456
| 0.165049
| 0.174757
| 0.89199
| 0.89199
| 0.722896
| 0.692152
| 0.692152
| 0.692152
| 0
| 0.010323
| 0.308702
| 4,344
| 126
| 94
| 34.47619
| 0.812854
| 0.010359
| 0
| 0.875
| 1
| 0
| 0.132418
| 0.025599
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.025
| 0
| 0.05
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.