<commit_before>import sys

# Detect Python 3
PY3 = (sys.hexversion >= 0x03000000)

if PY3:
    types_not_to_encode = (int, str)
    string_type = str
    from urllib.parse import urlparse
else:
    types_not_to_encode = (int, long, basestring)
    string_type = basestring
    from urllib2 import urlparse<commit_msg>Fix the urlparse import in Python 2.  (This is used for saving/loading tokens in files.)  The urlparse that you can import from urllib2 is actually the urlparse module, but what we want is the urlparse function inside that module.<commit_after>import sys

# Detect Python 3
PY3 = (sys.hexversion >= 0x03000000)

if PY3:
    types_not_to_encode = (int, str)
    string_type = str
    from urllib.parse import urlparse
else:
    types_not_to_encode = (int, long, basestring)
    string_type = basestring
    from urlparse import urlparse
{'fraction_non_alphanumeric': 0.06455399061032864, 'fraction_numerical': 0.03169014084507042, 'mean_word_length': 3.930635838150289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1965288', 'n_tokens_mistral': 293, 'n_tokens_neox': 275, 'n_words': 97}