<commit_before>"""
Final-Project.py
Author: Payton
Credit: Python Documentation, Morgan, Mr. Dennison, Stack Overflow
Assignment: Final-Project
Write and submit a program that is your Final Project.
"""
import binascii
import utf-8
from bitstring import BitArray
quit = False

def text_to_bits(text, encoding='utf-8', errors='surrogatepass'):
    bits = bin(int.from_bytes(text.encode(encoding, errors), 'big'))[2:]
    return bits.zfill(8 * ((len(bits) + 7) // 8))

def text_from_bits(bits, encoding='utf-8', errors='surrogatepass'):
    n = int(bits, 2)
    return n.to_bytes((n.bit_length() + 7) // 8, 'big').decode(encoding, errors) or '\0'

def int2bytes(i):
    hex_string = '%x' % i
    n = len(hex_string)<commit_msg>Updated from Brython Server: 5/20/2016 2:17:29 PM<commit_after>"""
Final-Project.py
Author: Payton
Credit: Python Documentation, Morgan, Mr. Dennison, Stack Overflow
Assignment: Final-Project
Write and submit a program that is your Final Project.
"""
import binascii
quit = False

def text_to_bits(text, encoding='utf-8', errors='surrogatepass'):
    bits = bin(int.from_bytes(text.encode(encoding, errors), 'big'))[2:]
    return bits.zfill(8 * ((len(bits) + 7) // 8))

def text_from_bits(bits, encoding='utf-8', errors='surrogatepass'):
    n = int(bits, 2)
    return n.to_bytes((n.bit_length() + 7) // 8, 'big').decode(encoding, errors) or '\0'

def int2bytes(i):
    hex_string = '%x' % i
    n = len(hex_string)
{'fraction_non_alphanumeric': 0.15672676837725383, 'fraction_numerical': 0.024271844660194174, 'mean_word_length': 4.681102362204724, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '59437', 'n_tokens_mistral': 525, 'n_tokens_neox': 495, 'n_words': 137}