<commit_before>import os
import json
import sys


from .utils.encoding import (
    force_obj_to_text,
)
from .utils.filesystem import (
    ensure_path_exists,
    is_same_path,
)


def get_live_data_dir():
    """
    pygeth needs a base directory to store it's chain data.  By default this is
    the directory that `geth` uses as it's `datadir`.
    """
    if sys.platform == 'darwin':
        data_dir = os.path.expanduser(os.path.join(
            "~",
            "Library",
            "Ethereum",
        ))
    elif sys.platform == 'linux2':
        data_dir = os.path.expanduser(os.path.join(
            "~",
            ".ethereum",
        ))
    elif sys.platform == 'win32':
        data_dir = os.path.expanduser(os.path.join(
            "\\",
            "~",
            "AppData",
            "Roaming",
            "Ethereum",
        ))

    else:
        raise ValueError((
            "Unsupported platform: '{0}'.  Only darwin/linux2/win32 are "
            "supported.  You must specify the geth datadir manually"
        ).format(sys.platform))
    return data_dir


def get_testnet_data_dir():
    return os.path.abspath(os.path.expanduser(os.path.join(
        get_live_data_dir(),
        "testnet",
    )))<commit_msg>use python3 compatible linux strings<commit_after>import os
import json
import sys


from .utils.encoding import (
    force_obj_to_text,
)
from .utils.filesystem import (
    ensure_path_exists,
    is_same_path,
)


def get_live_data_dir():
    """
    pygeth needs a base directory to store it's chain data.  By default this is
    the directory that `geth` uses as it's `datadir`.
    """
    if sys.platform == 'darwin':
        data_dir = os.path.expanduser(os.path.join(
            "~",
            "Library",
            "Ethereum",
        ))
    elif sys.platform in {'linux', 'linux2', 'linux3'}:
        data_dir = os.path.expanduser(os.path.join(
            "~",
            ".ethereum",
        ))
    elif sys.platform == 'win32':
        data_dir = os.path.expanduser(os.path.join(
            "\\",
            "~",
            "AppData",
            "Roaming",
            "Ethereum",
        ))

    else:
        raise ValueError((
            "Unsupported platform: '{0}'.  Only darwin/linux2/win32 are "
            "supported.  You must specify the geth datadir manually"
        ).format(sys.platform))
    return data_dir


def get_testnet_data_dir():
    return os.path.abspath(os.path.expanduser(os.path.join(
        get_live_data_dir(),
        "testnet",
    )))
{'fraction_non_alphanumeric': 0.12421383647798742, 'fraction_numerical': 0.006289308176100629, 'mean_word_length': 1.9219288174512055, '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': '6910652', 'n_tokens_mistral': 823, 'n_tokens_neox': 805, 'n_words': 179}