code
stringlengths
3
6.57k
_finger_fail(self, finger, master_key)
salt.utils.pem_finger(master_key, sum_type=self.opts['hash_type'])
sys.exit(42)
Crypticle(object)
hashlib.sha256()
__init__(self, opts, key_string, key_size=192)
self.extract_keys(self.key_string, key_size)
salt.payload.Serial(opts)
generate_key_string(cls, key_size=192)
os.urandom(key_size // 8 + cls.SIG_SIZE)
base64.b64encode(key)
b64key.decode('utf-8')
b64key.replace('\n', '')
extract_keys(cls, key_string, key_size)
key_string.decode('base64')
len(key)
encrypt(self, data)
len(data)
chr(pad)
os.urandom(self.AES_BLOCK_SIZE)
AES.new(aes_key, AES.MODE_CBC, iv_bytes)
cypher.encrypt(data)
hmac.new(hmac_key, data, hashlib.sha256)
digest()
decrypt(self, data)
hmac.new(hmac_key, data, hashlib.sha256)
digest()
len(mac_bytes)
len(sig)
log.debug('Failed to authenticate message')
AuthenticationError('message authentication failed')
zip(mac_bytes, sig)
ord(zipped_x)
ord(zipped_y)
log.debug('Failed to authenticate message')
AuthenticationError('message authentication failed')
AES.new(aes_key, AES.MODE_CBC, iv_bytes)
cypher.decrypt(data)
ord(data[-1])
dumps(self, obj)
self.encrypt(self.PICKLE_PAD + self.serial.dumps(obj)
loads(self, data)
self.decrypt(data)
data.startswith(self.PICKLE_PAD)
self.serial.loads(data[len(self.PICKLE_PAD)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "booktrade.settings")
get_wsgi_application()
matplotlib.use("Agg")
np.set_printoptions(threshold=np.nan)
freeze_dict(obj)
isinstance(obj, dict)
list(obj.items()
dict_items.append((FROZEN_TAG, True)
tuple([(k, freeze_dict(v)
unfreeze_dict(obj)
isinstance(obj, tuple)
if (FROZEN_TAG, True)
dict((k, unfreeze_dict(v)
get_lang_code_dicts()
re.compile('[%s]' % bad_chars)
open("data/lang_codes.txt")
f.read()
data.split("\n")
line.split()
rgx.sub('', line[0])
rgx.sub('', line[2])
lang_to_code.iteritems()
read_conll(treebank_path, langs, code_to_lang, train_or_dev, tgt_size=None, test=False)
os.listdir(treebank_path + "UD_" + code_to_lang[lang])
file.endswith("train.conllu")
os.path.join(treebank_path + "UD_" + code_to_lang[lang], file)
os.listdir(treebank_path + "UD_" + code_to_lang[lang])
file.endswith("dev.conllu")
os.path.join(treebank_path+ "UD_" + code_to_lang[lang], file)
open(filepath)
f.readlines()
join(data)
split("\n \n")
parse(sent)
min(tgt_size, len(ud)
dict(word['feats'])
word_tags.update({'POS':word['upostag']})
freeze_dict(word_tags)
unique.append(word_tags)
sent_text.append(word['form'])
sent_tags.append(freeze_dict(word_tags)
all_text.append(sent_text)
all_tags.append(sent_tags)
zip(all_text, all_tags)
addNullLabels(annot_sents, langs, unique_tags)
unfreeze_dict(tags)
new_tags.append(freeze_dict(tag_dict)
sortbylength(data, lang_ids, maxlen=500)
range(len(src)
sorted(indexed_src, key=lambda x: -len(x[1])
len(item[1])
len(item[1])
zip(sorted_src, sorted_tgt)
get_train_order(training_data, batch_size, startIdx=0)
len(elem[0])