<commit_before>#!/usr/bin/env bash

set -e

VERSION="v1.0.0"

# uname -s, uname -m
# Deb 32: Linux i686
# Ubuntu 64: Linux x86_64
# FreeBSD: FreeBSD amd64

if [[ "$UID" != 0 ]]; then
    echo NOTE: sudo needed to set up and run start service
    exit 1
fi


function setenv {
    OS=$(uname -s | tr "[:upper:]" "[:lower:]")
    ARCH=$(uname -m)

    SUPPORTED=false
    if [[ $OS == "linux" ]]; then
        case $ARCH in
            "x86_64")
                ARCH="amd64"
                SUPPORTED=true
            ;;
            "i686")
                ARCH="386"
                SUPPORTED=true
            ;;
            # untested
            arm*)
                ARCH="arm"
                SUPPORTED=true
            ;;
        esac
    elif [[ $OS == 'freebsd' ]]; then
        # untested for 32 bit
        ARCH=$(uname -m)
        SUPPORTED=true
    fi

    if [[ $SUPPORTED == false ]]; then
        echo $OS $ARCH is not supported
        exit 2
    fi
}

function install-binary {
    echo Stopping docker-volume-local-persist service if running
    echo ''
    if [[ $* == *--upstart* ]]; then
        sudo service docker-volume-local-persist stop
    else
        sudo systemctl stop docker-volume-local-persist
    fi

    BINARY_URL="https://github.com/CWSpear/local-persist/releases/download/${VERSION}/local-persist-${OS}-${ARCH}"
    BINARY_DEST="/usr/bin/docker-volume-local-persist"

    echo Downloading binary:
    echo "  From: $BINARY_URL"
    echo "  To:   $BINARY_DEST"
<commit_msg>Allow the stop-before-installing command to fail<commit_after>#!/usr/bin/env bash

set -e

VERSION="v1.0.0"

# uname -s, uname -m
# Deb 32: Linux i686
# Ubuntu 64: Linux x86_64
# FreeBSD: FreeBSD amd64

if [[ "$UID" != 0 ]]; then
    echo NOTE: sudo needed to set up and run start service
    exit 1
fi


function setenv {
    OS=$(uname -s | tr "[:upper:]" "[:lower:]")
    ARCH=$(uname -m)

    SUPPORTED=false
    if [[ $OS == "linux" ]]; then
        case $ARCH in
            "x86_64")
                ARCH="amd64"
                SUPPORTED=true
            ;;
            "i686")
                ARCH="386"
                SUPPORTED=true
            ;;
            # untested
            arm*)
                ARCH="arm"
                SUPPORTED=true
            ;;
        esac
    elif [[ $OS == 'freebsd' ]]; then
        # untested for 32 bit
        ARCH=$(uname -m)
        SUPPORTED=true
    fi

    if [[ $SUPPORTED == false ]]; then
        echo $OS $ARCH is not supported
        exit 2
    fi
}

function install-binary {
    echo Stopping docker-volume-local-persist service if running
    echo ''
    if [[ $* == *--upstart* ]]; then
        (sudo service docker-volume-local-persist stop || true)
    else
        (sudo systemctl stop docker-volume-local-persist || true)
    fi

    BINARY_URL="https://github.com/CWSpear/local-persist/releases/download/${VERSION}/local-persist-${OS}-${ARCH}"
    BINARY_DEST="/usr/bin/docker-volume-local-persist"

    echo Downloading binary:
    echo "  From: $BINARY_URL"
    echo "  To:   $BINARY_DEST"

{'fraction_non_alphanumeric': 0.13081679140904653, 'fraction_numerical': 0.021477383664171817, 'mean_word_length': 1.7894736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1503257', 'n_tokens_mistral': 1121, 'n_tokens_neox': 980, 'n_words': 255}