<commit_before>import platform
import os
from OpenSSL import crypto
import shutil

import config

on_macos = platform.uname().system.lower() == 'darwin'
on_windows = platform.uname().system.lower() == 'windows'
on_linux = platform.uname().system.lower() == 'linux'
on_wsl = on_linux and 'microsoft' in platform.uname().release.lower()


def is_supported():
    return not on_windows


def is_os_supported(os=None):
    if not os or os not in config.SUPPORTED_OS_VERSIONS:
        return False

    os_major, os_minor, _ = f'{config.OS_VERSION}.0.0'.split('.', 2)
    os_min_major, os_min_minor, _ = f'{config.SUPPORTED_OS_VERSIONS.get(os).get("min")}.0.0'.split('.', 2)
    os_max_major, os_max_minor, _ = f'{config.SUPPORTED_OS_VERSIONS.get(os).get("max")}.0.0'.split('.', 2)

    if int(os_major) < int(os_min_major) or \
            int(os_major) == int(os_min_major) and int(os_minor) < int(os_min_minor):
        print(f'ERROR: Your OS version is not supported.\n'
              f'Min version: {config.SUPPORTED_OS_VERSIONS.get(os).get("min")}\n'
              f'Sys version: {config.OS_VERSION}')
        return False

    if int(os_major) > int(os_max_major) or \
            int(os_major) == int(os_max_major) and int(os_minor) > int(os_max_minor):
        print(f'WARNING: Your OS is newer than the last tested version.\n'
              f'Tested version: {config.SUPPORTED_OS_VERSIONS.get(os).get("max")}\n'
              f'System version: {config.OS_VERSION}')

    return True


def is_tunnel_needed():
    return on_macos or on_wsl


def create_cache_folder():<commit_msg>refactored msg<commit_after>import platform
import os
from OpenSSL import crypto
import shutil

import config

on_macos = platform.uname().system.lower() == 'darwin'
on_windows = platform.uname().system.lower() == 'windows'
on_linux = platform.uname().system.lower() == 'linux'
on_wsl = on_linux and 'microsoft' in platform.uname().release.lower()


def is_supported():
    return not on_windows


def is_os_supported(os=None):
    if not os or os not in config.SUPPORTED_OS_VERSIONS:
        return False

    os_major, os_minor, _ = f'{config.OS_VERSION}.0.0'.split('.', 2)
    os_min_major, os_min_minor, _ = f'{config.SUPPORTED_OS_VERSIONS.get(os).get("min")}.0.0'.split('.', 2)
    os_max_major, os_max_minor, _ = f'{config.SUPPORTED_OS_VERSIONS.get(os).get("max")}.0.0'.split('.', 2)

    if int(os_major) < int(os_min_major) or \
            int(os_major) == int(os_min_major) and int(os_minor) < int(os_min_minor):
        print(f'ERROR: Your OS version is not supported.\n'
              f'Minimun version: {config.SUPPORTED_OS_VERSIONS.get(os).get("min")}\n'
              f'System version: {config.OS_VERSION}')
        return False

    if int(os_major) > int(os_max_major) or \
            int(os_major) == int(os_max_major) and int(os_minor) > int(os_max_minor):
        print(f'WARNING: Your OS is newer than the last tested version.\n'
              f'Tested version: {config.SUPPORTED_OS_VERSIONS.get(os).get("max")}\n'
              f'System version: {config.OS_VERSION}')

    return True


def is_tunnel_needed():
    return on_macos or on_wsl


def create_cache_folder():
{'fraction_non_alphanumeric': 0.14042821158690177, 'fraction_numerical': 0.005667506297229219, 'mean_word_length': 3.591040462427746, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1617067', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1109, 'n_words': 230}