<commit_before>"""
This file is part of Python TripleSec - a Python implementation of TripleSec

Released under The BSD 3-Clause License
Copyright (c) 2013 Keybase

These are the definitions of the data structures, the exceptions and other tools
used across the codebase.
"""

import hashlib
import six
import binascii
import sys
from six.moves import zip
from collections import namedtuple
if sys.version_info < (3, 4):
    import sha3


MAGIC_BYTES = binascii.unhexlify(b'1c94d7de')


## DATA STRUCTURES
Cipher = namedtuple('Cipher', ['name', 'implementation', 'overhead_size', 'key_size'])
MAC = namedtuple('MAC', ['name', 'implementation', 'key_size', 'output_size'])
KDF = namedtuple('KDF', ['name', 'implementation', 'parameters'])
Scrypt_params = namedtuple('Scrypt_params', ['N', 'r', 'p'])
PBKDF2_params = namedtuple('PBKDF2', ['i', 'PRF'])
Constants = namedtuple('Constants', ['header', 'salt_size', 'MACs', 'ciphers', 'KDF'])


### EXCEPTIONS
class TripleSecError(Exception):
    """Generic TripleSec-related error"""<commit_msg>Added fix for sha3 problems in Python 3.4<commit_after>"""
This file is part of Python TripleSec - a Python implementation of TripleSec

Released under The BSD 3-Clause License
Copyright (c) 2013 Keybase

These are the definitions of the data structures, the exceptions and other tools
used across the codebase.
"""

import hashlib
import six
import binascii
import sys
from six.moves import zip
from collections import namedtuple
if sys.version_info > (3, 2):
    if 'sha3_512' not in hashlib.algorithms_available:
        import sha3


MAGIC_BYTES = binascii.unhexlify(b'1c94d7de')


## DATA STRUCTURES
Cipher = namedtuple('Cipher', ['name', 'implementation', 'overhead_size', 'key_size'])
MAC = namedtuple('MAC', ['name', 'implementation', 'key_size', 'output_size'])
KDF = namedtuple('KDF', ['name', 'implementation', 'parameters'])
Scrypt_params = namedtuple('Scrypt_params', ['N', 'r', 'p'])
PBKDF2_params = namedtuple('PBKDF2', ['i', 'PRF'])
Constants = namedtuple('Constants', ['header', 'salt_size', 'MACs', 'ciphers', 'KDF'])


### EXCEPTIONS
class TripleSecError(Exception):
    """Generic TripleSec-related error"""
{'fraction_non_alphanumeric': 0.1389017074296262, 'fraction_numerical': 0.016151361329026302, 'mean_word_length': 6.1551155115511555, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5902474', 'n_tokens_mistral': 713, 'n_tokens_neox': 665, 'n_words': 221}