<commit_before>#!/bin/bash
set -o errexit

PYTHON_VERSION="$1"

function cleanup ()
{
    yum clean all
    rm -rf /var/yum/cache
}

trap "cleanup" TERM EXIT

function install_from_source ()
{
    declare -A VERSIONS

    VERSIONS=( ["3.7"]="3.7.9" ["3.8"]="3.8.6" ["3.9"]="3.9.0" )
    PYVER="${VERSIONS[$PYTHON_VERSION]}"
    PYURL="https://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tgz"

    case "${PYTHON_VERSION}" in
        3.7|3.8|3.9) BUILD_ARGS=("--enable-optimizations" "--with-ensurepip=install") ;;
    esac

    wget "${PYURL}"
    tar xzf "Python-${PYVER}.tgz"
    pushd Python-"${PYVER}"

    export CFLAGS="-D_GNU_SOURCE -fPIC -fwrapv"
    export CXXFLAGS="-D_GNU_SOURCE -fPIC -fwrapv"
    export OPT="-D_GNU_SOURCE -fPIC -fwrapv"
    export LINKCC="gcc"
    export CC="gcc"<commit_msg>feat: upgrade Pythons to the latest stable versions (#31)<commit_after>#!/bin/bash
set -o errexit

PYTHON_VERSION="$1"

function cleanup ()
{
    yum clean all
    rm -rf /var/yum/cache
}

trap "cleanup" TERM EXIT

function install_from_source ()
{
    declare -A VERSIONS

    VERSIONS=( ["3.7"]="3.7.12" ["3.8"]="3.8.12" ["3.9"]="3.9.9" )
    PYVER="${VERSIONS[$PYTHON_VERSION]}"
    PYURL="https://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tgz"

    case "${PYTHON_VERSION}" in
        3.7|3.8|3.9) BUILD_ARGS=("--enable-optimizations" "--with-ensurepip=install") ;;
    esac

    wget "${PYURL}"
    tar xzf "Python-${PYVER}.tgz"
    pushd Python-"${PYVER}"

    export CFLAGS="-D_GNU_SOURCE -fPIC -fwrapv"
    export CXXFLAGS="-D_GNU_SOURCE -fPIC -fwrapv"
    export OPT="-D_GNU_SOURCE -fPIC -fwrapv"
    export LINKCC="gcc"
    export CC="gcc"
{'fraction_non_alphanumeric': 0.19041916167664671, 'fraction_numerical': 0.02874251497005988, 'mean_word_length': 3.2519083969465647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '885733', 'n_tokens_mistral': 724, 'n_tokens_neox': 676, 'n_words': 123}