<commit_before>#!/usr/bin/python3
"""provides compiler and plaform enum and argparse related functions"""

import buildtools.core as core

from enum import Enum


class Compiler(Enum):
    """list of compilers"""
    VS2015 = 1
    VS2017 = 2
    VS2019 = 3


class Platform(Enum):
    """list of platforms"""
    AUTO = 0
    WIN32 = 1
    X64 = 2


def add_compiler(parser):
    """add compiler argument to argparse parser"""
    parser.add_argument('compiler', help='The compiler to use.')


def add_platform(parser):
    """add platform argument to argparse parser"""
    parser.add_argument('platform', help='The platform to build for.')


def get_compiler(args) -> Compiler:
    """get the compiler from the argparse arguments"""
    compiler_name = args.compiler

    if compiler_name == 'vs2015':
        return Compiler.VS2015

    if compiler_name == 'vs2017':
        return Compiler.VS2017

    if compiler_name == 'vs2019':
        return Compiler.VS2019

    print('Unknown compiler: ', compiler_name, flush=True)
    return Compiler.VS2019


def get_platform(args) -> Platform:
    """get the platform from the argparse arguments"""
    platform = args.platform
    if platform == 'auto':
        return Platform.AUTO

    if platform == 'win32':
        return Platform.WIN32

    if platform in ['x64', 'win64']:
        return Platform.X64<commit_msg>don't care about case for the platform argument<commit_after>#!/usr/bin/python3
"""provides compiler and plaform enum and argparse related functions"""

import buildtools.core as core

from enum import Enum


class Compiler(Enum):
    """list of compilers"""
    VS2015 = 1
    VS2017 = 2
    VS2019 = 3


class Platform(Enum):
    """list of platforms"""
    AUTO = 0
    WIN32 = 1
    X64 = 2


def add_compiler(parser):
    """add compiler argument to argparse parser"""
    parser.add_argument('compiler', help='The compiler to use.')


def add_platform(parser):
    """add platform argument to argparse parser"""
    parser.add_argument('platform', help='The platform to build for.')


def get_compiler(args) -> Compiler:
    """get the compiler from the argparse arguments"""
    compiler_name = args.compiler

    if compiler_name == 'vs2015':
        return Compiler.VS2015

    if compiler_name == 'vs2017':
        return Compiler.VS2017

    if compiler_name == 'vs2019':
        return Compiler.VS2019

    print('Unknown compiler: ', compiler_name, flush=True)
    return Compiler.VS2019


def get_platform(args) -> Platform:
    """get the platform from the argparse arguments"""
    platform = args.platform
    if platform == 'auto':
        return Platform.AUTO

    if platform.lower() == 'win32':
        return Platform.WIN32

    if platform.lower() in ['x64', 'win64']:
        return Platform.X64
{'fraction_non_alphanumeric': 0.11083213773314203, 'fraction_numerical': 0.04375896700143472, 'mean_word_length': 3.200301204819277, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3916805', 'n_tokens_mistral': 908, 'n_tokens_neox': 788, 'n_words': 264}