max_stars_repo_path
stringlengths 4
245
| max_stars_repo_name
stringlengths 7
115
| max_stars_count
int64 101
368k
| id
stringlengths 2
8
| content
stringlengths 6
1.03M
|
---|---|---|---|---|
services/ssh/create_60_sec_jwt.py
|
jrsouth/lagoon
| 418 |
112964
|
#!/usr/bin/env python3
import os
import jwt
from datetime import datetime, timezone, timedelta
iat = datetime.now(timezone.utc)
exp = iat + timedelta(minutes=1)
payload = {'exp': exp, 'iat': iat, 'role': 'admin', 'aud': os.environ['JWTAUDIENCE'], 'sub': 'ssh'}
print(jwt.encode(payload, os.environ['JWTSECRET'], algorithm='HS256').decode())
|
dialogue-engine/src/programy/clients/restful/yadlan/flask/client.py
|
cotobadesign/cotoba-agent-oss
| 104 |
112969
|
<reponame>cotobadesign/cotoba-agent-oss
"""
Copyright (c) 2020 COTOBA DESIGN, Inc.
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.
"""
"""
Copyright (c) 2016-2019 <NAME> http://www.keithsterling.com
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 time
import logging
from flask import Flask, jsonify, request, Response, make_response
from flask_cors import CORS
from programy.utils.logging.loghandler import YadlanLogHandler
from programy.utils.logging.ylogger import YLogger
from programy.clients.restful.yadlan.client import YadlanRestBotClient
class FlaskYadlanClient(YadlanRestBotClient):
def __init__(self, id, argument_parser=None):
YadlanRestBotClient.__init__(self, id, argument_parser)
self.initialise()
def get_request_body(self, request):
return request.data
def run(self, flask):
YLogger.set_default_level()
YLogger.debug(self, "%s Client running on %s:%s" %
(self.id,
self.configuration.client_configuration.host,
self.configuration.client_configuration.port))
self.startup()
if self.configuration.client_configuration.debug is True:
YLogger.debug(self, "%s Client running in debug mode" % self.id)
if self.configuration.client_configuration.ssl_cert_file is not None and \
self.configuration.client_configuration.ssl_key_file is not None:
context = (self.configuration.client_configuration.ssl_cert_file,
self.configuration.client_configuration.ssl_key_file)
YLogger.debug(self, "%s Client running in https mode" % self.id)
flask.run(host=self.configuration.client_configuration.host,
port=self.configuration.client_configuration.port,
debug=self.configuration.client_configuration.debug,
ssl_context=context)
else:
YLogger.debug(self, "%s Client running in http mode, careful now !" % self.id)
flask.run(host=self.configuration.client_configuration.host,
port=self.configuration.client_configuration.port,
debug=self.configuration.client_configuration.debug)
self.shutdown()
if __name__ == '__main__':
REST_CLIENT = None
print("Initiating Yadlan Flask Service...")
APP = Flask('yadlan')
CORS(APP)
APP.config['JSON_AS_ASCII'] = False
handler = YadlanLogHandler()
handler.setFormatter(logging.Formatter('%(message)s'))
werkzeug_logger = logging.getLogger('werkzeug')
werkzeug_logger.handlers.clear()
werkzeug_logger.addHandler(handler)
@APP.route('/<version>/stop', methods=['POST'])
def stopPost(version=None):
if REST_CLIENT.checkBotVersion(version) is False:
return Response(status='404')
try:
REST_CLIENT.save_data_before_exit()
except Exception:
pass
func = request.environ.get('werkzeug.server.shutdown')
if func is None:
raise RuntimeError('Not running with the Werkzeug Server')
func()
return 'OK'
@APP.route('/<version>/ask', methods=['POST'])
def askPost(version=None):
if REST_CLIENT.checkBotVersion(version) is False:
return Response(status='404')
currentStartTime = time.time()
response_data, status = REST_CLIENT.process_request(request)
latency = (time.time() - currentStartTime)
response_data['latency'] = latency
if REST_CLIENT.engine_version is not None:
response_data['version'] = REST_CLIENT.engine_version
rest_response = make_response(jsonify(REST_CLIENT.create_response(request, response_data, status, latency)))
rest_response.mimetype = 'application/json; charset=utf-8'
return rest_response, status
@APP.route('/<version>/status', methods=['GET'])
def statGet(version=None):
if REST_CLIENT.checkBotVersion(version) is False:
return Response(status='404')
return ''
@APP.route('/<version>/debug', methods=['POST'])
def debugPost(version=None):
if REST_CLIENT.checkBotVersion(version) is False:
return Response(status='404')
try:
debugInfo, status = REST_CLIENT.process_debug_request(request)
if REST_CLIENT.engine_version is not None:
debugInfo['version'] = REST_CLIENT.engine_version
except Exception:
pass
response = make_response(jsonify(debugInfo))
response.mimetype = 'application/json; charset=utf-8'
return response, status
print("Loading, please wait...")
REST_CLIENT = FlaskYadlanClient("yadlan")
print("Server start...")
REST_CLIENT.run(APP)
|
util/compute_bootstrap.py
|
AnneBeyer/tgen
| 222 |
112975
|
<filename>util/compute_bootstrap.py
#!/usr/bin/env python
# -"- coding: utf-8 -"-
from argparse import ArgumentParser
import os
import re
from subprocess import call
from tgen.logf import log_info
MY_PATH = os.path.dirname(os.path.abspath(__file__))
def lcall(arg_str):
log_info(arg_str)
return call(arg_str, shell=True)
def get_confidence(metric, lines):
for idx, line in enumerate(lines):
if line.startswith(metric):
lines = lines[idx:]
break
for idx, line in enumerate(lines):
if line.startswith('Confidence of [Sys1'):
return line.strip()
return '???'
def process_all(args):
join_sets = os.path.join(MY_PATH, 'join_sets.pl')
gen_log = os.path.join(MY_PATH, 'mteval-v13a-sig.pl')
bootstrap = os.path.join(MY_PATH, 'paired_bootstrap_resampling_bleu_v13a.pl')
# create the test and source files
lcall("%s %s/s*/test-conc.sgm > %s/test-conc.sgm" %
(join_sets, args.experiment_dirs[0], args.target_dir))
lcall("%s %s/s*/test-das.sgm > %s/test-das.sgm" %
(join_sets, args.experiment_dirs[0], args.target_dir))
exp_nums = []
for exp_dir in args.experiment_dirs:
exp_num = int(re.search(r'(?:^|/)([0-9]+)', exp_dir).group(1))
exp_nums.append(exp_num)
lcall("%s %s/s*/out-text.sgm > %s/%d.sgm" % (join_sets, exp_dir, args.target_dir, exp_num))
os.chdir(args.target_dir)
for exp_num in exp_nums:
lcall("%s -s test-das.sgm -r test-conc.sgm -t %d.sgm -f %d.log.txt > %d.score.txt" %
(gen_log, exp_num, exp_num, exp_num))
for skip, exp_num1 in enumerate(exp_nums):
for exp_num2 in exp_nums[skip + 1:]:
# recompute only if not done already (TODO switch for this)
out_file = 'bootstrap.%dvs%d.txt' % (exp_num1, exp_num2)
if not os.path.isfile(out_file) or os.stat(out_file).st_size == 0:
lcall("%s %s.log.txt %s.log.txt 1000 0.01 > %s" %
(bootstrap, exp_num1, exp_num2, out_file))
with open(out_file) as fh:
bootstrap_data = fh.readlines()
print "%dvs%d BLEU: %s" % (exp_num1, exp_num2, bootstrap_data[0].strip())
if __name__ == '__main__':
ap = ArgumentParser()
ap.add_argument('target_dir', type=str, help='Target directory for bootstrap logs')
ap.add_argument('experiment_dirs', nargs='+', type=str, help='Experiment directories to use')
args = ap.parse_args()
process_all(args)
|
vilya/views/settings/codereview.py
|
mubashshirjamal/code
| 1,582 |
112981
|
# -*- coding: utf-8 -*-
import json
from vilya.libs.auth.decorators import login_required
from vilya.libs.template import st
_q_exports = ['setting', ]
@login_required
def _q_index(request):
user = request.user
return st('settings/codereview.html', **locals())
@login_required
def setting(request):
is_enable = request.get_form_var('is_enable')
field = request.get_form_var('field')
user = request.user
result = "success"
origin = user.settings.__getattr__(field)
try:
user.settings.__setattr__(field, is_enable)
except Exception:
result = "fail"
return json.dumps({"result": result, "origin": origin})
|
neo/io/intanio.py
|
Mario-Kart-Felix/python-neo
| 199 |
113038
|
<filename>neo/io/intanio.py
from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.intanrawio import IntanRawIO
class IntanIO(IntanRawIO, BaseFromRaw):
__doc__ = IntanRawIO.__doc__
_prefered_signal_group_mode = 'group-by-same-units'
def __init__(self, filename):
IntanRawIO.__init__(self, filename=filename)
BaseFromRaw.__init__(self, filename)
|
bfxapi/models/trade.py
|
uggel/bitfinex-api-py
| 162 |
113066
|
<filename>bfxapi/models/trade.py<gh_stars>100-1000
"""
Module used to describe all of the different data types
"""
import datetime
class TradeModel:
"""
Enum used to index the different values in a raw trade array
"""
ID = 0
PAIR = 1
MTS_CREATE = 2
ORDER_ID = 3
EXEC_AMOUNT = 4
EXEC_PRICE = 5
ORDER_TYPE = 6
ORDER_PRICE = 7
MAKER = 8
FEE = 9
FEE_CURRENCY = 10
class Trade:
"""
ID integer Trade database id
PAIR string Pair (BTCUSD, ...)
MTS_CREATE integer Execution timestamp
ORDER_ID integer Order id
EXEC_AMOUNT float Positive means buy, negative means sell
EXEC_PRICE float Execution price
ORDER_TYPE string Order type
ORDER_PRICE float Order price
MAKER int 1 if true, 0 if false
FEE float Fee
FEE_CURRENCY string Fee currency
"""
SHORT = 'SHORT'
LONG = 'LONG'
def __init__(self, tid, pair, mts_create, order_id, amount, price, order_type,
order_price, maker, fee, fee_currency):
# pylint: disable=invalid-name
self.id = tid
self.pair = pair
self.mts_create = mts_create
self.date = datetime.datetime.fromtimestamp(mts_create/1000.0)
self.order_id = order_id
self.amount = amount
self.direction = Trade.SHORT if amount < 0 else Trade.LONG
self.price = price
self.order_type = order_type
self.order_price = order_price
self.maker = maker
self.fee = fee
self.fee_currency = fee_currency
@staticmethod
def from_raw_rest_trade(raw_trade):
"""
Generate a Trade object from a raw trade array
"""
# [24224048, 'tBTCUSD', 1542800024000, 1151353484, 0.09399997, 19963, None, None,
# -1, -0.000188, 'BTC']
tid = raw_trade[TradeModel.ID]
pair = raw_trade[TradeModel.PAIR]
mtsc = raw_trade[TradeModel.MTS_CREATE]
oid = raw_trade[TradeModel.ORDER_ID]
amnt = raw_trade[TradeModel.EXEC_AMOUNT]
price = raw_trade[TradeModel.EXEC_PRICE]
otype = raw_trade[TradeModel.ORDER_TYPE]
oprice = raw_trade[TradeModel.ORDER_PRICE]
maker = raw_trade[TradeModel.MAKER]
fee = raw_trade[TradeModel.FEE]
feeccy = raw_trade[TradeModel.FEE_CURRENCY]
return Trade(tid, pair, mtsc, oid, amnt, price, otype, oprice, maker,
fee, feeccy)
def __str__(self):
return "Trade '{}' x {} @ {} <direction='{}' fee={}>".format(
self.pair, self.amount, self.price, self.direction, self.fee)
|
examples/sample_program.py
|
GProulx/PyCuber
| 199 |
113100
|
import sys
import os
import pycuber as pc
from pycuber.solver import CFOPSolver
c = pc.Cube()
alg = pc.Formula()
random_alg = alg.random()
c(random_alg)
solver = CFOPSolver(c)
solution = solver.solve(suppress_progress_messages=True)
print(solution)
|
tests/attacks/test_adversarial_embedding.py
|
monshri/adversarial-robustness-toolbox
| 1,350 |
113101
|
<filename>tests/attacks/test_adversarial_embedding.py
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
import unittest
import numpy as np
from art.attacks.poisoning.backdoor_attack import PoisoningAttackBackdoor
from art.attacks.poisoning.adversarial_embedding_attack import PoisoningAttackAdversarialEmbedding
from art.attacks.poisoning.perturbations import add_pattern_bd
from art.utils import load_dataset
from tests.utils import master_seed, get_image_classifier_kr_tf
os.environ["KMP_DUPLICATE_LIB_OK"] = "True"
logger = logging.getLogger(__name__)
BATCH_SIZE = 100
NB_TRAIN = 5000
NB_TEST = 10
NB_EPOCHS = 1
class TestAdversarialEmbedding(unittest.TestCase):
"""
A unittest class for testing Randomized Smoothing as a post-processing step for classifiers.
"""
@classmethod
def setUpClass(cls):
# Get MNIST
(x_train, y_train), (x_test, y_test), _, _ = load_dataset("mnist")
x_train, y_train = x_train[:NB_TRAIN], y_train[:NB_TRAIN]
x_test, y_test = x_test[:NB_TEST], y_test[:NB_TEST]
cls.mnist = (x_train, y_train), (x_test, y_test)
def setUp(self):
master_seed(seed=301)
def test_keras(self):
"""
Test with a KerasClassifier.
:return:
"""
# Build KerasClassifier
krc = get_image_classifier_kr_tf(loss_type="label")
# Get MNIST
(x_train, y_train), (_, _) = self.mnist
target_idx = 9
target = np.zeros(10)
target[target_idx] = 1
target2 = np.zeros(10)
target2[(target_idx + 1) % 10] = 1
backdoor = PoisoningAttackBackdoor(add_pattern_bd)
emb_attack = PoisoningAttackAdversarialEmbedding(krc, backdoor, 2, target)
classifier = emb_attack.poison_estimator(x_train, y_train, nb_epochs=NB_EPOCHS)
data, labels, bd = emb_attack.get_training_data()
self.assertEqual(x_train.shape, data.shape)
self.assertEqual(y_train.shape, labels.shape)
self.assertEqual(bd.shape, (len(x_train), 2))
# Assert successful cloning of classifier model
self.assertTrue(classifier is not krc)
emb_attack2 = PoisoningAttackAdversarialEmbedding(krc, backdoor, 2, [(target, target2)])
_ = emb_attack2.poison_estimator(x_train, y_train, nb_epochs=NB_EPOCHS)
data, labels, bd = emb_attack2.get_training_data()
self.assertEqual(x_train.shape, data.shape)
self.assertEqual(y_train.shape, labels.shape)
self.assertEqual(bd.shape, (len(x_train), 2))
_ = PoisoningAttackAdversarialEmbedding(krc, backdoor, 2, [(target, target2)], pp_poison=[0.4])
def test_errors(self):
krc = get_image_classifier_kr_tf(loss_type="function")
krc_valid = get_image_classifier_kr_tf(loss_type="label")
backdoor = PoisoningAttackBackdoor(add_pattern_bd)
target_idx = 9
target = np.zeros(10)
target[target_idx] = 1
target2 = np.zeros(10)
target2[(target_idx + 1) % 10] = 1
# invalid loss function
with self.assertRaises(TypeError):
_ = PoisoningAttackAdversarialEmbedding(krc, backdoor, 2, target)
# feature layer not real name
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, "not a layer", target)
# feature layer out of range
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, target)
# target misshaped
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, np.expand_dims(target, axis=0))
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, [target])
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, target, regularization=-1)
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, target, discriminator_layer_1=-1)
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, target, discriminator_layer_2=-1)
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, target, pp_poison=-1)
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, [(target, target2)], pp_poison=[])
with self.assertRaises(ValueError):
_ = PoisoningAttackAdversarialEmbedding(krc_valid, backdoor, 20, [(target, target2)], pp_poison=[-1])
if __name__ == "__main__":
unittest.main()
|
scripts/pretrain.py
|
yihui-he/longformer
| 1,458 |
113129
|
import argparse
import glob
import os
import random
import logging
import numpy as np
import math
from tqdm import tqdm
import time
import torch
from transformers import AutoTokenizer, AutoModelForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers.optimization import AdamW, get_linear_schedule_with_warmup
from torch.utils.data import Dataset, DataLoader
import pytorch_lightning as ptl
from pytorch_lightning.logging.test_tube import TestTubeLogger
from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateLogger
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# DONE: reproduce RoBERTa numbers on the Longformer corpus
# DONE: testing ddp single machine
# DONE: testing ddp multiple machines
# DONE: testing resume from checkpoint
# TODO: try on a TPU-pod
# TODO: run on beaker on ai2-server1/2
try:
import torch_xla.core.xla_model as xm
except ImportError:
XLA_AVAILABLE = False
else:
XLA_AVAILABLE = True
class MMapTextDataset(Dataset):
def __init__(self, mmap_filename, chunk_size, bos_token_id, eos_token_id):
# `chunk_size - 2` to reserve space for <s> and </s>
self.num_instances = np.memmap(mmap_filename, mode='r', dtype=np.uint16).shape[0] // (chunk_size - 2)
# defer loading the token_ids memmap until after the first __getitem__ call.
# when spawning new processes for ddp, there is a hard limit in python < 3.8 that
# pickle files need to be < 4GB. By waiting until after the first __getitem__ we
# don't have to pickle the memmap
self.token_ids = None
self._mmap_filename = mmap_filename
self._chunk_size = chunk_size
self._bos_token_id = bos_token_id
self._eos_token_id = eos_token_id
def __len__(self):
return self.num_instances
def __getitem__(self, i):
if self.token_ids is None:
self.token_ids = np.memmap(self._mmap_filename, mode='r', dtype=np.uint16)
from_index = i * (self._chunk_size - 2)
to_index = (i + 1) * (self._chunk_size - 2)
data = np.concatenate(([self._bos_token_id], self.token_ids[from_index:to_index], [self._eos_token_id]))
return torch.tensor(data, dtype=torch.long)
# ========================= preprocessing code ========================= #
@staticmethod
def _process_file(full_fname):
"Step 1: tokenize an input text file then save token ids into `np.memmap` shards of size `args.shard_size`"
fname = full_fname.split('/')[-1]
log_filename = f'{args.input_dir}/logs-{args.shard_size}/{fname}.log'
if os.path.isfile(log_filename):
logging.info(f'Skipping {full_fname} ...')
return # log file already exists. Skip current file.
logging.info(f'Processing {full_fname} ...')
with open(full_fname, 'r') as fin:
token_list = []
shard_count = 0
tokens_count = 0
def _write_shard():
if len(token_list) == 0:
return
if token_list[-1] != MMapTextDataset.tokenizer.sep_token_id: # handle a rare case
token_list.append(MMapTextDataset.tokenizer.sep_token_id)
shared_filename = f'{args.input_dir}/shards-{args.shard_size}/{fname}-{shard_count}.bin'
logging.info(f'Writing {len(token_list)} tokens to shared {shared_filename}')
fp = np.memmap(shared_filename, dtype=np.uint16, mode='w+', shape=len(token_list))
fp[:] = token_list[:]
del fp # flush and close file
for line in tqdm(fin):
line = line.strip()
if line == '': # drop empty lines
continue
tokens = MMapTextDataset.tokenizer.encode(line, add_special_tokens=False) # `__getitem__` adds special tokens
token_list.extend(tokens)
if len(token_list) > args.shard_size:
_write_shard()
tokens_count += len(token_list)
token_list = []
shard_count += 1
else:
token_list.append(MMapTextDataset.tokenizer.sep_token_id)
_write_shard()
tokens_count += len(token_list)
with open(log_filename, 'w') as f:
f.write(f'Generated {tokens_count} tokens in {shard_count + 1} shards')
@staticmethod
def _combine_shards(output_fname, shards_list):
"Step 2: combining memmap shards into one `train.bin` or `val.bin` file"
total_size = 0
for filename in shards_list:
total_size += np.memmap(filename, mode='r', dtype=np.uint16).shape[0]
logging.info(f'Writing {total_size} tokens to {output_fname}')
all_token_ids = np.empty(total_size, dtype=np.uint16)
last_token_index = 0
for filename in tqdm(shards_list):
shared = np.memmap(filename, mode='r', dtype=np.uint16)
all_token_ids[last_token_index:last_token_index+len(shared)] = shared[:]
last_token_index += len(shared)
fp = np.memmap(output_fname, dtype=np.uint16, mode='w+', shape=total_size)
fp[:] = all_token_ids[:]
del fp
@staticmethod
def raw_text_to_mmap(args):
"""This is the main preprocessing function. It processes all the text files in `args.input_dir` and
outputs two np.memmap files, one for training and one for validation with ratio `args.train_dev_split`.
Processing each input file involves tokenizing it, sharding it into shards of size `args.shard_size`,
then writing each shard as an np.memmap file. The stream of tokens in the memmap file represents documents
separated with `tokenizer.sep_token`. In `__getitem__`, the `tokenizer.bos_token` and `tokenizer.eos_token`
are added. The reason for not adding them at preprocessing time is to allow different sequence lengths
later on. Notice that this is the "FULL-SENTENCES" setting in the RoBERTa paper, Table2.
"""
MMapTextDataset.tokenizer = AutoTokenizer.from_pretrained(args.tokenizer, use_fast=True)
assert len(MMapTextDataset.tokenizer) < 65535 # will use uint16 to store token ids
all_files = glob.glob(f'{args.input_dir}/*.txt')
if os.path.exists(f'{args.input_dir}/cache/train.bin') and os.path.exists(f'{args.input_dir}/cache/val.bin'):
logger.info("Cache already exists. Remove the cache directory to regenerate")
return
try:
os.mkdir(f'{args.input_dir}/cache/')
except FileExistsError:
pass
try:
os.mkdir(f'{args.input_dir}/shards-{args.shard_size}/')
except FileExistsError:
pass
try:
os.mkdir(f'{args.input_dir}/logs-{args.shard_size}/') # log progrss to be able to resume
except FileExistsError:
pass
# STEP1: tokenizing and saving to shards
if args.num_preprocessing_workers > 1:
from multiprocessing.pool import Pool
with Pool(args.num_preprocessing_workers) as p:
list(tqdm(p.imap(MMapTextDataset._process_file, all_files), total=len(all_files)))
else:
[MMapTextDataset._process_file(f) for f in tqdm(all_files)]
# STEP2: shuffling shards and combining them into train.bin and val.bin files
all_shards = glob.glob(f'{args.input_dir}/shards-{args.shard_size}/*.bin')
random.shuffle(all_shards) # shuffling based on shards not individual lines
val_shards_count = int(args.train_dev_split * len(all_shards))
val_shards = all_shards[:val_shards_count]
train_shards = all_shards[val_shards_count:]
# TODO: if MMapTextDataset._combining_shards is very slow for large files, it can be skipped but we nned to
# update the dataset to read from multiple shards directly
MMapTextDataset._combine_shards(f'{args.input_dir}/cache/val.bin', val_shards)
MMapTextDataset._combine_shards(f'{args.input_dir}/cache/train.bin', train_shards)
del MMapTextDataset.tokenizer
# ========================= end preprocessing code ========================= #
class Pretrainer(ptl.LightningModule):
def __init__(self, hparams):
super().__init__()
self.args = hparams
self.hparams = self.args
self.model = AutoModelForMaskedLM.from_pretrained(args.model)
self.config = self.model.config
tokenizer = AutoTokenizer.from_pretrained(args.tokenizer)
self.pad_token_id = tokenizer.pad_token_id
self.eos_token_id = tokenizer.eos_token_id
self.bos_token_id = tokenizer.bos_token_id
logger.info(f'Creating dataset cache from dir {self.args.input_dir}. This could be slow the first time.')
MMapTextDataset.raw_text_to_mmap(args)
# TODO: add support for other objective functions (whole word masking, BART objectives)
self.data_collator = DataCollatorForLanguageModeling(
tokenizer=tokenizer, mlm=True, mlm_probability=self.args.mlm_prob
)
self.start_time = 0
def to(self, *args, **kwargs):
param_count_before_to = len(list(self.parameters()))
super().to(*args, **kwargs)
if self.trainer.use_tpu:
# need to re-tie the weights after moving to XLA!
self.model.tie_weights()
if 'roberta' in self.args.model:
self.model.lm_head.bias = self.model.lm_head.decoder.bias
param_count_after_to = len(list(self.parameters()))
assert param_count_before_to == param_count_after_to
def forward(self, input_ids=None, labels=None):
# get the padding mask - 1 for NOT masked, 0 for MASKED/PAD
attention_mask = (input_ids != self.pad_token_id).int()
# output is loss, prediction_scores, hidden_states
output = self.model(input_ids=input_ids, attention_mask=attention_mask, labels=labels)
return output[0] # loss
def training_step(self, batch, batch_nb):
loss = self(**batch)
input_ids = batch['input_ids']
tensorboard_logs = {
'input_size': input_ids.numel(),
'mlm_loss': loss,
'mlm_bpc': loss/math.log(2),
'mlm_perplexity': torch.exp(loss),
'token_per_step': input_ids.numel() * self.args.grad_accum * self.trainer.world_size,
}
if self.start_time != 0:
elapsed_time = time.time() - self.start_time
tensorboard_logs['second_per_batch'] = elapsed_time
self.start_time = time.time()
if self.on_gpu:
tensorboard_logs['memory'] = torch.cuda.memory_allocated(loss.device) / 1024 ** 3
return {'loss': loss, 'log': tensorboard_logs}
def validation_step(self, batch, batch_nb):
# TODO: log how long evaluation takes
self.start_time = 0 # reset training_step timer
loss = self(**batch)
tensorboard_logs = {
'val_mlm_loss': loss.detach(),
}
return {'val_loss': tensorboard_logs["val_mlm_loss"], 'log': tensorboard_logs}
def validation_epoch_end(self, outputs):
avg_loss = torch.stack([x['log']['val_mlm_loss'] for x in outputs if 'val_mlm_loss' in x['log']]).mean()
if self.use_ddp:
# TODO: PTL is already doing this. Is it still needed here?
# https://github.com/PyTorchLightning/pytorch-lightning/blob/0.8.5/pytorch_lightning/metrics/converters.py#L251
torch.distributed.all_reduce(avg_loss, op=torch.distributed.ReduceOp.SUM)
avg_loss /= torch.distributed.get_world_size()
elif self.use_tpu:
avg_loss = xm.all_reduce(xm.REDUCE_SUM, avg_loss) / xm.xrt_world_size()
logs = {'val_mlm_loss': avg_loss}
return {'log': logs, 'progress_bar': logs, "val_loss": avg_loss}
def configure_optimizers(self):
no_decay = ["bias", "LayerNorm.weight"]
optimizer_grouped_parameters = [
{
"params": [p for n, p in self.named_parameters() if not any(nd in n for nd in no_decay) and p.requires_grad],
"weight_decay": self.args.weight_decay,
},
{
"params": [p for n, p in self.named_parameters() if any(nd in n for nd in no_decay) and p.requires_grad],
"weight_decay": 0.0,
},
]
optimizer = AdamW(optimizer_grouped_parameters, lr=self.args.lr, eps=self.args.adam_epsilon)
scheduler = get_linear_schedule_with_warmup(
optimizer, num_warmup_steps=self.args.warmup_steps, num_training_steps=self.args.train_steps
)
return [optimizer], [{"scheduler": scheduler, "interval": "step"}]
def _get_loader(self, fname, is_train):
dataset = MMapTextDataset(fname, chunk_size=self.args.seqlen,
bos_token_id=self.bos_token_id, eos_token_id=self.eos_token_id)
# TODO: consider `replace_sampler_ddp=True` and removing the following if statement
if self.trainer.use_ddp:
sampler = torch.utils.data.distributed.DistributedSampler(dataset, shuffle=is_train)
shuffle = False
elif self.trainer.use_tpu:
sampler = torch.utils.data.distributed.DistributedSampler(
dataset,
num_replicas=xm.xrt_world_size(),
rank=xm.get_ordinal(),
shuffle=is_train,
)
shuffle = False
else:
sampler = None
shuffle = is_train
loader = DataLoader(
dataset,
batch_size=self.args.batch_size,
shuffle=shuffle,
sampler=sampler,
num_workers=self.args.num_workers,
collate_fn=self.data_collator,
drop_last=is_train,
)
return loader
def train_dataloader(self):
return self._get_loader(f'{self.args.input_dir}/cache/train.bin', True)
def val_dataloader(self):
return self._get_loader(f'{self.args.input_dir}/cache/val.bin', False)
def grad_norm(self, norm_type):
# Override PTL `grad_norm` function to only return `total_grad_norm` instead norms of individual params
# TODO: grad_norm reporting needs to take fp16 loss scale into account
parameters = [p for p in self.parameters() if p.grad is not None]
device = parameters[0].device
total_norm = torch.zeros([], device=device if parameters else None)
norm_type = float(norm_type)
for p in parameters:
param_norm = p.grad.data.pow(norm_type).sum()
total_norm.add_(param_norm)
total_norm = (total_norm ** (1.0 / norm_type))
return {'total_grad_norm': total_norm}
@staticmethod
def add_args(parser):
parser.add_argument("--seed", type=int, default=3)
# Dataset. Some of these params are only useful when generating the dataset cache
parser.add_argument("--input_dir", type=str, default='/net/nfs.corp/s2-research/beltagy/longformer/data/')
# Used only at the preprocessing phase
parser.add_argument("--train_dev_split", type=float, default=0.05)
parser.add_argument("--shard_size", type=int, default=1024 ** 3 // 4) # 250MB
parser.add_argument("--num_preprocessing_workers", type=int, default=1)
# Used only at the training phase
parser.add_argument("--seqlen", type=int, default=512)
parser.add_argument("--mlm_prob", type=float, default=0.15)
# HF model loading
parser.add_argument("--tokenizer", type=str, default='roberta-base')
parser.add_argument("--model", type=str, default='roberta-base')
# Checkpointing and logging
parser.add_argument("--save_dir", type=str, default='/runs/')
parser.add_argument("--save_prefix", type=str, default='test',
help="path of output directory is --save_dir/--save_prefix")
parser.add_argument("--resume", type=str, default=None, # It is better to use a different output dir.
help="Path to a checkpoint to load model weights and training state. It overwrites args")
parser.add_argument("--resume_model_only", type=str, default=None,
help="Path to a checkpoint to load model weights but not training state")
parser.add_argument("--log_rate", type=int, default=10)
parser.add_argument("--disable_checkpointing", type=bool, default=False)
# Training hyperparams
parser.add_argument("--lr", type=float, default=1e-5)
parser.add_argument("--train_steps", type=int, default=3000, help='# training grad. updates')
parser.add_argument("--warmup_steps", type=int, default=1000, help='# warmup grad. updates')
parser.add_argument("--val_every", type=int, default=1000, help='# training grad. updates between evaluations')
parser.add_argument("--val_batches", type=int, default=1000, help='# evaluation **batches**')
parser.add_argument("--weight_decay", type=float, default=0.01)
parser.add_argument("--adam_epsilon", type=float, default=1e-6)
parser.add_argument("--grad_clip", type=float, default=0) # TODO: test this with fp16. Likely not working
# RoBERTa's tokens_per_step = 2^18 = 512(seqlen) x 1(gpu_count) x 32(batch_size) x 16(grad_accum)
parser.add_argument("--batch_size", type=int, default=32)
parser.add_argument("--grad_accum", type=int, default=1)
# Compute resources
parser.add_argument("--fp16", type=bool, default=False)
parser.add_argument("--num_workers", type=int, default=0)
parser.add_argument("--gpu_count", type=int, default=1, # `--gpus` is reserved for internal use by PTL
help="Number of gpus. This respects `CUDA_VISIBLE_DEVICES`")
# For multi-node training, use the PyTorch launch script. The script and instructions can be found here:
# https://github.com/pytorch/pytorch/blob/master/torch/distributed/launch.py.
# To run PTL in a mode compatible with the launch script, two things are needed:
# - pass the argument `--use_env` to `torch.distributed.launch`
# - make sure `--nproc_per_node` matches `--gpu_count` and `--nnodes` matches `--node_count`.
# For example, to run on 2 nodes, 3 gpus each, the command line on node rank 1 would be like:
# >>>> python -m torch.distributed.launch \
# --use_env --nnodes 2 --nproc_per_node 3 \
# --node_rank 1 --master_addr s2-server4 --master_port 12343 \
# scripts/pretrain.py \
# --gpu_count 2 --node_count 2 \
# --input_dir my_data_dir --save_prefix test_multinode
parser.add_argument("--node_count", type=int, default=1,
help="Number of nodes. It needs to match --nnodes of torch.distributed.launch")
parser.add_argument("--tpu_core_count", type=int, default=None)
return parser
def main(args):
random.seed(args.seed * 10)
np.random.seed(args.seed * 100)
torch.manual_seed(args.seed * 1000)
if torch.cuda.is_available():
torch.cuda.manual_seed_all(args.seed * 10000)
if args.resume_model_only is not None:
pretrainer = Pretrainer.load_from_checkpoint(args.resume_model_only, args)
else:
pretrainer = Pretrainer(args)
# logger here is a SummaryWritter for tensorboard
# it is used by the trainer, and certain return variables
# from the model are automatically logged
logger = TestTubeLogger(
save_dir=args.save_dir,
name=args.save_prefix,
version=0 # always use version=0
)
checkpoint_callback = ModelCheckpoint(
# model saved to filepath/prefix_....
filepath=os.path.join(args.save_dir, args.save_prefix, 'checkpoint'),
prefix='',
save_top_k=1,
save_last=True,
verbose=True,
monitor='val_loss',
mode='min',
period=-1, # to allow multiple checkpoints per epoch
)
args.val_every *= args.grad_accum # PTL is expecting number of batches_per_gpu
trainer = ptl.Trainer(
gpus=args.gpu_count,
num_nodes=args.node_count,
num_tpu_cores=args.tpu_core_count,
distributed_backend='ddp' if (args.gpu_count > 1 or args.node_count > 1) else None,
replace_sampler_ddp=False,
track_grad_norm=2,
max_epochs=10000, min_epochs=0, max_steps=args.train_steps, # run for many epochs, but stop after max_steps
val_check_interval=args.val_every, limit_val_batches=args.val_batches,
early_stop_callback=None,
row_log_interval=args.log_rate,
progress_bar_refresh_rate=args.log_rate,
logger=logger,
checkpoint_callback=checkpoint_callback if not args.disable_checkpointing else None,
accumulate_grad_batches=args.grad_accum,
resume_from_checkpoint=args.resume,
gradient_clip_val=args.grad_clip,
precision=16 if args.fp16 else 32, amp_level='O2',
num_sanity_val_steps=2,
callbacks=[LearningRateLogger()],
)
trainer.fit(pretrainer)
if __name__ == "__main__":
parser = Pretrainer.add_args(argparse.ArgumentParser(description="pretrain"))
args = parser.parse_args()
main(args)
|
model/utils/pad.py
|
UmaTaru/run
| 163 |
113159
|
import torch
from torch.autograd import Variable
from .convert import to_var
from .vocab import PAD_TOKEN, SOS_TOKEN, EOS_TOKEN
def pad(tensor, length, dtype=None):
if isinstance(tensor, Variable):
var = tensor
if length > var.size(0):
return torch.cat(
[var, torch.zeros(
length - var.size(0), *var.size()[1:], dtype=dtype).cuda()])
else:
return var
else:
if length > tensor.size(0):
return torch.cat(
[tensor, torch.zeros(
length - tensor.size(0), *tensor.size()[1:], dtype=dtype).cuda()])
else:
return tensor
def pad_and_pack(tensor_list):
length_list = ([t.size(0) for t in tensor_list])
max_len = max(length_list)
padded = [pad(t, max_len) for t in tensor_list]
packed = torch.stack(padded, 0)
return packed, length_list
def pad_tokens(tokens, max_sentence_length=30):
n_valid_tokens = len(tokens)
if n_valid_tokens > max_sentence_length - 1:
tokens = tokens[:max_sentence_length - 1]
n_pad = max_sentence_length - n_valid_tokens - 1
tokens = tokens + [EOS_TOKEN] + [PAD_TOKEN] * n_pad
return tokens
def pad_conversation(conversation, max_sentence_length=30):
conversation = [pad_tokens(sentence,
max_sentence_length=max_sentence_length) for sentence in conversation]
return conversation
def pad_sentences(conversations, max_sentence_length=30, max_conversation_length=10):
all_padded_sentences = []
all_sentence_length = []
for conversation in conversations:
if len(conversation) > max_conversation_length:
conversation = conversation[:max_conversation_length]
sentence_length = [min(len(sentence) + 1, max_sentence_length) # +1 for EOS token
for sentence in conversation]
all_sentence_length.append(sentence_length)
sentences = pad_conversation(conversation)
all_padded_sentences.append(sentences)
# [n_conversations, n_sentence (various), max_sentence_length]
sentences = all_padded_sentences
# [n_conversations, n_sentence (various)]
sentence_length = all_sentence_length
return sentences, sentence_length
|
python/v2.6/configure_dynamic_asset_selection.py
|
byagihas/googleads-dfa-reporting-samples
| 103 |
113187
|
<reponame>byagihas/googleads-dfa-reporting-samples
#!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""This example enables dynamic asset selection for an in-stream video creative.
Requires an existing in-stream video creative, a new video asset, and a
targeting template ID as input. To get an in-stream video creative, run
create_instream_video_creative.py. To get a targeting template, run
create_targeting_template.py.
"""
import argparse
import sys
from apiclient.http import MediaFileUpload
import dfareporting_utils
from oauth2client import client
# Declare command-line flags.
argparser = argparse.ArgumentParser(add_help=False)
argparser.add_argument(
'profile_id', type=int,
help='The ID of the profile to configure dynamic asset selection for')
argparser.add_argument(
'creative_id', type=int,
help='The ID of the in-stream video creative to configure selection for.')
argparser.add_argument(
'template_id', type=int,
help='The ID of the template to use for targeting.')
argparser.add_argument(
'video_name', help='Suggested name to use for the uploaded creative asset.')
argparser.add_argument(
'path_to_video_file', help='Path to the asset file to be uploaded.')
def main(argv):
# Retrieve command line arguments.
flags = dfareporting_utils.get_arguments(argv, __doc__, parents=[argparser])
# Authenticate and construct service.
service = dfareporting_utils.setup(flags)
profile_id = flags.profile_id
creative_id = flags.creative_id
template_id = flags.template_id
path_to_video_file = flags.path_to_video_file
video_name = flags.video_name
try:
# Retrieve the specified creative.
creative = service.creatives().get(profileId=profile_id,
id=creative_id).execute()
if not creative or creative['type'] != 'INSTREAM_VIDEO':
sys.exit('Invalid creative specified.')
if 'creativeAssetSelection' not in creative:
# Locate an existing video asset to use as a default.
default_asset_id = next((asset['id']
for asset in creative['creativeAssets']
if asset['role'] == 'PARENT_VIDEO'), None)
if not default_asset_id:
sys.exit('Default video asset could not be found.')
# Enable dynamic asset selection for the creative.
creative['dynamicAssetSelection'] = True
# Create a new selection using the existing asset as a default.
creative['creativeAssetSelection'] = {
'defaultAssetId': default_asset_id,
'rules': []
}
# Upload the new video asset and add it to the creative.
video_asset = upload_creative_asset(
service, profile_id, creative['advertiserId'], video_name,
path_to_video_file, 'VIDEO')
creative['creativeAssets'].append({
'assetIdentifier': video_asset['assetIdentifier'],
'role': 'PARENT_VIDEO'
})
# Create a rule targeting the new video asset and add it to the creative.
creative['creativeAssetSelection']['rules'].append({
'assetId': video_asset['id'],
'name': 'Test rule for asset %s' % video_asset['id'],
'targetingTemplateId': template_id
})
request = service.creatives().update(profileId=profile_id, body=creative)
# Execute request and print response.
response = request.execute()
print ('Dynamic asset selection enabled for creative with ID %s.'
% response['id'])
except client.AccessTokenRefreshError:
print ('The credentials have been revoked or expired, please re-run the '
'application to re-authorize')
def upload_creative_asset(
service, profile_id, advertiser_id, asset_name, path_to_asset_file,
asset_type):
"""Uploads a creative asset and returns a creative asset metadata object."""
# Construct the creative asset metadata
creative_asset = {
'assetIdentifier': {
'name': asset_name,
'type': asset_type
}
}
media = MediaFileUpload(path_to_asset_file)
if not media.mimetype():
media = MediaFileUpload(path_to_asset_file, 'application/octet-stream')
response = service.creativeAssets().insert(
advertiserId=advertiser_id,
profileId=profile_id,
media_body=media,
body=creative_asset).execute()
return response
if __name__ == '__main__':
main(sys.argv)
|
uxy/uxy_du.py
|
sustrik/uxy
| 735 |
113221
|
# Copyright (c) 2019 <NAME>
#
# 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 argparse
import re
import sys
from uxy import base
def _linux(args, uxy_args):
parser = argparse.ArgumentParser("__main__.py du", add_help=False)
parser.add_argument("-0", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("--null", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("-c", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("--total", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("-h", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("--human-readable", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("--si", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("-s", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("--summarize", action="store_true", default=argparse.SUPPRESS)
parser.add_argument("--time", nargs="?", default=argparse.SUPPRESS)
parser.add_argument("--time-style", nargs=1, default=argparse.SUPPRESS)
parser.add_argument("--help", action="store_true", default=argparse.SUPPRESS)
base.check_args(args, parser)
if uxy_args.long:
fmtargs = ['--time', '--time-style=full-iso']
regexp = re.compile(r'\s*([^\s]*)\s+([^\s]*)\s+([^\s]*)\s+([^\s]*)\s+(.*)')
fmt = base.Format("USAGE TIME FILE")
else:
fmtargs = []
regexp = re.compile(r'\s*([^\s]*)\s+(.*)')
fmt = base.Format("USAGE FILE")
proc = base.launch(uxy_args, ['du'] + fmtargs + args[1:])
base.writeline(fmt.render())
for ln in proc:
m = regexp.match(ln)
if not m:
continue
fields = []
if uxy_args.long:
time = "%sT%s%s:%s" % (m.group(2), m.group(3), m.group(4)[:-2],
m.group(4)[-2:])
fields.append(base.encode_field(m.group(1)))
fields.append(base.encode_field(time))
fields.append(base.encode_field(m.group(5)))
else:
for i in range(1, regexp.groups + 1):
fields.append(base.encode_field(m.group(i)))
base.writeline(fmt.render(fields))
return proc.wait()
def _bsd(args, uxy_args):
fmtargs = []
regexp = re.compile(r'\s*([^\s]*)\s+(.*)')
fmt = base.Format("USAGE FILE")
proc = base.launch(uxy_args, ['du'] + fmtargs + args[1:])
base.writeline(fmt.render())
for ln in proc:
m = regexp.match(ln)
if not m:
continue
fields = []
for i in range(1, regexp.groups + 1):
fields.append(base.encode_field(m.group(i)))
base.writeline(fmt.render(fields))
return proc.wait()
def du(args, uxy_args):
if uxy_args.platform.startswith("linux"):
_linux(args, uxy_args)
else:
_bsd(args, uxy_args)
|
newm/hysteresis.py
|
sadrach-cl/newm
| 265 |
113223
|
from __future__ import annotations
import math
class Hysteresis:
def __init__(self, amount: float, initial_value: float):
self._amount = amount
self._at = round(initial_value)
def __call__(self, value: float) -> int:
i, j = math.floor(value), math.ceil(value)
if self._at != i and self._at != j:
self._at = round(value)
di, dj = abs(value - i), abs(value - j)
if di + self._amount < dj and self._at == j:
self._at = i
if dj + self._amount < di and self._at == i:
self._at = j
return self._at
if __name__ == '__main__':
h = Hysteresis(0.2, 0)
for v in [0.5, 0.7, 1.0, 1.2, 1.5, 1.3, 1.5, 1.7, 1.5]:
print(v, h(v))
|
saas/system/api/resource/backend-framework/webpy/tesla-faas/teslafaas/server_entry/webapp/proxy_handler.py
|
iuskye/SREWorks
| 407 |
113239
|
#!/usr/bin/env python
# encoding: utf-8
""" """
from common.decorators import exception_wrapper
__author__ = 'adonis'
import re
import httplib
import urllib
import web
import requests
import requests_unixsocket
import logging
from teslafaas.common.const import ALL_HEADERS, NON_WSGI_HEADER
from teslafaas.common.util_func import get_cur_time_ms
requests_unixsocket.monkeypatch()
log = logging.getLogger(__name__)
class NoContainerPath(Exception):
pass
# TODO: multipart http request support
class ProxyHandler(object):
US_URL_PREFIX = u'http+unix://%2Ftmp%2Ftesla-faas%2F'
US_URL_SOCKET = u'container-%s.socket'
# GW_PATTERN = '^/v2/apps/(?P<app_name>.*?)/faas/(?P<service_name>.*?)/(?P<service_url>.*)$'
# GW_EMPTY_SERVICE_PATTERN = '^/v2/apps/(?P<app_name>.*?)/faas/(?P<service_name>.*?)[/]?$'
GW_PATTERN = '/v2/apps/(?P<app_name>.*?)/faas/(?P<service_name>.*?)/(?P<service_url>.*)$'
GW_EMPTY_SERVICE_PATTERN = '/v2/apps/(?P<app_name>.*?)/faas/(?P<service_name>.*?)[/]?$'
@classmethod
def parse_url(cls):
url_path = web.ctx.path
if url_path in ('/', ''):
raise NoContainerPath()
paths = url_path.split('/')
if len(paths) < 2:
raise NoContainerPath()
if re.search("/v2/apps/", web.ctx.path):
return cls.parse_gateway_url(url_path)
else:
c_name = paths[1]
if url_path.startswith('/%s/' % c_name):
target_uri = url_path.replace('/%s/' % c_name, "")
else:
target_uri = url_path.replace('/%s' % c_name, "")
return c_name, target_uri
@classmethod
def parse_gateway_url(cls, gw_url):
m = re.search(cls.GW_PATTERN, gw_url)
if m is None:
m = re.search(cls.GW_EMPTY_SERVICE_PATTERN, gw_url)
if m is None:
raise Exception('invalid gateway url path: %s' % gw_url)
res = m.groupdict()
return res['service_name'], res.get('service_url', '')
@classmethod
def get_container_url_path(cls):
container_name, target_uri = cls.parse_url()
socket_name = ProxyHandler.US_URL_SOCKET % container_name
socket_name = urllib.quote(socket_name)
res = u"%s%s/%s" % (ProxyHandler.US_URL_PREFIX, socket_name, target_uri)
return res
@staticmethod
def get_proxy_headers():
headers = {}
for x in ALL_HEADERS:
if x == 'Content-Length':
continue
wsgi_header = ("HTTP_%s" % x).upper().replace('-', '_')
if x in NON_WSGI_HEADER:
wsgi_header = x.upper().replace('-', '_')
header_value = web.ctx.env.get(wsgi_header, '')
if header_value:
headers[x] = header_value
return headers
@staticmethod
def cors_wl_process():
# origin header exist only in cross site request
origin = web.ctx.env.get('HTTP_ORIGIN', '')
# if origin:
# web.header('Access-Control-Allow-Origin', origin)
# web.header('Access-Control-Allow-Credentials', 'true')
# web.header("Access-Control-Allow-Methods",
# "GET,POST,OPTIONS,PUT,DELETE")
# web.header("Access-Control-Allow-Headers",
# "Content-Type,Accept,X-Auth-User,X-User-Info,"
# "Product-Name,X-File,X-Product,X-Cluster, "
# "X-Upload-Path")
def debug_info(self, start=True):
debug_info = "%s: %s"
url_path = "%s%s" % (web.ctx.home, web.ctx.fullpath)
if start:
title = "START"
detail_fields = (web.ctx.method, url_path)
else:
title = "END"
delay_ms = get_cur_time_ms() - self._start_time
delay_ms_str = "%sms" % delay_ms
detail_fields = (web.ctx.method, url_path, web.ctx.status, delay_ms_str)
debug_info = debug_info % (title, " ".join(detail_fields))
return debug_info
def proxy(self, http_method):
# with requests_unixsocket.monkeypatch():
self._start_time = get_cur_time_ms()
log.info(self.debug_info(start=True))
res = self._proxy(http_method)
log.info(self.debug_info(start=False))
return res
def _proxy(self, http_method):
try:
target = self.get_container_url_path()
log.info('target container url path: %s', target)
http_method = http_method.lower()
req_func = getattr(requests, http_method)
req_args = dict(
verify=False,
data=web.data(),
params=web.input(),
timeout=60,
headers=self.get_proxy_headers(),
)
if not self.get_proxy_headers().has_key('HTTP_X_EMPID'):
raise requests.RequestException
response = req_func(target, **req_args)
except requests.RequestException as e:
raise Exception("can not connect to container/service: %s. %s"
% (self.parse_url(), e))
status_code = response.status_code
# error processing
if 200 <= status_code < 300:
pass
elif 400 <= status_code < 500:
pass
else:
pass
# set status line
web.ctx.status = "%s %s" % (
status_code, httplib.responses.get(status_code, ""))
# set headers
for x in ALL_HEADERS:
value = response.headers.get(x, None)
if value:
web.header(x, value)
# set body
return response.content
@exception_wrapper
def GET(self):
try:
self.get_container_url_path()
except NoContainerPath:
return "success"
# return json.dumps(dict(code=200, message='Tesla FaaS Server', data=[]))
return self.proxy('GET')
@exception_wrapper
def POST(self):
return self.proxy('POST')
@exception_wrapper
def PUT(self):
return self.proxy('PUT')
@exception_wrapper
def DELETE(self):
return self.proxy('DELETE')
|
tests/integration/test_run_distillation_agent.py
|
medipixel/rl_algorithms
| 466 |
113262
|
<filename>tests/integration/test_run_distillation_agent.py
"""Test only one step of distillation file for training."""
import os
import pickle
import re
import shutil
import subprocess
def check_distillation_agent(config: str, run_file: str):
"""Test that 1 episode of run file works well."""
cmd = (
f"python {run_file} --cfg-path {config} --integration-test "
+ f"--episode-num 1 --interim-test 1 --off-render"
)
p = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
shell=True,
)
output, _ = p.communicate()
print(str(output))
assert p.returncode == 0
# Find saved checkpoint path and data path.
pattern = r"./checkpoint/.+/"
data_pattern = r"data/.+/"
checkpoint_path = re.findall(pattern, str(output))[0]
full_data_path, n_frame_from_last_path = re.findall(data_pattern, str(output))
try:
num_episode_step = re.findall(r"episode step: \d+", str(output))[0]
num_episode_step = int(re.findall(r"\d+", num_episode_step)[0])
# Check if the number of data is same with iterated episode step.
saved_data_list = os.listdir(full_data_path)
assert (
len(saved_data_list) == num_episode_step
), "The number of data does not match the number of iterated episode steps."
# Check if n_frame_from_last works well.
n_frame_from_last_data_list = os.listdir(n_frame_from_last_path)
assert 3 == len(
n_frame_from_last_data_list
), f"n_frame_from_last doesn't work properly(expected num of data: 3, num of data: {len(n_frame_from_last_data_list)})."
# Check if train-phase data only contaions state, not state & q value.
with open(full_data_path + saved_data_list[0], "rb") as f:
datum = pickle.load(f)
assert (
len(datum) == 1
), "The length of the data is not appropriate(length must be 1, state only)."
except Exception as e:
raise e
finally:
"""Delete generated directories."""
delete_path(checkpoint_path)
delete_path(full_data_path)
delete_path(n_frame_from_last_path)
def delete_path(path: str):
"""Delete directory."""
shutil.rmtree(path)
# TODO: Add student training test code.
def test_distillation():
"""Test distillation agent."""
check_distillation_agent(
"configs/pong_no_frameskip_v4/distillation_dqn.yaml",
"run_pong_no_frameskip_v4.py",
)
check_distillation_agent(
"configs/lunarlander_v2/distillation_dqn.yaml", "run_lunarlander_v2.py"
)
if __name__ == "__main__":
test_distillation()
|
tools/lib-alert-tree/metalk8s/__init__.py
|
SaintLoong/metalk8s
| 255 |
113299
|
<filename>tools/lib-alert-tree/metalk8s/__init__.py
"""MetalK8s hierarchy of alerts."""
from lib_alert_tree.models import Relationship, severity_pair
from lib_alert_tree.prometheus import PrometheusRule
from .network import NETWORK_WARNING
from .nodes import NODE_WARNING, NODE_CRITICAL
from .platform import PLATFORM_WARNING, PLATFORM_CRITICAL
from .volumes import VOLUME_WARNING, VOLUME_CRITICAL
CLUSTER_WARNING, CLUSTER_CRITICAL = severity_pair(
name="Cluster",
summary_name="The cluster",
relationship=Relationship.ANY,
warning_children=[NETWORK_WARNING, NODE_WARNING, PLATFORM_WARNING, VOLUME_WARNING],
critical_children=[NODE_CRITICAL, PLATFORM_CRITICAL, VOLUME_CRITICAL],
duration="1m",
)
|
azure/core/pipeline/transport/_base_async.py
|
adityasingh1993/azure-core
| 2,728 |
113310
|
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# 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 asyncio
import abc
from collections.abc import AsyncIterator
from typing import AsyncIterator as AsyncIteratorType, TypeVar, Generic, Any
from ._base import (
_HttpResponseBase,
_HttpClientTransportResponse,
)
from ...utils._pipeline_transport_rest_shared_async import _PartGenerator
try:
from contextlib import AbstractAsyncContextManager # type: ignore
except ImportError: # Python <= 3.7
class AbstractAsyncContextManager(object): # type: ignore
async def __aenter__(self):
"""Return `self` upon entering the runtime context."""
return self
@abc.abstractmethod
async def __aexit__(self, exc_type, exc_value, traceback):
"""Raise any exception triggered within the runtime context."""
return None
AsyncHTTPResponseType = TypeVar("AsyncHTTPResponseType")
HTTPResponseType = TypeVar("HTTPResponseType")
HTTPRequestType = TypeVar("HTTPRequestType")
class _ResponseStopIteration(Exception):
pass
def _iterate_response_content(iterator):
""""To avoid:
TypeError: StopIteration interacts badly with generators and cannot be raised into a Future
"""
try:
return next(iterator)
except StopIteration:
raise _ResponseStopIteration()
class AsyncHttpResponse(_HttpResponseBase): # pylint: disable=abstract-method
"""An AsyncHttpResponse ABC.
Allows for the asynchronous streaming of data from the response.
"""
def stream_download(self, pipeline, **kwargs) -> AsyncIteratorType[bytes]:
"""Generator for streaming response body data.
Should be implemented by sub-classes if streaming download
is supported. Will return an asynchronous generator.
:param pipeline: The pipeline object
:type pipeline: azure.core.pipeline.Pipeline
:keyword bool decompress: If True which is default, will attempt to decode the body based
on the *content-encoding* header.
"""
def parts(self) -> AsyncIterator:
"""Assuming the content-type is multipart/mixed, will return the parts as an async iterator.
:rtype: AsyncIterator
:raises ValueError: If the content is not multipart/mixed
"""
if not self.content_type or not self.content_type.startswith("multipart/mixed"):
raise ValueError(
"You can't get parts if the response is not multipart/mixed"
)
return _PartGenerator(self, default_http_response_type=AsyncHttpClientTransportResponse)
class AsyncHttpClientTransportResponse(_HttpClientTransportResponse, AsyncHttpResponse):
"""Create a HTTPResponse from an http.client response.
Body will NOT be read by the constructor. Call "body()" to load the body in memory if necessary.
:param HttpRequest request: The request.
:param httpclient_response: The object returned from an HTTP(S)Connection from http.client
"""
class AsyncHttpTransport(
AbstractAsyncContextManager,
abc.ABC,
Generic[HTTPRequestType, AsyncHTTPResponseType]
):
"""An http sender ABC.
"""
@abc.abstractmethod
async def send(self, request, **kwargs):
"""Send the request using this HTTP sender.
"""
@abc.abstractmethod
async def open(self):
"""Assign new session if one does not already exist."""
@abc.abstractmethod
async def close(self):
"""Close the session if it is not externally owned."""
async def sleep(self, duration):
await asyncio.sleep(duration)
|
social/backends/openstreetmap.py
|
raccoongang/python-social-auth
| 1,987 |
113312
|
from social_core.backends.openstreetmap import OpenStreetMapOAuth
|
internal/usecases/metafunctions/metafunctions.py
|
HEmile/problog
| 189 |
113339
|
<reponame>HEmile/problog
"""
Module name
"""
testprogram = """
a(1).
a(2).
b(1,2).
b(2,3).
c(2,6).
c(3,4).
c(3,5).
d(5).
q(X,Z) :- @f(a(X),b(X,Y)), c(Y,Z), @g(d(Z)).
query(q(_,_)).
"""
from problog.engine import DefaultEngine
from problog.program import PrologString
from problog.logic import *
from problog.formula import LogicFormula
from problog.engine_stack import SimpleProbabilisticBuiltIn
import re
import sys
from collections import defaultdict
def builtin_annotate(annotation, *terms, **kwdargs):
return builtin_annotate_help(annotation, terms, **kwdargs)
def builtin_annotate_help(
annotation, terms, target=None, database=None, engine=None, **kwdargs
):
body = And.from_list(terms)
body_vars = body.variables()
clause_head = Term(engine.get_non_cache_functor(), *body_vars)
clause = Clause(clause_head, body)
subdb = database.extend()
subdb += clause
results = engine.call(
clause_head, subcall=True, database=subdb, target=target, **kwdargs
)
results = [(res, n) for res, n in results]
output = []
for res, node in results:
varvalues = {var: val for var, val in zip(body_vars, res)}
output.append(([annotation] + [term.apply(varvalues) for term in terms], node))
target.annotations[node].append(annotation)
return output
def main(filename=None):
# Step 1: remove syntactic sugar
if filename is None:
data = testprogram
else:
with open(filename) as f:
data = f.read()
data, count = re.subn("@([^(]+)[(]", r"annotate(\1, ", data)
model = PrologString(data)
engine = DefaultEngine(label_all=True)
for i in range(2, 10):
engine.add_builtin("annotate", i, SimpleProbabilisticBuiltIn(builtin_annotate))
db = engine.prepare(model)
gp = LogicFormula(keep_all=True)
gp.annotations = defaultdict(list)
gp = engine.ground_all(db, target=gp)
print(gp)
print(gp.annotations)
pass
if __name__ == "__main__":
main(*sys.argv[1:])
|
docs/examples/data_access/django/example/app/test_app.py
|
connec/oso
| 2,167 |
113380
|
import pytest
from django_oso.models import AuthorizedModel, authorize_model
from django_oso.oso import Oso, reset_oso
from django.core.management import call_command
from app.models import Post, User
@pytest.fixture(autouse=True)
def reset():
reset_oso()
@pytest.fixture
def users():
(manager, _) = User.objects.get_or_create(username="manager")
(user, _) = User.objects.get_or_create(username="user", manager=manager)
return {"user": user, "manager": manager}
@pytest.fixture
def posts(users):
(public_user_post, _) = Post.objects.get_or_create(
contents="public user post", access_level="public", creator=users["user"]
)
(private_user_post, _) = Post.objects.get_or_create(
contents="private user post", access_level="private", creator=users["user"]
)
(public_manager_post, _) = Post.objects.get_or_create(
contents="public manager post",
access_level="public",
creator=users["manager"],
)
(private_manager_post, _) = Post.objects.get_or_create(
contents="private manager post",
access_level="private",
creator=users["manager"],
)
return {
"public_user_post": public_user_post,
"private_user_post": private_user_post,
"public_manager_post": public_manager_post,
"private_manager_post": private_manager_post,
}
@pytest.mark.django_db
def test_user_access_to_posts(users, posts):
authorized_posts = Post.objects.authorize(None, actor=users["user"], action="GET")
assert authorized_posts.count() == 3
assert posts["public_user_post"] in authorized_posts
assert posts["private_user_post"] in authorized_posts
assert posts["public_manager_post"] in authorized_posts
@pytest.mark.django_db
def test_manager_access_to_posts(users, posts):
authorized_posts = Post.objects.authorize(
None, actor=users["manager"], action="GET"
)
assert authorized_posts.count() == 4
assert posts["public_user_post"] in authorized_posts
assert posts["private_user_post"] in authorized_posts
assert posts["public_manager_post"] in authorized_posts
assert posts["private_manager_post"] in authorized_posts
|
config/config.py
|
vovanphuc/hum2song
| 108 |
113393
|
class Config(object):
env = 'default'
backbone = 'resnet18'
classify = 'softmax'
num_classes = 5000
metric = 'arc_margin'
easy_margin = False
use_se = False
loss = 'focal_loss'
display = False
finetune = False
meta_train = '/preprocessed/train_meta.csv'
train_root = '/preprocessed'
train_list = 'full_data_train.txt'
val_list = 'full_data_val.txt'
checkpoints_path = 'checkpoints'
save_interval = 1
train_batch_size = 32 # batch size
input_shape = (630, 80)
mp3aug_ratio = 1.0
npy_aug = True
optimizer = 'sgd'
use_gpu = True # use GPU or not
gpu_id = '0, 1'
num_workers = 0 # how many workers for loading data
print_freq = 100 # print info every N batch
debug_file = '/tmp/debug' # if os.path.exists(debug_file): enter ipdb
result_file = '/result/submission.csv'
max_epoch = 100
lr = 1e-2 # initial learning rate
lr_step = 10
lr_decay = 0.5 # when val_loss increase, lr = lr*lr_decay
weight_decay = 1e-1
|
tests/r/test_slid.py
|
hajime9652/observations
| 199 |
113404
|
<reponame>hajime9652/observations
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.slid import slid
def test_slid():
"""Test module slid.py by downloading
slid.csv and testing shape of
extracted data has 7425 rows and 5 columns
"""
test_path = tempfile.mkdtemp()
x_train, metadata = slid(test_path)
try:
assert x_train.shape == (7425, 5)
except:
shutil.rmtree(test_path)
raise()
|
tock/projects/templatetags/project_tags.py
|
mikiec84/tock
| 134 |
113486
|
from django import template
register = template.Library()
def get(value, key):
return value.get(key)
register.filter('get', get)
|
azure-devops/azext_devops/devops_sdk/v6_0/pipelines_checks/__init__.py
|
dhilmathy/azure-devops-cli-extension
| 248 |
113603
|
<reponame>dhilmathy/azure-devops-cli-extension
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# Generated file, DO NOT EDIT
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------------------------
from .models import *
from .pipelines_checks_client import PipelinesChecksClient
__all__ = [
'ApprovalConfig',
'ApprovalConfigSettings',
'CheckConfiguration',
'CheckConfigurationRef',
'CheckRun',
'CheckRunResult',
'CheckSuite',
'CheckSuiteRef',
'CheckSuiteRequest',
'CheckType',
'GraphSubjectBase',
'IdentityRef',
'ReferenceLinks',
'Resource',
'TaskCheckConfig',
'TaskCheckDefinitionReference',
'PipelinesChecksClient'
]
|
helpers/labml_helpers/datasets/remote/test/mnist_server.py
|
mcx/labml
| 174 |
113625
|
<reponame>mcx/labml<gh_stars>100-1000
from labml import lab
from labml_helpers.datasets.remote import DatasetServer
from torchvision import datasets, transforms
def main():
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.1307,), (0.3081,))
])
train_dataset = datasets.MNIST(str(lab.get_data_path()),
train=True,
download=True,
transform=transform)
valid_dataset = datasets.MNIST(str(lab.get_data_path()),
train=False,
download=True,
transform=transform)
ds = DatasetServer()
ds.add_dataset('mnist_train', train_dataset)
ds.add_dataset('mnist_valid', valid_dataset)
ds.start()
if __name__ == '__main__':
main()
|
test/dlc_tests/benchmark/bai/mxnet/training/test_performance_mxnet_training.py
|
Elizaaaaa/deep-learning-containers
| 383 |
113647
|
import re
import pytest
from invoke.context import Context
from test.test_utils.benchmark import execute_single_node_benchmark, get_py_version
@pytest.mark.skip(reason="Temp skip due to timeout")
@pytest.mark.model("resnet18_v2")
@pytest.mark.integration("cifar10 dataset")
def test_performance_mxnet_cpu(mxnet_training, cpu_only):
ctx = Context()
python_version = get_py_version(mxnet_training)
task_name = f"mx_train_single_node_cpu_{python_version}_resnet18v2_cifar10"
script_url = " https://github.com/awslabs/deeplearning-benchmark.git"
execute_single_node_benchmark(ctx, mxnet_training, "mxnet", task_name, python_version, script_url)
|
recipes/Python/277099_Rss_aggregator_with_twisted/recipe-277099.py
|
tdiprima/code
| 2,023 |
113675
|
<gh_stars>1000+
from twisted.internet import reactor, protocol, defer
from twisted.web import client
import feedparser, time, sys
# You can get this file from http://xoomer.virgilio.it/dialtone/out.py
# Since it's only a list of URLs made in this way:
# out = [ ( 'URL', 'EXTRA_INFOS'),
# ( 'URL', 'EXTRA_INFOS')
# ...
# ]
import out
try:
import cStringIO as _StringIO
except ImportError:
import StringIO as _StringIO
rss_feeds = out.rss_feed # This is the HUGE feed list (730 feeds)
DEFERRED_GROUPS = 60 # Number of simultaneous connections
INTER_QUERY_TIME = 300 # Max Age (in seconds) of each feed in the cache
TIMEOUT = 30 # Timeout in seconds for the web request
# This dict structure will be the following:
# { 'URL': (TIMESTAMP, value) }
cache = {}
class FeederProtocol(object):
def __init__(self):
self.parsed = 1
self.with_errors = 0
self.error_list = []
def isCached(self, site):
# Try to get the tuple (TIMESTAMP, FEED_STRUCT) from the dict if it has
# already been downloaded. Otherwise assign None to already_got
already_got = cache.get(site[0], None)
# Ok guys, we got it cached, let's see what we will do
if already_got:
# Well, it's cached, but will it be recent enough?
elapsed_time = time.time() - already_got[0]
# Woooohooo it is, elapsed_time is less than INTER_QUERY_TIME so I
# can get the page from the memory, recent enough
if elapsed_time < INTER_QUERY_TIME:
return True
else:
# Uhmmm... actually it's a bit old, I'm going to get it from the
# Net then, then I'll parse it and then I'll try to memoize it
# again
return False
else:
# Well... We hadn't it cached in, so we need to get it from the Net
# now, It's useless to check if it's recent enough, it's not there.
return False
def gotError(self, traceback, extra_args):
# An Error as occurred, print traceback infos and go on
print traceback, extra_args
self.with_errors += 1
self.error_list.append(extra_args)
print "="*20
print "Trying to go on..."
def getPageFromMemory(self, data, key=None):
# Getting the second element of the tuple which is the parsed structure
# of the feed at address key, the first element of the tuple is the
# timestamp
print "Getting from memory..."
return defer.succeed(cache.get(key,key)[1])
def parseFeed(self, feed):
# This is self explaining :)
print "parsing..."
try:
feed+''
parsed = feedparser.parse(_StringIO.StringIO(feed))
except TypeError:
parsed = feedparser.parse(_StringIO.StringIO(str(feed)))
print "parsed feed"
return parsed
def memoize(self, feed, addr):
# feed is the raw structure, just as returned from feedparser.parse()
# while addr is the address from which the feed was got.
print "Memoizing",addr,"..."
if cache.get(addr, None):
cache[addr] = (time.time(), feed)
else:
cache.setdefault(addr, (time.time(),feed))
return feed
def workOnPage(self, parsed_feed, addr):
# As usual, addr is the feed address and file is the file in
# which you can eventually save the structure.
print "-"*20
print "finished retrieving"
print "Feed Version:",parsed_feed.get('version','Unknown')
#
# Uncomment the following if you want to print the feeds
#
chan = parsed_feed.get('channel', None)
if chan:
print chan.get('title', '')
#print chan.get('link', '')
#print chan.get('tagline', '')
#print chan.get('description','')
print "-"*20
#items = parsed_feed.get('items', None)
#if items:
# for item in items:
# print '\tTitle: ', item.get('title','')
# print '\tDate: ', item.get('date', '')
# print '\tLink: ', item.get('link', '')
# print '\tDescription: ', item.get('description', '')
# print '\tSummary: ', item.get('summary','')
# print "-"*20
#print "got",addr
#print "="*40
return parsed_feed
def stopWorking(self, data=None):
print "Closing connection number %d..."%(self.parsed,)
print "=-"*20
# This is here only for testing. When a protocol/interface will be
# created to communicate with this rss-aggregator server, we won't need
# to die after we parsed some feeds just one time.
self.parsed += 1
print self.parsed, self.END_VALUE
if self.parsed > self.END_VALUE: #
print "Closing all..." #
for i in self.error_list: # Just for testing sake
print i #
print len(self.error_list) #
reactor.stop() #
def getPage(self, data, args):
return client.getPage(args,timeout=TIMEOUT)
def printStatus(self, data=None):
print "Starting feed group..."
def start(self, data=None, std_alone=True):
d = defer.succeed(self.printStatus())
for feed in data:
# Now we start telling the reactor that it has
# to get all the feeds one by one...
cached = self.isCached(feed)
if not cached:
# When the feed is not cached, it's time to
# go and get it from the web directly
d.addCallback(self.getPage, feed[0])
d.addErrback(self.gotError, (feed[0], 'getting'))
# Parse the feed and if there's some errors call self.gotError
d.addCallback(self.parseFeed)
d.addErrback(self.gotError, (feed[0], 'parsing'))
# Now memoize it, if there's some error call self.getError
d.addCallback(self.memoize, feed[0])
d.addErrback(self.gotError, (feed[0], 'memoizing'))
else: # If it's cached
d.addCallback(self.getPageFromMemory, feed[0])
d.addErrback(self.gotError, (feed[0], 'getting from memory'))
# When you get the raw structure you can work on it
# to format in the best way you can think of.
# For any error call self.gotError.
d.addCallback(self.workOnPage, feed[0])
d.addErrback(self.gotError, (feed[0], 'working on page'))
# And when the for loop is ended we put
# stopWorking on the callback for the last
# feed gathered
# This is only for testing purposes
if std_alone:
d.addCallback(self.stopWorking)
d.addErrback(self.gotError, (feed[0], 'while stopping'))
if not std_alone:
return d
class FeederFactory(protocol.ClientFactory):
protocol = FeederProtocol()
def __init__(self, std_alone=False):
self.feeds = self.getFeeds()
self.std_alone = std_alone
self.protocol.factory = self
self.protocol.END_VALUE = len(self.feeds) # this is just for testing
if std_alone:
self.start(self.feeds)
def start(self, addresses):
# Divide into groups all the feeds to download
if len(addresses) > DEFERRED_GROUPS:
url_groups = [[] for x in xrange(DEFERRED_GROUPS)]
for i, addr in enumerate(addresses):
url_groups[i%DEFERRED_GROUPS].append(addr)
else:
url_groups = [[addr] for addr in addresses]
for group in url_groups:
if not self.std_alone:
return self.protocol.start(group, self.std_alone)
else:
self.protocol.start(group, self.std_alone)
def getFeeds(self, where=None):
# This is used when you call a COMPLETE refresh of the feeds,
# or for testing purposes
#print "getting feeds"
# This is to get the feeds we want
if not where: # We don't have a database, then we use the local
# variabile rss_feeds
return rss_feeds
else: return None
if __name__=="__main__":
f = FeederFactory(std_alone=True)
reactor.run()
|
test_project/tst/models.py
|
babayko/django-fias
| 108 |
113686
|
<gh_stars>100-1000
from django.db import models
# Create your models here.
from fias.fields import AddressField, ChainedAreaField
from fias.models import AddrObj, FIASAddress, FIASAddressWithArea, FIASHouse
class Item(models.Model):
title = models.CharField('title', max_length=100)
location = AddressField()
class ItemWithArea(models.Model):
title = models.CharField('title', max_length=100)
location = AddressField()
area = ChainedAreaField(AddrObj, on_delete=models.CASCADE, address_field='location', related_name='+')
#class CachedAddress(FIASAddress):
# pass
#class CachedAddressWithArea(FIASAddressWithArea):
# pass
#class CachedAddressWithHouse(FIASAddress, FIASHouse):
# pass
#class NullableAddressItem(models.Model):
# title = models.CharField('title', max_length=100)
#
# location = AddressField(blank=True, null=True)
|
eg/eg_exec.py
|
sbienkow/eg
| 1,389 |
113702
|
# In eg 0.0.x, this file could be used to invoke eg directly, without installing
# via pip. Eg 0.1.x switched to also support python 3. This meant changing the
# way imports were working, which meant this script had to move up a level to be
# a sibling of the eg module directory. This file will exist for a time in order
# to try and give a more friendly error for people that are using the symlink
# approach. This warning will eventually disappear in a future version of eg.
DEPRECATION_WARNING = """
You are invoking eg via the script at <eg-repo>/eg/eg_exec.py. This file has
been deprecated in order to work with both python 2 and 3.
Please instead invoke <eg-repo>/eg_exec.py, or install with pip.
If you're using a symlink and need to update it, try something like the
following:
rm `which eg`
ln -s <absolute-path-to-eg-repo>/eg_exec.py /usr/local/bin/eg
Or, simply install with pip:
sudo pip install eg
"""
print(DEPRECATION_WARNING)
|
siammot/modelling/track_head/EMM/sr_pool.py
|
pha-nguyen/siam-mot
| 399 |
113720
|
import torch
from torch import nn
from maskrcnn_benchmark.modeling.poolers import LevelMapper
from maskrcnn_benchmark.modeling.utils import cat
from maskrcnn_benchmark.layers import ROIAlign
class SRPooler(nn.Module):
"""
SRPooler for Detection with or without FPN.
Also, the requirement of passing the scales is not strictly necessary, as they
can be inferred from the size of the feature map / size of original image,
which is available thanks to the BoxList.
"""
def __init__(self, output_size, scales, sampling_ratio):
"""
Arguments:
output_size (list[tuple[int]] or list[int]): output size for the pooled region
scales (list[float]): scales for each Pooler
sampling_ratio (int): sampling ratio for ROIAlign
"""
super(SRPooler, self).__init__()
poolers = []
for scale in scales:
poolers.append(
ROIAlign(
output_size, spatial_scale=scale, sampling_ratio=sampling_ratio
)
)
self.poolers = nn.ModuleList(poolers)
self.output_size = output_size
# get the levels in the feature map by leveraging the fact that the network always
# downsamples by a factor of 2 at each level.
lvl_min = -torch.log2(torch.tensor(scales[0], dtype=torch.float32)).item()
lvl_max = -torch.log2(torch.tensor(scales[-1], dtype=torch.float32)).item()
self.map_levels = LevelMapper(lvl_min, lvl_max)
def convert_to_roi_format(self, boxes):
concat_boxes = cat([b.bbox for b in boxes], dim=0)
device, dtype = concat_boxes.device, concat_boxes.dtype
ids = cat(
[
torch.full((len(b), 1), i, dtype=dtype, device=device)
for i, b in enumerate(boxes)
],
dim=0,
)
rois = torch.cat([ids, concat_boxes], dim=1)
return rois
def forward(self, x, boxes, sr=None):
"""
Arguments:
x (list[Tensor]): feature maps for each level
boxes (list[BoxList]): boxes to be used to perform the pooling operation.
sr(list([BoxList])): search region boxes.
Returns:
result (Tensor)
"""
num_levels = len(self.poolers)
if sr is None:
rois = self.convert_to_roi_format(boxes)
else:
# extract features for SR when it is none
rois = self.convert_to_roi_format(sr)
if num_levels == 1:
return self.poolers[0](x[0], rois)
# Always use the template box to get the feature level
levels = self.map_levels(boxes)
num_rois = len(rois)
num_channels = x[0].shape[1]
output_size = self.output_size[0]
dtype, device = x[0].dtype, x[0].device
result = torch.zeros(
(num_rois, num_channels, output_size, output_size),
dtype=dtype,
device=device,
)
for level, (per_level_feature, pooler) in enumerate(zip(x, self.poolers)):
idx_in_level = torch.nonzero(levels == level).squeeze(1)
rois_per_level = rois[idx_in_level]
result[idx_in_level] = pooler(per_level_feature, rois_per_level).to(dtype)
return result
|
examples/issues/issue249.py
|
tgolsson/appJar
| 666 |
113726
|
<gh_stars>100-1000
import sys
sys.path.append("../../")
from appJar import gui
def DoExit(opt):
if app.yesNoBox("Confirm exit","Exit sub window now?", parent="SUB1"):
app.hideSubWindow("SUB1")
with gui("Example","400x200") as app:
app.setLocation(100,100)
with app.subWindow("SUB1", modal=True):
app.addEntry("E1")
app.addButton("Exit",DoExit)
app.addNamedButton("SubWindow", "SUB1", app.showSubWindow)
app.addButton("Quit", app.stop)
|
languages/python/oso/polar/__main__.py
|
connec/oso
| 2,167 |
113736
|
<reponame>connec/oso
import sys
from .polar import Polar
Polar().repl(files=sys.argv[1:])
|
skidl/libs/msp430_sklib.py
|
arjenroodselaar/skidl
| 700 |
113780
|
<filename>skidl/libs/msp430_sklib.py
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)])])
|
src/genie/libs/parser/junos/tests/ShowChassisPower/cli/equal/golden_output_expected.py
|
balmasea/genieparser
| 204 |
113799
|
expected_output = {
'power-usage-information': {
'power-usage-item': [
{
'name': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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': '<NAME>',
'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'
}
}
}
|
tests/test_environment.py
|
kasium/alembic
| 1,324 |
113846
|
<gh_stars>1000+
#!coding: utf-8
import os
import sys
from alembic import command
from alembic import testing
from alembic import util
from alembic.environment import EnvironmentContext
from alembic.migration import MigrationContext
from alembic.script import ScriptDirectory
from alembic.testing import config
from alembic.testing import eq_
from alembic.testing import is_
from alembic.testing import mock
from alembic.testing.assertions import expect_raises_message
from alembic.testing.env import _get_staging_directory
from alembic.testing.env import _no_sql_testing_config
from alembic.testing.env import _sqlite_file_db
from alembic.testing.env import _sqlite_testing_config
from alembic.testing.env import clear_staging_env
from alembic.testing.env import staging_env
from alembic.testing.env import write_script
from alembic.testing.fixtures import capture_context_buffer
from alembic.testing.fixtures import TestBase
class EnvironmentTest(TestBase):
def setUp(self):
staging_env()
self.cfg = _no_sql_testing_config()
def tearDown(self):
clear_staging_env()
def _fixture(self, **kw):
script = ScriptDirectory.from_config(self.cfg)
env = EnvironmentContext(self.cfg, script, **kw)
return env
def test_x_arg(self):
env = self._fixture()
self.cfg.cmd_opts = mock.Mock(x="y=5")
eq_(env.get_x_argument(), "y=5")
def test_x_arg_asdict(self):
env = self._fixture()
self.cfg.cmd_opts = mock.Mock(x=["y=5"])
eq_(env.get_x_argument(as_dictionary=True), {"y": "5"})
def test_x_arg_no_opts(self):
env = self._fixture()
eq_(env.get_x_argument(), [])
def test_x_arg_no_opts_asdict(self):
env = self._fixture()
eq_(env.get_x_argument(as_dictionary=True), {})
def test_tag_arg(self):
env = self._fixture(tag="x")
eq_(env.get_tag_argument(), "x")
def test_migration_context_has_config(self):
env = self._fixture()
env.configure(url="sqlite://")
ctx = env._migration_context
is_(ctx.config, self.cfg)
ctx = MigrationContext(ctx.dialect, None, {})
is_(ctx.config, None)
def test_sql_mode_parameters(self):
env = self._fixture()
a_rev = "arev"
env.script.generate_revision(a_rev, "revision a", refresh=True)
write_script(
env.script,
a_rev,
"""\
"Rev A"
revision = '{}'
down_revision = None
from alembic import op
def upgrade():
op.execute('''
do some SQL thing with a % percent sign %
''')
""".format(
a_rev
),
)
with capture_context_buffer(transactional_ddl=True) as buf:
command.upgrade(self.cfg, "arev", sql=True)
assert "do some SQL thing with a % percent sign %" in buf.getvalue()
@config.requirements.legacy_engine
@testing.uses_deprecated(
r"The Engine.execute\(\) function/method is considered legacy"
)
def test_error_on_passing_engine(self):
env = self._fixture()
engine = _sqlite_file_db()
a_rev = "arev"
env.script.generate_revision(a_rev, "revision a", refresh=True)
write_script(
env.script,
a_rev,
"""\
"Rev A"
revision = '%s'
down_revision = None
from alembic import op
def upgrade():
pass
def downgrade():
pass
"""
% a_rev,
)
migration_fn = mock.MagicMock()
def upgrade(rev, context):
migration_fn(rev, context)
return env.script._upgrade_revs(a_rev, rev)
with expect_raises_message(
util.CommandError,
r"'connection' argument to configure\(\) is "
r"expected to be a sqlalchemy.engine.Connection ",
):
env.configure(
connection=engine, fn=upgrade, transactional_ddl=False
)
class CWDTest(TestBase):
def setUp(self):
self.env = staging_env()
self.cfg = _sqlite_testing_config()
def tearDown(self):
clear_staging_env()
@testing.combinations(
(
".",
["."],
),
("/tmp/foo:/tmp/bar", ["/tmp/foo", "/tmp/bar"]),
("/tmp/foo /tmp/bar", ["/tmp/foo", "/tmp/bar"]),
("/tmp/foo,/tmp/bar", ["/tmp/foo", "/tmp/bar"]),
(". /tmp/foo", [".", "/tmp/foo"]),
)
def test_sys_path_prepend(self, config_value, expected):
self.cfg.set_main_option("prepend_sys_path", config_value)
script = ScriptDirectory.from_config(self.cfg)
env = EnvironmentContext(self.cfg, script)
target = os.path.abspath(_get_staging_directory())
def assert_(heads, context):
eq_(
[os.path.abspath(p) for p in sys.path[0 : len(expected)]],
[os.path.abspath(p) for p in expected],
)
return []
p = [p for p in sys.path if os.path.abspath(p) != target]
with mock.patch.object(sys, "path", p):
env.configure(url="sqlite://", fn=assert_)
with env:
script.run_env()
|
stocklook/apis/twitah.py
|
zbarge/stocklook
| 149 |
113872
|
"""
MIT License
Copyright (c) 2017 <NAME>
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 re
import json
import logging as lg
from collections import Counter
from tweepy import Stream, OAuthHandler
from tweepy.streaming import StreamListener
from stocklook.config import (TWITTER_APP_KEY,
TWITTER_APP_SECRET,
TWITTER_CLIENT_KEY,
TWITTER_CLIENT_SECRET,
DATA_DIRECTORY,
config)
from stocklook.utils.database import (db_map_dict_to_alchemy_object,
db_get_python_dtypes,
db_describe_dict, AlchemyDatabase)
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (String, Boolean, DateTime, Float,
Integer, BigInteger, Column, ForeignKey, Table, Enum,
UniqueConstraint, TIMESTAMP, create_engine)
logger = lg.getLogger(__name__)
# Go to http://apps.twitter.com and create an app.
# The consumer key and secret will be generated for you after
consumer_key = config.get(TWITTER_APP_KEY, None)
consumer_secret = config.get(TWITTER_APP_SECRET, None)
# After the step above, you will be redirected to your app's page.
# Create an access token under the the "Your access token" section
access_token = config.get(TWITTER_CLIENT_KEY, None)
access_token_secret = config.get(TWITTER_CLIENT_SECRET, None)
# Global cache storing
# bits of tweets and counts.
# Used to identify spam.
SPAM_COUNTER = Counter()
# Compiled regex objects
# used to find stuff in tweets.
SPAM_RE = re.compile(
r"(FREE|GIVEAWAY|SALE|"
r"LUCKY|GIVING AWAY|"
r"SIGN UP|TO WIN|TO PARTICIPATE|"
r"LAST CHANCE|LIMITED TIME)",
re.IGNORECASE)
TWEET_TARGET_RE = re.compile(
r"(RT\s@|@)[A-Za-z0-9_\-]+(:\s|\s)", re.IGNORECASE)
TWITTER_HANDLE_RE = re.compile(
r'@[A-Za-z0-9_]+(\W|$|\b)', re.IGNORECASE)
def twitter_message_is_spam(
text, max_count=3,
counter=SPAM_COUNTER,
drop_handles=True,
max_cache=10000,
key_length=20):
"""
Returns True when a message has been identified as spam.
:param text: (str)
The message to be checked
:param max_count: (int, default 3)
The max number of times the message
key can show up before being considered spam.
:param counter: (collections.Counter, default stocklook.apis.twitah.SPAM_COUNTER)
Used to track the number of times
a message key has passed through the function.
:param drop_handles: (bool, default True)
True scrubs twitter handles (starting with @)
from text before generating the key. This helps
to identify duplicate message content being spammed to
different twitter handles.
:param max_cache: (int, default 10,000)
The max # of entries in the :param counter cache before it's cleared.
Counter keys associated to counts greater than :param max_count
will be kept as long as the total number of those entries is below :param max_cache.
:param key_length: (int, default 20)
The number of characters to trim the text down to when creating the key.
20 characters is enough to identify most duplicate content.
:return:
"""
if drop_handles:
text = twitter_drop_handles_from_txt(text)
key = text[:key_length]
counter[key] += 1
if len(counter) > max_cache:
# Not sure if this is even useful...
# but i figure if this runs
# long enough it could slow things down.
print("Clearing counter...")
spam = {k: v for k, v in counter.items()
if v >= max_count}
counter.clear()
if len(spam) < max_cache:
print("Loading spam keys "
"back into counter")
counter.update(spam)
return counter[key] >= max_count \
or SPAM_RE.search(text) is not None
def twitter_split_handle_from_txt(tweet):
"""
Looks for RT @twitterhandle: or just @twitterhandle in the beginning of the tweet.
The handle is split off and returned as two separate strings.
:param tweet: (str)
The tweet text to split.
:return: (str, str)
twitter_handle, rest_of_tweet
"""
match = TWEET_TARGET_RE.search(tweet)
if match is not None:
match = match.group()
tweet = tweet.replace(match, '')
return match, tweet
def twitter_drop_handles_from_txt(tweet):
"""
Strips out any @twitter_handle from a message
exposing the root content Used to identify duplicate
content.
:param tweet:
:return:
"""
while True:
m = TWITTER_HANDLE_RE.search(tweet)
if m is None:
break
tweet = tweet.replace(m.group(), '')
return tweet
# SQLAlchemy declarations begin here
SQLTwitterBase = declarative_base()
class SQLTwitterUser(SQLTwitterBase):
"""
Stores data about a twitter user.
"""
__tablename__ = 'twitter_users'
user_id = Column(Integer, primary_key=True)
tweets = relationship('SQLTweet', back_populates='user')
contributors_enabled = Column(Boolean)
created_at = Column(String(255))
default_profile = Column(Boolean)
default_profile_image = Column(Boolean)
description = Column(String(255))
favourites_count = Column(Integer)
follow_request_sent = Column(String)
followers_count = Column(Integer)
following = Column(String)
friends_count = Column(Integer)
geo_enabled = Column(Boolean)
id = Column(Integer)
id_str = Column(String(255))
is_translator = Column(Boolean)
lang = Column(String(255))
listed_count = Column(Integer)
location = Column(String(255))
name = Column(String(255))
notifications = Column(String)
profile_background_color = Column(String(255))
profile_background_image_url = Column(String(255))
profile_background_image_url_https = Column(String(255))
profile_background_tile = Column(Boolean)
profile_banner_url = Column(String(255))
profile_image_url = Column(String(255))
profile_image_url_https = Column(String(255))
profile_link_color = Column(String(255))
profile_sidebar_border_color = Column(String(255))
profile_sidebar_fill_color = Column(String(255))
profile_text_color = Column(String(255))
profile_use_background_image = Column(Boolean)
protected = Column(Boolean)
screen_name = Column(String(255))
statuses_count = Column(Integer)
time_zone = Column(String(255))
translator_type = Column(String(255))
url = Column(String)
utc_offset = Column(Integer)
verified = Column(Boolean)
class SQLTweet(SQLTwitterBase):
"""
Stores data about an individual tweet.
"""
__tablename__ = 'twitter_tweets'
tweet_id = Column(Integer, primary_key=True)
user = relationship('SQLTwitterUser', back_populates='tweets')
user_id = Column(Integer, ForeignKey('twitter_users.user_id'))
# Generated via describe_json_object
contributors = Column(String)
coordinates = Column(String)
created_at = Column(String(255))
display_text_range = Column(String)
favorite_count = Column(Integer)
favorited = Column(Boolean)
filter_level = Column(String(255))
geo = Column(String)
id = Column(Integer)
id_str = Column(String(255))
in_reply_to_screen_name = Column(String(255))
in_reply_to_status_id = Column(Integer)
in_reply_to_status_id_str = Column(String(255))
in_reply_to_user_id = Column(Integer)
in_reply_to_user_id_str = Column(String(255))
is_quote_status = Column(Boolean)
lang = Column(String(255))
place = Column(String)
possibly_sensitive = Column(Boolean)
quote_count = Column(Integer)
reply_count = Column(Integer)
retweet_count = Column(Integer)
retweeted = Column(Boolean)
source = Column(String(255))
text = Column(String(255))
timestamp_ms = Column(String(255))
truncated = Column(Boolean)
DB_TWEET_DTYPES = db_get_python_dtypes(SQLTweet, include_str=True)
DB_TWEET_DTYPES_ITEMS = DB_TWEET_DTYPES.items()
DB_TWITTER_USER_DTYPES = db_get_python_dtypes(SQLTwitterUser, include_str=True)
DB_TWITTER_USER_DTYPES_ITEMS = DB_TWITTER_USER_DTYPES.items()
DB_TWITTER_USER_CACHE = dict()
class TwitterDatabaseListener(StreamListener, AlchemyDatabase):
"""
Streams tweets to a SQLAlchemy database.
"""
def __init__(self, api=None, stream_options=None, engine=None, session_maker=None):
if stream_options is None:
stream_options = dict()
StreamListener.__init__(self, api=api)
AlchemyDatabase.__init__(
self, engine=engine,
session_maker=session_maker,
declarative_base=SQLTwitterBase)
self._auth = None
self._stream = None
self._stream_options = stream_options
self.session = self.get_session()
@property
def auth(self):
"""
tweepy.OAuthHandler generated on demand using environment (or user injected)
variables that have been loaded into global dictionary stocklook.config.config
:return:
"""
if self._auth is None:
tokens = (consumer_key, consumer_secret,
access_token, access_token_secret)
if not all(tokens):
raise KeyError("Unable to authorize twitter "
"as there is a missing token. "
"Please make sure the following "
"environment variables are set:\n\t"
"1) {}: {}\n\t"
"2) {}: {}\n\t"
"3) {}: {}\n\t"
"4) {}: {}\n\t".format(
TWITTER_APP_KEY, consumer_key,
TWITTER_APP_SECRET, consumer_secret,
TWITTER_CLIENT_KEY, access_token,
TWITTER_CLIENT_SECRET, access_token_secret))
self._auth = OAuthHandler(consumer_key, consumer_secret)
self._auth.set_access_token(access_token, access_token_secret)
return self._auth
def get_user_sql_object(self, user_data):
"""
Checks memory cache for user object.
Then checks database for user object.
Then creates user object as last resort
adding to database & memory cache.
:param user_data: (dict)
:return: SQLTwitterUser
"""
try:
# Return cached user object
return DB_TWITTER_USER_CACHE[user_data['id_str']]
except KeyError:
# Find user in database
user = self.session \
.query(SQLTwitterUser) \
.filter(SQLTwitterUser.id == user_data['id']).first()
if user is None:
# Make user and add to database
user = db_map_dict_to_alchemy_object(
user_data, SQLTwitterUser,
dtype_items=DB_TWITTER_USER_DTYPES_ITEMS)
self.session.add(user)
# Cache user
DB_TWITTER_USER_CACHE[user.id_str] = user
# Keep the cache clean
if len(DB_TWITTER_USER_CACHE) > 10000:
DB_TWITTER_USER_CACHE.clear()
return user
def stream_data_to_sql(self, data):
"""
Parses JSON data into SQLAlchemy object data.
Creates or retrieves twitter user.
:param data: (str, dict)
The JSON data to be converted.
"""
if isinstance(data, str):
data = json.loads(data)
user = self.get_user_sql_object(data['user'])
tweet = db_map_dict_to_alchemy_object(
data, SQLTweet,
dtype_items=DB_TWEET_DTYPES_ITEMS)
try:
user.tweets.append(tweet)
except AttributeError as e:
logger.error(e)
self.session.rollback()
else:
self.session.commit()
return user, tweet
@property
def stream(self):
"""
tweepy.Stream object.
:return:
"""
if self._stream is None:
self._stream = Stream(
self.auth, self,
**self._stream_options)
return self._stream
def on_data(self, data):
"""
Checks for spam before loading
tweet/user data into database.
:param data: (str)
JSON data from twitter API.
"""
data = json.loads(data)
text = data['text']
# Uncomment line below to print sqlalchemy columns.
# db_describe_dict(data)
if not twitter_message_is_spam(text):
self.stream_data_to_sql(data)
print("{}\n{}\n\n".format(
data['created_at'], text))
return True
def on_error(self, status):
print(status)
if __name__ == '__main__':
tdb = TwitterDatabaseListener()
tdb.stream.filter(track=['BTC'])
|
esphome/components/cs5460a/sensor.py
|
OttoWinter/esphomeyaml
| 249 |
113877
|
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi, sensor
from esphome.const import (
CONF_CURRENT,
CONF_ID,
CONF_POWER,
CONF_VOLTAGE,
UNIT_VOLT,
UNIT_AMPERE,
UNIT_WATT,
DEVICE_CLASS_POWER,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_VOLTAGE,
)
from esphome import automation
from esphome.automation import maybe_simple_id
CODEOWNERS = ["@balrog-kun"]
DEPENDENCIES = ["spi"]
cs5460a_ns = cg.esphome_ns.namespace("cs5460a")
CS5460APGAGain = cs5460a_ns.enum("CS5460APGAGain")
PGA_GAIN_OPTIONS = {
"10X": CS5460APGAGain.CS5460A_PGA_GAIN_10X,
"50X": CS5460APGAGain.CS5460A_PGA_GAIN_50X,
}
CS5460AComponent = cs5460a_ns.class_("CS5460AComponent", spi.SPIDevice, cg.Component)
CS5460ARestartAction = cs5460a_ns.class_("CS5460ARestartAction", automation.Action)
CONF_SAMPLES = "samples"
CONF_PHASE_OFFSET = "phase_offset"
CONF_PGA_GAIN = "pga_gain"
CONF_CURRENT_GAIN = "current_gain"
CONF_VOLTAGE_GAIN = "voltage_gain"
CONF_CURRENT_HPF = "current_hpf"
CONF_VOLTAGE_HPF = "voltage_hpf"
CONF_PULSE_ENERGY = "pulse_energy"
def validate_config(config):
current_gain = abs(config[CONF_CURRENT_GAIN]) * (
1.0 if config[CONF_PGA_GAIN] == "10X" else 5.0
)
voltage_gain = config[CONF_VOLTAGE_GAIN]
pulse_energy = config[CONF_PULSE_ENERGY]
if current_gain == 0.0 or voltage_gain == 0.0:
raise cv.Invalid("The gains can't be zero")
max_energy = (0.25 * 0.25 / 3600 / (2**-4)) / (voltage_gain * current_gain)
min_energy = (0.25 * 0.25 / 3600 / (2**18)) / (voltage_gain * current_gain)
mech_min_energy = (0.25 * 0.25 / 3600 / 7.8) / (voltage_gain * current_gain)
if pulse_energy < min_energy or pulse_energy > max_energy:
raise cv.Invalid(
"For given current&voltage gains, the pulse energy must be between "
f"{min_energy} Wh and {max_energy} Wh and in mechanical counter mode "
f"between {mech_min_energy} Wh and {max_energy} Wh"
)
return config
validate_energy = cv.float_with_unit("energy", "(Wh|WH|wh)?", optional_unit=True)
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(CS5460AComponent),
cv.Optional(CONF_SAMPLES, default=4000): cv.int_range(min=1, max=0xFFFFFF),
cv.Optional(CONF_PHASE_OFFSET, default=0): cv.int_range(min=-64, max=63),
cv.Optional(CONF_PGA_GAIN, default="10X"): cv.enum(
PGA_GAIN_OPTIONS, upper=True
),
cv.Optional(CONF_CURRENT_GAIN, default=0.001): cv.negative_one_to_one_float,
cv.Optional(CONF_VOLTAGE_GAIN, default=0.001): cv.zero_to_one_float,
cv.Optional(CONF_CURRENT_HPF, default=True): cv.boolean,
cv.Optional(CONF_VOLTAGE_HPF, default=True): cv.boolean,
cv.Optional(CONF_PULSE_ENERGY, default=10.0): validate_energy,
cv.Optional(CONF_VOLTAGE): sensor.sensor_schema(
unit_of_measurement=UNIT_VOLT,
accuracy_decimals=0,
device_class=DEVICE_CLASS_VOLTAGE,
),
cv.Optional(CONF_CURRENT): sensor.sensor_schema(
unit_of_measurement=UNIT_AMPERE,
accuracy_decimals=1,
device_class=DEVICE_CLASS_CURRENT,
),
cv.Optional(CONF_POWER): sensor.sensor_schema(
unit_of_measurement=UNIT_WATT,
accuracy_decimals=0,
device_class=DEVICE_CLASS_POWER,
),
}
)
.extend(cv.COMPONENT_SCHEMA)
.extend(spi.spi_device_schema(cs_pin_required=False)),
validate_config,
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await spi.register_spi_device(var, config)
cg.add(var.set_samples(config[CONF_SAMPLES]))
cg.add(var.set_phase_offset(config[CONF_PHASE_OFFSET]))
cg.add(var.set_pga_gain(config[CONF_PGA_GAIN]))
cg.add(var.set_gains(config[CONF_CURRENT_GAIN], config[CONF_VOLTAGE_GAIN]))
cg.add(var.set_hpf_enable(config[CONF_CURRENT_HPF], config[CONF_VOLTAGE_HPF]))
cg.add(var.set_pulse_energy_wh(config[CONF_PULSE_ENERGY]))
if CONF_VOLTAGE in config:
conf = config[CONF_VOLTAGE]
sens = await sensor.new_sensor(conf)
cg.add(var.set_voltage_sensor(sens))
if CONF_CURRENT in config:
conf = config[CONF_CURRENT]
sens = await sensor.new_sensor(conf)
cg.add(var.set_current_sensor(sens))
if CONF_POWER in config:
conf = config[CONF_POWER]
sens = await sensor.new_sensor(conf)
cg.add(var.set_power_sensor(sens))
@automation.register_action(
"cs5460a.restart",
CS5460ARestartAction,
maybe_simple_id(
{
cv.Required(CONF_ID): cv.use_id(CS5460AComponent),
}
),
)
async def restart_action_to_code(config, action_id, template_arg, args):
paren = await cg.get_variable(config[CONF_ID])
return cg.new_Pvariable(action_id, template_arg, paren)
|
jmetal/algorithm/singleobjective/__init__.py
|
12yuens2/jMetalPy
| 335 |
113912
|
from .evolution_strategy import EvolutionStrategy
from .genetic_algorithm import GeneticAlgorithm
from .local_search import LocalSearch
from .simulated_annealing import SimulatedAnnealing
|
test/unit/test_unpack.py
|
timmartin/skulpt
| 2,671 |
113939
|
# Unpack tests from CPython converted from doctest to unittest
import unittest
class UnpackTest(unittest.TestCase):
def test_basic(self):
t = (1, 2, 3)
a, b, c = t
self.assertEqual(a, 1)
self.assertEqual(b, 2)
self.assertEqual(c, 3)
l = [4, 5, 6]
a, b, c = l
self.assertEqual(a, 4)
self.assertEqual(b, 5)
self.assertEqual(c, 6)
a, b, c = 7, 8, 9
self.assertEqual(a, 7)
self.assertEqual(b, 8)
self.assertEqual(c, 9)
s = 'one'
a, b, c = s
self.assertEqual(a, 'o')
self.assertEqual(b, 'n')
self.assertEqual(c, 'e')
def test_single(self):
st = (99,)
sl = [100]
a, = st
self.assertEqual(a, 99)
b, = sl
self.assertEqual(b, 100)
def test_non_sequence(self):
def unpack():
a, b, c = 7
# Currently has incorrect message
self.assertRaises(TypeError, unpack)
def test_wrong_size(self):
def tup_too_big():
t = (1, 2, 3)
a, b = t
def list_too_big():
l = [4, 5, 6]
a, b = l
def tup_too_small():
t = (1, 2, 3)
a, b, c, d = t
def list_too_small():
l = [4, 5, 6]
a, b, c, d = l
self.assertRaises(ValueError, tup_too_big)
self.assertRaises(ValueError, list_too_big)
self.assertRaises(ValueError, tup_too_small)
self.assertRaises(ValueError, list_too_small)
def test_class(self):
class Seq:
def __getitem__(self, i):
if i >= 0 and i < 3: return i
raise IndexError
a, b, c = Seq()
self.assertEqual(a, 0)
self.assertEqual(b, 1)
self.assertEqual(c, 2)
def test_class_fail(self):
class Seq:
def __getitem__(self, i):
if i >= 0 and i < 3: return i
raise IndexError
def too_small():
a, b, c, d = Seq()
def too_big():
a, b = Seq()
self.assertRaises(ValueError, too_small)
self.assertRaises(ValueError, too_big)
def test_bad_class(self):
class BadSeq:
def __getitem__(self, i):
if i >=0 and i < 3:
return i
elif i ==3:
raise NameError
else:
raise IndexError
def raise_bad_error1():
a, b, c, d, e = BadSeq()
def raise_bad_error2():
a, b, c = BadSeq()
self.assertRaises(NameError, raise_bad_error1)
self.assertRaises(NameError, raise_bad_error2)
if __name__ == "__main__":
unittest.main()
|
discodo/server/__init__.py
|
eunwoo1104/discodo
| 105 |
113944
|
from .server import app as server
|
.modules/.recon-ng/modules/recon/locations-pushpins/twitter.py
|
termux-one/EasY_HaCk
| 1,103 |
113976
|
from recon.core.module import BaseModule
from datetime import datetime
from urlparse import parse_qs
class Module(BaseModule):
meta = {
'name': 'Twitter Geolocation Search',
'author': '<NAME> (@LaNMaSteR53)',
'description': 'Searches Twitter for media in the specified proximity to a location.',
'required_keys': ['twitter_api', 'twitter_secret'],
'query': 'SELECT DISTINCT latitude || \',\' || longitude FROM locations WHERE latitude IS NOT NULL AND longitude IS NOT NULL',
'options': (
('radius', 1, True, 'radius in kilometers'),
),
}
def module_run(self, points):
rad = self.options['radius']
url = 'https://api.twitter.com/1.1/search/tweets.json'
for point in points:
self.heading(point, level=0)
self.output('Collecting data for an unknown number of tweets...')
results = self.search_twitter_api({'q':'', 'geocode': '%s,%fkm' % (point, rad)})
for tweet in results:
if not tweet['geo']:
continue
tweet_id = tweet['id_str']
source = 'Twitter'
screen_name = tweet['user']['screen_name']
profile_name = tweet['user']['name']
profile_url = 'https://twitter.com/%s' % screen_name
media_url = 'https://twitter.com/%s/statuses/%s' % (screen_name, tweet_id)
thumb_url = tweet['user']['profile_image_url_https']
message = tweet['text']
latitude = tweet['geo']['coordinates'][0]
longitude = tweet['geo']['coordinates'][1]
time = datetime.strptime(tweet['created_at'], '%a %b %d %H:%M:%S +0000 %Y')
self.add_pushpins(source, screen_name, profile_name, profile_url, media_url, thumb_url, message, latitude, longitude, time)
self.verbose('%s tweets processed.' % (len(results)))
|
protos/__init__.py
|
oktoshi/OpenBazaar-Server
| 723 |
114036
|
__author__ = 'chris'
"""
Package for holding all of our protobuf classes
"""
|
flask/app.py
|
vdaytona/statistical-arbitrage-18-19
| 163 |
114113
|
# import os
# from flask import Flask, render_template, send_from_directory
# app = Flask(__name__)
# @app.route("/")
# def index():
# return render_template("index.html")
# if __name__ == '__main__':
# app.run(debug = True)
# === bokeh demo at below ===
# embedding the graph to html
from flask import Flask, render_template, request
from bokeh.resources import CDN
from bokeh.plotting import figure
from bokeh.embed import components
app = Flask(__name__)
def create_figure():
plot = figure()
plot.circle([1,2], [3,4])
return plot
# Index page
@app.route('/')
def index():
# Create the plot
plot = create_figure()
# tag here means the tag to reference to the new bokeh chart, saved as a js file
js, plot_tag = components(plot, CDN, "/Users/brendantham/Desktop/FYP/Flask/static/plots")
# TODO:
# 1) fix URLS
# 2) figure out where to store the js files for future load use
# with open('/Users/brendantham/Desktop/FYP/Flask/static/plots/plot1.js', 'w') as f:
# f.write(js)
return render_template("index.html", script1 = js, plot1 = plot_tag)
# With debug=True, Flask server will auto-reload
# when there are code changes
if __name__ == '__main__':
app.run(port=5000, debug=True)
|
tests/migrations/0010_song.py
|
ababic/django-modelcluster
| 278 |
114117
|
# Generated by Django 2.1.5 on 2019-01-17 21:49
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('tests', '0009_article_related_articles'),
]
operations = [
migrations.CreateModel(
name='Song',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
('album', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='songs', to='tests.Album')),
],
options={
'ordering': ['sort_order'],
},
),
]
|
backend/model/user_token.py
|
LiangTang1993/Icarus
| 686 |
114125
|
<gh_stars>100-1000
"""
token
fingerprint
useragent
expire_time
ip
"""
import binascii
import os
import time
from typing import Optional
import peewee
from peewee import TextField, BigIntegerField, BlobField
from slim.utils import to_bin, get_bytes_from_blob
from model import StdUserModel, INETField, db
class UserToken(StdUserModel):
expire = BigIntegerField(null=True)
first_meet_time = BigIntegerField(null=True)
ip_first_meet = INETField(default=None, null=True) # 注册IP
ua_first_meet = TextField(null=True)
last_access_time = BigIntegerField(null=True)
ip_latest = INETField(default=None, null=True)
ua_latest = TextField(null=True)
class Meta:
db_table = 'user_token'
@classmethod
def new(cls, user_id, expires_days=30):
create_time = int(time.time())
expire_time = create_time + expires_days * 24 * 60 * 60
token = os.urandom(16)
return UserToken.create(id=token, time=create_time, user_id=user_id, expire=expire_time)
@classmethod
def clear_by_user_id(cls, user_id):
try:
cls.update(deleted_at=int(time.time())).where(cls.user_id == user_id).execute()
except peewee.DatabaseError:
db.rollback()
@classmethod
def get_by_token(cls, token) -> Optional['UserToken']:
if isinstance(token, str):
try:
token = to_bin(token)
except binascii.Error:
return
try:
t = cls.get(cls.id == token, time.time() < cls.expire, cls.deleted_at.is_null(True))
except peewee.DoesNotExist:
pass
def get_token(self):
return get_bytes_from_blob(self.id)
async def init(self, view: 'AbstractSQLView'):
"""
从请求初始化信息
:param view:
:return:
"""
# req = view._request
self.first_meet_time = int(time.time())
self.ip_first_meet = await view.get_ip()
self.ua_first_meet = view.headers.get('User-Agent', None)
self.save()
async def access_save(self, view: 'AbstractSQLView'):
self.last_access_time = int(time.time())
self.ip_latest = await view.get_ip()
self.ua_latest = view.headers.get('User-Agent', None)
self.save()
|
pywraps/py_kernwin_idaview.py
|
fengjixuchui/src
| 1,160 |
114128
|
#<pycode(py_kernwin_idaview)>
#-------------------------------------------------------------------------
# IDAViewWrapper
#-------------------------------------------------------------------------
import _ida_kernwin
class IDAViewWrapper(CustomIDAMemo):
"""
Deprecated. Use View_Hooks instead.
Because the lifecycle of an IDAView is not trivial to track (e.g., a user
might close, then re-open the same disassembly view), this wrapper doesn't
bring anything superior to the View_Hooks: quite the contrary, as the
latter is much more generic (and better maps IDA's internal model.)
"""
def __init__(self, title):
CustomIDAMemo.__init__(self)
self._title = title
def Bind(self):
rc = _ida_kernwin.pyidag_bind(self)
if rc:
self.hook()
return rc
def Unbind(self):
rc = _ida_kernwin.pyidag_unbind(self)
if rc:
self.unhook()
return rc
#</pycode(py_kernwin_idaview)>
|
tests/compare_messages.py
|
matan-h/friendly
| 287 |
114140
|
<gh_stars>100-1000
"""Compare messages for exceptions other than SyntaxError"""
import messages_3_6
import messages_3_7
import messages_3_8
import messages_3_9
import messages_3_10
info_36 = messages_3_6.messages
info_37 = messages_3_7.messages
info_38 = messages_3_8.messages
info_39 = messages_3_9.messages
info_310 = messages_3_10.messages
output = open("compare_messages.html", "w", encoding="utf8")
output.write("<div>\n")
files = set()
def print_different(fn_name, in_36, in_37, in_38, in_39, in_310):
# Just tracking changes going forward in time, from
# one version to the next.
printed_37 = False
printed_38 = False
if in_36 != in_37:
if fn_name not in files:
output.write("<div class='filename-header'>\n")
files.add(fn_name)
output.write(fn_name)
output.write("</div>\n")
output.write("<pre class='highlight friendly-small-pre'>")
output.write("<b>3.6: </b>" + in_36 + "\n")
output.write("<b>3.7: </b>" + in_37 + "\n")
printed_37 = True
output.write("</pre>\n")
if in_37 != in_38:
if fn_name not in files:
output.write("<div class='filename-header'>\n")
files.add(fn_name)
output.write(fn_name)
output.write("</div>\n")
output.write("<pre class='highlight friendly-small-pre'>")
if not printed_37:
output.write("<b>3.7: </b>" + in_37 + "\n")
output.write("<b>3.8: </b>" + in_38 + "\n")
output.write("</pre>\n")
if in_38 != in_39:
if fn_name not in files:
output.write("<div class='filename-header'>")
files.add(fn_name)
output.write(fn_name)
output.write("</div>\n")
output.write("<pre class='highlight friendly-small-pre'>")
if not printed_38:
output.write("<b>3.8: </b>" + in_38 + "\n")
output.write("<b>3.9: </b>" + in_39 + "\n")
output.write("</pre>\n")
if in_39 != in_310:
if fn_name not in files:
output.write("<div class='filename-header'>")
files.add(fn_name)
output.write(fn_name)
output.write("</div>\n")
output.write("<pre class='highlight friendly-small-pre'>")
if not printed_38:
output.write("<b>3.9: </b>" + in_39 + "\n")
output.write("<b>3.10: </b>" + in_310 + "\n")
output.write("</pre>\n")
for f_name in info_36:
try:
messages_36 = info_36[f_name].replace("<", "<").replace(">", ">")
messages_37 = info_37[f_name].replace("<", "<").replace(">", ">")
messages_38 = info_38[f_name].replace("<", "<").replace(">", ">")
messages_39 = info_39[f_name].replace("<", "<").replace(">", ">")
messages_310 = info_310[f_name].replace("<", "<").replace(">", ">")
except KeyError:
output.write("<div class='filename-header'>")
output.write("entry does not exist in one data file for " + f_name)
output.write("</div>\n")
continue
print_different(
f_name, messages_36, messages_37, messages_38, messages_39, messages_310
)
output.write("</div>\n")
output.close()
|
source/remediation_runbooks/scripts/GetPublicEBSSnapshots.py
|
sybeck2k/aws-security-hub-automated-response-and-remediation
| 129 |
114178
|
<filename>source/remediation_runbooks/scripts/GetPublicEBSSnapshots.py
#!/usr/bin/python
###############################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License Version 2.0 (the "License"). You may not #
# use this file except in compliance with the License. A copy of the License #
# is located at #
# #
# http://www.apache.org/licenses/LICENSE-2.0/ #
# #
# or in the "license" file accompanying this file. This file is distributed #
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express #
# or implied. See the License for the specific language governing permis- #
# sions and limitations under the License. #
###############################################################################
import json
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError
boto_config = Config(
retries = {
'mode': 'standard',
'max_attempts': 10
}
)
def connect_to_ec2(boto_config):
return boto3.client('ec2', config=boto_config)
def get_public_snapshots(event, context):
account_id = event['account_id']
if 'testmode' in event and event['testmode']:
return [
"snap-12341234123412345",
"snap-12341234123412345",
"snap-12341234123412345",
"snap-12341234123412345",
"snap-12341234123412345"
]
return list_public_snapshots(account_id)
def list_public_snapshots(account_id):
ec2 = connect_to_ec2(boto_config)
control_token = 'start'
try:
public_snapshot_ids = []
while control_token:
if control_token == 'start': # needed a value to start the loop. Now reset it
control_token = ''
kwargs = {
'MaxResults': 100,
'OwnerIds': [ account_id ],
'RestorableByUserIds': [ 'all' ]
}
if control_token:
kwargs['NextToken'] = control_token
response = ec2.describe_snapshots(
**kwargs
)
for snapshot in response['Snapshots']:
public_snapshot_ids.append(snapshot['SnapshotId'])
if 'NextToken' in response:
control_token = response['NextToken']
else:
control_token = ''
return public_snapshot_ids
except Exception as e:
print(e)
exit('Failed to describe_snapshots')
|
aetros/commands/StartSimpleCommand.py
|
aetros/aetros-cli
| 120 |
114181
|
<filename>aetros/commands/StartSimpleCommand.py
from __future__ import absolute_import
from __future__ import print_function
import argparse
import sys
from aetros.starter import start_keras
from aetros.backend import JobBackend
from aetros.utils import unpack_full_job_id
class StartSimpleCommand:
def __init__(self, logger):
self.logger = logger
self.client = None
self.registered = False
self.active = True
def main(self, args):
import aetros.const
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
prog=aetros.const.__prog__ + ' start-simple', description="Internal usage.")
parser.add_argument('id', nargs='?', help='Job id, e.g. user/modelname/0db75a64acb74c27bd72c22e359de7a4c44a20e5 to start a pre-created job.')
parser.add_argument('--fetch', action='store_true', help="Fetch job from server.")
parsed_args = parser.parse_args(args)
if not parsed_args.id:
parser.print_help()
sys.exit(1)
owner, name, id = unpack_full_job_id(parsed_args.id)
job_backend = JobBackend(model_name=owner + '/' + name)
job_backend.section('checkout')
if parsed_args.fetch:
job_backend.fetch(id)
job_backend.load(id)
job_backend.start()
start_keras(self.logger, job_backend)
|
veinmind-backdoor/plugins/service.py
|
Jqqzzz/veinmind-tools
| 364 |
114232
|
<gh_stars>100-1000
from register import register
from common import *
import os
import re
@register.register("service")
class service():
service_dir_list = ["/etc/systemd/system"]
def detect(self, image):
results = []
for service_dir in self.service_dir_list:
for root, dirs, files in image.walk(service_dir):
for file in files:
try:
filepath = os.path.join(root, file)
f = image.open(filepath, mode="r")
f_content = f.read()
for backdoor_regex in regex.backdoor_regex_list:
if re.search(backdoor_regex, f_content):
r = result.Result()
r.image_id = image.id()
if len(image.reporefs()) > 0:
r.image_ref = image.reporefs()[0]
else:
r.image_ref = image.id()
r.filepath = filepath
r.description = "regex: " + backdoor_regex
results.append(r)
except FileNotFoundError:
continue
except BaseException as e:
log.logger.error(e)
return results
|
tests/integration/optimizers/test_optimizer_pod_choice.py
|
Rohitpandit021/jina
| 15,179 |
114236
|
import os
import pytest
from jina import Document
from jina.optimizers import FlowOptimizer, EvaluationCallback
from jina.optimizers.flow_runner import SingleFlowRunner
cur_dir = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture
def config(tmpdir):
os.environ['JINA_OPTIMIZER_WORKSPACE_DIR'] = str(tmpdir)
os.environ['JINA_OPTIMIZER_PARAMETER_FILE'] = os.path.join(cur_dir, 'parameter.yml')
os.environ['JINA_OPTIMIZER_DATA_FILE'] = os.path.join(cur_dir, 'data.jsonlines')
yield
del os.environ['JINA_OPTIMIZER_WORKSPACE_DIR']
del os.environ['JINA_OPTIMIZER_PARAMETER_FILE']
del os.environ['JINA_OPTIMIZER_DATA_FILE']
def document_generator_option1(num_doc):
for _ in range(num_doc):
doc = Document(content='DummyCrafterOption1')
groundtruth_doc = Document(content='hello')
yield doc, groundtruth_doc
def document_generator_option2(num_doc):
for _ in range(num_doc):
doc = Document(content='DummyCrafterOption2')
groundtruth_doc = Document(content='hello')
yield doc, groundtruth_doc
def test_optimizer_single_flow_option1(tmpdir, config):
eval_flow_runner = SingleFlowRunner(
flow_yaml=os.path.join(cur_dir, 'flow_pod_choice.yml'),
documents=document_generator_option1(10),
request_size=1,
execution_endpoint='search',
)
opt = FlowOptimizer(
flow_runner=eval_flow_runner,
parameter_yaml=os.path.join(cur_dir, 'parameter_pod_choice.yml'),
evaluation_callback=EvaluationCallback(),
workspace_base_dir=str(tmpdir),
n_trials=10,
)
result = opt.optimize_flow()
assert (
result.best_parameters['JINA_DUMMYCRAFTER_CHOICE'] == 'pods/craft_option1.yml'
)
assert result.best_parameters['JINA_DUMMYCRAFTER_PARAM1'] == 0
assert result.best_parameters['JINA_DUMMYCRAFTER_PARAM2'] == 1
assert result.best_parameters['JINA_DUMMYCRAFTER_PARAM3'] == 1
def test_optimizer_single_flow_option2(tmpdir, config):
eval_flow_runner = SingleFlowRunner(
flow_yaml=os.path.join(cur_dir, 'flow_pod_choice.yml'),
documents=document_generator_option2(10),
request_size=1,
execution_endpoint='search',
)
opt = FlowOptimizer(
flow_runner=eval_flow_runner,
parameter_yaml=os.path.join(cur_dir, 'parameter_pod_choice.yml'),
evaluation_callback=EvaluationCallback(),
workspace_base_dir=str(tmpdir),
n_trials=20,
)
result = opt.optimize_flow()
assert (
result.best_parameters['JINA_DUMMYCRAFTER_CHOICE'] == 'pods/craft_option2.yml'
)
assert result.best_parameters['JINA_DUMMYCRAFTER_PARAM4'] == 0
assert result.best_parameters['JINA_DUMMYCRAFTER_PARAM5'] == 1
assert result.best_parameters['JINA_DUMMYCRAFTER_PARAM6'] == 1
|
pymtl3/dsl/Placeholder.py
|
kevinyuan/pymtl3
| 152 |
114252
|
"""
========================================================================
Placeholder.py
========================================================================
Author : <NAME>
Date : June 1, 2019
"""
class Placeholder:
pass
|
indra/tests/test_hprd.py
|
zebulon2/indra
| 136 |
114261
|
from os.path import join, abspath, dirname
from nose.tools import raises
from indra.statements import Complex, Phosphorylation
from indra.sources import hprd
test_dir = join(abspath(dirname(__file__)), 'hprd_tests_data')
id_file = join(test_dir, 'HPRD_ID_MAPPINGS.txt')
def test_process_complexes():
cplx_file = join(test_dir, 'PROTEIN_COMPLEXES.txt')
hp = hprd.process_flat_files(id_file, complexes_file=cplx_file)
assert isinstance(hp, hprd.HprdProcessor)
assert isinstance(hp.statements, list)
assert len(hp.statements) == 3
s0 = hp.statements[0]
assert isinstance(s0, Complex)
assert len(s0.members) == 3
assert set([ag.name for ag in s0.members]) == \
set(['ASCL1', 'TCF3', 'MEF2C'])
assert s0.members[0].db_refs == \
{'HGNC': '738', 'UP': 'P50553', 'EGID': '429',
'REFSEQ_PROT': 'NP_004307.2'}
assert s0.members[1].db_refs == \
{'HGNC': '11633', 'UP': 'P15923', 'EGID': '6929',
'REFSEQ_PROT': 'NP_003191.1'}
assert s0.members[2].db_refs == \
{'HGNC': '6996', 'UP': 'Q06413', 'EGID': '4208',
'REFSEQ_PROT': 'NP_002388.2'}
assert len(s0.evidence) == 2
assert s0.evidence[0].pmid == '8900141'
assert s0.evidence[0].source_api == 'hprd'
assert s0.evidence[0].annotations['evidence'] == ['in vivo']
assert s0.evidence[0].source_id == ('http://hprd.org/interactions?'
'hprd_id=00011&isoform_id=00011_1'
'&isoform_name=Isoform_1')
assert s0.evidence[1].pmid == '8948587'
def test_process_ptms():
ptm_file = join(test_dir, 'POST_TRANSLATIONAL_MODIFICATIONS.txt')
seq_file = join(test_dir, 'PROTEIN_SEQUENCES.txt')
hp = hprd.process_flat_files(id_file, ptm_file=ptm_file, seq_file=seq_file)
assert isinstance(hp, hprd.HprdProcessor)
assert isinstance(hp.statements, list)
assert len(hp.statements) == 13
s0 = hp.statements[0]
assert isinstance(s0, Phosphorylation)
assert s0.enz.name == 'MAPK1'
assert s0.enz.db_refs == {'UP': 'P28482', 'HGNC': '6871', 'EGID': '5594',
'REFSEQ_PROT': 'NP_002736.3'}
assert s0.sub.name == 'TCF3'
assert s0.sub.db_refs == {'UP': 'P15923', 'HGNC': '11633', 'EGID': '6929',
'REFSEQ_PROT': 'NP_003191.1'}
assert s0.residue == 'T'
assert s0.position == '355'
assert len(s0.evidence) == 1
assert s0.evidence[0].pmid == '14592976'
assert s0.evidence[0].source_api == 'hprd'
assert s0.evidence[0].annotations['evidence'] == ['in vivo']
assert s0.evidence[0].annotations['site_motif'] == \
{'motif': 'NFSSSPSTPVGSPQG', 'respos': 8,
'off_by_one': False}
def test_process_ppis():
ppi_file = join(test_dir, 'BINARY_PROTEIN_PROTEIN_INTERACTIONS.txt')
hp = hprd.process_flat_files(id_file, ppi_file=ppi_file)
assert isinstance(hp, hprd.HprdProcessor)
assert isinstance(hp.statements, list)
assert len(hp.statements) == 5
s0 = hp.statements[0]
assert isinstance(s0, Complex)
assert len(s0.members) == 2
assert set([ag.name for ag in s0.members]) == set(['ITGA7', 'CHRNA1'])
assert s0.members[0].db_refs == \
{'HGNC': '6143', 'UP': 'Q13683', 'EGID': '3679',
'REFSEQ_PROT': 'NP_001138468.1'}
assert s0.members[1].db_refs == \
{'HGNC': '1955', 'UP': 'P02708', 'EGID': '1134',
'REFSEQ_PROT': 'NP_001034612.1'}
assert len(s0.evidence) == 1
assert s0.evidence[0].pmid == '10910772'
assert s0.evidence[0].source_api == 'hprd'
assert s0.evidence[0].annotations['evidence'] == ['in vivo']
assert s0.evidence[0].source_id == ('http://hprd.org/interactions?'
'hprd_id=02761&isoform_id=02761_1'
'&isoform_name=Isoform_1')
@raises(ValueError)
def test_process_ptms_no_seq():
ptm_file = join(test_dir, 'POST_TRANSLATIONAL_MODIFICATIONS.txt')
hp = hprd.process_flat_files(id_file, ptm_file=ptm_file)
|
test/dot_index_test.py
|
ohld/annoy
| 9,609 |
114361
|
# Copyright (c) 2018 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
import numpy
import random
from common import TestCase
from annoy import AnnoyIndex
def dot_metric(a, b):
return -numpy.dot(a, b)
def recall(retrieved, relevant):
return float(len(set(relevant) & set(retrieved))) \
/ float(len(set(relevant)))
class DotIndexTest(TestCase):
def test_get_nns_by_vector(self):
f = 2
i = AnnoyIndex(f, 'dot')
i.add_item(0, [2, 2])
i.add_item(1, [3, 2])
i.add_item(2, [3, 3])
i.build(10)
self.assertEqual(i.get_nns_by_vector([4, 4], 3), [2, 1, 0])
self.assertEqual(i.get_nns_by_vector([1, 1], 3), [2, 1, 0])
self.assertEqual(i.get_nns_by_vector([4, 2], 3), [2, 1, 0])
def test_get_nns_by_item(self):
f = 2
i = AnnoyIndex(f, 'dot')
i.add_item(0, [2, 2])
i.add_item(1, [3, 2])
i.add_item(2, [3, 3])
i.build(10)
self.assertEqual(i.get_nns_by_item(0, 3), [2, 1, 0])
self.assertEqual(i.get_nns_by_item(2, 3), [2, 1, 0])
def test_dist(self):
f = 2
i = AnnoyIndex(f, 'dot')
i.add_item(0, [0, 1])
i.add_item(1, [1, 1])
i.add_item(2, [0, 0])
self.assertAlmostEqual(i.get_distance(0, 1), 1.0)
self.assertAlmostEqual(i.get_distance(1, 2), 0.0)
def recall_at(self, n, n_trees=10, n_points=1000, n_rounds=5):
# the best movie/variable name
total_recall = 0.
for r in range(n_rounds):
# create random points at distance x
f = 10
idx = AnnoyIndex(f, 'dot')
data = numpy.array([
[random.gauss(0, 1) for z in range(f)]
for j in range(n_points)
])
expected_results = [
sorted(
range(n_points),
key=lambda j: dot_metric(data[i], data[j])
)[:n]
for i in range(n_points)
]
for i, vec in enumerate(data):
idx.add_item(i, vec)
idx.build(n_trees)
for i in range(n_points):
nns = idx.get_nns_by_vector(data[i], n)
total_recall += recall(nns, expected_results[i])
return total_recall / float(n_rounds * n_points)
def test_recall_at_10(self):
value = self.recall_at(10)
self.assertGreaterEqual(value, 0.65)
def test_recall_at_100(self):
value = self.recall_at(100)
self.assertGreaterEqual(value, 0.95)
def test_recall_at_1000(self):
value = self.recall_at(1000)
self.assertGreaterEqual(value, 0.99)
def test_recall_at_1000_fewer_trees(self):
value = self.recall_at(1000, n_trees=4)
self.assertGreaterEqual(value, 0.99)
def test_get_nns_with_distances(self):
f = 3
i = AnnoyIndex(f, 'dot')
i.add_item(0, [0, 0, 2])
i.add_item(1, [0, 1, 1])
i.add_item(2, [1, 0, 0])
i.build(10)
l, d = i.get_nns_by_item(0, 3, -1, True)
self.assertEqual(l, [0, 1, 2])
self.assertAlmostEqual(d[0], 4.0)
self.assertAlmostEqual(d[1], 2.0)
self.assertAlmostEqual(d[2], 0.0)
l, d = i.get_nns_by_vector([2, 2, 2], 3, -1, True)
self.assertEqual(l, [0, 1, 2])
self.assertAlmostEqual(d[0], 4.0)
self.assertAlmostEqual(d[1], 4.0)
self.assertAlmostEqual(d[2], 2.0)
def test_include_dists(self):
f = 40
i = AnnoyIndex(f, 'dot')
v = numpy.random.normal(size=f)
i.add_item(0, v)
i.add_item(1, -v)
i.build(10)
indices, dists = i.get_nns_by_item(0, 2, 10, True)
self.assertEqual(indices, [0, 1])
self.assertAlmostEqual(dists[0], numpy.dot(v, v))
def test_distance_consistency(self):
n, f = 1000, 3
i = AnnoyIndex(f, 'dot')
for j in range(n):
i.add_item(j, numpy.random.normal(size=f))
i.build(10)
for a in random.sample(range(n), 100):
indices, dists = i.get_nns_by_item(a, 100, include_distances=True)
for b, dist in zip(indices, dists):
self.assertAlmostEqual(dist, numpy.dot(
i.get_item_vector(a),
i.get_item_vector(b)
))
self.assertAlmostEqual(dist, i.get_distance(a, b))
|
mctorch/optim/rsgd.py
|
SatyadevNtv/mctorch
| 188 |
114372
|
import torch
from torch.optim.optimizer import Optimizer, required
from torch.optim import SGD
class rSGD(SGD):
def __init__(self, params, lr=required, momentum=0, dampening=0,
weight_decay=0, nesterov=False):
super(rSGD, self).__init__(params, lr=lr, momentum=momentum,
dampening=dampening, weight_decay=weight_decay,
nesterov=nesterov)
@torch.no_grad()
def step(self, closure=None):
"""Performs a single optimization step.
Also added case where parameter is constrained to a manifold.
Current implementation just supports normal SGD update without
momentum.
Arguments:
closure (callable, optional): A closure that reevaluates the model
and returns the loss.
"""
loss = None
if closure is not None:
with torch.enable_grad():
loss = closure()
for group in self.param_groups:
weight_decay = group['weight_decay']
momentum = group['momentum']
dampening = group['dampening']
nesterov = group['nesterov']
for p in group['params']:
if p.grad is None:
continue
if not hasattr(p, 'manifold') or p.manifold is None:
d_p = p.grad
if weight_decay != 0:
d_p = d_p.add(p, alpha=weight_decay)
if momentum != 0:
param_state = self.state[p]
if 'momentum_buffer' not in param_state:
buf = param_state['momentum_buffer'] = torch.clone(d_p).detach()
else:
buf = param_state['momentum_buffer']
buf.mul_(momentum).add_(d_p, alpha=1 - dampening)
if nesterov:
d_p = d_p.add(buf, alpha=momentum)
else:
d_p = buf
p.add_(d_p, alpha=-group['lr'])
else:
p.data.add_(p.manifold.retr(p.data,
-group['lr'] * p.rgrad.data) - p.data)
return loss
|
SMPyBandits/Policies/UCBH.py
|
balbok0/SMPyBandits
| 309 |
114456
|
<gh_stars>100-1000
# -*- coding: utf-8 -*-
""" The UCB-H policy for bounded bandits, with knowing the horizon.
Reference: [Audibert et al. 09].
"""
__author__ = "<NAME>"
__version__ = "0.6"
from numpy import sqrt, log
import numpy as np
np.seterr(divide='ignore') # XXX dangerous in general, controlled here!
try:
from .UCBalpha import UCBalpha, ALPHA
except ImportError:
from UCBalpha import UCBalpha, ALPHA
class UCBH(UCBalpha):
""" The UCB-H policy for bounded bandits, with knowing the horizon.
Reference: [Audibert et al. 09].
"""
def __init__(self, nbArms, horizon=None, alpha=ALPHA, lower=0., amplitude=1.):
super(UCBH, self).__init__(nbArms, lower=lower, amplitude=amplitude)
self.horizon = int(horizon) #: Parameter :math:`T` = known horizon of the experiment.
self.alpha = alpha #: Parameter alpha
def __str__(self):
return r"UCB-H($T={}$, $\alpha={:.3g}$)".format(self.horizon, self.alpha)
def computeIndex(self, arm):
r""" Compute the current index, at time t and after :math:`N_k(t)` pulls of arm k:
.. math:: I_k(t) = \frac{X_k(t)}{N_k(t)} + \sqrt{\frac{\alpha \log(T)}{2 N_k(t)}}.
"""
if self.pulls[arm] < 1:
return float('+inf')
else:
return (self.rewards[arm] / self.pulls[arm]) + sqrt((self.alpha * log(self.horizon)) / (2 * self.pulls[arm]))
def computeAllIndex(self):
""" Compute the current indexes for all arms, in a vectorized manner."""
indexes = (self.rewards / self.pulls) + np.sqrt((self.alpha * np.log(self.horizon)) / (2 * self.pulls))
indexes[self.pulls < 1] = float('+inf')
self.index[:] = indexes
|
code/engram_functions.py
|
Apsu/engram
| 103 |
114458
|
# %load code/engram_functions.py
# Import dependencies
import xlrd
import numpy as np
from sympy.utilities.iterables import multiset_permutations
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
def permute_optimize_keys(fixed_letters, fixed_letter_indices, open_letter_indices,
all_letters, keys, data_matrix, bigrams, bigram_frequencies,
min_score=0, verbose=False):
"""
Find all permutations of letters, optimize layout, and generate output.
"""
matrix_selected = select_keys(data_matrix, keys, verbose=False)
unassigned_letters = []
for all_letter in all_letters:
if all_letter not in fixed_letters:
unassigned_letters.append(all_letter)
if len(unassigned_letters) == len(open_letter_indices):
break
letter_permutations = permute_letters(unassigned_letters, verbose)
if verbose:
print("{0} permutations".format(len(letter_permutations)))
top_permutation, top_score = optimize_layout(np.array([]), matrix_selected, bigrams, bigram_frequencies,
letter_permutations, open_letter_indices,
fixed_letters, fixed_letter_indices, min_score, verbose)
return top_permutation, top_score, letter_permutations
def permute_optimize(starting_permutation, letters, all_letters, all_keys,
data_matrix, bigrams, bigram_frequencies, min_score=0, verbose=False):
"""
Find all permutations of letters, optimize layout, and generate output.
"""
matrix_selected = select_keys(data_matrix, all_keys, verbose=False)
open_positions = []
fixed_positions = []
open_letters = []
fixed_letters = []
assigned_letters = []
for iletter, letter in enumerate(letters):
if letter.strip() == "":
open_positions.append(iletter)
for all_letter in all_letters:
if all_letter not in letters and all_letter not in assigned_letters:
open_letters.append(all_letter)
assigned_letters.append(all_letter)
break
else:
fixed_positions.append(iletter)
fixed_letters.append(letter)
letter_permutations = permute_letters(open_letters, verbose)
if verbose:
print("{0} permutations".format(len(letter_permutations)))
top_permutation, top_score = optimize_layout(starting_permutation, matrix_selected, bigrams,
bigram_frequencies, letter_permutations, open_positions,
fixed_letters, fixed_positions, min_score, verbose)
return top_permutation, top_score
def select_keys(data_matrix, keys, verbose=False):
"""
Select keys to quantify pairwise relationships.
"""
# Extract pairwise entries for the keys:
nkeys = len(keys)
Select = np.zeros((nkeys, nkeys))
u = 0
for i in keys:
u += 1
v = 0
for j in keys:
v += 1
Select[u-1,v-1] = data_matrix[i-1,j-1]
# Normalize matrix with min-max scaling to a range with max 1:
newMin = np.min(Select) / np.max(Select)
newMax = 1.0
Select = newMin + (Select - np.min(Select)) * (newMax - newMin) / (np.max(Select) - np.min(Select))
if verbose:
# Heatmap of array
heatmap(data=Select, title="Matrix heatmap", xlabel="Key 1", ylabel="Key 2", print_output=False); plt.show()
return Select
def permute_letters(letters, verbose=False):
"""
Find all permutations of a given set of letters (max: 8-10 letters).
"""
letter_permutations = []
for p in multiset_permutations(letters):
letter_permutations.append(p)
letter_permutations = np.array(letter_permutations)
return letter_permutations
def score_layout(data_matrix, letters, bigrams, bigram_frequencies, verbose=False):
"""
Compute the score for a given letter-key layout (NOTE normalization step).
"""
# Create a matrix of bigram frequencies:
nletters = len(letters)
F2 = np.zeros((nletters, nletters))
# Find the bigram frequency for each ordered pair of letters in the permutation:
for i1 in range(nletters):
for i2 in range(nletters):
bigram = letters[i1] + letters[i2]
i2gram = np.where(bigrams == bigram)
if np.size(i2gram) > 0:
F2[i1, i2] = bigram_frequencies[i2gram][0]
# Normalize matrices with min-max scaling to a range with max 1:
newMax = 1
minF2 = np.min(F2)
maxF2 = np.max(F2)
newMin2 = minF2 / maxF2
F2 = newMin + (F2 - minF2) * (newMax - newMin2) / (maxF2 - minF2)
# Compute the score for this permutation:
score = np.average(data_matrix * F2)
if verbose:
print("Score for letter permutation {0}: {1}".format(letters, score))
return score
def tally_bigrams(input_text, bigrams, normalize=True, verbose=False):
"""
Compute the score for a given letter-key layout (NOTE normalization step).
"""
# Find the bigram frequency for each ordered pair of letters in the input text
#input_text = [str.upper(str(x)) for x in input_text]
input_text = [str.upper(x) for x in input_text]
nchars = len(input_text)
F = np.zeros(len(bigrams))
for ichar in range(0, nchars-1):
bigram = input_text[ichar] + input_text[ichar + 1]
i2gram = np.where(bigrams == bigram)
if np.size(i2gram) > 0:
F[i2gram] += 1
# Normalize matrix with min-max scaling to a range with max 1:
if normalize:
newMax = 1
newMin = np.min(F) / np.max(F)
F = newMin + (F - np.min(F)) * (newMax - newMin) / (np.max(F) - np.min(F))
bigram_frequencies_for_input = F
if verbose:
print("Bigram frequencies for input: {0}".format(bigram_frequencies_for_input))
return bigram_frequencies_for_input
def tally_layout_samefinger_bigrams(layout, bigrams, bigram_frequencies, nkeys=32, verbose=False):
"""
Tally the number of same-finger bigrams within (a list of 24 letters representing) a layout:
['P','Y','O','U','C','I','E','A','G','K','J','X','M','D','L','B','R','T','N','S','H','V','W','F']
"""
if nkeys == 32:
# Left: Right:
# 1 2 3 4 25 28 13 14 15 16 31
# 5 6 7 8 26 29 17 18 19 20 32
# 9 10 11 12 27 30 21 22 23 24
same_finger_keys = [[1,5],[5,9],[1,9], [2,6],[6,10],[2,10],
[3,7],[7,11],[3,11], [4,8],[8,12],[4,12],
[25,26],[26,27],[25,27], [28,29],[29,30],[28,30], [31,32],
[4,25],[4,26],[4,27], [8,25],[8,26],[8,27], [12,25],[12,26],[12,27],
[13,28],[13,29],[13,30], [17,28],[17,29],[17,30], [21,28],[21,29],[21,30],
[31,16],[31,20],[31,24], [32,16],[32,20],[32,24],
[13,17],[17,21],[13,21], [14,18],[18,22],[14,22],
[15,19],[19,23],[15,23], [16,20],[20,24],[16,24]]
elif nkeys == 24:
# 1 2 3 4 13 14 15 16
# 5 6 7 8 17 18 19 20
# 9 10 11 12 21 22 23 24
same_finger_keys = [[1,5],[5,9],[1,9], [2,6],[6,10],[2,10],
[3,7],[7,11],[3,11], [4,8],[8,12],[4,12],
[13,17],[17,21],[13,21], [14,18],[18,22],[14,22],
[15,19],[19,23],[15,23], [16,20],[20,24],[16,24]]
layout = [str.upper(x) for x in layout]
max_frequency = 1.00273E+11
samefinger_bigrams = []
samefinger_bigram_counts = []
for bigram_keys in same_finger_keys:
bigram1 = layout[bigram_keys[0]-1] + layout[bigram_keys[1]-1]
bigram2 = layout[bigram_keys[1]-1] + layout[bigram_keys[0]-1]
i2gram1 = np.where(bigrams == bigram1)
i2gram2 = np.where(bigrams == bigram2)
if np.size(i2gram1) > 0:
samefinger_bigrams.append(bigram1)
samefinger_bigram_counts.append(max_frequency * bigram_frequencies[i2gram1] / np.max(bigram_frequencies))
if np.size(i2gram2) > 0:
samefinger_bigrams.append(bigram2)
samefinger_bigram_counts.append(max_frequency * bigram_frequencies[i2gram2] / np.max(bigram_frequencies))
samefinger_bigrams_total = np.sum([x[0] for x in samefinger_bigram_counts])
if verbose:
print(" Total same-finger bigram frequencies: {0:15.0f}".format(samefinger_bigrams_total))
return samefinger_bigrams, samefinger_bigram_counts, samefinger_bigrams_total
def tally_layout_bigram_rolls(layout, bigrams, bigram_frequencies, nkeys=32, verbose=False):
"""
Tally the number of bigrams that engage little-to-index finger inward rolls
for (a list of 24 or 32 letters representing) a layout,
within the four columns of one hand, or any column across two hands.
layout = ['P','Y','O','U','C','I','E','A','G','K','J','X','L','D','B','V','N','T','R','S','H','M','W','F']
bigram_rolls, bigram_roll_counts, bigram_rolls_total = tally_layout_bigram_rolls(layout, bigrams, bigram_frequencies, nkeys=24, verbose=True)
"""
if nkeys == 32:
# Left: Right:
# 1 2 3 4 25 28 13 14 15 16 31
# 5 6 7 8 26 29 17 18 19 20 32
# 9 10 11 12 27 30 21 22 23 24
roll_keys = [[1,2],[2,3],[3,4], [5,6],[6,7],[7,8], [9,10],[10,11],[11,12],
[16,15],[15,14],[14,13], [20,19],[19,18],[18,17], [24,23],[23,22],[22,21],
[1,3],[2,4],[1,4], [5,7],[6,8],[5,8], [9,11],[10,12],[9,12],
[16,14],[15,13],[16,13], [20,18],[19,17],[20,17], [24,22],[23,21],[24,21],
[1,6],[1,7],[1,8],[2,7],[2,8],[3,8],
[5,2],[5,3],[5,4],[6,3],[6,4],[7,4],
[5,10],[5,11],[5,12],[6,11],[6,12],[7,12],
[9,6],[9,7],[9,8],[10,7],[10,8],[11,8],
[16,19],[16,18],[16,17],[15,18],[15,17],[14,17],
[20,15],[20,14],[20,13],[19,14],[19,13],[18,13],
[20,23],[20,22],[20,21],[19,22],[19,21],[18,21],
[24,19],[24,18],[24,17],[23,18],[23,17],[22,17],
[1,10],[1,11],[1,12],[2,11],[2,12],[3,12],
[9,2],[9,3],[9,4],[10,3],[10,4],[11,4],
[16,23],[16,22],[16,21],[15,22],[15,21],[14,21],
[24,15],[24,14],[24,13],[23,14],[23,13],[22,13]]
for i in [1,2,3,4,5,6,7,8,9,10,11,12, 25,26,27]:
for j in [13,14,15,16,17,18,19,20,21,22,23,24, 28,29,30,31,32]:
roll_keys.append([i,j])
for i in [13,14,15,16,17,18,19,20,21,22,23,24, 28,29,30,31,32]:
for j in [1,2,3,4,5,6,7,8,9,10,11,12, 25,26,27]:
roll_keys.append([i,j])
elif nkeys == 24:
# 1 2 3 4 13 14 15 16
# 5 6 7 8 17 18 19 20
# 9 10 11 12 21 22 23 24
roll_keys = [[1,2],[2,3],[3,4], [5,6],[6,7],[7,8], [9,10],[10,11],[11,12],
[16,15],[15,14],[14,13], [20,19],[19,18],[18,17], [24,23],[23,22],[22,21],
[1,3],[2,4],[1,4], [5,7],[6,8],[5,8], [9,11],[10,12],[9,12],
[16,14],[15,13],[16,13], [20,18],[19,17],[20,17], [24,22],[23,21],[24,21],
[1,6],[1,7],[1,8],[2,7],[2,8],[3,8], [5,2],[5,3],[5,4],[6,3],[6,4],[7,4],
[5,10],[5,11],[5,12],[6,11],[6,12],[7,12], [9,6],[9,7],[9,8],[10,7],[10,8],[11,8],
[16,19],[16,18],[16,17],[15,18],[15,17],[14,17], [20,15],[20,14],[20,13],[19,14],[19,13],[18,13],
[20,23],[20,22],[20,21],[19,22],[19,21],[18,21], [24,19],[24,18],[24,17],[23,18],[23,17],[22,17],
[1,10],[1,11],[1,12],[2,11],[2,12],[3,12], [9,2],[9,3],[9,4],[10,3],[10,4],[11,4],
[16,23],[16,22],[16,21],[15,22],[15,21],[14,21], [24,15],[24,14],[24,13],[23,14],[23,13],[22,13]]
for i in range(0,12):
for j in range(12,24):
roll_keys.append([i,j])
for i in range(12,24):
for j in range(0,12):
roll_keys.append([i,j])
layout = [str.upper(x) for x in layout]
max_frequency = 1.00273E+11
bigram_rolls = []
bigram_roll_counts = []
for bigram_keys in roll_keys:
bigram1 = layout[bigram_keys[0]-1] + layout[bigram_keys[1]-1]
bigram2 = layout[bigram_keys[1]-1] + layout[bigram_keys[0]-1]
i2gram1 = np.where(bigrams == bigram1)
i2gram2 = np.where(bigrams == bigram2)
if np.size(i2gram1) > 0:
bigram_rolls.append(bigram1)
bigram_roll_counts.append(max_frequency * bigram_frequencies[i2gram1] / np.max(bigram_frequencies))
if np.size(i2gram2) > 0:
bigram_rolls.append(bigram2)
bigram_roll_counts.append(max_frequency * bigram_frequencies[i2gram2] / np.max(bigram_frequencies))
bigram_rolls_total = np.sum([x[0] for x in bigram_roll_counts])
if verbose:
print(" Total bigram inward roll frequencies: {0:15.0f}".format(bigram_rolls_total))
return bigram_rolls, bigram_roll_counts, bigram_rolls_total
def optimize_layout(starting_permutation, data_matrix, bigrams, bigram_frequencies, letter_permutations,
open_positions, fixed_letters, fixed_positions=[], min_score=0, verbose=False):
"""
Compute scores for all letter-key layouts.
"""
top_permutation = starting_permutation
top_score = min_score
use_score_function = False
nletters = len(open_positions) + len(fixed_positions)
F2 = np.zeros((nletters, nletters))
# Loop through the permutations of the selected letters:
for p in letter_permutations:
letters = np.array(['W' for x in range(nletters)]) # KEEP to initialize!
for imove, open_position in enumerate(open_positions):
letters[open_position] = p[imove]
for ifixed, fixed_position in enumerate(fixed_positions):
letters[fixed_position] = fixed_letters[ifixed]
# Compute the score for this permutation:
if use_score_function:
score = score_layout(data_matrix, letters, bigrams, bigram_frequencies, verbose=False)
else:
# Find the bigram frequency for each ordered pair of letters in the permutation:
for i1 in range(nletters):
for i2 in range(nletters):
bigram = letters[i1] + letters[i2]
i2gram = np.where(bigrams == bigram)
if np.size(i2gram) > 0:
F2[i1, i2] = bigram_frequencies[i2gram][0]
# Normalize matrices with min-max scaling to a range with max 1:
newMax = 1
minF2 = np.min(F2)
maxF2 = np.max(F2)
newMin2 = minF2 / maxF2
F = newMin + (F2 - minF2) * (newMax - newMin2) / (maxF2 - minF2)
# Compute the score for this permutation:
score = np.average(data_matrix * F)
if score > top_score:
top_score = score
top_permutation = letters
if verbose:
if top_score == min_score:
print("top_score = min_score")
print("{0:0.8f}".format(top_score))
print(*top_permutation)
return top_permutation, top_score
def exchange_letters(letters, fixed_letter_indices, all_letters, all_keys, data_matrix,
bigrams, bigram_frequencies, verbose=True):
"""
Exchange letters, 8 keys at a time (8! = 40,320) selected twice in 14 different ways:
Indices:
0 1 2 3 12 13 14 15
4 5 6 7 16 17 18 19
8 9 10 11 20 21 22 23
1. Top rows
0 1 2 3 12 13 14 15
2. Bottom rows
8 9 10 11 20 21 22 23
3. Top and bottom rows on the right side
12 13 14 15
20 21 22 23
4. Top and bottom rows on the left side
0 1 2 3
8 9 10 11
5. Top right and bottom left rows
12 13 14 15
8 9 10 11
6. Top left and bottom right rows
0 1 2 3
20 21 22 23
7. Center of the top and bottom rows on both sides
1 2 13 14
9 10 21 22
8. The eight corners
0 3 12 15
8 11 20 23
9. Left half of the top and bottom rows on both sides
0 1 12 13
8 9 20 21
10. Right half of the top and bottom rows on both sides
2 3 14 15
10 11 22 23
11. Left half of non-home rows on the left and right half of the same rows on the right
0 1 14 15
8 9 22 23
12. Right half of non-home rows on the left and left half of the same rows on the right
2 3 12 13
10 11 20 21
13. Top center and lower sides
1 2 13 14
8 11 20 23
14. Top sides and lower center
0 3 12 15
9 10 21 22
15. Repeat 1-14
"""
top_score = score_layout(data_matrix, letters, bigrams, bigram_frequencies, verbose=False)
print('Initial score: {0}'.format(top_score))
print(*letters)
top_permutation = letters
lists_of_open_indices = [
[0,1,2,3,12,13,14,15],
[8,9,10,11,20,21,22,23],
[12,13,14,15,20,21,22,23],
[0,1,2,3,8,9,10,11],
[12,13,14,15,8,9,10,11],
[0,1,2,3,20,21,22,23],
[1,2,13,14,9,10,21,22],
[0,3,12,15,8,11,20,23],
[0,1,12,13,8,9,20,21],
[2,3,14,15,10,11,22,23],
[0,1,14,15,8,9,22,23],
[2,3,12,13,10,11,20,21],
[1,2,8,11,13,14,20,23],
[0,3,9,10,12,15,21,22]
]
lists_of_print_statements = [
'1. Top rows',
'2. Bottom rows',
'3. Top and bottom rows on the right side',
'4. Top and bottom rows on the left side',
'5. Top right and bottom left rows',
'6. Top left and bottom right rows',
'7. Center of the top and bottom rows on both sides',
'8. The eight corners',
'9. Left half of the top and bottom rows on both sides',
'10. Right half of the top and bottom rows on both sides',
'11. Left half of non-home rows on the left and right half of the same rows on the right',
'12. Right half of non-home rows on the left and left half of the same rows on the right',
'13. Top center and lower sides',
'14. Top sides and lower center'
]
for istep in [1,2]:
if istep == 1:
s = "Set 1: 14 letter exchanges: "
elif istep == 2:
s = "Set 2: 14 letter exchanges: "
for ilist, open_indices in enumerate(lists_of_open_indices):
print_statement = lists_of_print_statements[ilist]
if verbose:
print('{0} {1}'.format(s, print_statement))
starting_permutation = top_permutation.copy()
for open_index in open_indices:
if open_index not in fixed_letter_indices:
top_permutation[open_index] = ''
top_permutation, top_score = permute_optimize(starting_permutation, top_permutation, letters24,
keys24, data_matrix, bigrams, bigram_frequencies,
min_score=top_score, verbose=True)
if verbose:
print('')
print(' -------- DONE --------')
print('')
return top_permutation, top_score
def rank_within_epsilon(numbers, epsilon, factor=False, verbose=True):
"""
numbers = np.array([10,9,8,7,6])
epsilon = 1
rank_within_epsilon(numbers, epsilon, factor=False, verbose=True)
>>> array([1., 1., 2., 2., 3.])
numbers = np.array([0.798900824, 0.79899900824, 0.79900824])
epsilon = 0.9**8 - 0.9**9
factor24 = ((24**2 - 1) + (1-epsilon)) / (24**2) # 0.999925266109375
rank_within_epsilon(numbers, factor24, factor=True, verbose=True)
>>> array([2., 1., 1.])
"""
numbers = np.array(numbers)
Isort = np.argsort(-numbers)
numbers_sorted = numbers[Isort]
count = 1
ranks = np.zeros(np.size(numbers))
for i, num in enumerate(numbers_sorted):
if ranks[i] == 0:
if factor:
lower_bound = num * epsilon
else:
lower_bound = num - epsilon
bounded_nums1 = num >= numbers_sorted
bounded_nums2 = numbers_sorted >= lower_bound
bounded_nums = bounded_nums1 * bounded_nums2
count += 1
for ibounded, bounded_num in enumerate(bounded_nums):
if bounded_num == True:
ranks[ibounded] = count
uranks = np.unique(ranks)
nranks = np.size(uranks)
new_ranks = ranks.copy()
new_count = 0
for rank in uranks:
new_count += 1
same_ranks = ranks == rank
for isame, same_rank in enumerate(same_ranks):
if same_rank == True:
new_ranks[isame] = new_count
#ranks_sorted = new_ranks[Isort]
ranks_sorted = [np.int(x) for x in new_ranks]
if verbose:
for i, num in enumerate(numbers_sorted):
print(" ({0}) {1}".format(np.int(ranks_sorted[i]), num))
return numbers_sorted, ranks_sorted, Isort
def print_matrix_info(matrix_data, matrix_label, nkeys, nlines=10):
"""
Print matrix output.
"""
print("{0} min = {1}, max = {2}".format(matrix_label, np.min(matrix_data), np.max(matrix_data)))
matrix_flat = matrix_data.flatten()
argsort = np.argsort(matrix_flat)
print("{0} key number pairs with minimum values:".format(matrix_label))
for x in argsort[0:nlines]:
if x % nkeys == 0:
min_row = np.int(np.ceil(x / nkeys)) + 1
min_col = 1
else:
min_row = np.int(np.ceil(x / nkeys))
min_col = x - nkeys * (min_row-1) + 1
print(" {0} -> {1} ({2})".format(min_row, min_col, matrix_flat[x]))
print("{0} key number pairs with maximum values:".format(matrix_label))
max_sort = argsort[-nlines::]
for x in max_sort[::-1]:
if x % nkeys == 0:
max_row = np.int(np.ceil(x / nkeys)) + 1
max_col = 1
else:
max_row = np.int(np.ceil(x / nkeys))
max_col = x - nkeys * (max_row-1) + 1
print(" {0} -> {1} ({2})".format(max_row, max_col, matrix_flat[x]))
def heatmap(data, title="", xlabel="", ylabel="", x_axis_labels=[], y_axis_labels=[], print_output=True):
"""
Plot heatmap of matrix.
"""
# use heatmap function, set the color as viridis and
# make each cell seperate using linewidth parameter
plt.figure()
sns_plot = sns.heatmap(data, xticklabels=x_axis_labels, yticklabels=y_axis_labels, linewidths=1,
cmap="viridis", square=True, vmin=np.min(data), vmax=np.max(data))
plt.title(title)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
sns_plot.set_xticklabels(x_axis_labels) #, rotation=75)
sns_plot.set_yticklabels(y_axis_labels)
if print_output:
sns_plot.figure.savefig("{0}_heatmap.png".format(title))
def histmap(data, title="", print_output=True):
"""
Plot histogram.
"""
sns.distplot(data)
plt.title(title)
if print_output:
sns_plot.figure.savefig("{0}_histogram.png".format(title))
def print_layout24(layout):
"""
Print layout.
"""
print(' {0} {1}'.format(' '.join(layout[0:4]),
' '.join(layout[12:16])))
print(' {0} {1}'.format(' '.join(layout[4:8]),
' '.join(layout[16:20])))
print(' {0} {1}'.format(' '.join(layout[8:12]),
' '.join(layout[20:24])))
def print_layout24_instances(layout, letters24, instances24, bigrams, bigram_frequencies):
"""
Print billions of instances per letter (not Z or Q) in layout form.
layout = ['P','Y','O','U','C','I','E','A','G','K','J','X','M','D','L','B','R','T','N','S','H','V','W','F']
print_layout24_instances(layout, letters24, instances24, bigrams, bigram_frequencies)
"""
layout_instances = []
layout_instances_strings = []
for letter in layout:
index = letters24.index(letter)
layout_instances.append(instances24[index])
layout_instances_strings.append('{0:3.0f}'.format(instances24[index]/instances_denominator))
print(' {0} {1}'.format(' '.join(layout_instances_strings[0:4]),
' '.join(layout_instances_strings[12:16])))
print(' {0} {1}'.format(' '.join(layout_instances_strings[4:8]),
' '.join(layout_instances_strings[16:20])))
print(' {0} {1}'.format(' '.join(layout_instances_strings[8:12]),
' '.join(layout_instances_strings[20:24])))
left_sum = np.sum(layout_instances[0:12])
right_sum = np.sum(layout_instances[12:24])
pL = ''
pR = ''
if left_sum > right_sum:
pL = ' ({0:3.2f}%)'.format(100 * (left_sum - right_sum) / right_sum)
elif right_sum > left_sum:
pR = ' ({0:3.2f}%)'.format(100 * (right_sum - left_sum) / left_sum)
print('\n left: {0}{1} right: {2}{3}'.format(left_sum, pL, right_sum, pR))
tally_layout_samefinger_bigrams(layout, bigrams, bigram_frequencies, nkeys=24, verbose=True)
tally_layout_bigram_rolls(layout, bigrams, bigram_frequencies, nkeys=24, verbose=True)
def print_bigram_frequency(input_pair, bigrams, bigram_frequencies):
"""
>>> print_bigram_frequency(['t','h'], bigrams, bigram_frequencies)
"""
# Find the bigram frequency
input_text = [str.upper(str(x)) for x in input_pair]
nchars = len(input_text)
for ichar in range(0, nchars-1):
bigram1 = input_text[ichar] + input_text[ichar + 1]
bigram2 = input_text[ichar + 1] + input_text[ichar]
i2gram1 = np.where(bigrams == bigram1)
i2gram2 = np.where(bigrams == bigram2)
if np.size(i2gram1) > 0:
freq1 = bigram_frequencies[i2gram1[0][0]]
print("{0}: {1:3.2f}".format(bigram1, freq1))
if np.size(i2gram2) > 0:
freq2 = bigram_frequencies[i2gram2[0][0]]
print("{0}: {1:3.2f}".format(bigram2, freq2))
|
siuba/sql/translate.py
|
tmastny/siuba
| 831 |
114501
|
"""
This module holds default translations from pandas syntax to sql for 3 kinds of operations...
1. scalar - elementwise operations (e.g. array1 + array2)
2. aggregation - operations that result in a single number (e.g. array1.mean())
3. window - operations that do calculations across a window
(e.g. array1.lag() or array1.expanding().mean())
"""
from sqlalchemy import sql
from sqlalchemy.sql import sqltypes as types, func as fn
from functools import singledispatch
from .verbs import case_when, if_else
# warning for when sql defaults differ from pandas ============================
import warnings
class SiubaSqlRuntimeWarning(UserWarning): pass
def warn_arg_default(func_name, arg_name, arg, correct):
warnings.warn(
"\n{func_name} sql translation defaults "
"{arg_name} to {arg}. To return identical result as pandas, use "
"{arg_name} = {correct}.\n\n"
"This warning only displays once per function".format(
func_name = func_name, arg_name = arg_name, arg = repr(arg), correct = repr(correct)
),
SiubaSqlRuntimeWarning
)
# Custom dispatching in call trees ============================================
from sqlalchemy.sql.elements import ColumnClause
from sqlalchemy.sql.base import ImmutableColumnCollection
class SqlColumn(ColumnClause): pass
class SqlColumnAgg(SqlColumn): pass
# Custom over clause handling ================================================
# TODO: must make these take both tbl, col as args, since hard to find window funcs
def sa_is_window(clause):
return isinstance(clause, sql.elements.Over) \
or isinstance(clause, sql.elements.WithinGroup)
def sa_get_over_clauses(clause):
windows = []
append_win = lambda col: windows.append(col)
sql.util.visitors.traverse(clause, {}, {"over": append_win})
return windows
def sa_modify_window(clause, group_by = None, order_by = None):
if group_by:
group_cols = [columns[name] for name in group_by]
partition_by = sql.elements.ClauseList(*group_cols)
clone = clause._clone()
clone.partition_by = partition_by
return clone
return clause
from sqlalchemy.sql.elements import Over
class CustomOverClause: pass
class AggOver(Over, CustomOverClause):
def set_over(self, group_by, order_by = None):
self.partition_by = group_by
return self
class RankOver(Over, CustomOverClause):
def set_over(self, group_by, order_by = None):
crnt_partition = getattr(self.partition_by, 'clauses', tuple())
self.partition_by = sql.elements.ClauseList(*crnt_partition, *group_by.clauses)
return self
class CumlOver(Over, CustomOverClause):
def set_over(self, group_by, order_by):
self.partition_by = group_by
self.order_by = order_by
if not len(order_by):
warnings.warn(
"No order by columns explicitly set in window function. SQL engine"
"does not guarantee a row ordering. Recommend using an arrange beforehand.",
RuntimeWarning
)
return self
# Translator creation funcs ===================================================
# Windows ----
def win_absent(name):
from typing import Any
def not_implemented(*args, **kwargs) -> Any:
raise NotImplementedError("SQL dialect does not support {}.".format(name))
return not_implemented
def win_over(name: str):
sa_func = getattr(sql.func, name)
def f(col) -> RankOver:
return RankOver(sa_func(), order_by = col)
return f
def win_cumul(name):
sa_func = getattr(sql.func, name)
def f(col, *args, **kwargs) -> CumlOver:
return CumlOver(sa_func(col, *args, **kwargs), rows = (None,0))
return f
def win_agg(name):
sa_func = getattr(sql.func, name)
def f(col, *args, **kwargs) -> AggOver:
return AggOver(sa_func(col, *args, **kwargs))
return f
def sql_func_diff(col, periods = 1):
if periods > 0:
return CumlOver(col - sql.func.lag(col, periods))
elif periods < 0:
return CumlOver(col - sql.func.lead(col, abs(periods)))
raise ValueError("periods argument to sql diff cannot be 0")
# Ordered and theoretical set aggregates ----
def set_agg(name):
sa_func = getattr(sql.func, name)
return lambda col, *args: sa_func(*args).within_group(col)
# Datetime ----
def sql_extract(name):
return lambda col: sql.func.extract(name, col)
def sql_func_extract_dow_monday(col):
# make monday = 0 rather than sunday
monday0 = sql.cast(sql.func.extract('dow', col) + 6, types.Integer) % 7
# cast to numeric, since that's what extract('dow') returns
return sql.cast(monday0, types.Numeric)
def sql_is_first_of(name, reference):
return lambda col: fn.date_trunc(name, col) == fn.date_trunc(reference, col)
def sql_func_last_day_in_period(col, period):
return fn.date_trunc(period, col) + sql.text("interval '1 %s - 1 day'" % period)
def sql_func_days_in_month(col):
return fn.extract('day', sql_func_last_day_in_period(col, 'month'))
def sql_is_last_day_of(period):
def f(col):
last_day = sql_func_last_day_in_period(col, period)
return fn.date_trunc('day', col) == last_day
return f
def sql_func_floor_date(col, unit):
# see https://www.postgresql.org/docs/9.1/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
# valid values:
# microseconds, milliseconds, second, minute, hour,
# day, week, month, quarter, year, decade, century, millennium
# TODO: implement in siuba.dply.lubridate
return fn.date_trunc(unit, col)
# Strings ----
def sql_str_strip(name):
strip_func = getattr(fn, name)
def f(col, to_strip = " \t\n\v\f\r"):
return strip_func(col, to_strip)
return f
def sql_func_capitalize(col):
first_char = fn.upper(fn.left(col, 1))
rest = fn.right(col, fn.length(col) - 1)
return first_char.op('||')(rest)
# Others ----
def sql_agg(name):
sa_func = getattr(sql.func, name)
return lambda col: sa_func(col)
def sql_scalar(name):
sa_func = getattr(sql.func, name)
return lambda col, *args: sa_func(col, *args)
def sql_colmeth(meth, *outerargs):
def f(col, *args) -> SqlColumn:
return getattr(col, meth)(*outerargs, *args)
return f
def sql_not_impl():
return NotImplementedError
# Custom implementations ----
def sql_func_astype(col, _type):
mappings = {
str: types.Text,
'str': types.Text,
int: types.Integer,
'int': types.Integer,
float: types.Numeric,
'float': types.Numeric,
bool: types.Boolean,
'bool': types.Boolean
}
try:
sa_type = mappings[_type]
except KeyError:
raise ValueError("sql astype currently only supports type objects: str, int, float, bool")
return sql.cast(col, sa_type)
# Base translations ===========================================================
base_scalar = dict(
# infix operators -----
# NOTE: all sqlalchemy.Column operators are used
# TODO: need way to implement ** operator
# sqlalchemy.ColumnElement methods ----
cast = sql_colmeth("cast"),
between = sql_colmeth("between"),
isin = sql_colmeth("in_"),
# bitwise operations -----
# TODO
# these are methods on sql.funcs ----
abs = sql_scalar("abs"),
acos = sql_scalar("acos"),
asin = sql_scalar("asin"),
atan = sql_scalar("atan"),
atan2 = sql_scalar("atan2"),
cos = sql_scalar("cos"),
cot = sql_scalar("cot"),
astype = sql_func_astype,
# I was lazy here and wrote lambdas directly ---
# TODO: I think these are postgres specific?
isna = sql_colmeth("is_", None),
isnull = sql_colmeth("is_", None),
notna = lambda col: ~col.is_(None),
fillna = sql.functions.coalesce,
# dply.vector funcs ----
# TODO: move to postgres specific
# TODO: this is to support a DictCall (e.g. used in case_when)
dict = dict,
# TODO: don't use singledispatch to add sql support to case_when
case_when = case_when,
if_else = if_else,
# POSTGRES compatility ------------------------------------------------
# _special_methods
__round__ = sql_scalar("round"),
#
copy = sql_not_impl(),
# binary
add = sql_colmeth('__add__'),
sub = sql_colmeth('__sub__'),
#truediv
#floordiv
mul = sql_colmeth('__mul__'),
mod = sql_colmeth('__mod__'),
#pow = sql_colmeth('__pow__'),
lt = sql_colmeth('__lt__'),
gt = sql_colmeth('__gt__'),
le = sql_colmeth('__le__'),
ge = sql_colmeth('__ge__'),
ne = sql_colmeth('__ne__'),
eq = sql_colmeth('__eq__'),
#round = sql_scalar("round"),
radd = sql_colmeth('__radd__'),
rsub = sql_colmeth('__rsub__'),
#rtruediv
#rfloordiv
rmul = sql_colmeth('__rmul__'),
rmod = sql_colmeth('__rmod__'),
# computations ---
clip = lambda col, lower, upper: fn.least(fn.greatest(col, lower), upper),
# datetime_properties ---
date = sql_not_impl(),
time = sql_not_impl(),
timetz = sql_not_impl(),
year = sql_extract('year'),# , sql.cast(col, sql.sqltypes.Date)),
month = sql_extract('month'),
day = sql_extract('day'),
hour = sql_extract('hour'),
minute = sql_extract('minute'),
second = sql_extract('second'),
#microsecond = sql_extract('microsecond'), # TODO: postgres includes seconds
nanosecond = sql_not_impl(),
week = sql_extract('week'),
weekofyear = sql_extract('week'),
dayofweek = sql_func_extract_dow_monday,
weekday = sql_func_extract_dow_monday,
dayofyear = sql_extract('doy'),
quarter = sql_extract('quarter'),
is_month_start = sql_is_first_of('day', 'month'),
is_month_end = sql_is_last_day_of('month'),
is_quarter_start = sql_is_first_of('day', 'quarter'),
#is_quarter_end = sql_is_last_day_of('quarter'),
is_year_start = sql_is_first_of('day', 'year'),
is_year_end = sql_is_last_day_of('year'),
is_leap_year = sql_not_impl(),
daysinmonth = sql_func_days_in_month,
days_in_month = sql_func_days_in_month,
tz = sql_not_impl(),
freq = sql_not_impl(),
# datetime methods ---
#to_period = ,
## dt.to_pydatetime
#tz_localize =
## dt.tz_convert
#normalize =
#strftime =
#round =
#floor =
#ceil =
#month_name =
#day_name =
# TODO: slotting in a floor_date method, since I can't do my job
# or make common SQL queries without it....
floor_date = sql_func_floor_date,
# string methdos ---
capitalize = sql_func_capitalize,
#casefold = ,
#cat = ,
center = sql_not_impl(),
contains = sql_not_impl(),
# count = ,
# # str.decode
# encode = ,
endswith = sql_colmeth("endswith"),
# #extract =
# # str.extractall
# find = ,
# findall = ,
# #get
# #index
# #join
len = sql.func.length,
# ljust = ,
lower = sql.func.lower,
# TODO: whitespace options based loosely on builtin string.isspace
lstrip = sql_str_strip('ltrim'),
# match = ,
# # str.normalize
# pad = ,
# # str.partition
# # str.repeat
# replace = ,
# rfind = ,
# # str.rindex
# rjust = ,
# # str.rpartition
rstrip = sql_str_strip('rtrim'),
# slice = ,
# slice_replace = ,
# split = ,
# rsplit = ,
startswith = sql_colmeth("startswith"),
strip = sql_str_strip('trim'),
# swapcase = ,
title = sql.func.initcap,
# # str.translate
upper = sql.func.upper,
# wrap = ,
# # str.zfill
# isalnum = ,
# isalpha = ,
# isdigit = ,
# isspace = ,
# islower = ,
# isupper = ,
# istitle = ,
# isnumeric = ,
# isdecimal = ,
)
base_agg = dict(
mean = sql_agg("avg"),
sum = sql_agg("sum"),
min = sql_agg("min"),
max = sql_agg("max"),
count = sql_agg("count"),
# TODO: generalize case where doesn't use col
# need better handeling of vector funcs
nunique = lambda col: sql.func.count(sql.func.distinct(col)),
# POSTGRES compatibility ----------------------------------------------
quantile = set_agg("percentile_cont"),
)
base_win = dict(
rank = win_over("rank"),
#first = win_over2("first"),
#last = win_over2("last"),
#nth = win_over3
#lead = win_over4
#lag
# aggregate functions ---
mean = win_agg("avg"),
var = win_agg("variance"),
sum = win_agg("sum"),
min = win_agg("min"),
max = win_agg("max"),
# ordered set funcs ---
#quantile
#median
# counts ----
count = win_agg("count"),
#n
#n_distinct
# cumulative funcs ---
#avg("id") OVER (PARTITION BY "email" ORDER BY "id" ROWS UNBOUNDED PRECEDING)
#cummean = win_agg("
cumsum = win_cumul("sum"),
#cummin
#cummax
diff = sql_func_diff,
# POSTGRES compatibility ----------------------------------------------
# computations
#prod = lambda col: AggOver(fn.exp(fn.sum(fn.log(col)))),
std = win_agg("stddev_samp"),
)
# based on https://github.com/tidyverse/dbplyr/blob/master/R/backend-.R
base_nowin = dict(
#row_number = win_absent("ROW_NUMBER"),
#min_rank = win_absent("RANK"),
rank = win_absent("RANK"),
dense_rank = win_absent("DENSE_RANK"),
percent_rank = win_absent("PERCENT_RANK"),
cume_dist = win_absent("CUME_DIST"),
ntile = win_absent("NTILE"),
mean = win_absent("AVG"),
sd = win_absent("SD"),
var = win_absent("VAR"),
cov = win_absent("COV"),
cor = win_absent("COR"),
sum = win_absent("SUM"),
min = win_absent("MIN"),
max = win_absent("MAX"),
median = win_absent("PERCENTILE_CONT"),
quantile = win_absent("PERCENTILE_CONT"),
n = win_absent("N"),
n_distinct = win_absent("N_DISTINCT"),
cummean = win_absent("MEAN"),
cumsum = win_absent("SUM"),
cummin = win_absent("MIN"),
cummax = win_absent("MAX"),
nth = win_absent("NTH_VALUE"),
first = win_absent("FIRST_VALUE"),
last = win_absent("LAST_VALUE"),
lead = win_absent("LEAD"),
lag = win_absent("LAG"),
order_by = win_absent("ORDER_BY"),
str_flatten = win_absent("STR_FLATTEN"),
count = win_absent("COUNT")
)
funcs = dict(scalar = base_scalar, aggregate = base_agg, window = base_win)
# MISC ===========================================================================
# scalar, aggregate, window #no_win, agg_no_win
# local to table
# alias to LazyTbl.no_win.dense_rank...
# LazyTbl.agg.dense_rank...
from collections.abc import MutableMapping
import itertools
class SqlTranslator(MutableMapping):
def __init__(self, d, **kwargs):
self.d = d
self.kwargs = kwargs
def __len__(self):
return len(set(self.d) + set(self.kwargs))
def __iter__(self):
old_keys = iter(self.d)
new_keys = (k for k in self.kwargs if k not in self.d)
return itertools.chain(old_keys, new_keys)
def __getitem__(self, x):
try:
return self.kwargs[x]
except KeyError:
return self.d[x]
def __setitem__(self, k, v):
self.d[k] = v
def __delitem__(self, k):
del self.d[k]
|
src/ostorlab/apis/agent_details.py
|
bbhunter/ostorlab
| 113 |
114502
|
"""Get agent details from the public api."""
import json
from typing import Dict, Optional
from ostorlab.apis import request
class AgentDetailsAPIRequest(request.APIRequest):
"""Get agent details for a specified agent_key."""
def __init__(self, agent_key: str) -> None:
"""Initializer"""
self._agent_key = agent_key
@property
def query(self) -> Optional[str]:
"""The query to fetch the agent details with an agent key.
Returns:
The query to fetch the agent details.
"""
return """
query Agent($agentKey: String!){
agent(agentKey: $agentKey) {
name,
gitLocation,
yamlFileLocation,
dockerLocation,
access,
listable,
key
versions(orderBy: Version, sort: Desc, page: 1, numberElements: 1) {
versions {
version
}
}
}
}
"""
@property
def data(self) -> Optional[Dict]:
"""Sets the body of the API request, to fetch the specific agent.
Returns:
The body of the agent details request.
"""
data = {
'query': self.query,
'variables': json.dumps({'agentKey': self._agent_key})
}
return data
|
bnpy/allocmodel/__init__.py
|
raphael-group/bnpy
| 184 |
114506
|
<gh_stars>100-1000
from bnpy.allocmodel.AllocModel import AllocModel
from bnpy.allocmodel.mix.FiniteMixtureModel import FiniteMixtureModel
from bnpy.allocmodel.mix.DPMixtureModel import DPMixtureModel
from bnpy.allocmodel.mix.DPMixtureRestrictedLocalStep import make_xPiVec_and_emptyPi
from bnpy.allocmodel.topics.FiniteTopicModel import FiniteTopicModel
from bnpy.allocmodel.topics.HDPTopicModel import HDPTopicModel
from bnpy.allocmodel.hmm.FiniteHMM import FiniteHMM
from bnpy.allocmodel.hmm.HDPHMM import HDPHMM
from bnpy.allocmodel.relational.FiniteSMSB import FiniteSMSB
from bnpy.allocmodel.relational.FiniteMMSB import FiniteMMSB
from bnpy.allocmodel.relational.FiniteAssortativeMMSB import FiniteAssortativeMMSB
from bnpy.allocmodel.relational.HDPMMSB import HDPMMSB
from bnpy.allocmodel.relational.HDPAssortativeMMSB import HDPAssortativeMMSB
AllocModelConstructorsByName = {
'FiniteMixtureModel': FiniteMixtureModel,
'DPMixtureModel': DPMixtureModel,
'FiniteTopicModel': FiniteTopicModel,
'HDPTopicModel': HDPTopicModel,
'FiniteHMM': FiniteHMM,
'HDPHMM': HDPHMM,
'FiniteSMSB': FiniteSMSB,
'FiniteMMSB': FiniteMMSB,
'FiniteAssortativeMMSB': FiniteAssortativeMMSB,
'HDPMMSB': HDPMMSB,
'HDPAssortativeMMSB': HDPAssortativeMMSB,
}
AllocModelNameSet = set(AllocModelConstructorsByName.keys())
__all__ = ['AllocModel']
for name in AllocModelConstructorsByName:
__all__.append(name)
|
test/demoappext-setuptools/setup.py
|
tanvimoharir/python-versioneer
| 204 |
114547
|
from setuptools import setup, Extension
import versioneer
commands = versioneer.get_cmdclass().copy()
extension = Extension('demo.ext',
sources=['demo/ext.c'],
)
setup(name="demoappext",
version=versioneer.get_version(),
description="Demo",
url="url",
author="author",
author_email="email",
zip_safe=True,
packages=["demo"],
# package_dir={"": "src"},
entry_points={
'console_scripts': [ 'rundemo = demo.main:run' ],
},
install_requires=["demolib==1.0"],
cmdclass=commands,
ext_modules=[extension],
)
|
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py
|
Polidea/SiriusObfuscator
| 427 |
114567
|
from __future__ import print_function
import os
import lldbsuite.test.lldbtest as lldbtest
from builder_base import *
def buildDsym(
sender=None,
architecture=None,
compiler=None,
dictionary=None,
clean=True):
"""Build the binaries with dsym debug info."""
commands = []
if clean:
commands.append(["make", "clean", getCmdLine(dictionary)])
commands.append(["make", "MAKE_DSYM=YES", getArchSpec(
architecture), getCCSpec(compiler), getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
# True signifies that we can handle building dsym.
return True
|
third_party/html5lib-python/html5lib/tests/test_parser.py
|
tingshao/catapult
| 2,151 |
114606
|
<filename>third_party/html5lib-python/html5lib/tests/test_parser.py
from __future__ import absolute_import, division, unicode_literals
import os
import sys
import traceback
import warnings
import re
warnings.simplefilter("error")
from .support import get_data_files
from .support import TestData, convert, convertExpected, treeTypes
from html5lib import html5parser, constants
# Run the parse error checks
checkParseErrors = False
# XXX - There should just be one function here but for some reason the testcase
# format differs from the treedump format by a single space character
def convertTreeDump(data):
return "\n".join(convert(3)(data).split("\n")[1:])
namespaceExpected = re.compile(r"^(\s*)<(\S+)>", re.M).sub
def runParserTest(innerHTML, input, expected, errors, treeClass,
namespaceHTMLElements):
with warnings.catch_warnings(record=True) as caughtWarnings:
warnings.simplefilter("always")
p = html5parser.HTMLParser(tree=treeClass,
namespaceHTMLElements=namespaceHTMLElements)
try:
if innerHTML:
document = p.parseFragment(input, innerHTML)
else:
document = p.parse(input)
except:
errorMsg = "\n".join(["\n\nInput:", input, "\nExpected:", expected,
"\nTraceback:", traceback.format_exc()])
assert False, errorMsg
otherWarnings = [x for x in caughtWarnings
if not issubclass(x.category, constants.DataLossWarning)]
assert len(otherWarnings) == 0, [(x.category, x.message) for x in otherWarnings]
if len(caughtWarnings):
return
output = convertTreeDump(p.tree.testSerializer(document))
expected = convertExpected(expected)
if namespaceHTMLElements:
expected = namespaceExpected(r"\1<html \2>", expected)
errorMsg = "\n".join(["\n\nInput:", input, "\nExpected:", expected,
"\nReceived:", output])
assert expected == output, errorMsg
errStr = []
for (line, col), errorcode, datavars in p.errors:
assert isinstance(datavars, dict), "%s, %s" % (errorcode, repr(datavars))
errStr.append("Line: %i Col: %i %s" % (line, col,
constants.E[errorcode] % datavars))
errorMsg2 = "\n".join(["\n\nInput:", input,
"\nExpected errors (" + str(len(errors)) + "):\n" + "\n".join(errors),
"\nActual errors (" + str(len(p.errors)) + "):\n" + "\n".join(errStr)])
if checkParseErrors:
assert len(p.errors) == len(errors), errorMsg2
def test_parser():
sys.stderr.write('Testing tree builders ' + " ".join(list(treeTypes.keys())) + "\n")
files = get_data_files('tree-construction')
for filename in files:
testName = os.path.basename(filename).replace(".dat", "")
if testName in ("template",):
continue
tests = TestData(filename, "data")
for index, test in enumerate(tests):
input, errors, innerHTML, expected = [test[key] for key in
('data', 'errors',
'document-fragment',
'document')]
if errors:
errors = errors.split("\n")
for treeName, treeCls in treeTypes.items():
for namespaceHTMLElements in (True, False):
yield (runParserTest, innerHTML, input, expected, errors, treeCls,
namespaceHTMLElements)
|
Athos/tests/onnx/unittests/test_convolution.py
|
kanav99/EzPC
| 221 |
114608
|
"""
Authors: <NAME>.
Copyright:
Copyright (c) 2021 Microsoft Research
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 onnx
from onnx import helper
import pytest
# Athos DIR
import sys, os
import optparse
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
from tests.utils import (
ONNXConfig,
Compiler,
assert_almost_equal,
make_onnx_graph,
run_onnx,
Frontend,
)
# TODO: add conv autopad, convtranspose autopad, convtranspose_dilations, fix grouped conv dims
@pytest.mark.parametrize(
"a_shape, kernel_shape, pads, strides, output_shape, group",
[
pytest.param(
[1, 1, 5, 5],
[1, 1, 3, 3],
[1, 1, 1, 1],
[1, 1],
[1, 1, 5, 5],
1,
id="conv2d_pad",
),
pytest.param(
[1, 1, 5, 5],
[1, 1, 3, 3],
[0, 0, 0, 0],
[1, 1],
[1, 1, 3, 3],
1,
id="conv2d_nopad",
),
pytest.param(
[1, 1, 7, 5],
[1, 1, 3, 3],
[1, 1, 1, 1],
[2, 2],
[1, 1, 4, 3],
1,
id="conv2d_strides_pad",
),
pytest.param(
[1, 1, 7, 5],
[1, 1, 3, 3],
[0, 0, 0, 0],
[2, 2],
[1, 1, 3, 2],
1,
id="conv2d_strides_nopad",
),
pytest.param(
[1, 1, 7, 5],
[1, 1, 3, 3],
[1, 0, 1, 0],
[2, 2],
[1, 1, 4, 2],
1,
marks=pytest.mark.skip(reason="Seedot reshape typecheck assertion"),
id="conv2d_strides_assymetric_pad",
), # padding only along H dimension
# a_shape, kernel_shape, pads, strides, output_shape",
pytest.param(
[1, 2, 4, 16, 16],
[2, 2, 3, 3, 3],
[1, 1, 1, 1, 1, 1],
[1, 1, 1],
[1, 2, 4, 16, 16],
1,
id="conv3d_pad",
),
pytest.param(
[1, 2, 4, 16, 16],
[2, 2, 3, 3, 3],
[0, 0, 0, 0, 0, 0],
[1, 1, 1],
[1, 2, 2, 14, 14],
1,
id="conv3d_nopad",
),
pytest.param(
[1, 2, 4, 16, 16],
[2, 2, 3, 3, 3],
[1, 1, 1, 1, 1, 1],
[2, 2, 2],
[1, 2, 2, 8, 8],
1,
id="conv3d_strides_pad",
),
pytest.param(
[1, 2, 4, 16, 16],
[2, 2, 3, 3, 3],
[0, 0, 0, 0, 0, 0],
[2, 2, 2],
[1, 2, 1, 7, 7],
1,
id="conv3d_strides_nopad",
),
pytest.param(
[1, 4, 5, 5],
[1, 1, 3, 3],
[0, 0, 0, 0],
[1, 1],
[1, 1, 3, 3],
4,
id="conv2d_grouped",
marks=pytest.mark.skip(reason="fix test dims"),
),
],
)
@pytest.mark.parametrize("dtype", [np.single])
def test_conv(
test_dir, backend, a_shape, kernel_shape, pads, strides, output_shape, group, dtype
):
Op = "Conv"
if len(a_shape) == 4:
version = 2 # 2d
elif len(a_shape) == 5:
version = 3 # 3d
if version == 3 and backend in ["2PC_HE", "2PC_OT"]:
pytest.skip("[conv3d] Missing Support in SCI")
a = np.random.randn(*a_shape).astype(dtype)
kernel = np.random.randn(*kernel_shape).astype(dtype)
# Only need this for its shape
out = np.zeros(output_shape).astype(dtype)
hw_kernel_shape = kernel_shape[-version:]
node = onnx.helper.make_node(
Op,
inputs=["a", "kernel"],
outputs=["output"],
kernel_shape=hw_kernel_shape,
pads=pads,
strides=strides,
group=group,
# Default values for other attributes: dilations=[1, 1], groups=1
)
graph = make_onnx_graph(
node,
inputs=[a],
outputs=[out],
tensors=[kernel],
tensor_names=["kernel"],
name=Op + "_test",
)
expected_output = run_onnx(graph, [a])
config = ONNXConfig(backend).parse_io(graph)
config.config["scale"] = 12
compiler = Compiler(graph, config, test_dir, Frontend.ONNX)
mpc_output = compiler.compile_and_run([a])
assert_almost_equal(
model_output=expected_output, mpc_tensor=mpc_output, precision=2
)
return
@pytest.mark.parametrize(
"a_shape, kernel_shape, pads, strides, output_shape, output_padding",
[
pytest.param(
[1, 1, 3, 3],
[1, 2, 3, 3],
[0, 0, 0, 0],
[1, 1],
[1, 2, 5, 5],
False,
id="convtranspose2d_nopad",
),
pytest.param(
[1, 1, 3, 3],
[1, 2, 3, 3],
[1, 1, 1, 1],
[1, 1],
[1, 2, 3, 3],
False,
id="convtranspose2d_pad",
),
pytest.param(
[1, 1, 3, 3],
[1, 2, 3, 3],
[0, 0, 0, 0],
[3, 2],
[1, 2, 10, 8],
True,
id="convtranspose2d_output_padding",
),
pytest.param(
[1, 1, 3, 4, 5],
[1, 2, 3, 3, 3],
[0, 0, 0, 0, 0, 0],
[1, 1, 1],
[1, 2, 5, 6, 7],
False,
id="convtranspose3d_nopad",
),
pytest.param(
[1, 1, 3, 4, 5],
[1, 2, 3, 3, 3],
[1, 1, 1, 1, 1, 1],
[1, 1, 1],
[1, 2, 3, 4, 5],
False,
id="convtranspose3d_pad",
),
],
)
@pytest.mark.parametrize("dtype", [np.single])
def test_convtranspose(
test_dir,
backend,
a_shape,
kernel_shape,
pads,
strides,
output_shape,
output_padding,
dtype,
):
Op = "ConvTranspose"
if len(a_shape) == 4:
version = 2 # 2d
elif len(a_shape) == 5:
version = 3 # 3d
if version == 3 and backend in ["2PC_HE", "2PC_OT"]:
pytest.skip("[conv3dtranspose] Missing Support in SCI")
a = np.random.randn(*a_shape).astype(dtype)
kernel = np.random.randn(*kernel_shape).astype(dtype)
# Only need this for its shape
out = np.zeros(output_shape).astype(dtype)
hw_kernel_shape = kernel_shape[-version:]
if not output_padding:
node = onnx.helper.make_node(
Op,
inputs=["a", "kernel"],
outputs=["output"],
kernel_shape=hw_kernel_shape,
pads=pads,
strides=strides
# Default values for other attributes: dilations=[1, 1], groups=1
)
else:
node = onnx.helper.make_node(
Op,
inputs=["a", "kernel"],
outputs=["output"],
kernel_shape=hw_kernel_shape,
pads=pads,
strides=strides,
output_padding=[1, 1]
# Default values for other attributes: dilations=[1, 1], groups=1
)
graph = make_onnx_graph(
node,
inputs=[a],
outputs=[out],
tensors=[kernel],
tensor_names=["kernel"],
name=Op + "_test",
)
expected_output = run_onnx(graph, [a])
config = ONNXConfig(backend).parse_io(graph)
config.config["scale"] = 12
compiler = Compiler(graph, config, test_dir, Frontend.ONNX)
mpc_output = compiler.compile_and_run([a])
assert_almost_equal(
model_output=expected_output, mpc_tensor=mpc_output, precision=2
)
return
|
Packs/ContentManagement/Scripts/ListCreator/ListCreator.py
|
diCagri/content
| 799 |
114624
|
import demistomock as demisto
from CommonServerPython import *
SCRIPT_NAME = 'ListCreator'
def configure_list(list_name: str, list_data: str) -> bool:
"""Create system lists using the createList built-in method.
"""
demisto.debug(f'{SCRIPT_NAME} - Setting "{list_name}" list.')
res = demisto.executeCommand('createList', {'listName': list_name, 'listData': list_data})
if is_error(res):
error_message = f'{SCRIPT_NAME} - {get_error(res)}'
demisto.debug(error_message)
return False
return True
def main():
args = demisto.args()
list_name = args.get('list_name')
list_data = args.get('list_data')
try:
configuration_status = configure_list(list_name, list_data)
return_results(
CommandResults(
outputs_prefix='ConfigurationSetup.Lists',
outputs_key_field='listname',
outputs={
'listname': list_name,
'creationstatus': 'Success.' if configuration_status else 'Failure.',
},
)
)
except Exception as e:
return_error(f'{SCRIPT_NAME} - Error occurred while setting up machine.\n{e}')
if __name__ in ('__main__', '__builtin__', 'builtins'):
main()
|
mushroom_rl/environments/mujoco_envs/humanoid_gait/_external_simulation/human_muscle.py
|
PuzeLiu/mushroom-rl
| 344 |
114636
|
import numpy as np
from .muscle_simulation_stepupdate import step_update_state
class MuscleTendonComplex:
def __init__(self, nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi, eref=0.04, act=0.01,
tau=0.01, w=0.56, c=0.05, N=1.5, K=5.0, stim=0.0,
vce=0.0, frcmtc=0.0, lmtc=0.0):
self.init_nameMuscle = nameMuscle
self.init_frcmax = float(frcmax)
self.init_vmax = float(vmax)
self.init_eref = float(eref)
self.init_lslack = float(lslack)
self.init_lopt = float(lopt)
self.init_tau = float(tau)
self.init_w = float(w)
self.init_c = float(c)
self.init_N = float(N)
self.init_K = float(K)
self.init_stim = float(stim)
self.init_act = float(act)
self.init_lmtc = float(lmtc)
self.init_lce = float(lce)
self.init_vce = float(vce)
self.init_frcmtc = float(frcmtc)
self.init_r = r.astype('float')
self.init_phiref = phiref.astype('float')
self.init_phimaxref = phimaxref.astype('float')
self.init_rho = rho.astype('float')
self.init_dirAng = dirAng.astype('float')
self.init_phiScale = phiScale.astype('float')
self.init_offsetCorr = offsetCorr.astype('int')
self.init_timestep = float(timestep)
self.init_angJoi = angJoi.astype('float')
self.reset_state()
self.MR = float(0.01)
self.typeMuscle = int(self.angJoi.size)
self.levelArm = np.zeros(self.typeMuscle).astype('float')
tmpL = np.zeros(self.typeMuscle)
for i in range(0, self.typeMuscle):
if self.offsetCorr[i] == 0:
tmpL[i] = self.dirAng[i] * (self.angJoi[i] - self.phiref[i]) * self.r[i] * self.rho[i]
self.levelArm[i] = self.r[i]
elif self.offsetCorr[i] == 1:
tmp1 = np.sin((self.phiref[i] - self.phimaxref[i]) * self.phiScale[i])
tmp2 = np.sin((self.angJoi[i] - self.phimaxref[i]) * self.phiScale[i])
tmpL[i] = self.dirAng[i] * (tmp2 - tmp1) * self.r[i] * self.rho[i] / self.phiScale[i]
self.levelArm[i] = np.cos((self.angJoi[i] - self.phimaxref[i]) * self.phiScale[i]) * self.r[i]
else:
raise ValueError('Invalid muscle level arm offset correction type. ')
self.lmtc = self.lslack + self.lopt + np.sum(tmpL)
self.lce = self.lmtc - self.lslack
self.lse = float(self.lmtc - self.lce)
# unitless parameters
self.Lse = float(self.lse / self.lslack)
self.Lce = float(self.lce / self.lopt)
self.actsubstep = float((self.stim - self.act) * self.timestep / 2.0 / self.tau + self.act)
self.lcesubstep = float(self.vce * self.timestep / 2.0 + self.lce)
# test
self.lce_avg = float(self.lce)
self.vce_avg = float(self.vce)
self.frcmtc_avg = float(0)
self.act_avg = float(self.act)
self.frame = 0
def stepUpdateState(self, angJoi):
"""
Muscle Tendon Complex Dynamics
update muscle states based on the muscle dynamics
Muscle state stim has to be updated outside before this function is called
"""
self.frcmax, self.vmax, self.eref, self.lslack, self.lopt, self.tau, \
self.w, self.c, self.N, self.K, self.stim, self.act, self.lmtc, self.lce, \
self.vce, self.frcmtc, \
self.r, self.phiref, \
self.phimaxref, self.rho, \
self.dirAng, self.phiScale, \
self.angJoi, self.levelArm, self.offsetCorr, \
self.timestep, self.MR, self.typeMuscle, \
self.lse, self.Lse, self.Lce, self.actsubstep, \
self.lcesubstep, self.lce_avg, self.vce_avg, self.frcmtc_avg, self.act_avg, self.frame = \
step_update_state(
self.frcmax, self.vmax, self.eref, self.lslack, self.lopt, self.tau,
self.w, self.c, self.N, self.K, self.stim, self.act, self.lmtc, self.lce,
self.vce, self.frcmtc,
self.r, self.phiref,
self.phimaxref, self.rho,
self.dirAng, self.phiScale,
angJoi, self.levelArm, self.offsetCorr,
self.timestep, self.MR, self.typeMuscle,
self.lse, self.Lse, self.Lce, self.actsubstep,
self.lcesubstep, self.lce_avg, self.vce_avg, self.frcmtc_avg, self.act_avg, self.frame)
def reset_state(self):
self.frame = int(0)
self.lce_avg = float(0)
self.frcmtc_avg = float(0)
self.act_avg = float(0)
self.vce_avg = float(0)
self.nameMuscle = self.init_nameMuscle
self.frcmax = self.init_frcmax
self.vmax = self.init_vmax
self.eref = self.init_eref
self.lslack = self.init_lslack
self.lopt = self.init_lopt
self.tau = self.init_tau
self.w = self.init_w
self.c = self.init_c
self.N = self.init_N
self.K = self.init_K
self.stim = self.init_stim
self.act = self.init_act
self.lmtc = self.init_lmtc
self.lce = self.init_lce
self.vce = self.init_vce
self.frcmtc = self.init_frcmtc
self.r = self.init_r
self.phiref = self.init_phiref
self.phimaxref = self.init_phimaxref
self.rho = self.init_rho
self.dirAng = self.init_dirAng
self.phiScale = self.init_phiScale
self.offsetCorr = self.init_offsetCorr
self.timestep = self.init_timestep
self.angJoi = self.init_angJoi
class TIA(MuscleTendonComplex):
"""
Tibialis Anterior (TIA): The Tibialis anterior (Tibialis anticus) is situated on the lateral
side of the tibia. In real human it serves multiple function which are, Dorsal Flexion
of the ankle, Inversion of the foot, Adduction of the foot and also Contributing in
maintaining the medial arch of the foot. Here TIA is modelled as muscle actuating the
ankle dorsiflexion in the sagittal plane.
"""
def __init__(self, angAnk, timestep):
frcmax = 800 # maximum isometric force [N]
lopt = 0.06 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.24 # tendon slack length [m]
# Tibialis Anterior attachment
rTIAmax = 0.04 # [m] maximum lever contribution
rTIAmin = 0.01 # [m] minimum lever contribution
phimaxTIA = 80 * np.pi / 180 # [rad] angle of maximum lever contribution
phiminTIA = 180 * np.pi / 180 # [rad] angle of minimum lever contribution
phirefTIA = 110 * np.pi / 180 # [rad] reference angle at which MTU length equals
phiScaleTIA = np.arccos(rTIAmin / rTIAmax) / (phiminTIA - phimaxTIA)
rhoTIA = 0.7
r = np.array((rTIAmax,))
phiref = np.array((phirefTIA,))
phimaxref = np.array((phimaxTIA,))
rho = np.array((rhoTIA,))
dirAng = np.array((1.0,))
offsetCorr = np.array((1,))
phiScale = np.array((phiScaleTIA,))
lce = lopt
angJoi = np.array((angAnk,))
nameMuscle = "TIA"
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class SOL(MuscleTendonComplex):
"""
Soleus (SOL): Soleus muscles is Located in superficial posterior compartment of the
leg, along with GAS it helps in the plantarflexion of the ankle joint. Here SOL is
modelled as a muscle actuating the ankle plantarflexion in the sagittal plane.
"""
def __init__(self, angAnk, timestep):
frcmax = 4000 # maximum isometric force [N]
lopt = 0.04 # optimum fiber length CE [m]
vmax = 6.0 # maximum contraction velocity [lopt/s]
lslack = 0.26 # tendon slack length [m]
# SOLeus attachment
rSOLmax = 0.06 # [m] maximum lever contribution
rSOLmin = 0.02 # [m] minimum lever contribution
phimaxSOL = 100 * np.pi / 180 # [rad] angle of maximum lever contribution
phiminSOL = 180 * np.pi / 180 # [rad] angle of minimum lever contribution
phirefSOL = 90 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoSOL = 0.5 # sum of lopt and lslack
phiScaleSOL = np.arccos(rSOLmin / rSOLmax) / (phiminSOL - phimaxSOL)
r = np.array((rSOLmax,))
phiref = np.array((phirefSOL,))
phimaxref = np.array((phimaxSOL,))
rho = np.array((rhoSOL,))
dirAng = np.array((-1.0,))
offsetCorr = np.array((1,))
phiScale = np.array((phiScaleSOL,))
lce = lopt
angJoi = np.array((angAnk,))
nameMuscle = "SOL"
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class GAS(MuscleTendonComplex):
"""
Gastrocnemius (GAS): Gastrocnemius muscle which the major bulk at the back of
lower leg is a bi-articular muscle having two heads and runs from back of knee to the
heel. The gastrocnemius helps plantarflexion of the ankle joint and flexion of the knee
joint. Here GAS is modelled as a bi-articular MTU contributing to the knee flexion
and ankle plantarflexion actuations in the sagittal plane.
"""
def __init__(self, angKne, angAnk, timestep):
frcmax = 1500 # maximum isometric force [N]
lopt = 0.05 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.40 # tendon slack length [m]
# GAStrocnemius attachment (knee joint)
rGASkmax = 0.05 # [m] maximum lever contribution
rGASkmin = 0.02 # [m] minimum lever contribution
phimaxGASk = 140 * np.pi / 180 # [rad] angle of maximum lever contribution
phiminGASk = 45 * np.pi / 180 # [rad] angle of minimum lever contribution
phirefGASk = 165 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoGASk = 0.7 # sum of lopt and lslack
# rhoGASk = 0.045 # sum of lopt and lslack
phiScaleGASk = np.arccos(rGASkmin / rGASkmax) / (phiminGASk - phimaxGASk)
# GAStrocnemius attachment (ankle joint)
rGASamax = 0.06 # [m] maximum lever contribution
rGASamin = 0.02 # [m] minimum lever contribution
phimaxGASa = 100 * np.pi / 180 # [rad] angle of maximum lever contribution
phiminGASa = 180 * np.pi / 180 # [rad] angle of minimum lever contribution
phirefGASa = 80 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoGASa = 0.7 # sum of lopt and lslack
# rhoGASa = 0.045 # sum of lopt and lslack
phiScaleGASa = np.arccos(rGASamin / rGASamax) / (phiminGASa - phimaxGASa)
r = np.array((rGASkmax, rGASamax))
phiref = np.array((phirefGASk, phirefGASa))
phimaxref = np.array((phimaxGASk, phimaxGASa))
rho = np.array((rhoGASk, rhoGASa))
dirAng = np.array((1.0, -1.0))
offsetCorr = np.array((1, 1))
phiScale = np.array((phiScaleGASk, phiScaleGASa))
lce = lopt
nameMuscle = "GAS"
angJoi = np.array((angKne, angAnk))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class BFSH(MuscleTendonComplex):
"""
Biceps Femoris Short Head(BFSH): This is a part of hamstring muscle in the real hu-
man and is responsible for knee flexion. Here BFSH is modelled as muscle contributing
to the knee flexion actuation in the sagittal plane.
"""
def __init__(self, angKne, timestep):
frcmax = 350 # maximum isometric force [N]
lopt = 0.12 # optimum fiber length CE [m]
vmax = 12.0 # 6 # maximum contraction velocity [lopt/s]
lslack = 0.10 # tendon slack length [m]
# BFSH group attachment
rBFSH = 0.04 # [m] constant lever contribution
phirefBFSH = 160 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoBFSH = 0.7 # sum of lopt and lslack
r = np.array((rBFSH,))
phiref = np.array((phirefBFSH,))
phimaxref = np.array((0.0,))
rho = np.array((rhoBFSH,))
dirAng = np.array((1.0,))
offsetCorr = np.array((0,))
phiScale = np.array((0.0,))
lce = lopt
nameMuscle = "BFSH",
angJoi = np.array((angKne,))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class VAS(MuscleTendonComplex):
"""
Vasti (VAS): Vasti is a group of 3 muscles located in the thigh and is responsible for
knee extension. Here VAS is modelled as a muscle actuating the knee extension in the
sagittal plane.
"""
def __init__(self, angKne, timestep):
frcmax = 6000 # maximum isometric force [N]
lopt = 0.08 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.23 # tendon slack length [m]
# VAS group attachment
rVASmax = 0.06 # [m] maximum lever contribution
rVASmin = 0.04 # [m] minimum lever contribution
phimaxVAS = 165 * np.pi / 180 # [rad] angle of maximum lever contribution
phiminVAS = 45 * np.pi / 180 # [rad] angle of minimum lever contribution
phirefVAS = 120 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoVAS = 0.6 # sum of lopt and lslack
phiScaleVAS = np.arccos(rVASmin / rVASmax) / (phiminVAS - phimaxVAS)
r = np.array((rVASmax,))
phiref = np.array((phirefVAS,))
phimaxref = np.array((phimaxVAS,))
rho = np.array((rhoVAS,))
dirAng = np.array((-1.0,))
offsetCorr = np.array((1,))
phiScale = np.array((phiScaleVAS,))
lce = lopt
nameMuscle = "VAS"
angJoi = np.array((angKne,))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class REF(MuscleTendonComplex):
"""
Rectus Femoris (RF): The Rectus femoris muscle is one of the four quadriceps mus-
cles. It is located in the middle of the front of the thigh and is responsible for knee
extension and hip flexion. Here RF is modelled as a bi-articular MTU contributing to
the hip flexion and knee extension actuations in the sagittal plane.
"""
def __init__(self, angHip, angKne, timestep):
frcmax = 1200 # maximum isometric force [N]
lopt = 0.08 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.35 # tendon slack length [m]
# REF group attachement (hip)
rREFh = 0.08 # [m] constant lever contribution
phirefREFh = 170 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoREFh = 0.3 # sum of lopt and lslack
# REF group attachment (knee)
rREFkmax = 0.06 # [m] maximum lever contribution
rREFkmin = 0.04 # [m] minimum lever contribution
phimaxREFk = 165 * np.pi / 180 # [rad] angle of maximum lever contribution
phiminREFk = 45 * np.pi / 180 # [rad] angle of minimum lever contribution
phirefREFk = 125 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoREFk = 0.5 # sum of lopt and lslack
phiScaleREFk = np.arccos(rREFkmin / rREFkmax) / (phiminREFk - phimaxREFk)
r = np.array((rREFh, rREFkmax))
phiref = np.array((phirefREFh, phirefREFk))
phimaxref = np.array((0.0, phimaxREFk))
rho = np.array((rhoREFh, rhoREFk))
dirAng = np.array((1.0, -1.0))
offsetCorr = np.array((0, 1))
phiScale = np.array((0.0, phiScaleREFk))
lce = lopt
nameMuscle = "REF"
angJoi = np.array((angHip, angKne))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class HAM(MuscleTendonComplex):
"""
Hamstrings (HAM): The hamstring muscles are a group of four muscles located in the
back of the thigh. They are bi-articular muscles crossing the hip and knee joints, so
they can help in both knee flexion and hip extension at the same time. Here HAM
is modelled as a bi-articular MTU contributing to the hip extension and knee flexion
actuations in the sagittal plane.
"""
def __init__(self, angHip, angKne, timestep):
frcmax = 3000 # maximum isometric force [N]
lopt = 0.10 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.31 # tendon slack length [m]
# hamstring hip level arm and refernce angle
rHAMh = 0.08 # [m] constant lever contribution
phirefHAMh = 150 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoHAMh = 0.5 # sum of lopt and lslack
# hamstring knee level arm and reference angle
rHAMk = 0.05 # [m] constant lever contribution
phirefHAMk = 180 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoHAMk = 0.5 # sum of lopt and lslack
r = np.array((rHAMh, rHAMk))
phiref = np.array((phirefHAMh, phirefHAMk))
phimaxref = np.array((0.0, 0.0))
rho = np.array((rhoHAMh, rhoHAMk))
dirAng = np.array((-1.0, 1.0))
offsetCorr = np.array((0, 0))
phiScale = np.array((0.0, 0.0))
lce = lopt
nameMuscle = "HAM"
angJoi = np.array((angHip, angKne))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class HFL(MuscleTendonComplex):
"""
Hip Flexor (HFL): The hip flexors are a group of muscles that help to bring the legs
and trunk together in a flexion movement. HFL allow us to move our leg or knee up
towards your torso, as well as to bend your torso forward at the hip. The HLF modelled
here is one of the actuator for the hip flexion in the sagittal plane.
"""
def __init__(self, angHip, timestep):
frcmax = 2000 # maximum isometric force [N]
lopt = 0.11 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.10 # tendon slack length [m]
# level arm and reference angle
r = np.array((0.08,)) # [m] constant lever contribution
phiref = np.array((160 * np.pi / 180,)) # [rad] reference angle at which MTU length equals
phimaxref = np.array((0.0, 0.0))
rho = np.array((0.5,)) # sum of lopt and lslack
dirAng = np.array((1.0,)) # angle increase leads to MTC length increase
offsetCorr = np.array((0,)) # no level arm correction
phiScale = np.array((0.0,))
lce = lopt
angJoi = np.array((angHip,))
nameMuscle = "HFL"
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class GLU(MuscleTendonComplex):
"""
Glutei (GLU): The glutei muscles are a group muscles in the gluteal region, in real life
locomotion their functions include extension, abduction, external rotation and internal
rotation of the hip joint. But here in the model GLU is modelled antagonistic to HFL
as hip extensor, acting as one of the hip joint actuator in the sagittal plane.
"""
def __init__(self, angHip, timestep):
frcmax = 1500.0 # maximum isometric force [N]
lopt = 0.11 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.13 # tendon slack length [m]
# level arm and reference angle
r = np.array((0.08,)) # [m] constant lever contribution
phiref = np.array((120 * np.pi / 180,)) # [rad] reference angle at which MTU length equals
phimaxref = np.array((0.0, 0.0))
rho = np.array((0.5,)) # sum of lopt and lslack
dirAng = np.array((-1.0,)) # angle increase leads to MTC length decrease
offsetCorr = np.array((0,)) # no level arm correction
phiScale = np.array((0.0,))
lce = lopt # will be computed in the initialization
nameMuscle = "GLU"
angJoi = np.array((angHip,))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class HAD(MuscleTendonComplex):
"""
Hip Adductor (HAD): Hip adductors in the thigh are a group of muscles near the groin
area which helps in moving the leg towards the midline of the body in the coronal
plane. They are basically the are antagonistic to the hip abductors and also help in
stabilizing the hip joint in real life locomotion. The HAD modelled here will act as the
second actuator for the hip adduction in the coronal plane.
"""
def __init__(self, angHipFront, timestep):
frcmax = 4500.0 # maximum isometric force [N]
lopt = 0.10 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.18 # tendon slack length [m]
rHAD = 0.03 # [m] constant lever contribution
phirefHAD = 15 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoHAD = 1.0 # sum of lopt and lslack
r = np.array((rHAD,))
phiref = np.array((phirefHAD,))
phimaxref = np.array((0.0,))
rho = np.array((rhoHAD,))
dirAng = np.array((1.0,))
offsetCorr = np.array((0,))
phiScale = np.array((0.0,))
lce = lopt
nameMuscle = "HAD"
angJoi = np.array((angHipFront,))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
class HAB(MuscleTendonComplex):
"""
Hip Abductor (HAB): The hip abductor muscles in the thigh include a group of muscles
which helps in moving the leg away from the midline of the body in the coronal plane.
They also help to rotate the thigh in the hip socket and to stabilize the hip joint. The
HAB modelled here will act as an actuator for the hip adbuction in the coronal plane.
"""
def __init__(self, angHipFront, timestep):
frcmax = 3000.0 # maximum isometric force [N]
lopt = 0.09 # optimum fiber length CE [m]
vmax = 12.0 # maximum contraction velocity [lopt/s]
lslack = 0.07 # tendon slack length [m]
rHAB = 0.06 # [m] constant lever contribution
phirefHAB = 10 * np.pi / 180 # [rad] reference angle at which MTU length equals
rhoHAB = 0.7 # sum of lopt and lslack
r = np.array((rHAB,))
phiref = np.array((phirefHAB,))
phimaxref = np.array((0.0,))
rho = np.array((rhoHAB,))
dirAng = np.array((-1.0,))
offsetCorr = np.array((0,))
phiScale = np.array((0.0,))
lce = lopt
nameMuscle = "HAB"
angJoi = np.array((angHipFront,))
super().__init__(nameMuscle, frcmax, vmax, lslack, lopt,
lce, r, phiref, phimaxref, rho, dirAng, phiScale,
offsetCorr, timestep, angJoi)
|
boto3_type_annotations_with_docs/boto3_type_annotations/backup/client.py
|
cowboygneox/boto3_type_annotations
| 119 |
114673
|
<filename>boto3_type_annotations_with_docs/boto3_type_annotations/backup/client.py<gh_stars>100-1000
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from datetime import datetime
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is ``create_foo``, and you\'d normally invoke the
operation as ``client.create_foo(**kwargs)``, if the
``create_foo`` operation can be paginated, you can use the
call ``client.get_paginator(\"create_foo\")``.
:return: ``True`` if the operation can be paginated,
``False`` otherwise.
"""
pass
def create_backup_plan(self, BackupPlan: Dict, BackupPlanTags: Dict = None, CreatorRequestId: str = None) -> Dict:
"""
Backup plans are documents that contain information that AWS Backup uses to schedule tasks that create recovery points of resources.
If you call ``CreateBackupPlan`` with a plan that already exists, the existing ``backupPlanId`` is returned.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/CreateBackupPlan>`_
**Request Syntax**
::
response = client.create_backup_plan(
BackupPlan={
'BackupPlanName': 'string',
'Rules': [
{
'RuleName': 'string',
'TargetBackupVaultName': 'string',
'ScheduleExpression': 'string',
'StartWindowMinutes': 123,
'CompletionWindowMinutes': 123,
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'RecoveryPointTags': {
'string': 'string'
}
},
]
},
BackupPlanTags={
'string': 'string'
},
CreatorRequestId='string'
)
**Response Syntax**
::
{
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'VersionId': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **CreationDate** *(datetime) --*
The date and time that a backup plan is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **VersionId** *(string) --*
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1024 bytes long. They cannot be edited.
:type BackupPlan: dict
:param BackupPlan: **[REQUIRED]**
Specifies the body of a backup plan. Includes a ``BackupPlanName`` and one or more sets of ``Rules`` .
- **BackupPlanName** *(string) --* **[REQUIRED]**
The display name of a backup plan.
- **Rules** *(list) --* **[REQUIRED]**
An array of ``BackupRule`` objects, each of which specifies a scheduled task that is used to back up a selection of resources.
- *(dict) --*
Specifies a scheduled task used to back up a selection of resources.
- **RuleName** *(string) --* **[REQUIRED]**
>An optional display name for a backup rule.
- **TargetBackupVaultName** *(string) --* **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **ScheduleExpression** *(string) --*
A CRON expression specifying when AWS Backup initiates a backup job.
- **StartWindowMinutes** *(integer) --*
The amount of time in minutes before beginning a backup.
- **CompletionWindowMinutes** *(integer) --*
The amount of time AWS Backup attempts a backup before canceling the job and returning an error.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup will transition and expire backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days”. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **RecoveryPointTags** *(dict) --*
To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.
- *(string) --*
- *(string) --*
:type BackupPlanTags: dict
:param BackupPlanTags:
To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair. The specified tags are assigned to all backups created with this plan.
- *(string) --*
- *(string) --*
:type CreatorRequestId: string
:param CreatorRequestId:
Identifies the request and allows failed requests to be retried without the risk of executing the operation twice. If the request includes a ``CreatorRequestId`` that matches an existing backup plan, that plan is returned. This parameter is optional.
:rtype: dict
:returns:
"""
pass
def create_backup_selection(self, BackupPlanId: str, BackupSelection: Dict, CreatorRequestId: str = None) -> Dict:
"""
Creates a JSON document that specifies a set of resources to assign to a backup plan. Resources can be included by specifying patterns for a ``ListOfTags`` and selected ``Resources`` .
For example, consider the following patterns:
* ``Resources: "arn:aws:ec2:region:account-id:volume/volume-id"``
* ``ConditionKey:"department"`` ``ConditionValue:"finance"`` ``ConditionType:"StringEquals"``
* ``ConditionKey:"importance"`` ``ConditionValue:"critical"`` ``ConditionType:"StringEquals"``
Using these patterns would back up all Amazon Elastic Block Store (Amazon EBS) volumes that are tagged as ``"department=finance"`` , ``"importance=critical"`` , in addition to an EBS volume with the specified volume Id.
Resources and conditions are additive in that all resources that match the pattern are selected. This shouldn't be confused with a logical AND, where all conditions must match. The matching patterns are logically 'put together using the OR operator. In other words, all patterns that match are selected for backup.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/CreateBackupSelection>`_
**Request Syntax**
::
response = client.create_backup_selection(
BackupPlanId='string',
BackupSelection={
'SelectionName': 'string',
'IamRoleArn': 'string',
'Resources': [
'string',
],
'ListOfTags': [
{
'ConditionType': 'STRINGEQUALS',
'ConditionKey': 'string',
'ConditionValue': 'string'
},
]
},
CreatorRequestId='string'
)
**Response Syntax**
::
{
'SelectionId': 'string',
'BackupPlanId': 'string',
'CreationDate': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **SelectionId** *(string) --*
Uniquely identifies the body of a request to assign a set of resources to a backup plan.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **CreationDate** *(datetime) --*
The date and time a backup selection is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies the backup plan to be associated with the selection of resources.
:type BackupSelection: dict
:param BackupSelection: **[REQUIRED]**
Specifies the body of a request to assign a set of resources to a backup plan.
It includes an array of resources, an optional array of patterns to exclude resources, an optional role to provide access to the AWS service the resource belongs to, and an optional array of tags used to identify a set of resources.
- **SelectionName** *(string) --* **[REQUIRED]**
The display name of a resource selection document.
- **IamRoleArn** *(string) --* **[REQUIRED]**
The ARN of the IAM role that AWS Backup uses to authenticate when restoring the target resource; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **Resources** *(list) --*
An array of strings that either contain Amazon Resource Names (ARNs) or match patterns such as \"``arn:aws:ec2:us-east-1:123456789012:volume/*`` \" of resources to assign to a backup plan.
- *(string) --*
- **ListOfTags** *(list) --*
An array of conditions used to specify a set of resources to assign to a backup plan; for example, ``\"StringEquals\": {\"ec2:ResourceTag/Department\": \"accounting\"`` .
- *(dict) --*
Contains an array of triplets made up of a condition type (such as ``StringEquals`` ), a key, and a value. Conditions are used to filter resources in a selection that is assigned to a backup plan.
- **ConditionType** *(string) --* **[REQUIRED]**
An operation, such as ``StringEquals`` , that is applied to a key-value pair used to filter resources in a selection.
- **ConditionKey** *(string) --* **[REQUIRED]**
The key in a key-value pair. For example, in ``\"ec2:ResourceTag/Department\": \"accounting\"`` , ``\"ec2:ResourceTag/Department\"`` is the key.
- **ConditionValue** *(string) --* **[REQUIRED]**
The value in a key-value pair. For example, in ``\"ec2:ResourceTag/Department\": \"accounting\"`` , ``\"accounting\"`` is the value.
:type CreatorRequestId: string
:param CreatorRequestId:
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
:rtype: dict
:returns:
"""
pass
def create_backup_vault(self, BackupVaultName: str, BackupVaultTags: Dict = None, EncryptionKeyArn: str = None, CreatorRequestId: str = None) -> Dict:
"""
Creates a logical container where backups are stored. A ``CreateBackupVault`` request includes a name, optionally one or more resource tags, an encryption key, and a request ID.
.. note::
Sensitive data, such as passport numbers, should not be included the name of a backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/CreateBackupVault>`_
**Request Syntax**
::
response = client.create_backup_vault(
BackupVaultName='string',
BackupVaultTags={
'string': 'string'
},
EncryptionKeyArn='string',
CreatorRequestId='string'
)
**Response Syntax**
::
{
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'CreationDate': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **CreationDate** *(datetime) --*
The date and time a backup vault is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type BackupVaultTags: dict
:param BackupVaultTags:
Metadata that you can assign to help organize the resources that you create. Each tag is a key-value pair.
- *(string) --*
- *(string) --*
:type EncryptionKeyArn: string
:param EncryptionKeyArn:
The server-side encryption key that is used to protect your backups; for example, ``arn:aws:kms:us-west-2:111122223333:key/<KEY>`` .
:type CreatorRequestId: string
:param CreatorRequestId:
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
:rtype: dict
:returns:
"""
pass
def delete_backup_plan(self, BackupPlanId: str) -> Dict:
"""
Deletes a backup plan. A backup plan can only be deleted after all associated selections of resources have been deleted. Deleting a backup plan deletes the current version of a backup plan. Previous versions, if any, will still exist.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupPlan>`_
**Request Syntax**
::
response = client.delete_backup_plan(
BackupPlanId='string'
)
**Response Syntax**
::
{
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'DeletionDate': datetime(2015, 1, 1),
'VersionId': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **DeletionDate** *(datetime) --*
The date and time a backup plan is deleted, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **VersionId** *(string) --*
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version Ids cannot be edited.
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:rtype: dict
:returns:
"""
pass
def delete_backup_selection(self, BackupPlanId: str, SelectionId: str):
"""
Deletes the resource selection associated with a backup plan that is specified by the ``SelectionId`` .
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupSelection>`_
**Request Syntax**
::
response = client.delete_backup_selection(
BackupPlanId='string',
SelectionId='string'
)
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:type SelectionId: string
:param SelectionId: **[REQUIRED]**
Uniquely identifies the body of a request to assign a set of resources to a backup plan.
:returns: None
"""
pass
def delete_backup_vault(self, BackupVaultName: str):
"""
Deletes the backup vault identified by its name. A vault can be deleted only if it is empty.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupVault>`_
**Request Syntax**
::
response = client.delete_backup_vault(
BackupVaultName='string'
)
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and theAWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:returns: None
"""
pass
def delete_backup_vault_access_policy(self, BackupVaultName: str):
"""
Deletes the policy document that manages permissions on a backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupVaultAccessPolicy>`_
**Request Syntax**
::
response = client.delete_backup_vault_access_policy(
BackupVaultName='string'
)
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:returns: None
"""
pass
def delete_backup_vault_notifications(self, BackupVaultName: str):
"""
Deletes event notifications for the specified backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupVaultNotifications>`_
**Request Syntax**
::
response = client.delete_backup_vault_notifications(
BackupVaultName='string'
)
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:returns: None
"""
pass
def delete_recovery_point(self, BackupVaultName: str, RecoveryPointArn: str):
"""
Deletes the recovery point specified by a recovery point ID.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteRecoveryPoint>`_
**Request Syntax**
::
response = client.delete_recovery_point(
BackupVaultName='string',
RecoveryPointArn='string'
)
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type RecoveryPointArn: string
:param RecoveryPointArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
:returns: None
"""
pass
def describe_backup_job(self, BackupJobId: str) -> Dict:
"""
Returns metadata associated with creating a backup of a resource.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeBackupJob>`_
**Request Syntax**
::
response = client.describe_backup_job(
BackupJobId='string'
)
**Response Syntax**
::
{
'BackupJobId': 'string',
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'RecoveryPointArn': 'string',
'ResourceArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'State': 'CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED',
'StatusMessage': 'string',
'PercentDone': 'string',
'BackupSizeInBytes': 123,
'IamRoleArn': 'string',
'CreatedBy': {
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'BackupPlanVersion': 'string',
'BackupRuleId': 'string'
},
'ResourceType': 'string',
'BytesTransferred': 123,
'ExpectedCompletionDate': datetime(2015, 1, 1),
'StartBy': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **BackupJobId** *(string) --*
Uniquely identifies a request to AWS Backup to back up a resource.
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **ResourceArn** *(string) --*
An ARN that uniquely identifies a saved resource. The format of the ARN depends on the resource type.
- **CreationDate** *(datetime) --*
The date and time that a backup job is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CompletionDate** *(datetime) --*
The date and time that a job to create a backup job is completed, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **State** *(string) --*
The current state of a resource recovery point.
- **StatusMessage** *(string) --*
A detailed message explaining the status of the job to back up a resource.
- **PercentDone** *(string) --*
Contains an estimated percentage that is complete of a job at the time the job status was queried.
- **BackupSizeInBytes** *(integer) --*
The size, in bytes, of a backup.
- **IamRoleArn** *(string) --*
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **CreatedBy** *(dict) --*
Contains identifying information about the creation of a backup job, including the ``BackupPlanArn`` , ``BackupPlanId`` , ``BackupPlanVersion`` , and ``BackupRuleId`` of the backup plan that is used to create it.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **BackupPlanVersion** *(string) --*
Version IDs are unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. They cannot be edited.
- **BackupRuleId** *(string) --*
Uniquely identifies a rule used to schedule the backup of a selection of resources.
- **ResourceType** *(string) --*
The type of AWS resource to be backed-up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.
- **BytesTransferred** *(integer) --*
The size in bytes transferred to a backup vault at the time that the job status was queried.
- **ExpectedCompletionDate** *(datetime) --*
The date and time that a job to back up resources is expected to be completed, in Unix format and Coordinated Universal Time (UTC). The value of ``ExpectedCompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **StartBy** *(datetime) --*
Specifies the time in Unix format and Coordinated Universal Time (UTC) when a backup job must be started before it is canceled. The value is calculated by adding the start window to the scheduled time. So if the scheduled time were 6:00 PM and the start window is 2 hours, the ``StartBy`` time would be 8:00 PM on the date specified. The value of ``StartBy`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupJobId: string
:param BackupJobId: **[REQUIRED]**
Uniquely identifies a request to AWS Backup to back up a resource.
:rtype: dict
:returns:
"""
pass
def describe_backup_vault(self, BackupVaultName: str) -> Dict:
"""
Returns metadata about a backup vault specified by its name.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeBackupVault>`_
**Request Syntax**
::
response = client.describe_backup_vault(
BackupVaultName='string'
)
**Response Syntax**
::
{
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'EncryptionKeyArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'CreatorRequestId': 'string',
'NumberOfRecoveryPoints': 123
}
**Response Structure**
- *(dict) --*
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **EncryptionKeyArn** *(string) --*
The server-side encryption key that is used to protect your backups; for example, ``arn:aws:kms:us-west-2:111122223333:key/<KEY>`` .
- **CreationDate** *(datetime) --*
The date and time that a backup vault is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
- **NumberOfRecoveryPoints** *(integer) --*
The number of recovery points that are stored in a backup vault.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:rtype: dict
:returns:
"""
pass
def describe_protected_resource(self, ResourceArn: str) -> Dict:
"""
Returns information about a saved resource, including the last time it was backed-up, its Amazon Resource Name (ARN), and the AWS service type of the saved resource.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeProtectedResource>`_
**Request Syntax**
::
response = client.describe_protected_resource(
ResourceArn='string'
)
**Response Syntax**
::
{
'ResourceArn': 'string',
'ResourceType': 'string',
'LastBackupTime': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **ResourceArn** *(string) --*
An ARN that uniquely identifies a resource. The format of the ARN depends on the resource type.
- **ResourceType** *(string) --*
The type of AWS resource saved as a recovery point; for example, an EBS volume or an Amazon RDS database.
- **LastBackupTime** *(datetime) --*
The date and time that a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of ``LastBackupTime`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type ResourceArn: string
:param ResourceArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.
:rtype: dict
:returns:
"""
pass
def describe_recovery_point(self, BackupVaultName: str, RecoveryPointArn: str) -> Dict:
"""
Returns metadata associated with a recovery point, including ID, status, encryption, and lifecycle.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeRecoveryPoint>`_
**Request Syntax**
::
response = client.describe_recovery_point(
BackupVaultName='string',
RecoveryPointArn='string'
)
**Response Syntax**
::
{
'RecoveryPointArn': 'string',
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'ResourceArn': 'string',
'ResourceType': 'string',
'CreatedBy': {
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'BackupPlanVersion': 'string',
'BackupRuleId': 'string'
},
'IamRoleArn': 'string',
'Status': 'COMPLETED'|'PARTIAL'|'DELETING'|'EXPIRED',
'CreationDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'BackupSizeInBytes': 123,
'CalculatedLifecycle': {
'MoveToColdStorageAt': datetime(2015, 1, 1),
'DeleteAt': datetime(2015, 1, 1)
},
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'EncryptionKeyArn': 'string',
'IsEncrypted': True|False,
'StorageClass': 'WARM'|'COLD'|'DELETED',
'LastRestoreTime': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An ARN that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **ResourceArn** *(string) --*
An ARN that uniquely identifies a saved resource. The format of the ARN depends on the resource type.
- **ResourceType** *(string) --*
The type of AWS resource to save as a recovery point; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.
- **CreatedBy** *(dict) --*
Contains identifying information about the creation of a recovery point, including the ``BackupPlanArn`` , ``BackupPlanId`` , ``BackupPlanVersion`` , and ``BackupRuleId`` of the backup plan used to create it.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **BackupPlanVersion** *(string) --*
Version IDs are unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. They cannot be edited.
- **BackupRuleId** *(string) --*
Uniquely identifies a rule used to schedule the backup of a selection of resources.
- **IamRoleArn** *(string) --*
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **Status** *(string) --*
A status code specifying the state of the recovery point.
.. note::
A partial status indicates that the recovery point was not successfully re-created and must be retried.
- **CreationDate** *(datetime) --*
The date and time that a recovery point is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CompletionDate** *(datetime) --*
The date and time that a job to create a recovery point is completed, in Unix format and Coordinated Universal Time (UTC). The value of ``CompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **BackupSizeInBytes** *(integer) --*
The size, in bytes, of a backup.
- **CalculatedLifecycle** *(dict) --*
A ``CalculatedLifecycle`` object containing ``DeleteAt`` and ``MoveToColdStorageAt`` timestamps.
- **MoveToColdStorageAt** *(datetime) --*
A timestamp that specifies when to transition a recovery point to cold storage.
- **DeleteAt** *(datetime) --*
A timestamp that specifies when to delete a recovery point.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups that are transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **EncryptionKeyArn** *(string) --*
The server-side encryption key used to protect your backups; for example, ``arn:aws:kms:us-west-2:111122223333:key/<KEY>`` .
- **IsEncrypted** *(boolean) --*
A Boolean value that is returned as ``TRUE`` if the specified recovery point is encrypted, or ``FALSE`` if the recovery point is not encrypted.
- **StorageClass** *(string) --*
Specifies the storage class of the recovery point. Valid values are ``WARM`` or ``COLD`` .
- **LastRestoreTime** *(datetime) --*
The date and time that a recovery point was last restored, in Unix format and Coordinated Universal Time (UTC). The value of ``LastRestoreTime`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type RecoveryPointArn: string
:param RecoveryPointArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
:rtype: dict
:returns:
"""
pass
def describe_restore_job(self, RestoreJobId: str) -> Dict:
"""
Returns metadata associated with a restore job that is specified by a job ID.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeRestoreJob>`_
**Request Syntax**
::
response = client.describe_restore_job(
RestoreJobId='string'
)
**Response Syntax**
::
{
'RestoreJobId': 'string',
'RecoveryPointArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'PENDING'|'RUNNING'|'COMPLETED'|'ABORTED'|'FAILED',
'StatusMessage': 'string',
'PercentDone': 'string',
'BackupSizeInBytes': 123,
'IamRoleArn': 'string',
'ExpectedCompletionTimeMinutes': 123,
'CreatedResourceArn': 'string'
}
**Response Structure**
- *(dict) --*
- **RestoreJobId** *(string) --*
Uniquely identifies the job that restores a recovery point.
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **CreationDate** *(datetime) --*
The date and time that a restore job is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CompletionDate** *(datetime) --*
The date and time that a job to restore a recovery point is completed, in Unix format and Coordinated Universal Time (UTC). The value of ``CompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **Status** *(string) --*
Status code specifying the state of the job that is initiated by AWS Backup to restore a recovery point.
- **StatusMessage** *(string) --*
A detailed message explaining the status of a job to restore a recovery point.
- **PercentDone** *(string) --*
Contains an estimated percentage that is complete of a job at the time the job status was queried.
- **BackupSizeInBytes** *(integer) --*
The size, in bytes, of the restored resource.
- **IamRoleArn** *(string) --*
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **ExpectedCompletionTimeMinutes** *(integer) --*
The amount of time in minutes that a job restoring a recovery point is expected to take.
- **CreatedResourceArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a resource whose recovery point is being restored. The format of the ARN depends on the resource type of the backed-up resource.
:type RestoreJobId: string
:param RestoreJobId: **[REQUIRED]**
Uniquely identifies the job that restores a recovery point.
:rtype: dict
:returns:
"""
pass
def export_backup_plan_template(self, BackupPlanId: str) -> Dict:
"""
Returns the backup plan that is specified by the plan ID as a backup template.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ExportBackupPlanTemplate>`_
**Request Syntax**
::
response = client.export_backup_plan_template(
BackupPlanId='string'
)
**Response Syntax**
::
{
'BackupPlanTemplateJson': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupPlanTemplateJson** *(string) --*
The body of a backup plan template in JSON format.
.. note::
This is a signed JSON document that cannot be modified before being passed to ``GetBackupPlanFromJSON.``
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:rtype: dict
:returns:
"""
pass
def generate_presigned_url(self, ClientMethod: str = None, Params: Dict = None, ExpiresIn: int = None, HttpMethod: str = None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to
``ClientMethod``.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
for. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
default, the http method is whatever is used in the method\'s model.
:returns: The presigned url
"""
pass
def get_backup_plan(self, BackupPlanId: str, VersionId: str = None) -> Dict:
"""
Returns the body of a backup plan in JSON format, in addition to plan metadata.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupPlan>`_
**Request Syntax**
::
response = client.get_backup_plan(
BackupPlanId='string',
VersionId='string'
)
**Response Syntax**
::
{
'BackupPlan': {
'BackupPlanName': 'string',
'Rules': [
{
'RuleName': 'string',
'TargetBackupVaultName': 'string',
'ScheduleExpression': 'string',
'StartWindowMinutes': 123,
'CompletionWindowMinutes': 123,
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'RecoveryPointTags': {
'string': 'string'
},
'RuleId': 'string'
},
]
},
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'VersionId': 'string',
'CreatorRequestId': 'string',
'CreationDate': datetime(2015, 1, 1),
'DeletionDate': datetime(2015, 1, 1),
'LastExecutionDate': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **BackupPlan** *(dict) --*
Specifies the body of a backup plan. Includes a ``BackupPlanName`` and one or more sets of ``Rules`` .
- **BackupPlanName** *(string) --*
The display name of a backup plan.
- **Rules** *(list) --*
An array of ``BackupRule`` objects, each of which specifies a scheduled task that is used to back up a selection of resources.
- *(dict) --*
Specifies a scheduled task used to back up a selection of resources.
- **RuleName** *(string) --*
An optional display name for a backup rule.
- **TargetBackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **ScheduleExpression** *(string) --*
A CRON expression specifying when AWS Backup initiates a backup job.
- **StartWindowMinutes** *(integer) --*
An optional value that specifies a period of time in minutes after a backup is scheduled before a job is canceled if it doesn't start successfully.
- **CompletionWindowMinutes** *(integer) --*
A value in minutes after a backup job is successfully started before it must be completed or it is canceled by AWS Backup. This value is optional.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **RecoveryPointTags** *(dict) --*
An array of key-value pair strings that are assigned to resources that are associated with this rule when restored from backup.
- *(string) --*
- *(string) --*
- **RuleId** *(string) --*
Uniquely identifies a rule that is used to schedule the backup of a selection of resources.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **VersionId** *(string) --*
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
- **CreationDate** *(datetime) --*
The date and time that a backup plan is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **DeletionDate** *(datetime) --*
The date and time that a backup plan is deleted, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **LastExecutionDate** *(datetime) --*
The last time a job to back up resources was executed with this backup plan. A date and time, in Unix format and Coordinated Universal Time (UTC). The value of ``LastExecutionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:type VersionId: string
:param VersionId:
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.
:rtype: dict
:returns:
"""
pass
def get_backup_plan_from_json(self, BackupPlanTemplateJson: str) -> Dict:
"""
Returns a valid JSON document specifying a backup plan or an error.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupPlanFromJSON>`_
**Request Syntax**
::
response = client.get_backup_plan_from_json(
BackupPlanTemplateJson='string'
)
**Response Syntax**
::
{
'BackupPlan': {
'BackupPlanName': 'string',
'Rules': [
{
'RuleName': 'string',
'TargetBackupVaultName': 'string',
'ScheduleExpression': 'string',
'StartWindowMinutes': 123,
'CompletionWindowMinutes': 123,
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'RecoveryPointTags': {
'string': 'string'
},
'RuleId': 'string'
},
]
}
}
**Response Structure**
- *(dict) --*
- **BackupPlan** *(dict) --*
Specifies the body of a backup plan. Includes a ``BackupPlanName`` and one or more sets of ``Rules`` .
- **BackupPlanName** *(string) --*
The display name of a backup plan.
- **Rules** *(list) --*
An array of ``BackupRule`` objects, each of which specifies a scheduled task that is used to back up a selection of resources.
- *(dict) --*
Specifies a scheduled task used to back up a selection of resources.
- **RuleName** *(string) --*
An optional display name for a backup rule.
- **TargetBackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **ScheduleExpression** *(string) --*
A CRON expression specifying when AWS Backup initiates a backup job.
- **StartWindowMinutes** *(integer) --*
An optional value that specifies a period of time in minutes after a backup is scheduled before a job is canceled if it doesn't start successfully.
- **CompletionWindowMinutes** *(integer) --*
A value in minutes after a backup job is successfully started before it must be completed or it is canceled by AWS Backup. This value is optional.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **RecoveryPointTags** *(dict) --*
An array of key-value pair strings that are assigned to resources that are associated with this rule when restored from backup.
- *(string) --*
- *(string) --*
- **RuleId** *(string) --*
Uniquely identifies a rule that is used to schedule the backup of a selection of resources.
:type BackupPlanTemplateJson: string
:param BackupPlanTemplateJson: **[REQUIRED]**
A customer-supplied backup plan document in JSON format.
:rtype: dict
:returns:
"""
pass
def get_backup_plan_from_template(self, BackupPlanTemplateId: str) -> Dict:
"""
Returns the template specified by its ``templateId`` as a backup plan.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupPlanFromTemplate>`_
**Request Syntax**
::
response = client.get_backup_plan_from_template(
BackupPlanTemplateId='string'
)
**Response Syntax**
::
{
'BackupPlanDocument': {
'BackupPlanName': 'string',
'Rules': [
{
'RuleName': 'string',
'TargetBackupVaultName': 'string',
'ScheduleExpression': 'string',
'StartWindowMinutes': 123,
'CompletionWindowMinutes': 123,
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'RecoveryPointTags': {
'string': 'string'
},
'RuleId': 'string'
},
]
}
}
**Response Structure**
- *(dict) --*
- **BackupPlanDocument** *(dict) --*
Returns the body of a backup plan based on the target template, including the name, rules, and backup vault of the plan.
- **BackupPlanName** *(string) --*
The display name of a backup plan.
- **Rules** *(list) --*
An array of ``BackupRule`` objects, each of which specifies a scheduled task that is used to back up a selection of resources.
- *(dict) --*
Specifies a scheduled task used to back up a selection of resources.
- **RuleName** *(string) --*
An optional display name for a backup rule.
- **TargetBackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **ScheduleExpression** *(string) --*
A CRON expression specifying when AWS Backup initiates a backup job.
- **StartWindowMinutes** *(integer) --*
An optional value that specifies a period of time in minutes after a backup is scheduled before a job is canceled if it doesn't start successfully.
- **CompletionWindowMinutes** *(integer) --*
A value in minutes after a backup job is successfully started before it must be completed or it is canceled by AWS Backup. This value is optional.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **RecoveryPointTags** *(dict) --*
An array of key-value pair strings that are assigned to resources that are associated with this rule when restored from backup.
- *(string) --*
- *(string) --*
- **RuleId** *(string) --*
Uniquely identifies a rule that is used to schedule the backup of a selection of resources.
:type BackupPlanTemplateId: string
:param BackupPlanTemplateId: **[REQUIRED]**
Uniquely identifies a stored backup plan template.
:rtype: dict
:returns:
"""
pass
def get_backup_selection(self, BackupPlanId: str, SelectionId: str) -> Dict:
"""
Returns selection metadata and a document in JSON format that specifies a list of resources that are associated with a backup plan.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupSelection>`_
**Request Syntax**
::
response = client.get_backup_selection(
BackupPlanId='string',
SelectionId='string'
)
**Response Syntax**
::
{
'BackupSelection': {
'SelectionName': 'string',
'IamRoleArn': 'string',
'Resources': [
'string',
],
'ListOfTags': [
{
'ConditionType': 'STRINGEQUALS',
'ConditionKey': 'string',
'ConditionValue': 'string'
},
]
},
'SelectionId': 'string',
'BackupPlanId': 'string',
'CreationDate': datetime(2015, 1, 1),
'CreatorRequestId': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupSelection** *(dict) --*
Specifies the body of a request to assign a set of resources to a backup plan.
It includes an array of resources, an optional array of patterns to exclude resources, an optional role to provide access to the AWS service that the resource belongs to, and an optional array of tags used to identify a set of resources.
- **SelectionName** *(string) --*
The display name of a resource selection document.
- **IamRoleArn** *(string) --*
The ARN of the IAM role that AWS Backup uses to authenticate when restoring the target resource; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **Resources** *(list) --*
An array of strings that either contain Amazon Resource Names (ARNs) or match patterns such as "``arn:aws:ec2:us-east-1:123456789012:volume/*`` " of resources to assign to a backup plan.
- *(string) --*
- **ListOfTags** *(list) --*
An array of conditions used to specify a set of resources to assign to a backup plan; for example, ``"StringEquals": {"ec2:ResourceTag/Department": "accounting"`` .
- *(dict) --*
Contains an array of triplets made up of a condition type (such as ``StringEquals`` ), a key, and a value. Conditions are used to filter resources in a selection that is assigned to a backup plan.
- **ConditionType** *(string) --*
An operation, such as ``StringEquals`` , that is applied to a key-value pair used to filter resources in a selection.
- **ConditionKey** *(string) --*
The key in a key-value pair. For example, in ``"ec2:ResourceTag/Department": "accounting"`` , ``"ec2:ResourceTag/Department"`` is the key.
- **ConditionValue** *(string) --*
The value in a key-value pair. For example, in ``"ec2:ResourceTag/Department": "accounting"`` , ``"accounting"`` is the value.
- **SelectionId** *(string) --*
Uniquely identifies the body of a request to assign a set of resources to a backup plan.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **CreationDate** *(datetime) --*
The date and time a backup selection is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:type SelectionId: string
:param SelectionId: **[REQUIRED]**
Uniquely identifies the body of a request to assign a set of resources to a backup plan.
:rtype: dict
:returns:
"""
pass
def get_backup_vault_access_policy(self, BackupVaultName: str) -> Dict:
"""
Returns the access policy document that is associated with the named backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupVaultAccessPolicy>`_
**Request Syntax**
::
response = client.get_backup_vault_access_policy(
BackupVaultName='string'
)
**Response Syntax**
::
{
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'Policy': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **Policy** *(string) --*
The backup vault access policy document in JSON format.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:rtype: dict
:returns:
"""
pass
def get_backup_vault_notifications(self, BackupVaultName: str) -> Dict:
"""
Returns event notifications for the specified backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupVaultNotifications>`_
**Request Syntax**
::
response = client.get_backup_vault_notifications(
BackupVaultName='string'
)
**Response Syntax**
::
{
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'SNSTopicArn': 'string',
'BackupVaultEvents': [
'BACKUP_JOB_STARTED'|'BACKUP_JOB_COMPLETED'|'RESTORE_JOB_STARTED'|'RESTORE_JOB_COMPLETED'|'RECOVERY_POINT_MODIFIED'|'BACKUP_PLAN_CREATED'|'BACKUP_PLAN_MODIFIED',
]
}
**Response Structure**
- *(dict) --*
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **SNSTopicArn** *(string) --*
An ARN that uniquely identifies an Amazon Simple Notification Service (Amazon SNS) topic; for example, ``arn:aws:sns:us-west-2:111122223333:MyTopic`` .
- **BackupVaultEvents** *(list) --*
An array of events that indicate the status of jobs to back up resources to the backup vault.
- *(string) --*
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:rtype: dict
:returns:
"""
pass
def get_paginator(self, operation_name: str = None) -> Paginator:
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is ``create_foo``, and you\'d normally invoke the
operation as ``client.create_foo(**kwargs)``, if the
``create_foo`` operation can be paginated, you can use the
call ``client.get_paginator(\"create_foo\")``.
:raise OperationNotPageableError: Raised if the operation is not
pageable. You can use the ``client.can_paginate`` method to
check if an operation is pageable.
:rtype: L{botocore.paginate.Paginator}
:return: A paginator object.
"""
pass
def get_recovery_point_restore_metadata(self, BackupVaultName: str, RecoveryPointArn: str) -> Dict:
"""
Returns two sets of metadata key-value pairs. The first set lists the metadata that the recovery point was created with. The second set lists the metadata key-value pairs that are required to restore the recovery point.
These sets can be the same, or the restore metadata set can contain different values if the target service to be restored has changed since the recovery point was created and now requires additional or different information in order to be restored.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetRecoveryPointRestoreMetadata>`_
**Request Syntax**
::
response = client.get_recovery_point_restore_metadata(
BackupVaultName='string',
RecoveryPointArn='string'
)
**Response Syntax**
::
{
'BackupVaultArn': 'string',
'RecoveryPointArn': 'string',
'RestoreMetadata': {
'string': 'string'
}
}
**Response Structure**
- *(dict) --*
- **BackupVaultArn** *(string) --*
An ARN that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **RestoreMetadata** *(dict) --*
A set of metadata key-value pairs that lists the metadata key-value pairs that are required to restore the recovery point.
- *(string) --*
- *(string) --*
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type RecoveryPointArn: string
:param RecoveryPointArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
:rtype: dict
:returns:
"""
pass
def get_supported_resource_types(self) -> Dict:
"""
Returns the AWS resource types supported by AWS Backup.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetSupportedResourceTypes>`_
**Request Syntax**
::
response = client.get_supported_resource_types()
**Response Syntax**
::
{
'ResourceTypes': [
'string',
]
}
**Response Structure**
- *(dict) --*
- **ResourceTypes** *(list) --*
Contains a string with the supported AWS resource types:
* ``EBS`` for Amazon Elastic Block Store
* ``SGW`` for AWS Storage Gateway
* ``RDS`` for Amazon Relational Database Service
* ``DDB`` for Amazon DynamoDB
* ``EFS`` for Amazon Elastic File System
- *(string) --*
:rtype: dict
:returns:
"""
pass
def get_waiter(self, waiter_name: str = None) -> Waiter:
"""
Returns an object that can wait for some condition.
:type waiter_name: str
:param waiter_name: The name of the waiter to get. See the waiters
section of the service docs for a list of available waiters.
:returns: The specified waiter object.
:rtype: botocore.waiter.Waiter
"""
pass
def list_backup_jobs(self, NextToken: str = None, MaxResults: int = None, ByResourceArn: str = None, ByState: str = None, ByBackupVaultName: str = None, ByCreatedBefore: datetime = None, ByCreatedAfter: datetime = None, ByResourceType: str = None) -> Dict:
"""
Returns metadata about your backup jobs.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupJobs>`_
**Request Syntax**
::
response = client.list_backup_jobs(
NextToken='string',
MaxResults=123,
ByResourceArn='string',
ByState='CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED',
ByBackupVaultName='string',
ByCreatedBefore=datetime(2015, 1, 1),
ByCreatedAfter=datetime(2015, 1, 1),
ByResourceType='string'
)
**Response Syntax**
::
{
'BackupJobs': [
{
'BackupJobId': 'string',
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'RecoveryPointArn': 'string',
'ResourceArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'State': 'CREATED'|'PENDING'|'RUNNING'|'ABORTING'|'ABORTED'|'COMPLETED'|'FAILED'|'EXPIRED',
'StatusMessage': 'string',
'PercentDone': 'string',
'BackupSizeInBytes': 123,
'IamRoleArn': 'string',
'CreatedBy': {
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'BackupPlanVersion': 'string',
'BackupRuleId': 'string'
},
'ExpectedCompletionDate': datetime(2015, 1, 1),
'StartBy': datetime(2015, 1, 1),
'ResourceType': 'string',
'BytesTransferred': 123
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupJobs** *(list) --*
An array of structures containing metadata about your backup jobs returned in JSON format.
- *(dict) --*
Contains detailed information about a backup job.
- **BackupJobId** *(string) --*
Uniquely identifies a request to AWS Backup to back up a resource.
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **ResourceArn** *(string) --*
An ARN that uniquely identifies a resource. The format of the ARN depends on the resource type.
- **CreationDate** *(datetime) --*
The date and time a backup job is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CompletionDate** *(datetime) --*
The date and time a job to create a backup job is completed, in Unix format and Coordinated Universal Time (UTC). The value of ``CompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **State** *(string) --*
The current state of a resource recovery point.
- **StatusMessage** *(string) --*
A detailed message explaining the status of the job to back up a resource.
- **PercentDone** *(string) --*
Contains an estimated percentage complete of a job at the time the job status was queried.
- **BackupSizeInBytes** *(integer) --*
The size, in bytes, of a backup.
- **IamRoleArn** *(string) --*
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **CreatedBy** *(dict) --*
Contains identifying information about the creation of a backup job, including the ``BackupPlanArn`` , ``BackupPlanId`` , ``BackupPlanVersion`` , and ``BackupRuleId`` of the backup plan used to create it.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **BackupPlanVersion** *(string) --*
Version IDs are unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. They cannot be edited.
- **BackupRuleId** *(string) --*
Uniquely identifies a rule used to schedule the backup of a selection of resources.
- **ExpectedCompletionDate** *(datetime) --*
The date and time a job to back up resources is expected to be completed, in Unix format and Coordinated Universal Time (UTC). The value of ``ExpectedCompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **StartBy** *(datetime) --*
Specifies the time in Unix format and Coordinated Universal Time (UTC) when a backup job must be started before it is canceled. The value is calculated by adding the start window to the scheduled time. So if the scheduled time were 6:00 PM and the start window is 2 hours, the ``StartBy`` time would be 8:00 PM on the date specified. The value of ``StartBy`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **ResourceType** *(string) --*
The type of AWS resource to be backed-up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.
- **BytesTransferred** *(integer) --*
The size in bytes transferred to a backup vault at the time that the job status was queried.
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:type ByResourceArn: string
:param ByResourceArn:
Returns only backup jobs that match the specified resource Amazon Resource Name (ARN).
:type ByState: string
:param ByState:
Returns only backup jobs that are in the specified state.
:type ByBackupVaultName: string
:param ByBackupVaultName:
Returns only backup jobs that will be stored in the specified backup vault. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type ByCreatedBefore: datetime
:param ByCreatedBefore:
Returns only backup jobs that were created before the specified date.
:type ByCreatedAfter: datetime
:param ByCreatedAfter:
Returns only backup jobs that were created after the specified date.
:type ByResourceType: string
:param ByResourceType:
Returns only backup jobs for the specified resources:
* ``EBS`` for Amazon Elastic Block Store
* ``SGW`` for AWS Storage Gateway
* ``RDS`` for Amazon Relational Database Service
* ``DDB`` for Amazon DynamoDB
* ``EFS`` for Amazon Elastic File System
:rtype: dict
:returns:
"""
pass
def list_backup_plan_templates(self, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns metadata of your saved backup plan templates, including the template ID, name, and the creation and deletion dates.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupPlanTemplates>`_
**Request Syntax**
::
response = client.list_backup_plan_templates(
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'NextToken': 'string',
'BackupPlanTemplatesList': [
{
'BackupPlanTemplateId': 'string',
'BackupPlanTemplateName': 'string'
},
]
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **BackupPlanTemplatesList** *(list) --*
An array of template list items containing metadata about your saved templates.
- *(dict) --*
An object specifying metadata associated with a backup plan template.
- **BackupPlanTemplateId** *(string) --*
Uniquely identifies a stored backup plan template.
- **BackupPlanTemplateName** *(string) --*
The optional display name of a backup plan template.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_backup_plan_versions(self, BackupPlanId: str, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns version metadata of your backup plans, including Amazon Resource Names (ARNs), backup plan IDs, creation and deletion dates, plan names, and version IDs.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupPlanVersions>`_
**Request Syntax**
::
response = client.list_backup_plan_versions(
BackupPlanId='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'NextToken': 'string',
'BackupPlanVersionsList': [
{
'BackupPlanArn': 'string',
'BackupPlanId': 'string',
'CreationDate': datetime(2015, 1, 1),
'DeletionDate': datetime(2015, 1, 1),
'VersionId': 'string',
'BackupPlanName': 'string',
'CreatorRequestId': 'string',
'LastExecutionDate': datetime(2015, 1, 1)
},
]
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **BackupPlanVersionsList** *(list) --*
An array of version list items containing metadata about your backup plans.
- *(dict) --*
Contains metadata about a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **CreationDate** *(datetime) --*
The date and time a resource backup plan is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **DeletionDate** *(datetime) --*
The date and time a backup plan is deleted, in Unix format and Coordinated Universal Time (UTC). The value of ``DeletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **VersionId** *(string) --*
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.
- **BackupPlanName** *(string) --*
The display name of a saved backup plan.
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
- **LastExecutionDate** *(datetime) --*
The last time a job to back up resources was executed with this rule. A date and time, in Unix format and Coordinated Universal Time (UTC). The value of ``LastExecutionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_backup_plans(self, NextToken: str = None, MaxResults: int = None, IncludeDeleted: bool = None) -> Dict:
"""
Returns metadata of your saved backup plans, including Amazon Resource Names (ARNs), plan IDs, creation and deletion dates, version IDs, plan names, and creator request IDs.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupPlans>`_
**Request Syntax**
::
response = client.list_backup_plans(
NextToken='string',
MaxResults=123,
IncludeDeleted=True|False
)
**Response Syntax**
::
{
'NextToken': 'string',
'BackupPlansList': [
{
'BackupPlanArn': 'string',
'BackupPlanId': 'string',
'CreationDate': datetime(2015, 1, 1),
'DeletionDate': datetime(2015, 1, 1),
'VersionId': 'string',
'BackupPlanName': 'string',
'CreatorRequestId': 'string',
'LastExecutionDate': datetime(2015, 1, 1)
},
]
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **BackupPlansList** *(list) --*
An array of backup plan list items containing metadata about your saved backup plans.
- *(dict) --*
Contains metadata about a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **CreationDate** *(datetime) --*
The date and time a resource backup plan is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **DeletionDate** *(datetime) --*
The date and time a backup plan is deleted, in Unix format and Coordinated Universal Time (UTC). The value of ``DeletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **VersionId** *(string) --*
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.
- **BackupPlanName** *(string) --*
The display name of a saved backup plan.
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
- **LastExecutionDate** *(datetime) --*
The last time a job to back up resources was executed with this rule. A date and time, in Unix format and Coordinated Universal Time (UTC). The value of ``LastExecutionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:type IncludeDeleted: boolean
:param IncludeDeleted:
A Boolean value with a default value of ``FALSE`` that returns deleted backup plans when set to ``TRUE`` .
:rtype: dict
:returns:
"""
pass
def list_backup_selections(self, BackupPlanId: str, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns an array containing metadata of the resources associated with the target backup plan.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupSelections>`_
**Request Syntax**
::
response = client.list_backup_selections(
BackupPlanId='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'NextToken': 'string',
'BackupSelectionsList': [
{
'SelectionId': 'string',
'SelectionName': 'string',
'BackupPlanId': 'string',
'CreationDate': datetime(2015, 1, 1),
'CreatorRequestId': 'string',
'IamRoleArn': 'string'
},
]
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **BackupSelectionsList** *(list) --*
An array of backup selection list items containing metadata about each resource in the list.
- *(dict) --*
Contains metadata about a ``BackupSelection`` object.
- **SelectionId** *(string) --*
Uniquely identifies a request to assign a set of resources to a backup plan.
- **SelectionName** *(string) --*
The display name of a resource selection document.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **CreationDate** *(datetime) --*
The date and time a backup plan is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
- **IamRoleArn** *(string) --*
Specifies the IAM role Amazon Resource Name (ARN) to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_backup_vaults(self, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns a list of recovery point storage containers along with information about them.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupVaults>`_
**Request Syntax**
::
response = client.list_backup_vaults(
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'BackupVaultList': [
{
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'EncryptionKeyArn': 'string',
'CreatorRequestId': 'string',
'NumberOfRecoveryPoints': 123
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupVaultList** *(list) --*
An array of backup vault list members containing vault metadata, including Amazon Resource Name (ARN), display name, creation date, number of saved recovery points, and encryption information if the resources saved in the backup vault are encrypted.
- *(dict) --*
Contains metadata about a backup vault.
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **CreationDate** *(datetime) --*
The date and time a resource backup is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **EncryptionKeyArn** *(string) --*
The server-side encryption key that is used to protect your backups; for example, ``arn:aws:kms:us-west-2:111122223333:key/<KEY>`` .
- **CreatorRequestId** *(string) --*
A unique string that identifies the request and allows failed requests to be retried without the risk of executing the operation twice.
- **NumberOfRecoveryPoints** *(integer) --*
The number of recovery points that are stored in a backup vault.
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_protected_resources(self, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns an array of resources successfully backed up by AWS Backup, including the time the resource was saved, an Amazon Resource Name (ARN) of the resource, and a resource type.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListProtectedResources>`_
**Request Syntax**
::
response = client.list_protected_resources(
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'Results': [
{
'ResourceArn': 'string',
'ResourceType': 'string',
'LastBackupTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **Results** *(list) --*
An array of resources successfully backed up by AWS Backup including the time the resource was saved, an Amazon Resource Name (ARN) of the resource, and a resource type.
- *(dict) --*
A structure that contains information about a backed-up resource.
- **ResourceArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.
- **ResourceType** *(string) --*
The type of AWS resource; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.
- **LastBackupTime** *(datetime) --*
The date and time a resource was last backed up, in Unix format and Coordinated Universal Time (UTC). The value of ``LastBackupTime`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_recovery_points_by_backup_vault(self, BackupVaultName: str, NextToken: str = None, MaxResults: int = None, ByResourceArn: str = None, ByResourceType: str = None, ByBackupPlanId: str = None, ByCreatedBefore: datetime = None, ByCreatedAfter: datetime = None) -> Dict:
"""
Returns detailed information about the recovery points stored in a backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRecoveryPointsByBackupVault>`_
**Request Syntax**
::
response = client.list_recovery_points_by_backup_vault(
BackupVaultName='string',
NextToken='string',
MaxResults=123,
ByResourceArn='string',
ByResourceType='string',
ByBackupPlanId='string',
ByCreatedBefore=datetime(2015, 1, 1),
ByCreatedAfter=datetime(2015, 1, 1)
)
**Response Syntax**
::
{
'NextToken': 'string',
'RecoveryPoints': [
{
'RecoveryPointArn': 'string',
'BackupVaultName': 'string',
'BackupVaultArn': 'string',
'ResourceArn': 'string',
'ResourceType': 'string',
'CreatedBy': {
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'BackupPlanVersion': 'string',
'BackupRuleId': 'string'
},
'IamRoleArn': 'string',
'Status': 'COMPLETED'|'PARTIAL'|'DELETING'|'EXPIRED',
'CreationDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'BackupSizeInBytes': 123,
'CalculatedLifecycle': {
'MoveToColdStorageAt': datetime(2015, 1, 1),
'DeleteAt': datetime(2015, 1, 1)
},
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'EncryptionKeyArn': 'string',
'IsEncrypted': True|False,
'LastRestoreTime': datetime(2015, 1, 1)
},
]
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **RecoveryPoints** *(list) --*
An array of objects that contain detailed information about recovery points saved in a backup vault.
- *(dict) --*
Contains detailed information about the recovery points stored in a backup vault.
- **RecoveryPointArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **BackupVaultArn** *(string) --*
An ARN that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **ResourceArn** *(string) --*
An ARN that uniquely identifies a resource. The format of the ARN depends on the resource type.
- **ResourceType** *(string) --*
The type of AWS resource saved as a recovery point; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.
- **CreatedBy** *(dict) --*
Contains identifying information about the creation of a recovery point, including the ``BackupPlanArn`` , ``BackupPlanId`` , ``BackupPlanVersion`` , and ``BackupRuleId`` of the backup plan that is used to create it.
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **BackupPlanVersion** *(string) --*
Version IDs are unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. They cannot be edited.
- **BackupRuleId** *(string) --*
Uniquely identifies a rule used to schedule the backup of a selection of resources.
- **IamRoleArn** *(string) --*
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **Status** *(string) --*
A status code specifying the state of the recovery point.
- **CreationDate** *(datetime) --*
The date and time a recovery point is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CompletionDate** *(datetime) --*
The date and time a job to restore a recovery point is completed, in Unix format and Coordinated Universal Time (UTC). The value of ``CompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **BackupSizeInBytes** *(integer) --*
The size, in bytes, of a backup.
- **CalculatedLifecycle** *(dict) --*
A ``CalculatedLifecycle`` object containing ``DeleteAt`` and ``MoveToColdStorageAt`` timestamps.
- **MoveToColdStorageAt** *(datetime) --*
A timestamp that specifies when to transition a recovery point to cold storage.
- **DeleteAt** *(datetime) --*
A timestamp that specifies when to delete a recovery point.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **EncryptionKeyArn** *(string) --*
The server-side encryption key that is used to protect your backups; for example, ``arn:aws:kms:us-west-2:111122223333:key/<KEY>`` .
- **IsEncrypted** *(boolean) --*
A Boolean value that is returned as ``TRUE`` if the specified recovery point is encrypted, or ``FALSE`` if the recovery point is not encrypted.
- **LastRestoreTime** *(datetime) --*
The date and time a recovery point was last restored, in Unix format and Coordinated Universal Time (UTC). The value of ``LastRestoreTime`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:type ByResourceArn: string
:param ByResourceArn:
Returns only recovery points that match the specified resource Amazon Resource Name (ARN).
:type ByResourceType: string
:param ByResourceType:
Returns only recovery points that match the specified resource type.
:type ByBackupPlanId: string
:param ByBackupPlanId:
Returns only recovery points that match the specified backup plan ID.
:type ByCreatedBefore: datetime
:param ByCreatedBefore:
Returns only recovery points that were created before the specified timestamp.
:type ByCreatedAfter: datetime
:param ByCreatedAfter:
Returns only recovery points that were created after the specified timestamp.
:rtype: dict
:returns:
"""
pass
def list_recovery_points_by_resource(self, ResourceArn: str, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns detailed information about recovery points of the type specified by a resource Amazon Resource Name (ARN).
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRecoveryPointsByResource>`_
**Request Syntax**
::
response = client.list_recovery_points_by_resource(
ResourceArn='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'NextToken': 'string',
'RecoveryPoints': [
{
'RecoveryPointArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'Status': 'COMPLETED'|'PARTIAL'|'DELETING'|'EXPIRED',
'EncryptionKeyArn': 'string',
'BackupSizeBytes': 123,
'BackupVaultName': 'string'
},
]
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **RecoveryPoints** *(list) --*
An array of objects that contain detailed information about recovery points of the specified resource type.
- *(dict) --*
Contains detailed information about a saved recovery point.
- **RecoveryPointArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **CreationDate** *(datetime) --*
The date and time a recovery point is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **Status** *(string) --*
A status code specifying the state of the recovery point.
- **EncryptionKeyArn** *(string) --*
The server-side encryption key that is used to protect your backups; for example, ``arn:aws:kms:us-west-2:111122223333:key/<KEY>`` .
- **BackupSizeBytes** *(integer) --*
The size, in bytes, of a backup.
- **BackupVaultName** *(string) --*
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type ResourceArn: string
:param ResourceArn: **[REQUIRED]**
An ARN that uniquely identifies a resource. The format of the ARN depends on the resource type.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_restore_jobs(self, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns a list of jobs that AWS Backup initiated to restore a saved resource, including metadata about the recovery process.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRestoreJobs>`_
**Request Syntax**
::
response = client.list_restore_jobs(
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'RestoreJobs': [
{
'RestoreJobId': 'string',
'RecoveryPointArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'PENDING'|'RUNNING'|'COMPLETED'|'ABORTED'|'FAILED',
'StatusMessage': 'string',
'PercentDone': 'string',
'BackupSizeInBytes': 123,
'IamRoleArn': 'string',
'ExpectedCompletionTimeMinutes': 123,
'CreatedResourceArn': 'string'
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **RestoreJobs** *(list) --*
An array of objects that contain detailed information about jobs to restore saved resources.
- *(dict) --*
Contains metadata about a restore job.
- **RestoreJobId** *(string) --*
Uniquely identifies the job that restores a recovery point.
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **CreationDate** *(datetime) --*
The date and time a restore job is created, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **CompletionDate** *(datetime) --*
The date and time a job to restore a recovery point is completed, in Unix format and Coordinated Universal Time (UTC). The value of ``CompletionDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **Status** *(string) --*
A status code specifying the state of the job initiated by AWS Backup to restore a recovery point.
- **StatusMessage** *(string) --*
A detailed message explaining the status of the job to restore a recovery point.
- **PercentDone** *(string) --*
Contains an estimated percentage complete of a job at the time the job status was queried.
- **BackupSizeInBytes** *(integer) --*
The size, in bytes, of the restored resource.
- **IamRoleArn** *(string) --*
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
- **ExpectedCompletionTimeMinutes** *(integer) --*
The amount of time in minutes that a job restoring a recovery point is expected to take.
- **CreatedResourceArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def list_tags(self, ResourceArn: str, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Returns a list of key-value pairs assigned to a target recovery point, backup plan, or backup vault.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListTags>`_
**Request Syntax**
::
response = client.list_tags(
ResourceArn='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'NextToken': 'string',
'Tags': {
'string': 'string'
}
}
**Response Structure**
- *(dict) --*
- **NextToken** *(string) --*
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
- **Tags** *(dict) --*
To help organize your resources, you can assign your own metadata to the resources you create. Each tag is a key-value pair.
- *(string) --*
- *(string) --*
:type ResourceArn: string
:param ResourceArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the type of resource. Valid targets for ``ListTags`` are recovery points, backup plans, and backup vaults.
:type NextToken: string
:param NextToken:
The next item following a partial list of returned items. For example, if a request is made to return ``maxResults`` number of items, ``NextToken`` allows you to return more items in your list starting at the location pointed to by the next token.
:type MaxResults: integer
:param MaxResults:
The maximum number of items to be returned.
:rtype: dict
:returns:
"""
pass
def put_backup_vault_access_policy(self, BackupVaultName: str, Policy: str = None):
"""
Sets a resource-based policy that is used to manage access permissions on the target backup vault. Requires a backup vault name and an access policy document in JSON format.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/PutBackupVaultAccessPolicy>`_
**Request Syntax**
::
response = client.put_backup_vault_access_policy(
BackupVaultName='string',
Policy='string'
)
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type Policy: string
:param Policy:
The backup vault access policy document in JSON format.
:returns: None
"""
pass
def put_backup_vault_notifications(self, BackupVaultName: str, SNSTopicArn: str, BackupVaultEvents: List):
"""
Turns on notifications on a backup vault for the specified topic and events.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/PutBackupVaultNotifications>`_
**Request Syntax**
::
response = client.put_backup_vault_notifications(
BackupVaultName='string',
SNSTopicArn='string',
BackupVaultEvents=[
'BACKUP_JOB_STARTED'|'BACKUP_JOB_COMPLETED'|'RESTORE_JOB_STARTED'|'RESTORE_JOB_COMPLETED'|'RECOVERY_POINT_MODIFIED'|'BACKUP_PLAN_CREATED'|'BACKUP_PLAN_MODIFIED',
]
)
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type SNSTopicArn: string
:param SNSTopicArn: **[REQUIRED]**
The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events; for example, ``arn:aws:sns:us-west-2:111122223333:MyVaultTopic`` .
:type BackupVaultEvents: list
:param BackupVaultEvents: **[REQUIRED]**
An array of events that indicate the status of jobs to back up resources to the backup vault.
- *(string) --*
:returns: None
"""
pass
def start_backup_job(self, BackupVaultName: str, ResourceArn: str, IamRoleArn: str, IdempotencyToken: str = None, StartWindowMinutes: int = None, CompleteWindowMinutes: int = None, Lifecycle: Dict = None, RecoveryPointTags: Dict = None) -> Dict:
"""
Starts a job to create a one-time backup of the specified resource.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StartBackupJob>`_
**Request Syntax**
::
response = client.start_backup_job(
BackupVaultName='string',
ResourceArn='string',
IamRoleArn='string',
IdempotencyToken='string',
StartWindowMinutes=123,
CompleteWindowMinutes=123,
Lifecycle={
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
RecoveryPointTags={
'string': 'string'
}
)
**Response Syntax**
::
{
'BackupJobId': 'string',
'RecoveryPointArn': 'string',
'CreationDate': datetime(2015, 1, 1)
}
**Response Structure**
- *(dict) --*
- **BackupJobId** *(string) --*
Uniquely identifies a request to AWS Backup to back up a resource.
- **RecoveryPointArn** *(string) --*
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **CreationDate** *(datetime) --*
The date and time that a backup job is started, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type ResourceArn: string
:param ResourceArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.
:type IamRoleArn: string
:param IamRoleArn: **[REQUIRED]**
Specifies the IAM role ARN used to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
:type IdempotencyToken: string
:param IdempotencyToken:
A customer chosen string that can be used to distinguish between calls to ``StartBackupJob`` . Idempotency tokens time out after one hour. Therefore, if you call ``StartBackupJob`` multiple times with the same idempotency token within one hour, AWS Backup recognizes that you are requesting only one backup job and initiates only one. If you change the idempotency token for each call, AWS Backup recognizes that you are requesting to start multiple backups.
:type StartWindowMinutes: integer
:param StartWindowMinutes:
The amount of time in minutes before beginning a backup.
:type CompleteWindowMinutes: integer
:param CompleteWindowMinutes:
The amount of time AWS Backup attempts a backup before canceling the job and returning an error.
:type Lifecycle: dict
:param Lifecycle:
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup will transition and expire backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
:type RecoveryPointTags: dict
:param RecoveryPointTags:
To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.
- *(string) --*
- *(string) --*
:rtype: dict
:returns:
"""
pass
def start_restore_job(self, RecoveryPointArn: str, Metadata: Dict, IamRoleArn: str, IdempotencyToken: str = None, ResourceType: str = None) -> Dict:
"""
Recovers the saved resource identified by an Amazon Resource Name (ARN).
If the resource ARN is included in the request, then the last complete backup of that resource is recovered. If the ARN of a recovery point is supplied, then that recovery point is restored.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StartRestoreJob>`_
**Request Syntax**
::
response = client.start_restore_job(
RecoveryPointArn='string',
Metadata={
'string': 'string'
},
IamRoleArn='string',
IdempotencyToken='string',
ResourceType='string'
)
**Response Syntax**
::
{
'RestoreJobId': 'string'
}
**Response Structure**
- *(dict) --*
- **RestoreJobId** *(string) --*
Uniquely identifies the job that restores a recovery point.
:type RecoveryPointArn: string
:param RecoveryPointArn: **[REQUIRED]**
An ARN that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
:type Metadata: dict
:param Metadata: **[REQUIRED]**
A set of metadata key-value pairs. Lists the metadata that the recovery point was created with.
- *(string) --*
- *(string) --*
:type IamRoleArn: string
:param IamRoleArn: **[REQUIRED]**
The Amazon Resource Name (ARN) of the IAM role that AWS Backup uses to create the target recovery point; for example, ``arn:aws:iam::123456789012:role/S3Access`` .
:type IdempotencyToken: string
:param IdempotencyToken:
A customer chosen string that can be used to distinguish between calls to ``StartRestoreJob`` . Idempotency tokens time out after one hour. Therefore, if you call ``StartRestoreJob`` multiple times with the same idempotency token within one hour, AWS Backup recognizes that you are requesting only one restore job and initiates only one. If you change the idempotency token for each call, AWS Backup recognizes that you are requesting to start multiple restores.
:type ResourceType: string
:param ResourceType:
Starts a job to restore a recovery point for one of the following resources:
* ``EBS`` for Amazon Elastic Block Store
* ``SGW`` for AWS Storage Gateway
* ``RDS`` for Amazon Relational Database Service
* ``DDB`` for Amazon DynamoDB
* ``EFS`` for Amazon Elastic File System
:rtype: dict
:returns:
"""
pass
def stop_backup_job(self, BackupJobId: str):
"""
Attempts to cancel a job to create a one-time backup of a resource.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StopBackupJob>`_
**Request Syntax**
::
response = client.stop_backup_job(
BackupJobId='string'
)
:type BackupJobId: string
:param BackupJobId: **[REQUIRED]**
Uniquely identifies a request to AWS Backup to back up a resource.
:returns: None
"""
pass
def tag_resource(self, ResourceArn: str, Tags: Dict):
"""
Assigns a set of key-value pairs to a recovery point, backup plan, or backup vault identified by an Amazon Resource Name (ARN).
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/TagResource>`_
**Request Syntax**
::
response = client.tag_resource(
ResourceArn='string',
Tags={
'string': 'string'
}
)
:type ResourceArn: string
:param ResourceArn: **[REQUIRED]**
An ARN that uniquely identifies a resource. The format of the ARN depends on the type of the tagged resource.
:type Tags: dict
:param Tags: **[REQUIRED]**
Key-value pairs that are used to help organize your resources. You can assign your own metadata to the resources you create.
- *(string) --*
- *(string) --*
:returns: None
"""
pass
def untag_resource(self, ResourceArn: str, TagKeyList: List):
"""
Removes a set of key-value pairs from a recovery point, backup plan, or backup vault identified by an Amazon Resource Name (ARN)
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/UntagResource>`_
**Request Syntax**
::
response = client.untag_resource(
ResourceArn='string',
TagKeyList=[
'string',
]
)
:type ResourceArn: string
:param ResourceArn: **[REQUIRED]**
An ARN that uniquely identifies a resource. The format of the ARN depends on the type of the tagged resource.
:type TagKeyList: list
:param TagKeyList: **[REQUIRED]**
A list of keys to identify which key-value tags to remove from a resource.
- *(string) --*
:returns: None
"""
pass
def update_backup_plan(self, BackupPlanId: str, BackupPlan: Dict) -> Dict:
"""
Replaces the body of a saved backup plan identified by its ``backupPlanId`` with the input document in JSON format. The new version is uniquely identified by a ``VersionId`` .
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/UpdateBackupPlan>`_
**Request Syntax**
::
response = client.update_backup_plan(
BackupPlanId='string',
BackupPlan={
'BackupPlanName': 'string',
'Rules': [
{
'RuleName': 'string',
'TargetBackupVaultName': 'string',
'ScheduleExpression': 'string',
'StartWindowMinutes': 123,
'CompletionWindowMinutes': 123,
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'RecoveryPointTags': {
'string': 'string'
}
},
]
}
)
**Response Syntax**
::
{
'BackupPlanId': 'string',
'BackupPlanArn': 'string',
'CreationDate': datetime(2015, 1, 1),
'VersionId': 'string'
}
**Response Structure**
- *(dict) --*
- **BackupPlanId** *(string) --*
Uniquely identifies a backup plan.
- **BackupPlanArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, ``arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50`` .
- **CreationDate** *(datetime) --*
The date and time a backup plan is updated, in Unix format and Coordinated Universal Time (UTC). The value of ``CreationDate`` is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
- **VersionId** *(string) --*
Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version Ids cannot be edited.
:type BackupPlanId: string
:param BackupPlanId: **[REQUIRED]**
Uniquely identifies a backup plan.
:type BackupPlan: dict
:param BackupPlan: **[REQUIRED]**
Specifies the body of a backup plan. Includes a ``BackupPlanName`` and one or more sets of ``Rules`` .
- **BackupPlanName** *(string) --* **[REQUIRED]**
The display name of a backup plan.
- **Rules** *(list) --* **[REQUIRED]**
An array of ``BackupRule`` objects, each of which specifies a scheduled task that is used to back up a selection of resources.
- *(dict) --*
Specifies a scheduled task used to back up a selection of resources.
- **RuleName** *(string) --* **[REQUIRED]**
>An optional display name for a backup rule.
- **TargetBackupVaultName** *(string) --* **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
- **ScheduleExpression** *(string) --*
A CRON expression specifying when AWS Backup initiates a backup job.
- **StartWindowMinutes** *(integer) --*
The amount of time in minutes before beginning a backup.
- **CompletionWindowMinutes** *(integer) --*
The amount of time AWS Backup attempts a backup before canceling the job and returning an error.
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup will transition and expire backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days”. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **RecoveryPointTags** *(dict) --*
To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.
- *(string) --*
- *(string) --*
:rtype: dict
:returns:
"""
pass
def update_recovery_point_lifecycle(self, BackupVaultName: str, RecoveryPointArn: str, Lifecycle: Dict = None) -> Dict:
"""
Sets the transition lifecycle of a recovery point.
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/UpdateRecoveryPointLifecycle>`_
**Request Syntax**
::
response = client.update_recovery_point_lifecycle(
BackupVaultName='string',
RecoveryPointArn='string',
Lifecycle={
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
}
)
**Response Syntax**
::
{
'BackupVaultArn': 'string',
'RecoveryPointArn': 'string',
'Lifecycle': {
'MoveToColdStorageAfterDays': 123,
'DeleteAfterDays': 123
},
'CalculatedLifecycle': {
'MoveToColdStorageAt': datetime(2015, 1, 1),
'DeleteAt': datetime(2015, 1, 1)
}
}
**Response Structure**
- *(dict) --*
- **BackupVaultArn** *(string) --*
An ARN that uniquely identifies a backup vault; for example, ``arn:aws:backup:us-east-1:123456789012:vault:aBackupVault`` .
- **RecoveryPointArn** *(string) --*
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
- **Lifecycle** *(dict) --*
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
- **CalculatedLifecycle** *(dict) --*
A ``CalculatedLifecycle`` object containing ``DeleteAt`` and ``MoveToColdStorageAt`` timestamps.
- **MoveToColdStorageAt** *(datetime) --*
A timestamp that specifies when to transition a recovery point to cold storage.
- **DeleteAt** *(datetime) --*
A timestamp that specifies when to delete a recovery point.
:type BackupVaultName: string
:param BackupVaultName: **[REQUIRED]**
The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.
:type RecoveryPointArn: string
:param RecoveryPointArn: **[REQUIRED]**
An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, ``arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45`` .
:type Lifecycle: dict
:param Lifecycle:
The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.
Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
- **MoveToColdStorageAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is moved to cold storage.
- **DeleteAfterDays** *(integer) --*
Specifies the number of days after creation that a recovery point is deleted. Must be greater than ``MoveToColdStorageAfterDays`` .
:rtype: dict
:returns:
"""
pass
|
tests/test_models.py
|
abitrolly/stellar5
| 932 |
114676
|
from stellar.models import get_unique_hash, Table, Snapshot
def test_get_unique_hash():
assert get_unique_hash()
assert get_unique_hash() != get_unique_hash()
assert len(get_unique_hash()) == 32
def test_table():
table = Table(
table_name='hapsu',
snapshot=Snapshot(
snapshot_name='snapshot',
project_name='myproject',
hash='3330484d0a70eecab84554b5576b4553'
)
)
assert len(table.get_table_name('master')) == 24
|
helper_scripts/components/parse_v4l2_header.py
|
fengjixuchui/difuze
| 347 |
114678
|
from base_component import *
import os
import xml.etree.ElementTree as ET
class ParseV4L2Headers(Component):
"""
Component which parses the v4l2 headers to get ioctl function pointer structure members.
"""
def __init__(self, value_dict):
c2xml_path = None
kernel_src_dir = None
makeout_file = None
separate_out = None
v4l2_func_list_file = None
v4l2_id_cmd_out = None
opt_bin_path = None
llvm_bc_out = ""
v4l2_config_processor_so = None
if 'c2xml_bin' in value_dict:
c2xml_path = value_dict['c2xml_bin']
if 'kernel_src_dir' in value_dict:
kernel_src_dir = value_dict['kernel_src_dir']
if 'makeout' in value_dict:
makeout_file = value_dict['makeout']
if 'out' in value_dict:
separate_out = value_dict['out']
if 'v4l2_func_list' in value_dict:
v4l2_func_list_file = value_dict['v4l2_func_list']
if 'llvm_bc_out' in value_dict:
llvm_bc_out = value_dict["llvm_bc_out"]
if 'v4l2_id_cmd_out' in value_dict:
v4l2_id_cmd_out = value_dict['v4l2_id_cmd_out']
if 'opt_bin_path' in value_dict:
opt_bin_path = value_dict['opt_bin_path']
if 'v4l2_config_processor_so' in value_dict:
v4l2_config_processor_so = value_dict['v4l2_config_processor_so']
self.kernel_src_dir = kernel_src_dir
self.c2xml_path = c2xml_path
self.makeout_file = makeout_file
self.separate_out = separate_out
self.v4l2_func_list_file = v4l2_func_list_file
self.v4l2_id_cmd_out = v4l2_id_cmd_out
self.opt_bin_path = opt_bin_path
self.llvm_bc_out = llvm_bc_out
self.v4l2_config_processor_so = v4l2_config_processor_so
def setup(self):
"""
Perform setup.
:return: Error msg or none
"""
if not os.path.exists(self.v4l2_config_processor_so):
return "Provided v4l2 config processor so path:" + str(self.v4l2_config_processor_so) + " does not exist."
if not os.path.exists(self.c2xml_path):
return "Provided c2xml path:" + str(self.c2xml_path) + " does not exist."
if not os.path.isdir(self.kernel_src_dir) or not os.path.isdir(os.path.join(self.kernel_src_dir, 'include')):
return "Provided kernel src directory is invalid. " \
"The base directory is not present or it does not contain include folder"
if self.v4l2_func_list_file is None:
return "No file specified to output v4l2 func list."
if not os.path.exists(self.opt_bin_path):
return "Provided opt bin path:" + str(self.opt_bin_path) + " does not exist."
if self.v4l2_id_cmd_out is None:
return "No file specified to output v4l2 id -> cmdid list."
return None
def perform(self):
"""
Parse the headers
:return: True or False
"""
v4l2_hdr_file = os.path.join(self.kernel_src_dir, "include/media/v4l2-ioctl.h")
if os.path.exists(v4l2_hdr_file):
log_success("Grep ran successfully to find ops and operations structures.")
log_info("Running c2xml to find entry point configurations.")
target_bc_file = os.path.join(self.llvm_bc_out, "drivers/media/v4l2-core/v4l2-ioctl.llvm.bc")
if not os.path.exists(target_bc_file):
log_error("Unable to find v4l2 base bitcode file:" + str(target_bc_file))
return False
# second, run c2xml on all the header files.
if self.separate_out is None:
self.separate_out = self.kernel_src_dir
ret_val = _run_c2xml(self.c2xml_path, self.makeout_file, v4l2_hdr_file, self.v4l2_func_list_file,
dst_work_dir=self.separate_out)
if ret_val:
ret_val = os.system(self.opt_bin_path + " -analyze -debug -load " + self.v4l2_config_processor_so +
' -v4l2-config-processor -v4l2config=\"' +
self.v4l2_func_list_file + '\" -v4l2idconfig=\"' + self.v4l2_id_cmd_out + '\" ' +
target_bc_file)
return ret_val == 0
return ret_val
# if ret_val:
else:
log_error("Unable to find v4l2 hdr file:" + str(v4l2_hdr_file))
def get_name(self):
"""
get component name.
:return: Str
"""
return "ParseV4L2Headers"
def is_critical(self):
"""
This component is not critical.
:return: False
"""
return False
gcc_bins = ['aarch64-linux-android-gcc', 'arm-eabi-gcc']
def _is_comp_binary(arg_zero):
global gcc_bins
for curr_c in gcc_bins:
if str(arg_zero).endswith(curr_c):
return True
return False
def _handle_compile_command(comp_str, dst_includes):
comp_args = comp_str.split()
i = 0
while i < len(comp_args):
curr_arg = comp_args[i].strip()
if curr_arg == "-isystem":
curr_arg1 = "-I" + comp_args[i+1].strip()
if curr_arg1 not in dst_includes:
dst_includes.append(curr_arg1)
if curr_arg == "-include":
curr_arg1 = comp_args[i+1].strip()
if "dhd_sec_feature.h" not in curr_arg1:
final_arg = curr_arg + " " + curr_arg1
if final_arg not in dst_includes:
dst_includes.append(final_arg)
if curr_arg[0:2] == "-I":
if curr_arg not in dst_includes:
if 'drivers' not in curr_arg and 'sound' not in curr_arg:
dst_includes.append(curr_arg)
i += 1
def _run_c2xml(c2xml_bin, makeout_file, target_v4l2_hdr, output_file, dst_work_dir=None):
fp = open(makeout_file, "r")
all_comp_lines = fp.readlines()
fp.close()
all_hdr_options = list()
all_hdr_options.append("-Iinclude")
for comp_line in all_comp_lines:
comp_line = comp_line.strip()
comp_args = comp_line.split()
if len(comp_args) > 2:
if _is_comp_binary(comp_args[0]) or _is_comp_binary(comp_args[1]):
_handle_compile_command(comp_line, all_hdr_options)
all_hdr_options.append("-D__KERNEL__")
all_hdr_files = [target_v4l2_hdr]
dummy_out_file = "/tmp/dummy_out.xml"
output_fp = open(output_file, "w")
for curr_hdr_file in all_hdr_files:
curr_hdr_file = curr_hdr_file.strip()
cmd_line = " ".join(all_hdr_options)
cmd_line = c2xml_bin + " " + cmd_line + " " + curr_hdr_file + " > " + dummy_out_file + " 2>/dev/null"
back_wd = os.getcwd()
if dst_work_dir is not None:
os.chdir(dst_work_dir)
# print "Running Command:" + cmd_line
os.system(cmd_line)
if os.path.exists(dummy_out_file) and os.stat(dummy_out_file).st_size > 0:
root = ET.parse(dummy_out_file).getroot()
for curr_s in root:
if curr_s.get("type") == "struct" and curr_s.get("file") == curr_hdr_file and \
curr_s.get("ident") == "v4l2_ioctl_ops":
child_no = 0
for child_s in curr_s:
target_fun_name = child_s.get("ident")
output_fp.write(target_fun_name + "," + str(child_no) + "\n")
child_no += 1
if dst_work_dir is not None:
os.chdir(back_wd)
output_fp.close()
return True
|
examples/eigenfaces/demo.py
|
DeepanChakravarthiPadmanabhan/paz_coco
| 300 |
114707
|
import os
import argparse
import numpy as np
import processors as pe
from paz.backend.camera import VideoPlayer
from paz.backend.camera import Camera
from demo_pipeline import DetectEigenFaces
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Real-time face classifier')
parser.add_argument('-c', '--camera_id', type=int, default=0,
help='Camera device ID')
parser.add_argument('-o', '--offset', type=float, default=0.1,
help='Scaled offset to be added to bounding boxes')
parser.add_argument('-e', '--experiments_path', type=str,
default='experiments',
help='Directory for writing and loading experiments')
parser.add_argument('-d', '--database_path', type=str,
default='database',
help='Directory for the database')
args = parser.parse_args()
if not os.path.exists(args.experiments_path):
os.makedirs(args.experiments_path)
if not os.path.exists(args.database_path):
os.makedirs(args.database_path)
# check if eigenfaces and mean face are already computed
needed_files = ['eigenvalues.npy', 'eigenfaces.npy', 'mean_face.npy']
if set(os.listdir(args.experiments_path)) != set(needed_files):
raise FileNotFoundError('''Need necessary files to run the demo. Please
run eigenface.py first and then try running the
demo.''')
# check if database is available
needed_files = ['images', 'database.npy']
if set(os.listdir(args.database_path)) != set(needed_files):
raise FileNotFoundError('''Need database to run the demo. Please
update the database with database.py first
and then try running the demo.''')
eigenfaces = np.load(os.path.join(args.experiments_path, 'eigenfaces.npy'))
mean_face = np.load(os.path.join(args.experiments_path, 'mean_face.npy'))
database_path = os.path.join(args.database_path, 'database.npy')
weights = np.load(database_path, allow_pickle=True).item()
# user defined parameters
thresh = 1e4
norm_order = 2
# measure = pe.CalculateNorm(norm_order)
measure = pe.CalculateCosineSimilarity()
pipeline = DetectEigenFaces(weights, measure, thresh, eigenfaces,
mean_face, [args.offset, args.offset])
camera = Camera(args.camera_id)
player = VideoPlayer((640, 480), pipeline, camera)
player.run()
|
test/hlt/pytest/python/com/huawei/iotplatform/client/dto/OperationStaResult.py
|
yuanyi-thu/AIOT-
| 128 |
114743
|
class OperationStaResult(object):
def __init__(self):
self.total = None
self.wait = None
self.processing = None
self.success = None
self.fail = None
self.stop = None
self.timeout = None
def getTotal(self):
return self.total
def setTotal(self, total):
self.total = total
def getWait(self):
return self.wait
def setWait(self, wait):
self.wait = wait
def getProcessing(self):
return self.processing
def setProcessing(self, processing):
self.processing = processing
def getSuccess(self):
return self.success
def setSuccess(self, success):
self.success = success
def getFail(self):
return self.fail
def setFail(self, fail):
self.fail = fail
def getStop(self):
return self.stop
def setStop(self, stop):
self.stop = stop
def getTimeout(self):
return self.timeout
def setTimeout(self, timeout):
self.timeout = timeout
|
voctocore/tests/commands/test_get_audio.py
|
0xflotus/voctomix
| 521 |
114745
|
import json
from mock import ANY
from lib.response import OkResponse
from tests.commands.commands_test_base import CommandsTestBase
class GetAudioTest(CommandsTestBase):
def test_get_audio(self):
self.pipeline_mock.amix.getAudioVolumes.return_value = [1.0, 0.0, 0.25]
response = self.commands.get_audio()
self.assertIsInstance(response, OkResponse)
self.assertEqual(response.args, ('audio_status', ANY))
self.assertEqual(json.loads(response.args[1]), {
"cam1": 1.0,
"cam2": 0.0,
"grabber": 0.25
})
|
ldaptor/dns.py
|
scottcarr/ldaptor
| 133 |
114778
|
"""DNS-related utilities."""
from socket import inet_aton, inet_ntoa
import struct
def aton_octets(ip):
s = inet_aton(ip)
return struct.unpack("!I", s)[0]
def aton_numbits(num):
n = 0
while num > 0:
n >>= 1
n |= 2 ** 31
num -= 1
return n
def aton(ip):
try:
i = int(ip)
except ValueError:
return aton_octets(ip)
else:
return aton_numbits(i)
def ntoa(n):
s = struct.pack("!I", n)
ip = inet_ntoa(s)
return ip
def netmaskToNumbits(netmask):
bits = aton(netmask)
i = 2 ** 31
n = 0
while bits and i > 0:
if (bits & i) == 0:
if bits:
raise RuntimeError("Invalid netmask: %s" % netmask)
n += 1
bits -= i
i = i >> 1
return n
def ptrSoaName(ip, netmask):
"""
Convert an IP address and netmask to a CIDR delegation
-style zone name.
"""
net = aton(ip) & aton(netmask)
nmBits = netmaskToNumbits(netmask)
bytes, bits = divmod(nmBits, 8)
octets = ntoa(net).split(".")
octets.reverse()
if not bits:
octets = octets[-bytes:]
else:
partial = octets[-bytes - 1]
octets = octets[-bytes:]
octets.insert(0, "%s/%d" % (partial, nmBits))
return ".".join(octets) + ".in-addr.arpa."
|
datasets/cifar.py
|
takuhirok/rGAN
| 103 |
114779
|
import os
import sys
if sys.version_info[0] == 2:
import cPickle as pickle
else:
import pickle
import numpy as np
import torch
import torchvision.datasets as datasets
class CIFAR10NoisyLabels(datasets.CIFAR10):
"""CIFAR10 Dataset with noisy labels.
Args:
noise_type (string): Noise type (default: 'symmetric').
The value is either 'symmetric' or 'asymmetric'.
noise_rate (float): Probability of label corruption (default: 0.0).
seed (int): Random seed (default: 12345).
This is a subclass of the `CIFAR10` Dataset.
"""
def __init__(self,
noise_type='symmetric',
noise_rate=0.0,
seed=12345,
**kwargs):
super(CIFAR10NoisyLabels, self).__init__(**kwargs)
self.seed = seed
self.num_classes = 10
self.flip_pairs = np.asarray([[9, 1], [2, 0], [4, 7], [3, 5], [5, 3]])
if noise_rate > 0:
if noise_type == 'symmetric':
self.symmetric_noise(noise_rate)
elif noise_type == 'asymmetric':
self.asymmetric_noise(noise_rate)
else:
raise ValueError(
'expected noise_type is either symmetric or asymmetric '
'(got {})'.format(noise_type))
def symmetric_noise(self, noise_rate):
"""Insert symmetric noise.
For all classes, ground truth labels are replaced with uniform random
classes.
"""
np.random.seed(self.seed)
targets = np.array(self.targets)
mask = np.random.rand(len(targets)) <= noise_rate
rnd_targets = np.random.choice(self.num_classes, mask.sum())
targets[mask] = rnd_targets
targets = [int(target) for target in targets]
self.targets = targets
def asymmetric_noise(self, noise_rate):
"""Insert asymmetric noise.
Ground truth labels are flipped by mimicking real mistakes between
similar classes. Following `Making Deep Neural Networks Robust to Label Noise: a Loss Correction Approach`_,
ground truth labels are replaced with
* truck -> automobile,
* bird -> airplane,
* deer -> horse
* cat -> dog
* dog -> cat
.. _Making Deep Neural Networks Robust to Label Noise: a Loss Correction Approach
https://arxiv.org/abs/1609.03683
"""
np.random.seed(self.seed)
targets = np.array(self.targets)
for i, target in enumerate(targets):
if target in self.flip_pairs[:, 0]:
if np.random.uniform(0, 1) <= noise_rate:
idx = int(np.where(self.flip_pairs[:, 0] == target)[0])
targets[i] = self.flip_pairs[idx, 1]
targets = [int(x) for x in targets]
self.targets = targets
def T(self, noise_type, noise_rate):
if noise_type == 'symmetric':
T = (torch.eye(self.num_classes) * (1 - noise_rate) +
(torch.ones([self.num_classes, self.num_classes]) /
self.num_classes * noise_rate))
elif noise_type == 'asymmetric':
T = torch.eye(self.num_classes)
for i, j in self.flip_pairs:
T[i, i] = 1 - noise_rate
T[i, j] = noise_rate
return T
class CIFAR100NoisyLabels(datasets.CIFAR100):
"""CIFAR100 Dataset with noisy labels.
Args:
noise_type (string): Noise type (default: 'symmetric').
The value is either 'symmetric' or 'asymmetric'.
noise_rate (float): Probability of label corruption (default: 0.0).
seed (int): Random seed (default: 12345).
This is a subclass of the `CIFAR100` Dataset.
"""
def __init__(self,
noise_type='synmetric',
noise_rate=0.0,
seed=12345,
**kwargs):
super(CIFAR100NoisyLabels, self).__init__(**kwargs)
self.seed = seed
self.num_classes = 100
self.num_superclasses = 20
if noise_rate > 0:
if noise_type == 'symmetric':
self.symmetric_noise(noise_rate)
elif noise_type == 'asymmetric':
self.asymmetric_noise(noise_rate)
else:
raise ValueError(
'expected noise_type is either symmetric or asymmetric '
'(got {})'.format(noise_type))
def symmetric_noise(self, noise_rate):
"""Symmetric noise in CIFAR100.
For all classes, ground truth labels are replaced with uniform random
classes.
"""
np.random.seed(self.seed)
targets = np.array(self.targets)
mask = np.random.rand(len(targets)) <= noise_rate
rnd_targets = np.random.choice(self.num_classes, mask.sum())
targets[mask] = rnd_targets
targets = [int(x) for x in targets]
self.targets = targets
def asymmetric_noise(self, noise_rate):
"""Insert asymmetric noise.
Ground truth labels are flipped by mimicking real mistakes between
similar classes. Following `Making Deep Neural Networks Robust to Label Noise: a Loss Correction Approach`_,
ground truth labels are flipped into the next class circularly within
the same superclasses
.. _Making Deep Neural Networks Robust to Label Noise: a Loss Correction Approach
https://arxiv.org/abs/1609.03683
"""
np.random.seed(self.seed)
targets = np.array(self.targets)
Tdata = self.T('asymmetric', noise_rate).numpy().astype(np.float64)
Tdata = Tdata / np.sum(Tdata, axis=1)[:, None]
for i, target in enumerate(targets):
one_hot = np.random.multinomial(1, Tdata[target, :], 1)[0]
targets[i] = np.where(one_hot == 1)[0]
targets = [int(x) for x in targets]
self.targets = targets
def _load_coarse_targets(self):
if self.train:
downloaded_list = self.train_list
else:
downloaded_list = self.test_list
coarse_targets = []
for file_name, checksum in downloaded_list:
file_path = os.path.join(self.root, self.base_folder, file_name)
with open(file_path, 'rb') as f:
if sys.version_info[0] == 2:
entry = pickle.load(f)
else:
entry = pickle.load(f, encoding='latin1')
coarse_targets.extend(entry['coarse_labels'])
return coarse_targets
def T(self, noise_type, noise_rate):
if noise_type == 'symmetric':
T = (torch.eye(self.num_classes) * (1 - noise_rate) +
(torch.ones([self.num_classes, self.num_classes]) /
self.num_classes * noise_rate))
elif noise_type == 'asymmetric':
num_classes = self.num_classes
num_superclasses = self.num_superclasses
num_subclasses = num_classes // num_superclasses
targets = np.array(self.targets)
coarse_targets = np.asarray(self._load_coarse_targets())
T = torch.eye(num_classes) * (1 - noise_rate)
for i in range(num_superclasses):
subclass_targets = np.unique(targets[coarse_targets == i])
clean = subclass_targets
noisy = np.concatenate([clean[1:], clean[:1]])
for j in range(num_subclasses):
T[clean[j], noisy[j]] = noise_rate
return T
|
corehq/apps/toggle_ui/admin.py
|
omari-funzone/commcare-hq
| 471 |
114780
|
from django.contrib import admin
from corehq.apps.toggle_ui.models import ToggleAudit
@admin.register(ToggleAudit)
class ToggleAdmin(admin.ModelAdmin):
date_hierarchy = 'created'
list_display = ('username', 'slug', 'action', 'namespace', 'item', 'randomness')
list_filter = ('slug', 'namespace')
ordering = ('created',)
|
app/codeEvaluator.py
|
Vikum94/pslab-remote
| 1,129 |
114843
|
from __future__ import print_function
import sys,inspect
import numpy as np
from flask import json
from collections import OrderedDict
class Evaluator:
def __init__(self,functionList):
self.generatedApp=[]
self.hasPlot=False
self.itemList=[]
self.evalGlobals={}
self.functionList = functionList
self.evalGlobals = functionList.copy()
self.evalGlobals['print_']=self.printer
self.evalGlobals['print']=self.print
self.evalGlobals['button']=self.button
self.evalGlobals['label']=self.label
self.evalGlobals['plot']=self.plot
def toUnique(self,identifier,suffix=0): #Make any ID string unique. returns new string.
newId = identifier+str(suffix) if suffix else identifier
if newId in self.itemList:
return self.toUnique(identifier,suffix+1)
return newId
def print(self,*args):
'''
For now, the print function is being overloaded in order to capture the console output.
Future plans will store each line of execution as a json object. This approach will increase flexibility,
and outputs more than just text, such as images and widgets can be created.
'''
name=self.toUnique("print")
self.generatedApp.append({"type":"text","name":name,"value":[str(a) for a in args]})
self.itemList.append(name)
return name
def printer(self,txt,name="print"):
name=self.toUnique(name)
self.generatedApp.append({"type":"span","name":name,"class":"row well","value":str(txt)})
self.itemList.append(name)
return name
def label(self,txt,name="print",html_class=""):
name=self.toUnique(name)
self.generatedApp.append({"type":"label","name":name,"class":html_class,"value":str(txt)})
self.itemList.append(name)
return name
def button(self,label,endpoint,displayType="display_number",**kwargs):
name = kwargs.get("name","button-id")
name=self.toUnique(name)
self.itemList.append(name)
targetName = kwargs.get('target',name+'-label')
if 'target' not in kwargs: #If a target was not specified, make up a name
targetName = self.toUnique(name+'-label')
successOpts={"datapoint":'result',"type":displayType,"target":targetName}
if displayType=='update-plot': # specify the stacking of data
successOpts['stacking']=kwargs.get('stacking','xy')
self.generatedApp.append({"type":"button", "name":name,"label":label,"fetched_value":"","action":{"type":"POST","endpoint":endpoint,"success":successOpts}})
if 'target' not in kwargs: #If a target was not specified, make a label.
if displayType in ["display_number","display"]:
self.label('',targetName)
return name
#Plots
def plot(self,x,y,**kwargs):
name = kwargs.get('name',self.toUnique('myPlot'))
self.generatedApp.append({"type":"plot","name":name,"data":[np.array([x,y]).T.tolist()]}) #jqplot requires [x,y] pairs . not separate datasets.
self.itemList.append(name)
return name
def runCode(self,code):
self.generatedApp=[]
self.itemList=[]
submitted = compile(code.encode(), '<string>', mode='exec')
self.exec_scope = self.evalGlobals.copy()
try:
exec(submitted, self.exec_scope)
except Exception as e:
print(str(e))
return self.getApp()
def getApp(self):
return self.generatedApp
#### Extract Doc Strings ####
def getDocs(self):
flist = []
for a in self.functionList.keys():
if a[:2]=='__':continue
doc = ''
try:
doc = inspect.getdoc(self.functionList[a])
arglist = inspect.getargspec(self.functionList[a]).args
except Exception as e:
print(a,e)
continue
arglist.remove('self')
flist.append({'doc_string':str(doc),'name':a,'args':arglist})
return flist
|
tests/commands/dev/conftest.py
|
chuckyQ/briefcase
| 917 |
114855
|
<reponame>chuckyQ/briefcase<filename>tests/commands/dev/conftest.py
from unittest import mock
import pytest
from briefcase.commands import DevCommand
from briefcase.config import AppConfig
@pytest.fixture
def dev_command(tmp_path):
command = DevCommand(base_path=tmp_path)
command.subprocess = mock.MagicMock()
return command
@pytest.fixture
def first_app_uninstalled(tmp_path):
# Make sure the source code exists
(tmp_path / "src" / "first").mkdir(parents=True, exist_ok=True)
with (tmp_path / "src" / "first" / "__init__.py").open("w") as f:
f.write('print("Hello world")')
return AppConfig(
app_name="first",
bundle="com.example",
version="0.0.1",
description="The first simple app",
sources=["src/first"],
)
@pytest.fixture
def first_app(tmp_path, first_app_uninstalled):
# The same fixture as first_app_uninstalled,
# but ensures that the .dist-info folder for the app exists
(tmp_path / "src" / "first.dist-info").mkdir(exist_ok=True)
return first_app_uninstalled
@pytest.fixture
def second_app(tmp_path):
# Make sure the source code exists
(tmp_path / "src" / "second").mkdir(parents=True, exist_ok=True)
with (tmp_path / "src" / "second" / "__init__.py").open("w") as f:
f.write('print("Hello world")')
# Create the dist-info folder
(tmp_path / "src" / "second.dist-info").mkdir(exist_ok=True)
return AppConfig(
app_name="second",
bundle="com.example",
version="0.0.2",
description="The second simple app",
sources=["src/second"],
)
@pytest.fixture
def third_app(tmp_path):
# Make sure the source code exists
(tmp_path / "src" / "third").mkdir(parents=True, exist_ok=True)
with (tmp_path / "src" / "third" / "__init__.py").open("w") as f:
f.write('print("Hello world")')
# Create the dist-info folder
(tmp_path / "src" / "third.dist-info").mkdir(exist_ok=True)
return AppConfig(
app_name="third",
bundle="com.example",
version="0.0.2",
description="The third simple app",
sources=["src/third", "src/common", "other"],
)
|
gluoncv/data/transforms/presets/imagenet.py
|
Kh4L/gluon-cv
| 5,447 |
114865
|
"""Transforms for ImageNet series."""
from __future__ import absolute_import
import mxnet as mx
from mxnet.gluon.data.vision import transforms
__all__ = ['transform_eval']
def transform_eval(imgs, resize_short=256, crop_size=224,
mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)):
"""A util function to transform all images to tensors as network input by applying
normalizations. This function support 1 NDArray or iterable of NDArrays.
Parameters
----------
imgs : NDArray or iterable of NDArray
Image(s) to be transformed.
resize_short : int, default=256
Resize image short side to this value and keep aspect ratio.
crop_size : int, default=224
After resize, crop the center square of size `crop_size`
mean : iterable of float
Mean pixel values.
std : iterable of float
Standard deviations of pixel values.
Returns
-------
mxnet.NDArray or list of such tuple
A (1, 3, H, W) mxnet NDArray as input to network
If multiple image names are supplied, return a list.
"""
if isinstance(imgs, mx.nd.NDArray):
imgs = [imgs]
for im in imgs:
assert isinstance(im, mx.nd.NDArray), "Expect NDArray, got {}".format(type(im))
transform_fn = transforms.Compose([
transforms.Resize(resize_short, keep_ratio=True),
transforms.CenterCrop(crop_size),
transforms.ToTensor(),
transforms.Normalize(mean, std)
])
res = [transform_fn(img).expand_dims(0) for img in imgs]
if len(res) == 1:
return res[0]
return res
|
docs/pyplots/volumetrics.py
|
ValtoGameEngines/Intrinsic-Engine
| 1,176 |
114882
|
<filename>docs/pyplots/volumetrics.py
import matplotlib.pyplot as plt
import numpy as np
exp = 2.0
near = 1.0
far = 10000.0
volumeDepth = 128.0
def volumeZToDepth(z):
return np.power(z / volumeDepth, exp) * far + near
t1 = np.arange(0.0, volumeDepth, 1.0)
plt.plot(t1, volumeZToDepth(t1), 'bo', t1, volumeZToDepth(t1), 'k')
plt.ylabel('Depth')
plt.xlabel('Volume Z')
plt.show()
|
src/lib/shelve.py
|
DTenore/skulpt
| 2,671 |
114886
|
<filename>src/lib/shelve.py
import _sk_fail; _sk_fail._("shelve")
|
sdk/python/pulumi_aws/chime/__init__.py
|
chivandikwa/pulumi-aws
| 260 |
114965
|
# 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! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from .voice_connector import *
from .voice_connector_group import *
from .voice_connector_logging import *
from .voice_connector_organization import *
from .voice_connector_streaming import *
from .voice_connector_termination import *
from .voice_connector_termination_credentials import *
from ._inputs import *
from . import outputs
|
tools/constraint.py
|
fsanges/glTools
| 165 |
114982
|
import maya.mel as mm
import maya.cmds as mc
import maya.OpenMaya as OpenMaya
import glTools.utils.base
import glTools.utils.component
import glTools.utils.constraint
import glTools.utils.mathUtils
import glTools.utils.mesh
import glTools.utils.reference
import glTools.utils.stringUtils
import glTools.utils.transform
import types
def bake( constraint,
start = None,
end = None,
sampleBy = 1,
simulation = True ):
'''
Bake specified constraint
@param constraint: Constraint to bake animation for.
@type constraint: str
@param start: Start frame of bake animation range
@type start: float or None
@param end: End frame of bake animation range
@type end: float or None
@param sampleBy: Sample every Nth frame
@type sampleBy: int
@param simulation: Simulation option for bakeResults
@type simulation: bool
'''
# ==========
# - Checks -
# ==========
# Check Constraint
if not glTools.utils.constraint.isConstraint(constraint):
raise Exception('Object "'+constraint+'" is not a valid constraint node!')
# Check Start/End Frames
if start == None: start = mc.playbackOptions(q=True,min=True)
if end == None: end = mc.playbackOptions(q=True,max=True)
# ====================================
# - Get Slave Transform and Channels -
# ====================================
# Get Slave Transform
slave = glTools.utils.constraint.slave(constraint)
# Get Slave Channels
attrList = mc.listConnections(constraint,s=False,d=True,p=True) or []
slaveAttrs = [i.split('.')[-1] for i in attrList if i.startswith(slave+'.')] or []
if not slaveAttrs: raise Exception('No slave channels to bake!')
# ===================
# - Bake Constraint -
# ===================
mc.refresh(suspend=True)
mc.bakeResults( slave,
at = slaveAttrs,
time = (start,end),
disableImplicitControl = True,
simulation = simulation,
sampleBy = sampleBy )
mc.refresh(suspend=False)
# =================
# - Return Result -
# =================
return [slave+'.'+i for i in slaveAttrs]
def aimConstraint( target,
slave,
aim='z',
up='y',
worldUpType='scene',
worldUpObject=None,
worldUpVector='y',
offset=(0,0,0),
mo=False ):
'''
Create an aim constraint between the specifiec master and slave transforms.
Only constrains open, settable channels.
@param master: Constraint master transform.
@type master: str
@param slave: Constraint slave transform.
@type slave: str
@param aim: Aim axis.
@type aim: str
@param aim: Up axis.
@type aim: str
@param worldUpType: World Up type. Options - "scene", "object", "objectrotation", "vector", or "none".
@type worldUpType: str
@param worldUpObject: World Up object.
@type worldUpObject: str
@param worldUpVector: World Up vector.
@type worldUpVector: str
@param mo: Maintain constraint offset
@type mo: bool
'''
# Build Axis Dict
axis = {'x':(1,0,0),'y':(0,1,0),'z':(0,0,1),'-x':(-1,0,0),'-y':(0,-1,0),'-z':(0,0,-1)}
# ==========
# - Checks -
# ==========
# Check Master
if not mc.objExists(target):
raise Exception('Constraint target "'+target+'" does not exist!')
if not glTools.utils.transform.isTransform(target):
raise Exception('Constraint target "'+target+'" is not a valid transform!')
# Check Slave
if not mc.objExists(slave):
raise Exception('Constraint slave "'+slave+'" does not exist!')
if not glTools.utils.transform.isTransform(slave):
raise Exception('Constraint slave "'+slave+'" is not a valid transform!')
# Check Settable Channels
sk = []
if not mc.getAttr(slave+'.rx',se=True): sk.append('x')
if not mc.getAttr(slave+'.ry',se=True): sk.append('y')
if not mc.getAttr(slave+'.rz',se=True): sk.append('z')
if not sk: sk = 'none'
# =====================
# - Create Constraint -
# =====================
constraint = ''
try:
if worldUpObject:
constraint = mc.aimConstraint( target,
slave,
aim=axis[aim],
u=axis[aim],
worldUpType=worldUpType,
worldUpObject=worldUpObject,
worldUpVector=axis[worldUpVector],
sk=sk,
offset=offset,
mo=mo)[0]
else:
constraint = mc.aimConstraint( target,
slave,
aim=axis[aim],
u=axis[aim],
worldUpType=worldUpType,
worldUpVector=axis[worldUpVector],
sk=sk,
offset=offset,
mo=mo)[0]
except Exception, e:
raise Exception('Error creating constraint from "'+target+'" to "'+slave+'"! Exception msg: '+str(e))
# =================
# - Return Result -
# =================
return constraint
def pointConstraint(master,slave,mo=False,attrList=['tx','ty','tz']):
'''
Create a point constraint between the specifiec master and slave transforms.
Only constrains open, settable channels.
@param master: Constraint master transform.
@type master: str
@param slave: Constraint slave transform.
@type slave: str
@param mo: Maintain constraint offset
@type mo: bool
@param attrList: List of transform attributes to constrain.
@type attrList: list
'''
# ==========
# - Checks -
# ==========
# Check Target (Master)
if isinstance(master,types.StringTypes):
if not mc.objExists(master):
raise Exception('Constraint target "'+master+'" does not exist!')
if not glTools.utils.transform.isTransform(master):
raise Exception('Constraint target "'+master+'" is not a valid transform!')
elif isinstance(master,types.ListType):
for target in master:
if not mc.objExists(target):
raise Exception('Constraint target "'+target+'" does not exist!')
if not glTools.utils.transform.isTransform(target):
raise Exception('Constraint target "'+target+'" is not a valid transform!')
# Check Slave
if not mc.objExists(slave):
raise Exception('Constraint slave "'+slave+'" does not exist!')
if not glTools.utils.transform.isTransform(slave):
raise Exception('Constraint slave "'+slave+'" is not a valid transform!')
# Check Settable Channels
st = []
if not 'tx' in attrList or not mc.getAttr(slave+'.tx',se=True): st.append('x')
if not 'ty' in attrList or not mc.getAttr(slave+'.ty',se=True): st.append('y')
if not 'tz' in attrList or not mc.getAttr(slave+'.tz',se=True): st.append('z')
if not st: st = 'none'
# Skip All Check
if len(st) == 3:
print('No axis to constrain! Unable to create constraint...')
return None
# =====================
# - Create Constraint -
# =====================
constraint = ''
try: constraint = mc.pointConstraint(master,slave,sk=st,mo=mo)[0]
except Exception, e:
raise Exception('Error creating constraint from "'+master+'" to "'+slave+'"! Exception msg: '+str(e))
# =================
# - Return Result -
# =================
return constraint
def orientConstraint(master,slave,mo=False,attrList=['rx','ry','rz']):
'''
Create a point constraint between the specifiec master and slave transforms.
Only constrains open, settable channels.
@param master: Constraint master transform.
@type master: str
@param slave: Constraint slave transform.
@type slave: str
@param mo: Maintain constraint offset
@type mo: bool
@param attrList: List of transform attributes to constrain.
@type attrList: list
'''
# ==========
# - Checks -
# ==========
# Check Target (Master)
if isinstance(master,types.StringTypes):
if not mc.objExists(master):
raise Exception('Constraint target "'+master+'" does not exist!')
if not glTools.utils.transform.isTransform(master):
raise Exception('Constraint target "'+master+'" is not a valid transform!')
elif isinstance(master,types.ListType):
for target in master:
if not mc.objExists(target):
raise Exception('Constraint target "'+target+'" does not exist!')
if not glTools.utils.transform.isTransform(target):
raise Exception('Constraint target "'+target+'" is not a valid transform!')
# Check Slave
if not mc.objExists(slave):
raise Exception('Constraint slave "'+slave+'" does not exist!')
if not glTools.utils.transform.isTransform(slave):
raise Exception('Constraint slave "'+slave+'" is not a valid transform!')
# Check Settable Channels
sr = []
if not 'rx' in attrList or not mc.getAttr(slave+'.rx',se=True): sr.append('x')
if not 'ry' in attrList or not mc.getAttr(slave+'.ry',se=True): sr.append('y')
if not 'rz' in attrList or not mc.getAttr(slave+'.rz',se=True): sr.append('z')
if not st: st = 'none'
# Skip All Check
if len(sr) == 3:
print('No axis to constrain! Unable to create constraint...')
return None
# =====================
# - Create Constraint -
# =====================
constraint = ''
try: constraint = mc.orientConstraint(master,slave,sk=sr,mo=mo)[0]
except Exception, e:
raise Exception('Error creating constraint from "'+master+'" to "'+slave+'"! Exception msg: '+str(e))
# =================
# - Return Result -
# =================
return constraint
def parentConstraint(master,slave,mo=False,attrList=['tx','ty','tz','rx','ry','rz']):
'''
Create a parent constraint between the specifiec master and slave transforms.
Only constrains open, settable channels.
@param master: Constraint master transform.
@type master: str or list
@param slave: Constraint slave transform.
@type slave: str
@param mo: Maintain constraint offset
@type mo: bool
@param attrList: List of transform attributes to constrain.
@type attrList: list
'''
# ==========
# - Checks -
# ==========
# Check Target (Master)
if isinstance(master,types.StringTypes):
if not mc.objExists(master):
raise Exception('Constraint target "'+master+'" does not exist!')
if not glTools.utils.transform.isTransform(master):
raise Exception('Constraint target "'+master+'" is not a valid transform!')
elif isinstance(master,types.ListType):
for target in master:
if not mc.objExists(target):
raise Exception('Constraint target "'+target+'" does not exist!')
if not glTools.utils.transform.isTransform(target):
raise Exception('Constraint target "'+target+'" is not a valid transform!')
# Check Slave
if not mc.objExists(slave):
raise Exception('Constraint slave "'+slave+'" does not exist!')
if not glTools.utils.transform.isTransform(slave):
raise Exception('Constraint slave "'+slave+'" is not a valid transform!')
# Check Settable Channels
st = []
sr = []
if not 'tx' in attrList or not mc.getAttr(slave+'.tx',se=True): st.append('x')
if not 'ty' in attrList or not mc.getAttr(slave+'.ty',se=True): st.append('y')
if not 'tz' in attrList or not mc.getAttr(slave+'.tz',se=True): st.append('z')
if not 'rx' in attrList or not mc.getAttr(slave+'.rx',se=True): sr.append('x')
if not 'ry' in attrList or not mc.getAttr(slave+'.ry',se=True): sr.append('y')
if not 'rz' in attrList or not mc.getAttr(slave+'.rz',se=True): sr.append('z')
if not st: st = 'none'
if not sr: sr = 'none'
# =====================
# - Create Constraint -
# =====================
constraint = ''
try: constraint = mc.parentConstraint(master,slave,st=st,sr=sr,mo=mo)[0]
except Exception, e:
raise Exception('Error creating constraint from "'+master+'" to "'+slave+'"! Exception msg: '+str(e))
# =================
# - Return Result -
# =================
return constraint
def scaleConstraint(master,slave,mo=False,force=False,attrList=['sx','sy','sz']):
'''
Create a scale constraint between the specified master and slave transforms.
Only constrains open, settable channels.
@param master: Constraint master transform.
@type master: str
@param slave: Constraint slave transform.
@type slave: str
@param mo: Maintain constraint offset
@type mo: bool
@param force: Force constraint by deleteing scale channel keys. Use with caution!
@type force: bool
@param attrList: List of transform attributes to constrain.
@type attrList: list
'''
# ==========
# - Checks -
# ==========
# Check Master
if not mc.objExists(master):
raise Exception('Constraint master "'+master+'" does not exist!')
if not glTools.utils.transform.isTransform(master):
raise Exception('Constraint master "'+master+'" is not a valid transform!')
# Check Slave
if not mc.objExists(slave):
raise Exception('Constraint slave "'+slave+'" does not exist!')
if not glTools.utils.transform.isTransform(slave):
raise Exception('Constraint slave "'+slave+'" is not a valid transform!')
# Check Settable Channels
sk = []
if not 'sx' in attrList or not mc.getAttr(slave+'.sx',se=True): sk.append('x')
if not 'sy' in attrList or not mc.getAttr(slave+'.sy',se=True): sk.append('y')
if not 'sz' in attrList or not mc.getAttr(slave+'.sz',se=True): sk.append('z')
if not sk: st = 'none'
# Check All
if len(sk) == 3:
print('All scale channels locked! Unable to add constraint')
return None
# =====================
# - Create Constraint -
# =====================
if force: mc.cutKey(slave,at=attrList)
constraint = ''
try: constraint = mc.scaleConstraint(master,slave,sk=sk,mo=mo)[0]
except Exception, e:
#raise Exception('Error creating constraint from "'+master+'" to "'+slave+'"! Exception msg: '+str(e))
print('Error creating constraint from "'+master+'" to "'+slave+'"! Exception msg: '+str(e))
constraint = None
# =================
# - Return Result -
# =================
return constraint
def nonReferencedConstraints(slaveNSfilter=None,targetNSfilter=None):
'''
Return a list of non referenced constraint nodes in the current scene.
Optionally, filter results by slave and/or target namespace.
@param slaveNSfilter: Constraint slave transform namespace filter list.
@type slaveNSfilter: list
@param targetNSfilter: Constraint target transform namespace filter list.
@type targetNSfilter: list
'''
# =========================
# - Get Scene Constraints -
# =========================
sceneConstraints = mc.ls(type='constraint')
if not sceneConstraints: return []
# Filter Nonreferenced Constraints
nonRefConstraints = []
for constraint in sceneConstraints:
if not glTools.utils.reference.isReferenced(constraint):
if not constraint in nonRefConstraints:
nonRefConstraints.append(constraint)
# =================
# - Filter Result -
# =================
# Slave Namespace Filter
if slaveNSfilter:
for constraint in nonRefConstraints:
filterOut = True
constraintSlave = glTools.utils.constraint.slaveList(constraint)
for slave in constraintSlave:
if not ':' in slave: slave = ':'+slave
slaveNS = slave.split(':')[0]
if slaveNS in slaveNSfilter: filterOut = False
if filterOut:
nonRefConstraints.remove(constraint)
# Master Namespace Filter
if targetNSfilter:
for constraint in nonRefConstraints:
filterOut = True
constraintTarget = glTools.utils.constraint.targetList(constraint)
for target in constraintTarget:
if not ':' in target: target = ':'+target
targetNS = target.split(':')[0]
if targetNS in targetNSfilter: filterOut = False
if filterOut:
nonRefConstraints.remove(constraint)
# =================
# - Return Result -
# =================
return nonRefConstraints
def listReferenceDependents():
'''
'''
pass
def listReferenceDependencies():
'''
'''
pass
def translateOffsetTarget(target,offset,slave,prefix=None):
'''
Create a translate offset target constraint (parentConstraint).
The slave will follow the target in rotation only and the offset in translation.
Used mainly for specific IK pole vector target setup.
@param target: Constraint target.
@type target: str
@param offset: Offset target to follow in translation.
@type offset: str
@param slave: Slave transform to create constraint for.
@type slave: str
@param prefix: Naming prefix.
@type prefix: str or None
'''
# ==========
# - Checks -
# ==========
# Target
if not mc.objExists(target):
raise Exception('Target transform "'+target+'" does not exist!')
if not glTools.utils.transform.isTransform(target):
raise Exception('Target object "'+target+'" is not a valid tranform!')
# Offset
if not mc.objExists(offset):
raise Exception('Offset transform "'+offset+'" does not exist!')
if not glTools.utils.transform.isTransform(offset):
raise Exception('Offset object "'+offset+'" is not a valid tranform!')
# Slave
if not mc.objExists(slave):
raise Exception('Slave transform "'+slave+'" does not exist!')
if not glTools.utils.transform.isTransform(slave):
raise Exception('Slave object "'+slave+'" is not a valid tranform!')
# Prefix
if not prefix: prefix = glTools.utils.stringUtils.stripSuffix(slave)
# ====================
# - Build Constraint -
# ====================
# Parent Slave to Target
mc.delete(parentConstraint(target,slave))
mc.parent(slave,target)
# Create Offset Constraint
offsetConstraint = mc.pointConstraint(offset,slave,mo=True)[0]
offsetConstraint = mc.rename(offsetConstraint,prefix+'_offset_pointConstraint')
# =================
# - Return Result -
# =================
return offsetConstraint
def pointOnPolyConstraintCmd(pt):
'''
Generate a pointOnPolyConstraint setup command string.
@param pt: Mesh point to generate pointOnPolyConstraint command for.
@type pt: str
'''
# ==================
# - Initialize Cmd -
# ==================
cmd = ''
# ===============================
# - Get Mesh from Point on Poly -
# ===============================
fullname = mc.ls(pt,o=True)[0]
mesh = fullname.split(':')[-1]
meshSN = mesh.split('|')[-1]
# Get Mesh Component ID
meshID = glTools.utils.component.index(pt)
prevID = OpenMaya.MScriptUtil()
prevID.createFromInt(0)
prevIDPtr = prevID.asIntPtr()
# =======================
# - Constrain to Vertex -
# =======================
if '.vtx[' in pt:
# Initialize MItMeshVertex
meshIt = glTools.utils.mesh.getMeshVertexIter(mesh)
meshIt.setIndex(meshID,prevIDPtr)
# Get Vertex UV
uv = OpenMaya.MScriptUtil()
uv.createFromDouble(0.0)
uvPtr = uv.asFloat2Ptr()
meshIt.getUV(uvPtr)
uv = [ OpenMaya.MScriptUtil.getFloat2ArrayItem(uvPtr,0,j) for j in [0,1] ]
cmd += '; setAttr ($constraint[0]+".%sU%d") %f; setAttr ($constraint[0]+".%sV%d") %f' % ( meshSN, 0, uv[0], meshSN, 0, uv[1] )
# =====================
# - Constrain to Edge -
# =====================
elif '.e[' in pt:
# Initialize MItMeshEdge
meshIt = glTools.utils.mesh.getMeshEdgeIter(mesh)
meshIt.setIndex(meshID,prevIDPtr)
# Get Edge/Vertices UV
vtx = [ meshIt.index( j ) for j in [0,1] ]
vtxIt = glTools.utils.mesh.getMeshVertexIter(mesh)
uvs = []
for v in vtx:
vtxIt.setIndex(v,prevIDPtr)
uv = OpenMaya.MScriptUtil()
uv.createFromDouble( 0.0 )
uvPtr = uv.asFloat2Ptr()
vtxIt.getUV(uvPtr)
uvs.append( [ OpenMaya.MScriptUtil.getFloat2ArrayItem(uvPtr,0,j) for j in [0,1] ] )
uv = [ 0.5*(uvs[0][j]+uvs[1][j]) for j in [0,1] ]
cmd += '; setAttr ($constraint[0]+".%sU%d") %f; setAttr ($constraint[0]+".%sV%d") %f' % ( meshSN, 0, uv[0], meshSN, 0, uv[1] )
# =====================
# - Constrain to Face -
# =====================
elif '.f[' in pt:
# Initialize MItMeshface
meshIt = glTools.utils.mesh.getMeshFaceIter(mesh)
meshIt.setIndex(meshID,prevIDPtr)
# Get Face UV
u, v = OpenMaya.MFloatArray(), OpenMaya.MFloatArray()
meshIt.getUVs( u, v )
uv = ( sum(u)/len(u), sum(v)/len(v) )
cmd += '; setAttr ($constraint[0]+".%sU%d") %f; setAttr ($constraint[0]+".%sV%d") %f' % ( meshSN, 0, uv[0], meshSN, 0, uv[1] )
# =================
# - Return Result -
# =================
return cmd
|
ProofOfConcepts/Vision/OpenMvMaskDefaults/finetune.py
|
WoodData/EndpointAI
| 190 |
115007
|
<gh_stars>100-1000
import sys
import argparse
import torch
import torch.nn as nn
import torchvision
import numpy as np
import lightly.cli as cli
import lightly.data as data
import lightly.models as models
from classifier import Classifier
from utils import calculate_class_weight
# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument('--data', type=str, default='',
help='Path to directory which contains training images')
parser.add_argument('--test_data', type=str, default='',
help='Path to directory which contains test images')
parser.add_argument('--pretrained', type=str, default='checkpoints/pretrained.ckpt',
help='Path to the pretrained model checkpoint')
parser.add_argument('--finetuned', type=str, default='checkpoints/finetuned.pt',
help='Path to the finetuned model checkpoint (output)')
parser.add_argument('--batch_size', type=str, default=200,
help='Batch size for training')
parser.add_argument('--epochs', type=int, default=100,
help='Number of iterations through the whole dataset')
parser.add_argument('--model', type=str, default='resnet-9',
help='ResNet version')
parser.add_argument('--width', type=float, default=0.125,
help='Width of the ResNet')
parser.add_argument('--input_dim', type=int, default=64,
help='Input dimension of the training images')
parser.add_argument('--num_ftrs', type=int, default=16,
help='Dimension of the feature representations.')
parser.add_argument('--output_dim', type=int, default=3,
help='Output dimension of the ResNet (number of logits)')
parser.add_argument('--classifier_lr', type=float, default=1e-0,
help='Learning rate for the linear layer of the classifier')
parser.add_argument('--features_lr', type=float, default=1e-5,
help='Learning rate for the (pretrained) feature extractor')
parser.add_argument('--momentum', type=float, default=0.9,
help='Momentum for SGD')
parser.add_argument('--weight_decay', type=float, default=5e-4,
help='L2 regularization')
parser.add_argument('--color_jitter', type=float, default=0.25,
help='Strength of color-jitter transformation of training image')
parser.add_argument('--min_scale', type=float, default=0.9,
help='Minimum scale for randomized resized crop of training image')
parser.add_argument('--p_horizontal_flip', type=float, default=0.5,
help='Probability of flipping training image horizontally')
parser.add_argument('--p_vertical_flip', type=float, default=0.5,
help='Probability of flipping training image vertically')
parser.add_argument('--seed', type=int, default=1234,
help='Random seed.')
args = parser.parse_args()
if not args.data:
print('Please specify training data using the --data argument.')
print('Example: python finetune.py --data path/to/training/data')
sys.exit()
# reseed
np.random.seed(args.seed)
torch.manual_seed(args.seed)
torch.cuda.manual_seed(args.seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
# cuda?
device = 'cuda' if torch.cuda.is_available() else 'cpu'
print('Finetuning on device: %s' % (device))
# helper
def filter_state_dict(state_dict):
new_state_dict = {}
for key, item in state_dict.items():
new_key = '.'.join(key.split('.')[1:])
new_state_dict[new_key] = item
return new_state_dict
# initialize pretrained resnet
resnet = models.ResNetGenerator(args.model, args.width)
last_conv_channels = list(resnet.children())[-1].in_features
resnet = nn.Sequential(
models.batchnorm.get_norm_layer(3, 0),
*list(resnet.children())[:-1],
nn.Conv2d(last_conv_channels, args.num_ftrs, 1),
nn.AdaptiveAvgPool2d(1),
)
model = models.SimCLR(
resnet,
num_ftrs=args.num_ftrs,
)
if args.pretrained:
state_dict = torch.load(args.pretrained, map_location=device)['state_dict']
cli._helpers.load_from_state_dict(model, state_dict)
else:
print('No checkpoint was specified, weights will be initialized randomly')
# initialize classifier
classifier = Classifier(
model,
input_dim=args.input_dim,
output_dim=args.output_dim
).to(device)
# augmentations
augmentations = [
torchvision.transforms.ColorJitter(
brightness=args.color_jitter,
contrast=args.color_jitter,
saturation=args.color_jitter,
hue=args.color_jitter,
),
torchvision.transforms.RandomResizedCrop(
args.input_dim,
scale=(args.min_scale, 1.)
),
torchvision.transforms.RandomHorizontalFlip(
p=args.p_horizontal_flip
),
torchvision.transforms.RandomVerticalFlip(
p=args.p_vertical_flip
),
torchvision.transforms.ToTensor(),
]
transforms = torchvision.transforms.Compose(augmentations)
# load training data
dataset = data.LightlyDataset(
input_dir=args.data,
transform=transforms)
dataloader = torch.utils.data.DataLoader(
dataset,
batch_size=args.batch_size,
shuffle=True
)
# class weights
labels = [label for _, label, _ in dataset]
weight = calculate_class_weight(labels)
weight = torch.FloatTensor(weight).to(device)
# criterion
criterion = nn.CrossEntropyLoss(weight=weight)
# optimizer
parameter_groups = [
{
'params': classifier.classifier.parameters(),
'lr': args.classifier_lr
},
{
'params': classifier.features.parameters(),
'lr': args.features_lr
},
]
optimizer = torch.optim.SGD(
parameter_groups,
lr=0.1,
momentum=args.momentum,
weight_decay=args.weight_decay,
)
# training
def train_epoch(avg_loss, avg_accuracy):
for batch, target, _ in dataloader:
batch = batch.to(device)
target = target.to(device)
optimizer.zero_grad()
output = classifier(batch)
loss = criterion(output, target)
loss.backward()
optimizer.step()
_, label = output.max(-1)
accuracy = (target == label).float().mean().item()
avg_loss = loss.item() if avg_loss is None else avg_loss
avg_loss = 0.9 * avg_loss + 0.1 * loss.item()
avg_accuracy = accuracy if avg_accuracy is None else avg_accuracy
avg_accuracy = 0.9 * avg_accuracy + 0.1 * accuracy
return avg_loss, avg_accuracy
loss, accuracy = None, None
for e in range(1, args.epochs + 1):
loss, accuracy = train_epoch(loss, accuracy)
print('[Epoch %3d] Loss (running avg) %.3f, Accuracy (running avg) %.3f' %
(e, loss, accuracy))
# save checkpoint
print('Finetuning finished! Storing checkpoint at %s' % (args.finetuned))
classifier.eval()
torch.save(classifier.state_dict(), args.finetuned)
# test
if not args.test_data:
print('If you want to test the finetuned model, specify a test dataset with --test_data')
print('Example: python finetune.py --data path/to/training/data --test_data path/to/test/data')
sys.exit()
transformations = [
torchvision.transforms.Resize(args.input_dim),
torchvision.transforms.ToTensor(),
]
transforms = torchvision.transforms.Compose(transformations)
testset = data.LightlyDataset(
input_dir=args.test_data,
transform=transforms,
)
testloader = torch.utils.data.DataLoader(
testset,
batch_size=1,
)
with torch.no_grad():
test_loss, test_accuracy = 0., 0.
for batch, target, _ in testloader:
batch = batch.to(device)
target = target.to(device)
output = classifier(batch)
loss = criterion(output, target)
_, label = output.max(-1)
accuracy = (target == label).float().mean().item()
test_loss += loss.item() / len(testset)
test_accuracy += accuracy / len(testset)
print('[Test] Loss %.3f, Accuracy %.3f' % (test_loss, test_accuracy))
|
dataset/mnist.py
|
vahidk/TensorflowFramework
| 129 |
115073
|
<reponame>vahidk/TensorflowFramework<gh_stars>100-1000
"""Mnist dataset preprocessing and specifications."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import matplotlib.pyplot as plt
import numpy as np
import os
from six.moves import urllib
import struct
import sys
import tensorflow as tf
from common import dataset
from common import misc_utils
REMOTE_URL = "http://yann.lecun.com/exdb/mnist/"
LOCAL_DIR = "data/mnist/"
TRAIN_IMAGE_URL = "train-images-idx3-ubyte.gz"
TRAIN_LABEL_URL = "train-labels-idx1-ubyte.gz"
TEST_IMAGE_URL = "t10k-images-idx3-ubyte.gz"
TEST_LABEL_URL = "t10k-labels-idx1-ubyte.gz"
IMAGE_SIZE = 28
NUM_CLASSES = 10
class Mnist(dataset.AbstractDataset):
def get_params(self):
return {
"image_size": IMAGE_SIZE,
"num_classes": NUM_CLASSES,
}
def prepare(self, params):
"""This function will be called once to prepare the dataset."""
if not os.path.exists(LOCAL_DIR):
os.makedirs(LOCAL_DIR)
for name in [
TRAIN_IMAGE_URL,
TRAIN_LABEL_URL,
TEST_IMAGE_URL,
TEST_LABEL_URL]:
if not os.path.exists(LOCAL_DIR + name):
urllib.request.urlretrieve(REMOTE_URL + name, LOCAL_DIR + name)
def read(self, split, params):
"""Create an instance of the dataset object."""
image_urls = {
"train": TRAIN_IMAGE_URL,
"eval": TEST_IMAGE_URL
}[split]
label_urls = {
"train": TRAIN_LABEL_URL,
"eval": TEST_LABEL_URL
}[split]
with gzip.open(LOCAL_DIR + image_urls, "rb") as f:
_, num, rows, cols = struct.unpack(">IIII", f.read(16))
images = np.frombuffer(f.read(num * rows * cols), dtype=np.uint8)
images = np.reshape(images, [num, rows, cols, 1])
print("Loaded %d images of size [%d, %d]." % (num, rows, cols))
with gzip.open(LOCAL_DIR + label_urls, "rb") as f:
_, num = struct.unpack(">II", f.read(8))
labels = np.frombuffer(f.read(num), dtype=np.int8).astype(np.int32)
print("Loaded %d labels." % num)
return tf.data.Dataset.from_tensor_slices((images, labels))
def parse(self, mode, params, image, label):
"""Parse input record to features and labels."""
image = tf.cast(image, tf.float32)
image = tf.reshape(image, [IMAGE_SIZE, IMAGE_SIZE, 1])
# image = tf.image.per_image_standardization(image)
return {"image": image}, {"label": label}
dataset.DatasetFactory.register("mnist", Mnist)
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python dataset.mnist <convert|visualize>")
sys.exit(1)
if sys.argv[1] == "download":
d = Mnist()
d.prepare(misc_utils.Tuple(d.get_params()))
else:
print("Unknown command", sys.argv[1])
|
mayan/apps/tags/tests/test_document_tag_api.py
|
atitaya1412/Mayan-EDMS
| 343 |
115104
|
<gh_stars>100-1000
from rest_framework import status
from mayan.apps.documents.tests.mixins.document_mixins import DocumentTestMixin
from mayan.apps.rest_api.tests.base import BaseAPITestCase
from ..events import event_tag_attached, event_tag_removed
from ..permissions import (
permission_tag_attach, permission_tag_remove, permission_tag_view
)
from .mixins import TagAPIViewTestMixin, TagTestMixin
class DocumentTagAPIViewTestCase(
DocumentTestMixin, TagAPIViewTestMixin, TagTestMixin, BaseAPITestCase
):
auto_upload_test_document = False
def setUp(self):
super().setUp()
self._create_test_tag()
self._create_test_document_stub()
def test_document_attach_tag_api_view_no_permission(self):
self._clear_events()
response = self._request_test_document_tag_attach_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertTrue(self.test_tag not in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_attach_tag_api_view_with_document_access(self):
self.grant_access(
obj=self.test_document, permission=permission_tag_attach
)
self._clear_events()
response = self._request_test_document_tag_attach_api_view()
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertTrue(self.test_tag not in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_attach_tag_api_view_with_tag_access(self):
self.grant_access(
obj=self.test_tag, permission=permission_tag_attach
)
self._clear_events()
response = self._request_test_document_tag_attach_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertTrue(self.test_tag not in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_attach_tag_api_view_with_full_access(self):
self.grant_access(
obj=self.test_document, permission=permission_tag_attach
)
self.grant_access(
obj=self.test_tag, permission=permission_tag_attach
)
self._clear_events()
response = self._request_test_document_tag_attach_api_view()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertTrue(self.test_tag in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 1)
self.assertEqual(events[0].action_object, self.test_tag)
self.assertEqual(events[0].actor, self._test_case_user)
self.assertEqual(events[0].target, self.test_document)
self.assertEqual(events[0].verb, event_tag_attached.id)
def test_trashed_document_attach_tag_api_view_with_full_access(self):
self.grant_access(
obj=self.test_document, permission=permission_tag_attach
)
self.grant_access(
obj=self.test_tag, permission=permission_tag_attach
)
self.test_document.delete()
self._clear_events()
response = self._request_test_document_tag_attach_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertTrue(self.test_tag not in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_list_api_view_no_permission(self):
self.test_tag.documents.add(self.test_document)
self._clear_events()
response = self._request_test_document_tag_list_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_list_api_view_with_document_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(
obj=self.test_document, permission=permission_tag_view
)
self._clear_events()
response = self._request_test_document_tag_list_api_view()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['count'], 0)
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_list_api_view_with_tag_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(obj=self.test_tag, permission=permission_tag_view)
self._clear_events()
response = self._request_test_document_tag_list_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_list_api_view_with_full_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(
obj=self.test_document, permission=permission_tag_view
)
self.grant_access(obj=self.test_tag, permission=permission_tag_view)
self._clear_events()
response = self._request_test_document_tag_list_api_view()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['results'][0]['label'], self.test_tag.label)
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_trashed_document_tag_list_api_view_with_full_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(
obj=self.test_document, permission=permission_tag_view
)
self.grant_access(obj=self.test_tag, permission=permission_tag_view)
self.test_document.delete()
self._clear_events()
response = self._request_test_document_tag_list_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_remove_api_view_no_permission(self):
self.test_tag.documents.add(self.test_document)
self._clear_events()
response = self._request_test_document_tag_remove_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertTrue(self.test_tag in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_remove_api_view_with_document_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(
obj=self.test_document, permission=permission_tag_remove
)
self._clear_events()
response = self._request_test_document_tag_remove_api_view()
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertTrue(self.test_tag in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_remove_api_view_with_tag_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(obj=self.test_tag, permission=permission_tag_remove)
self._clear_events()
response = self._request_test_document_tag_remove_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertTrue(self.test_tag in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
def test_document_tag_remove_api_view_with_full_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(
obj=self.test_document, permission=permission_tag_remove
)
self.grant_access(obj=self.test_tag, permission=permission_tag_remove)
self._clear_events()
response = self._request_test_document_tag_remove_api_view()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertFalse(self.test_tag in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 1)
self.assertEqual(events[0].action_object, self.test_tag)
self.assertEqual(events[0].actor, self._test_case_user)
self.assertEqual(events[0].target, self.test_document)
self.assertEqual(events[0].verb, event_tag_removed.id)
def test_trashed_document_tag_remove_api_view_with_full_access(self):
self.test_tag.documents.add(self.test_document)
self.grant_access(
obj=self.test_document, permission=permission_tag_remove
)
self.grant_access(obj=self.test_tag, permission=permission_tag_remove)
self.test_document.delete()
self._clear_events()
response = self._request_test_document_tag_remove_api_view()
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertTrue(self.test_tag in self.test_document.tags.all())
events = self._get_test_events()
self.assertEqual(events.count(), 0)
|
src/sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py
|
fchapoton/sage
| 1,742 |
115114
|
<filename>src/sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py<gh_stars>1000+
## -*- encoding: utf-8 -*-
"""
This file (./sol/linalg_doctest.sage) was *autogenerated* from ./sol/linalg.tex,
with sagetex.sty version 2011/05/27 v2.3.1.
It contains the contents of all the sageexample environments from this file.
You should be able to doctest this file with:
sage -t ./sol/linalg_doctest.sage
It is always safe to delete this file; it is not used in typesetting your
document.
Sage example in ./sol/linalg.tex, line 89::
sage: A = matrix(GF(7),[[0,0,3,0,0],[1,0,6,0,0],[0,1,5,0,0],
....: [0,0,0,0,5],[0,0,0,1,5]])
sage: P = A.minpoly(); P
x^5 + 4*x^4 + 3*x^2 + 3*x + 1
sage: P.factor()
(x^2 + 2*x + 2) * (x^3 + 2*x^2 + x + 4)
Sage example in ./sol/linalg.tex, line 100::
sage: e1 = identity_matrix(GF(7),5)[0]
sage: e4 = identity_matrix(GF(7),5)[3]
sage: A.transpose().maxspin(e1)
[(1, 0, 0, 0, 0), (0, 1, 0, 0, 0), (0, 0, 1, 0, 0)]
sage: A.transpose().maxspin(e4)
[(0, 0, 0, 1, 0), (0, 0, 0, 0, 1)]
sage: A.transpose().maxspin(e1 + e4)
[(1, 0, 0, 1, 0), (0, 1, 0, 0, 1), (0, 0, 1, 5, 5),
(3, 6, 5, 4, 2), (1, 5, 3, 3, 0)]
Sage example in ./sol/linalg.tex, line 168::
sage: def Similar(A, B):
....: F1, U1 = A.frobenius(2)
....: F2, U2 = B.frobenius(2)
....: if F1 == F2:
....: return True, ~U2*U1
....: else:
....: return False, F1 - F2
sage: B = matrix(ZZ, [[0,1,4,0,4],[4,-2,0,-4,-2],[0,0,0,2,1],
....: [-4,2,2,0,-1],[-4,-2,1,2,0]])
sage: U = matrix(ZZ, [[3,3,-9,-14,40],[-1,-2,4,2,1],[2,4,-7,-1,-13],
....: [-1,0,1,4,-15],[-4,-13,26,8,30]])
sage: A = (U^-1 * B * U).change_ring(ZZ)
sage: ok, V = Similar(A, B); ok
True
sage: V
[ 1 2824643/1601680 -6818729/1601680 -43439399/11211760 73108601/11211760]
[ 0 342591/320336 -695773/320336 -2360063/11211760 -10291875/2242352]
[ 0 -367393/640672 673091/640672 -888723/4484704 15889341/4484704]
[ 0 661457/3203360 -565971/3203360 13485411/22423520 -69159661/22423520]
[ 0 -4846439/3203360 7915157/3203360 -32420037/22423520 285914347/22423520]
sage: ok, V = Similar(2*A, B); ok
False
"""
|
calendars/holidays/utils/anglorules.py
|
gusamarante/Quantequim
| 296 |
115140
|
<filename>calendars/holidays/utils/anglorules.py
from pandas.tseries.holiday import Holiday, next_monday_or_tuesday, \
sunday_to_monday, MO
from pandas.tseries.offsets import DateOffset
NewYearsDay = Holiday('New Year´s Day', month=1, day=1,
observance=sunday_to_monday)
UKEarlyMayBank = Holiday('Early May Bank Holiday', month=5, day=1,
offset=DateOffset(weekday=MO(1)))
UKSpringBank = Holiday('Spring Bank Holiday', month=5, day=31,
offset=DateOffset(weekday=MO(-1)))
USIndependenceDay = Holiday('US Independence Day', month=7, day=4,
observance=sunday_to_monday)
UKLateSummerBank = Holiday('Late Summer Bank Holiday', month=8, day=31,
offset=DateOffset(weekday=MO(-1)))
USVeteransDay = Holiday('US Veteran´s Day', month=11, day=11,
observance=sunday_to_monday)
Christmas = Holiday('Christmas', month=12, day=25, observance=sunday_to_monday)
BoxingDay = Holiday('BoxingDay', month=12, day=26,
observance=next_monday_or_tuesday)
|
lwh/21/encrpyt.py
|
saurabh896/python-1
| 3,976 |
115150
|
from hashlib import sha256
from hmac import HMAC
import os
class Encrypt(object):
def encrypt(self, password, salt=None):
if salt is None:
salt = os.urandom(8)
result = password.encode('utf-8')
for i in range(10):
result = HMAC(result, salt, sha256).digest()
return salt + result
def vaildate(self, password, hashed):
return hashed == self.encrypt(password, salt=hashed[:8])
if __name__ == '__main__':
obj = Encrypt()
hashed = obj.encrypt('wh5622')
# print(bytes.decode(hashed))
ans = obj.vaildate('wh5622', hashed)
print(ans)
|
pymagnitude/third_party/allennlp/tests/data/token_indexers/character_token_indexer_test.py
|
tpeng/magnitude
| 1,520 |
115152
|
# pylint: disable=no-self-use,invalid-name
from __future__ import absolute_import
from collections import defaultdict
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data import Token, Vocabulary
from allennlp.data.token_indexers import TokenCharactersIndexer
from allennlp.data.tokenizers.character_tokenizer import CharacterTokenizer
class CharacterTokenIndexerTest(AllenNlpTestCase):
def test_count_vocab_items_respects_casing(self):
indexer = TokenCharactersIndexer(u"characters")
counter = defaultdict(lambda: defaultdict(int))
indexer.count_vocab_items(Token(u"Hello"), counter)
indexer.count_vocab_items(Token(u"hello"), counter)
assert counter[u"characters"] == {u"h": 1, u"H": 1, u"e": 2, u"l": 4, u"o": 2}
indexer = TokenCharactersIndexer(u"characters", CharacterTokenizer(lowercase_characters=True))
counter = defaultdict(lambda: defaultdict(int))
indexer.count_vocab_items(Token(u"Hello"), counter)
indexer.count_vocab_items(Token(u"hello"), counter)
assert counter[u"characters"] == {u"h": 2, u"e": 2, u"l": 4, u"o": 2}
def test_as_array_produces_token_sequence(self):
indexer = TokenCharactersIndexer(u"characters")
padded_tokens = indexer.pad_token_sequence({u'k': [[1, 2, 3, 4, 5], [1, 2, 3], [1]]},
desired_num_tokens={u'k': 4},
padding_lengths={u"num_token_characters": 10})
assert padded_tokens == {u'k': [[1, 2, 3, 4, 5, 0, 0, 0, 0, 0],
[1, 2, 3, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}
def test_tokens_to_indices_produces_correct_characters(self):
vocab = Vocabulary()
vocab.add_token_to_namespace(u"A", namespace=u'characters')
vocab.add_token_to_namespace(u"s", namespace=u'characters')
vocab.add_token_to_namespace(u"e", namespace=u'characters')
vocab.add_token_to_namespace(u"n", namespace=u'characters')
vocab.add_token_to_namespace(u"t", namespace=u'characters')
vocab.add_token_to_namespace(u"c", namespace=u'characters')
indexer = TokenCharactersIndexer(u"characters")
indices = indexer.tokens_to_indices([Token(u"sentential")], vocab, u"char")
assert indices == {u"char": [[3, 4, 5, 6, 4, 5, 6, 1, 1, 1]]}
|
plex_mpv_shim/gdm.py
|
aelfa/plex-mpv-shim
| 231 |
115153
|
"""
PlexGDM.py - Version 0.3
This class implements the Plex GDM (G'Day Mate) protocol to discover
local Plex Media Servers. Also allow client registration into all local
media servers.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
"""
__author__ = 'DHJ (hippojay) <<EMAIL>>'
import socket
import struct
import threading
import time
import urllib.request, urllib.error, urllib.parse
from .conf import settings
class PlexGDM:
def __init__(self, debug=0):
self.discover_message = b'M-SEARCH * HTTP/1.0'
self.client_header = b'* HTTP/1.0'
self.client_data = None
self.client_id = None
self._multicast_address = '192.168.127.12'
self.discover_group = (self._multicast_address, 32414)
self.client_register_group = (self._multicast_address, 32413)
self.client_update_port = 32412
self.server_list = []
self.discovery_interval = 120
self._discovery_is_running = False
self._registration_is_running = False
self.discovery_complete = False
self.client_registered = False
self.debug = debug
def __printDebug(self, message, level=1):
if self.debug >= level:
print("PlexGDM: %s" % message)
def clientDetails(self, c_id, c_name, c_port, c_product, c_version):
capabilities = b"timeline,playback,navigation"
if settings.enable_play_queue:
capabilities = b"timeline,playback,navigation,playqueues"
data = {
b"Name": str(c_name).encode("utf-8"),
b"RawName": str(c_name).encode("utf-8"),
b"Port": str(c_port).encode("utf-8"),
b"Content-Type": b"plex/media-player",
b"Product": str(c_product).encode("utf-8"),
b"Protocol": b"plex",
b"Protocol-Version": b"1",
b"Protocol-Capabilities": capabilities,
b"Version": str(c_version).encode("utf-8"),
b"Resource-Identifier": str(c_id).encode("utf-8"),
b"Device-Class": b"pc"
}
self.client_data = b""
for key, value in list(data.items()):
self.client_data += b"%s: %s\n" % (key, value)
self.client_data = self.client_data.strip()
self.client_id = c_id
def getClientDetails(self):
if not self.client_data:
self.__printDebug("Client data has not been initialised. Please use PlexGDM.clientDetails()")
return self.client_data
def client_update(self):
update_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
# Set socket reuse, may not work on all OSs.
try:
update_sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
except:
pass
# Attempt to bind to the socket to receive and send data. If we can;t do this, then we cannot send registration
try:
update_sock.bind(('0.0.0.0', self.client_update_port))
except:
self.__printDebug("Error: Unable to bind to port [%s] -"
" client will not be registered" % self.client_update_port, 0)
return
update_sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 255)
update_sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP,
socket.inet_aton(self._multicast_address) + socket.inet_aton('0.0.0.0'))
update_sock.setblocking(False)
self.__printDebug("Sending registration data: HELLO %s\n%s" % (self.client_header, self.client_data), 3)
# Send initial client registration
try:
update_sock.sendto(b"HELLO %s\n%s" % (self.client_header, self.client_data), self.client_register_group)
except:
self.__printDebug("Error: Unable to send registration message", 0)
# Now, listen for client discovery reguests and respond.
while self._registration_is_running:
try:
data, addr = update_sock.recvfrom(1024)
self.__printDebug("Received UDP packet from [%s] containing [%s]" % (addr, data.strip()), 3)
except socket.error:
pass
else:
if b"M-SEARCH * HTTP/1." in data:
self.__printDebug("Detected client discovery request from %s. Replying" % (addr,), 2)
try:
update_sock.sendto(b"HTTP/1.0 200 OK\n%s" % self.client_data, addr)
except:
self.__printDebug("Error: Unable to send client update message", 0)
self.__printDebug("Sending registration data: HTTP/1.0 200 OK\n%s" % self.client_data, 3)
self.client_registered = True
time.sleep(0.5)
self.__printDebug("Client Update loop stopped", 1)
# When we are finished, then send a final goodbye message to deregister cleanly.
self.__printDebug("Sending registration data: BYE %s\n%s" % (self.client_header, self.client_data), 3)
try:
update_sock.sendto(b"BYE %s\n%s" % (self.client_header, self.client_data), self.client_register_group)
except:
self.__printDebug( "Error: Unable to send client update message" ,0)
self.client_registered = False
def check_client_registration(self):
if self.client_registered and self.discovery_complete:
if not self.server_list:
self.__printDebug("Server list is empty. Unable to check",2)
return False
try:
media_server=self.server_list[0]['server']
media_port=self.server_list[0]['port']
self.__printDebug("Checking server [%s] on port [%s]" % (media_server, media_port) ,2)
f = urllib.request.urlopen('http://%s:%s/clients' % (media_server, media_port))
client_result = f.read()
if self.client_id in client_result:
self.__printDebug("Client registration successful",1)
self.__printDebug("Client data is: %s" % client_result, 3)
return True
else:
self.__printDebug("Client registration not found",1)
self.__printDebug("Client data is: %s" % client_result, 3)
except:
self.__printDebug("Unable to check status")
pass
return False
def setInterval(self, interval):
self.discovery_interval = interval
def stop_all(self):
self.stop_registration()
def stop_registration(self):
if self._registration_is_running:
self.__printDebug("Registration shutting down", 1)
self._registration_is_running = False
self.register_t.join()
del self.register_t
else:
self.__printDebug("Registration not running", 1)
def start_registration(self, daemon = False):
if not self._registration_is_running:
self.__printDebug("Registration starting up", 1)
self._registration_is_running = True
self.register_t = threading.Thread(target=self.client_update)
self.register_t.setDaemon(daemon)
self.register_t.start()
else:
self.__printDebug("Registration already running", 1)
def start_all(self, daemon = False):
self.start_registration(daemon)
gdm = PlexGDM()
|
scripts/parse_elapsed.py
|
disktnk/chainer-compiler
| 116 |
115157
|
#!/usr/bin/env python3
#
# Usage:
#
# $ ./scripts/runtests.py -g onnx_real --show_log |& tee log
# $ ./scripts/parse_elapsed.py log
import re
import sys
tests = {}
cur_test = None
with open(sys.argv[1]) as f:
for line in f:
m = re.match(r'^Running for out/onnx_real_(.*?)/', line)
if m:
cur_test = m.group(1)
continue
m = re.match(r'^Elapsed: (\d+\.\d+)', line)
if m:
tests[cur_test] = float(m.group(1))
for name, elapsed in sorted(tests.items()):
print('%s %s' % (name, elapsed))
|
qiskit/transpiler/passes/utils/remove_barriers.py
|
Roshan-Thomas/qiskit-terra
| 1,599 |
115177
|
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
"""Remove all barriers in a circuit"""
from qiskit.dagcircuit import DAGCircuit
from qiskit.transpiler.basepasses import TransformationPass
class RemoveBarriers(TransformationPass):
"""Return a circuit with any barrier removed.
This transformation is not semantics preserving.
Example:
.. jupyter-execute::
from qiskit import QuantumCircuit
from qiskit.transpiler.passes import RemoveBarriers
circuit = QuantumCircuit(1)
circuit.x(0)
circuit.barrier()
circuit.h(0)
circuit = RemoveBarriers()(circuit)
circuit.draw()
"""
def run(self, dag: DAGCircuit) -> DAGCircuit:
"""Run the RemoveBarriers pass on `dag`."""
dag.remove_all_ops_named("barrier")
return dag
|
youtube_dlc/extractor/gedi.py
|
mrysn/yt-dlc
| 3,001 |
115183
|
<filename>youtube_dlc/extractor/gedi.py
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
base_url,
url_basename,
urljoin,
)
class GediBaseIE(InfoExtractor):
@staticmethod
def _clean_audio_fmts(formats):
unique_formats = []
for f in formats:
if 'acodec' in f:
unique_formats.append(f)
formats[:] = unique_formats
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
player_data = re.findall(
r'PlayerFactory\.setParam\(\'(?P<type>.+?)\',\s*\'(?P<name>.+?)\',\s*\'(?P<val>.+?)\'\);',
webpage)
formats = []
audio_fmts = []
hls_fmts = []
http_fmts = []
title = ''
thumb = ''
fmt_reg = r'(?P<t>video|audio)-(?P<p>rrtv|hls)-(?P<h>[\w\d]+)(?:-(?P<br>[\w\d]+))?$'
br_reg = r'video-rrtv-(?P<br>\d+)-'
for t, n, v in player_data:
if t == 'format':
m = re.match(fmt_reg, n)
if m:
# audio formats
if m.group('t') == 'audio':
if m.group('p') == 'hls':
audio_fmts.extend(self._extract_m3u8_formats(
v, video_id, 'm4a', m3u8_id='hls', fatal=False))
elif m.group('p') == 'rrtv':
audio_fmts.append({
'format_id': 'mp3',
'url': v,
'tbr': 128,
'ext': 'mp3',
'vcodec': 'none',
'acodec': 'mp3',
})
# video formats
elif m.group('t') == 'video':
# hls manifest video
if m.group('p') == 'hls':
hls_fmts.extend(self._extract_m3u8_formats(
v, video_id, 'mp4', m3u8_id='hls', fatal=False))
# direct mp4 video
elif m.group('p') == 'rrtv':
if not m.group('br'):
mm = re.search(br_reg, v)
http_fmts.append({
'format_id': 'https-' + m.group('h'),
'protocol': 'https',
'url': v,
'tbr': int(m.group('br')) if m.group('br') else
(int(mm.group('br')) if mm.group('br') else 0),
'height': int(m.group('h'))
})
elif t == 'param':
if n == 'videotitle':
title = v
if n == 'image_full_play':
thumb = v
title = self._og_search_title(webpage) if title == '' else title
# clean weird char
title = compat_str(title).encode('utf8', 'replace').replace(b'\xc3\x82', b'').decode('utf8', 'replace')
if audio_fmts:
self._clean_audio_fmts(audio_fmts)
self._sort_formats(audio_fmts)
if hls_fmts:
self._sort_formats(hls_fmts)
if http_fmts:
self._sort_formats(http_fmts)
formats.extend(audio_fmts)
formats.extend(hls_fmts)
formats.extend(http_fmts)
return {
'id': video_id,
'title': title,
'description': self._html_search_meta('twitter:description', webpage),
'thumbnail': thumb,
'formats': formats,
}
class GediIE(GediBaseIE):
_VALID_URL = r'''(?x)https?://video\.
(?:
(?:espresso\.)?repubblica
|lastampa
|huffingtonpost
|ilsecoloxix
|iltirreno
|messaggeroveneto
|ilpiccolo
|gazzettadimantova
|mattinopadova
|laprovinciapavese
|tribunatreviso
|nuovavenezia
|gazzettadimodena
|lanuovaferrara
|corrierealpi
|lasentinella
)
(?:\.gelocal)?\.it/(?!embed/).+?/(?P<id>[\d/]+)(?:\?|\&|$)'''
_TESTS = [{
'url': 'https://video.lastampa.it/politica/il-paradosso-delle-regionali-la-lega-vince-ma-sembra-aver-perso/121559/121683',
'md5': '84658d7fb9e55a6e57ecc77b73137494',
'info_dict': {
'id': '121559/121683',
'ext': 'mp4',
'title': 'Il paradosso delle Regionali: ecco perché la Lega vince ma sembra aver perso',
'description': 'md5:de7f4d6eaaaf36c153b599b10f8ce7ca',
'thumbnail': r're:^https://www\.repstatic\.it/video/photo/.+?-thumb-social-play\.jpg$',
},
}, {
'url': 'https://video.repubblica.it/motori/record-della-pista-a-spa-francorchamps-la-pagani-huayra-roadster-bc-stupisce/367415/367963',
'md5': 'e763b94b7920799a0e0e23ffefa2d157',
'info_dict': {
'id': '367415/367963',
'ext': 'mp4',
'title': 'Record della pista a Spa Francorchamps, la Pagani Huayra Roadster BC stupisce',
'description': 'md5:5deb503cefe734a3eb3f07ed74303920',
'thumbnail': r're:^https://www\.repstatic\.it/video/photo/.+?-thumb-social-play\.jpg$',
},
}, {
'url': 'https://video.ilsecoloxix.it/sport/cassani-e-i-brividi-azzurri-ai-mondiali-di-imola-qui-mi-sono-innamorato-del-ciclismo-da-ragazzino-incredibile-tornarci-da-ct/66184/66267',
'md5': 'e48108e97b1af137d22a8469f2019057',
'info_dict': {
'id': '66184/66267',
'ext': 'mp4',
'title': 'Cassani e i brividi azzurri ai Mondiali di Imola: \\"Qui mi sono innamorato del ciclismo da ragazzino, incredibile tornarci da ct\\"',
'description': 'md5:fc9c50894f70a2469bb9b54d3d0a3d3b',
'thumbnail': r're:^https://www\.repstatic\.it/video/photo/.+?-thumb-social-play\.jpg$',
},
}, {
'url': 'https://video.iltirreno.gelocal.it/sport/dentro-la-notizia-ferrari-cosa-succede-a-maranello/141059/142723',
'md5': 'a6e39f3bdc1842bbd92abbbbef230817',
'info_dict': {
'id': '141059/142723',
'ext': 'mp4',
'title': 'Dentro la notizia - Ferrari, cosa succede a Maranello',
'description': 'md5:9907d65b53765681fa3a0b3122617c1f',
'thumbnail': r're:^https://www\.repstatic\.it/video/photo/.+?-thumb-social-play\.jpg$',
},
}]
class GediEmbedsIE(GediBaseIE):
_VALID_URL = r'''(?x)https?://video\.
(?:
(?:espresso\.)?repubblica
|lastampa
|huffingtonpost
|ilsecoloxix
|iltirreno
|messaggeroveneto
|ilpiccolo
|gazzettadimantova
|mattinopadova
|laprovinciapavese
|tribunatreviso
|nuovavenezia
|gazzettadimodena
|lanuovaferrara
|corrierealpi
|lasentinella
)
(?:\.gelocal)?\.it/embed/.+?/(?P<id>[\d/]+)(?:\?|\&|$)'''
_TESTS = [{
'url': 'https://video.huffingtonpost.it/embed/politica/cotticelli-non-so-cosa-mi-sia-successo-sto-cercando-di-capire-se-ho-avuto-un-malore/29312/29276?responsive=true&el=video971040871621586700',
'md5': 'f4ac23cadfea7fef89bea536583fa7ed',
'info_dict': {
'id': '29312/29276',
'ext': 'mp4',
'title': 'Cotticelli: \\"Non so cosa mi sia successo. Sto cercando di capire se ho avuto un malore\\"',
'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
'thumbnail': r're:^https://www\.repstatic\.it/video/photo/.+?-thumb-social-play\.jpg$',
},
}, {
'url': 'https://video.espresso.repubblica.it/embed/tutti-i-video/01-ted-villa/14772/14870&width=640&height=360',
'md5': '0391c2c83c6506581003aaf0255889c0',
'info_dict': {
'id': '14772/14870',
'ext': 'mp4',
'title': 'Festival EMERGENCY, Villa: «La buona informazione aiuta la salute» (14772-14870)',
'description': 'md5:2bce954d278248f3c950be355b7c2226',
'thumbnail': r're:^https://www\.repstatic\.it/video/photo/.+?-thumb-social-play\.jpg$',
},
}]
@staticmethod
def _sanitize_urls(urls):
# add protocol if missing
for i, e in enumerate(urls):
if e.startswith('//'):
urls[i] = 'https:%s' % e
# clean iframes urls
for i, e in enumerate(urls):
urls[i] = urljoin(base_url(e), url_basename(e))
return urls
@staticmethod
def _extract_urls(webpage):
entries = [
mobj.group('url')
for mobj in re.finditer(r'''(?x)
(?:
data-frame-src=|
<iframe[^\n]+src=
)
(["'])
(?P<url>https?://video\.
(?:
(?:espresso\.)?repubblica
|lastampa
|huffingtonpost
|ilsecoloxix
|iltirreno
|messaggeroveneto
|ilpiccolo
|gazzettadimantova
|mattinopadova
|laprovinciapavese
|tribunatreviso
|nuovavenezia
|gazzettadimodena
|lanuovaferrara
|corrierealpi
|lasentinella
)
(?:\.gelocal)?\.it/embed/.+?)
\1''', webpage)]
return GediEmbedsIE._sanitize_urls(entries)
@staticmethod
def _extract_url(webpage):
urls = GediEmbedsIE._extract_urls(webpage)
return urls[0] if urls else None
|
regexploit/bin/regexploit_js.py
|
CrackerCat/regexploit
| 592 |
115185
|
<reponame>CrackerCat/regexploit<filename>regexploit/bin/regexploit_js.py
#!/usr/bin/env python
import argparse
import io
import json
import logging
import os.path
import re
import subprocess
import sys
import traceback
import warnings
from regexploit.ast.sre import SreOpParser
from regexploit.bin.files import file_generator
from regexploit.languages.javascript import fix_js_regex
from regexploit.output.text import TextOutput
from regexploit.redos import find
def handle_line_from_node(line: str, output: TextOutput):
regex = json.loads(line)
if pattern := regex.get("pattern"):
if (pattern_len := len(pattern)) < 5:
return # (.+)+
if pattern_len == 8059 and pattern.startswith("\\u{1F3F4}(?:\\u{E0067"):
return # annoying emoji regex
if pattern.count("*") + pattern.count("+") + pattern.count(",}") < 2:
return # no ReDoS possible
filename = regex["filename"]
lineno = regex["lineno"]
try:
logging.debug("%s#%s: %s", filename, lineno, pattern)
parsed = SreOpParser().parse_sre(pattern)
except:
try:
fixed = fix_js_regex(pattern)
re.compile(fixed)
except:
print(f"Error parsing: {pattern} from {filename}\n")
return
try:
parsed = SreOpParser().parse_sre(fixed)
except:
print(f"Error in regexploit parsing: {pattern} from {filename}")
print(traceback.format_exc())
return
output.next()
try:
for redos in find(parsed):
if redos.starriness > 2:
output.record(redos, pattern, filename=filename, lineno=lineno)
except Exception:
print(f"Error finding ReDoS: {pattern} from {filename}")
print(traceback.format_exc())
elif error := regex.get("error"):
print("ERR", error, regex.get("filename"))
def process_files(filenames, nodejs_executable, output):
args = [
os.path.join(os.path.split(__file__)[0], "javascript", "index.js"),
*filenames,
]
if nodejs_executable:
args = [nodejs_executable] + args
logging.debug("Processing batch: %s", args[2:])
node = subprocess.Popen(args, stdout=subprocess.PIPE)
for line in io.TextIOWrapper(node.stdout, encoding="utf-8"):
handle_line_from_node(line, output)
rc = node.poll()
return rc
def main():
if not os.path.isdir(
os.path.join(os.path.split(__file__)[0], "javascript", "node_modules")
):
path = os.path.join(os.path.split(__file__)[0], "javascript")
print("The JavaScript & TypeScript parsers require some node modules.\n")
print(f"Run (cd {path}; npm install)")
sys.exit(1)
with warnings.catch_warnings():
warnings.simplefilter(
"ignore", category=FutureWarning
) # Some js regexes are weird
parser = argparse.ArgumentParser(
description="Parse regexes out of javascript files and scan them for ReDoS"
)
parser.add_argument("files", nargs="+", help="Javascript or typescript files")
parser.add_argument(
"--node",
help="Location of nodejs executable (rather than using node from PATH)",
)
parser.add_argument(
"--glob", action="store_true", help="Glob the input filenames (**/*)"
)
parser.add_argument("--verbose", action="store_true", help="Verbose logging")
parser.add_argument(
"--ignore", action="append", help="Paths containing this string are ignored"
)
args = parser.parse_args()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
output = TextOutput(js_flavour=True)
files = file_generator(args.files, args.glob, ["*.js", "*.ts"], args.ignore)
while True:
batch = []
for _ in range(50):
try:
batch.append(next(files))
except StopIteration:
if batch:
process_files(batch, args.node, output)
return
process_files(batch, args.node, output)
print(f"Processed {output.regexes} regexes")
if __name__ == "__main__":
main()
|
win/pywinauto/controlproperties.py
|
sk8darr/BrowserRefresh-Sublime
| 191 |
115216
|
# GUI Application automation and testing library
# Copyright (C) 2006 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
"""Wrap"""
__revision__ = "$Rev: 439 $"
try:
import pywinauto
except ImportError:
import sys
sys.path.append("..")
from .win32structures import RECT, LOGFONTW
#====================================================================
class func_wrapper(object):
"Little class to allow attribute access to return a callable object"
def __init__(self, value):
self.value = value
def __call__(self, *args, **kwargs):
"Return the saved value"
return self.value
#====================================================================
class ControlProps(dict):
"Wrap controls read from a file to resemble hwnd controls"
def __init__(self, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
self.ref = None
#self.MenuItems = []
def __getattr__(self, attr):
# if the key is not in the dictionary but the plural is
if attr not in self and attr + "s" in self:
# return the first element of the possible list item
return func_wrapper(self[attr+'s'][0])
return func_wrapper(self[attr])
#def FriendlyClassName(self):
# print "sdafafasdfafasdfasdf",
# try:
# print "---", self['FriendlyClassName']
# except Exception, e:
# print "fffffffffffffffffffff"
# print `e`
# return self['FriendlyClassName']
def WindowText(self):
return self['Texts'][0]
def HasStyle(self, style):
return self['Style'] & style == style
def HasExStyle(self, exstyle):
return self['ExStyle'] & exstyle == exstyle
#====================================================================
def GetMenuBlocks(ctrls):
allMenuBlocks = []
for ctrl in ctrls:
if 'MenuItems' in ctrl:
# we need to get all the separate menu blocks!
menuBlocks = MenuBlockAsControls(ctrl.MenuItems())
allMenuBlocks.extend(menuBlocks)
return allMenuBlocks
#====================================================================
def MenuBlockAsControls(menuItems, parentage = []):
blocks = []
curBlock = []
for item in menuItems:
# do a bit of conversion first :-)
itemAsCtrl = MenuItemAsControl(item)
# update the FriendlyClassName to contain the 'path' to
# this particular item
# TODO: CHECK - as itemPath is currently unused!
if parentage:
itemPath = "%s->%s" % ("->".join(parentage), item['Text'])
else:
itemPath = item['Text']
#append the item to the current menu block
curBlock.append(itemAsCtrl)
# If the item has a sub menu
if 'MenuItems' in item:
# add the current item the path
parentage.append(item['Text'])
# Get the block for the SubMenu, and add it to the list of
# blocks we have found
blocks.extend(
MenuBlockAsControls(
item['MenuItems']['MenuItems'], parentage))
# and seeing as we are dong with that sub menu remove the current
# item from the path
del(parentage[-1])
# add the current block to the list of blocks
blocks.append(curBlock)
return blocks
#====================================================================
def MenuItemAsControl(menuItem):
"Make a menu item look like a control for tests"
itemAsCtrl = ControlProps()
itemAsCtrl["Texts"] = [menuItem['Text'], ]
itemAsCtrl["ControlID"] = menuItem['ID']
itemAsCtrl["Type"] = menuItem['Type']
itemAsCtrl["State"] = menuItem['State']
itemAsCtrl["Class"] = "MenuItem"
itemAsCtrl["FriendlyClassName"] = "MenuItem"
# as most of these don't matter - just set them up with default stuff
itemAsCtrl["Rectangle"] = RECT(0, 0, 999, 999)
itemAsCtrl["Fonts"] = [LOGFONTW(), ]
itemAsCtrl["ClientRects"] = [RECT(0, 0, 999, 999), ]
itemAsCtrl["ContextHelpID"] = 0
itemAsCtrl["UserData"] = 0
itemAsCtrl["Style"] = 0
itemAsCtrl["ExStyle"] = 0
itemAsCtrl["IsVisible"] = 1
return itemAsCtrl
#====================================================================
def SetReferenceControls(controls, refControls):
"""Set the reference controls for the controls passed in
This does some minor checking as following:
* test that there are the same number of reference controls as
controls - fails with an exception if there are not
* test if all the ID's are the same or not
"""
# numbers of controls must be the same (though in future I could imagine
# relaxing this constraint)
if len(controls) != len(refControls):
raise RuntimeError(
"Numbers of controls on ref. dialog does not match Loc. dialog")
# set the controls
for i, ctrl in enumerate(controls):
ctrl.ref = refControls[i]
toRet = 1
allIDsSameFlag = 2
allClassesSameFlag = 4
# find if all the control id's match
if [ctrl.ControlID() for ctrl in controls] == \
[ctrl.ControlID() for ctrl in refControls]:
toRet += allIDsSameFlag
# check if the control classes match
if [ctrl.Class() for ctrl in controls] == \
[ctrl.Class() for ctrl in refControls]:
toRet += allClassesSameFlag
return toRet
##====================================================================
#class ControlProps(dict):
# #----------------------------------------------------------------
# def __init__(self, props = {}):
# # default to having menuItems for all things
# self.MenuItems = []
#
# self.update(props)
# #for x in props:
# #self[x] = props[x]
#
# if hasattr(props, "handle"):
# self.__dict__['handle'] = props.handle
# else:
# self.__dict__['handle'] = None
#
# self.__dict__['ref'] = None
#
# #----------------------------------------------------------------
# # handles attribute access for dictionary items and
# # for plurals (e.g. if self.Fonts = [4, 2] then self.Font = 4)
# def __getattr__(self, key):
#
# # if the key is not in the dictionary but the plural is
# if key not in self and key + "s" in self:
#
# # try to get the first element of the possible list item
# try:
# return self[key + "s"][0]
# except TypeError, e:
# pass
#
# if key in self:
# return self[key]
#
# return self.__dict__[key]
#
# #----------------------------------------------------------------
# def __setattr__(self, key, value):
# if key in self.__dict__:
# self.__dict__[key] = value
# else:
# self[key] = value
#
# #----------------------------------------------------------------
# def HasStyle(self, flag):
# return self.Style & flag == flag
#
# #----------------------------------------------------------------
# def HasExStyle(self, flag):
# return self.ExStyle & flag == flag
#
#
|
data_preprocessing/convert_data_format/convert_mha_nii.py
|
aiswaryasankar/280
| 192 |
115236
|
import SimpleITK as sitk
data_mha = open('data_mha.txt', 'r')
mha_dir = data_mha.readlines()
data_nii = open('data_nii.txt', 'r')
nii_dir = data_nii.readlines()
for i in range(len(mha_dir)):
print(i)
path, _ = mha_dir[i].split("\n")
savepath, _ = nii_dir[i].split("\n")
img = sitk.ReadImage(path)
sitk.WriteImage(img, savepath)
|
Source/Utility/python-twitter/twitter/error.py
|
guissy/StockRecommendSystem
| 137 |
115255
|
#!/usr/bin/env python
class TwitterError(Exception):
"""Base class for Twitter errors"""
@property
def message(self):
'''Returns the first argument used to construct this error.'''
return self.args[0]
class PythonTwitterDeprecationWarning(DeprecationWarning):
"""Base class for python-twitter deprecation warnings"""
pass
class PythonTwitterDeprecationWarning330(PythonTwitterDeprecationWarning):
"""Warning for features to be removed in version 3.3.0"""
pass
|
admino/views.py
|
erdem/django-admino
| 221 |
115267
|
from collections import OrderedDict
from urllib import urlencode
from admino.serializers import ModelAdminSerializer
from django.core.urlresolvers import reverse_lazy
from django.http import JsonResponse
from django.views.generic import View
class APIView(View):
def json_response(self, data, *args, **kwargs):
return JsonResponse(data, safe=False, *args, **kwargs)
class ChangeListRetrieveAPIView(APIView):
def get_api_next_url(self, request, cl):
page_num = cl.page_num
if page_num and page_num is not int or not cl.multi_page:
return None
info = self.model._meta.app_label, self.model._meta.model_name
url = reverse_lazy("admin:%s_%s_api_list" % info)
host = request.get_host()
params = cl.params
params["p"] = page_num + 1
return "%s://%s%s?%s" % (request.scheme, host, url, urlencode(params))
def get_api_previous_url(self, request, cl):
page_num = cl.page_num
if page_num == 0 or not cl.multi_page:
return None
info = self.model._meta.app_label, self.model._meta.model_name
url = reverse_lazy("admin:%s_%s_api_list" % info)
host = request.get_host()
params = cl.params
params["p"] = page_num - 1
return "%s://%s%s?%s" % (request.scheme, host, url, urlencode(params))
def get(self, request, model_admin, admin_cl, *args, **kwargs):
self.model = admin_cl.model
results = []
for obj in admin_cl.result_list:
results.append(model_admin.obj_as_dict(request, obj))
data = OrderedDict()
data["count"] = admin_cl.result_count
data["next"] = self.get_api_next_url(request, admin_cl)
data["previous"] = self.get_api_previous_url(request, admin_cl)
data["results"] = results
return self.json_response(data)
class APIMetaView(APIView):
def get(self, request, model_admin, *args, **kwargs):
form = model_admin.get_form(request)
data = ModelAdminSerializer(model_admin=model_admin, admin_form=form).data
return self.json_response(data)
class AdminDetailRetrieveAPIView(APIView):
def get(self, request, model_admin, admin_cl, *args, **kwargs):
return self.json_response("ok")
|
apps/monitor/views/newsblur_users.py
|
Paul3MK/NewsBlur
| 3,073 |
115326
|
<reponame>Paul3MK/NewsBlur
import datetime
from django.contrib.auth.models import User
from django.shortcuts import render
from django.views import View
from apps.profile.models import Profile, RNewUserQueue
class Users(View):
def get(self, request):
last_month = datetime.datetime.utcnow() - datetime.timedelta(days=30)
last_day = datetime.datetime.utcnow() - datetime.timedelta(minutes=60*24)
data = {
'all': User.objects.count(),
'monthly': Profile.objects.filter(last_seen_on__gte=last_month).count(),
'daily': Profile.objects.filter(last_seen_on__gte=last_day).count(),
'premium': Profile.objects.filter(is_premium=True).count(),
'queued': RNewUserQueue.user_count(),
}
chart_name = "users"
chart_type = "counter"
formatted_data = {}
for k, v in data.items():
formatted_data[k] = f'{chart_name}{{category="{k}"}} {v}'
context = {
"data": formatted_data,
"chart_name": chart_name,
"chart_type": chart_type,
}
return render(request, 'monitor/prometheus_data.html', context, content_type="text/plain")
|
evaluate.py
|
BoPang1996/TubeTK
| 142 |
115344
|
import pickle
import os
import numpy as np
import torch
import warnings
from tqdm import tqdm
from Metrics import evaluateTracking
from dataset.dataLoader import Data_Loader_MOT
from network.tubetk import TubeTK
from post_processing.tube_nms import multiclass_nms
from apex import amp
import argparse
import multiprocessing
from configs.default import __C, cfg_from_file
from post_processing.tube_iou_matching import matching
warnings.filterwarnings('ignore')
import shutil
def synchronize():
"""
Helper function to synchronize (barrier) among all processes when
using distributed training
"""
if not torch.distributed.is_available():
return
if not torch.distributed.is_initialized():
return
world_size = torch.distributed.get_world_size()
if world_size == 1:
return
torch.distributed.barrier()
def match_video(video_name, tmp_dir, output_dir, model_arg):
tubes_path = os.path.join(tmp_dir, video_name)
tubes = []
frames = sorted([int(x) for x in os.listdir(tubes_path)])
for f in frames:
tube = pickle.load(open(os.path.join(tubes_path, str(f)), 'rb'))
tubes.append(tube)
tubes = np.concatenate(tubes)
matching(tubes, save_path=os.path.join(output_dir, video_name + '.txt'), verbose=True, arg=model_arg)
def evaluate(model, loader, test_arg, model_arg, output_dir='output'):
if not os.path.exists(output_dir):
os.makedirs(output_dir)
tmp_dir = os.path.join(output_dir, 'tmp')
try:
shutil.rmtree(tmp_dir)
except:
pass
os.makedirs(tmp_dir, exist_ok=True)
if test_arg.rank == 0:
loader = tqdm(loader, ncols=20)
for i, data in enumerate(loader):
imgs, img_metas = data[:2]
imgs = imgs.cuda()
with torch.no_grad():
tubes, _, _ = zip(*model(imgs, img_metas, return_loss=False))
for img, tube, img_meta in zip(imgs, tubes, img_metas):
# ===========================================VIS OUTPUT====================================================
# if img is not None:
# vis_output(img.cpu(), img_meta, bbox.cpu(), stride=model_arg.frame_stride, out_folder='/home/pb/results/')
# =========================================================================================================
tube[:, [0, 5, 10]] += img_meta['start_frame']
os.makedirs(os.path.join(tmp_dir, img_meta['video_name']), exist_ok=True)
tube = tube.cpu().data.numpy()
pickle.dump(tube, open(os.path.join(tmp_dir, img_meta['video_name'], str(img_meta['start_frame'])), 'wb'))
synchronize()
if test_arg.rank == 0:
print('Finish prediction, Start matching')
video_names = os.listdir(tmp_dir)
pool = multiprocessing.Pool(processes=20)
pool_list = []
for vid in video_names:
pool_list.append(pool.apply_async(match_video, (vid, tmp_dir, os.path.join(output_dir, 'res'), model_arg,)))
for p in tqdm(pool_list, ncols=20):
p.get()
pool.close()
pool.join()
shutil.rmtree(tmp_dir)
if test_arg.trainOrTest == 'train' and test_arg.dataset == 'MOT17':
print("FINISH MATCHING, START EVALUATE")
seq_map = 'MOT17_train.txt'
evaluateTracking(seq_map, os.path.join(output_dir, 'res'),
os.path.join(test_arg.data_url, 'train'), 'MOT17')
# elif test_arg.trainOrTest == 'train' and test_arg.dataset == 'MOT15':
# print("FINISH MATCHING, START EVALUATE")
# seq_map = 'MOT15_train.txt'
# evaluateTracking(seq_map, os.path.join(output_dir, 'res'),
# os.path.join(test_arg.data_url[3], 'train'), 'MOT15')
def main(test_arg, model_arg):
torch.distributed.init_process_group(backend="nccl", init_method='env://')
local_rank = int(os.environ["LOCAL_RANK"])
print('Rank: ' + str(test_arg.rank) + " Start!")
torch.cuda.set_device(local_rank)
if local_rank == 0:
print("Building TubeTK Model")
model = TubeTK(num_classes=1, arg=model_arg, pretrained=False)
data_loader = Data_Loader_MOT(
batch_size=test_arg.batch_size,
num_workers=8,
input_path=test_arg.data_url,
train_epoch=1,
test_epoch=1,
model_arg=model_arg,
dataset=test_arg.dataset,
test_seq=None,
test_type=test_arg.trainOrTest,
)
model = model.cuda(local_rank)
model = torch.nn.SyncBatchNorm.convert_sync_batchnorm(model)
if test_arg.apex:
model = amp.initialize(model, opt_level='O1')
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[local_rank],
output_device=local_rank,
find_unused_parameters=True)
if test_arg.local_rank == 0:
print("Loading Model")
checkpoint = torch.load(test_arg.model_path + '/' + test_arg.model_name, map_location=
{'cuda:0': 'cuda:' + str(test_arg.local_rank),
'cuda:1': 'cuda:' + str(test_arg.local_rank),
'cuda:2': 'cuda:' + str(test_arg.local_rank),
'cuda:3': 'cuda:' + str(test_arg.local_rank),
'cuda:4': 'cuda:' + str(test_arg.local_rank),
'cuda:5': 'cuda:' + str(test_arg.local_rank),
'cuda:6': 'cuda:' + str(test_arg.local_rank),
'cuda:7': 'cuda:' + str(test_arg.local_rank)})
model.load_state_dict(checkpoint['state'], strict=False)
if test_arg.local_rank == 0:
print("Finish Loading")
del checkpoint
model.eval()
loader = data_loader.test_loader
evaluate(model, loader, test_arg, model_arg, output_dir=test_arg.output_dir)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--batch_size', default=1, type=int)
parser.add_argument('--model_path', default='./models', type=str, help='model path')
parser.add_argument('--model_name', default='TubeTK', type=str, help='model name')
parser.add_argument('--data_url', default='./data/', type=str, help='model path')
parser.add_argument('--output_dir', default='./link_res', type=str, help='output path')
parser.add_argument('--apex', action='store_true', help='whether use apex')
parser.add_argument('--config', default='./configs/TubeTK_resnet_50_FPN_8frame_1stride.yaml', type=str, help='config file')
parser.add_argument('--dataset', default='MOT17', type=str, help='test which dataset: MOT17, MOT15')
parser.add_argument('--trainOrTest', default='test', type=str, help='evaluate train or test set')
parser.add_argument('--local_rank', type=int, help='gpus')
test_arg, unparsed = parser.parse_known_args()
model_arg = __C
if test_arg.config is not None:
cfg_from_file(test_arg.config)
test_arg.rank = int(os.environ["RANK"])
main(test_arg, model_arg)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.