<commit_before>import base64

def encode(b):
    assert isinstance(b, bytes), (type(b), b)
    return base64.b32encode(b).lower().rstrip(b"=").decode("ascii")

# we use the rfc4648 base32 alphabet, in lowercase
BASE32_ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567'

def is_base32(s):
    assert isinstance(s, str), (type(s), s)<commit_msg>base32.encode: return native str<commit_after>import sys, base64

def encode(b):
    assert isinstance(b, bytes), (type(b), b)
    out = base64.b32encode(b).lower().rstrip(b"=")
    if sys.version_info.major == 2:
        return out
    return out.decode("ascii")

# we use the rfc4648 base32 alphabet, in lowercase
BASE32_ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567'

def is_base32(s):
    assert isinstance(s, str), (type(s), s)
{'fraction_non_alphanumeric': 0.13914174252275682, 'fraction_numerical': 0.0611183355006502, 'mean_word_length': 4.9689922480620154, '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': '2449703', 'n_tokens_mistral': 321, 'n_tokens_neox': 287, 'n_words': 66}