<commit_before>#!/bin/bash

while [[ $# > 0 ]]
do
key="$1"

case $key in
    -p|--proxy)
    PROXY="$2"
    shift # past argument
    ;;
    -h|--help)
    HELP="1"
    shift
    ;;
    *)
            # unknown option
    ;;
esac
shift # past argument or value
done

if [[ "$HELP" == "1" ]]; then
  echo "./install-release.sh [-p proxy]"
  echo "To download through a proxy server, use -p socks5://127.0.0.1:1080 or -p http://127.0.0.1:3128 etc"
  exit
fi

YUM_CMD=$(command -v yum)
APT_CMD=$(command -v apt-get)

SOFTWARE_UPDATED=0

function update_software() {
  if [ ${SOFTWARE_UPDATED} -eq 1 ]; then
    return
  fi
  if [ -n "${YUM_CMD}" ]; then
    echo "Updating software repo via yum."
    ${YUM_CMD} -q makecache
  elif [ -n "${APT_CMD}" ]; then
    echo "Updating software repo via apt-get."
    ${APT_CMD} -qq update
  fi
  SOFTWARE_UPDATED=1
}

function install_component() {
  update_software
  local COMPONENT=$1
  if [ -n "${YUM_CMD}" ]; then
    echo "Installing ${COMPONENT} via yum."
    ${YUM_CMD} -y -q install $COMPONENT
  elif [ -n "${APT_CMD}" ]; then
    echo "Installing ${COMPONENT} via apt-get."
    ${APT_CMD} -y -qq install $COMPONENT
  fi
}

V2RAY_RUNNING=0
if pgrep "v2ray" > /dev/null ; then
  V2RAY_RUNNING=1
fi

VER="v1.7"

ARCH=$(uname -m)
VDIS="64"

if [[ "$ARCH" == "i686" ]] || [[ "$ARCH" == "i386" ]]; then
  VDIS="32"<commit_msg>Retrieve lastest version from github api<commit_after>#!/bin/bash

while [[ $# > 0 ]]
do
key="$1"

case $key in
    -p|--proxy)
    PROXY="$2"
    shift # past argument
    ;;
    -h|--help)
    HELP="1"
    shift
    ;;
    *)
            # unknown option
    ;;
esac
shift # past argument or value
done

if [[ "$HELP" == "1" ]]; then
  echo "./install-release.sh [-p proxy]"
  echo "To download through a proxy server, use -p socks5://127.0.0.1:1080 or -p http://127.0.0.1:3128 etc"
  exit
fi

YUM_CMD=$(command -v yum)
APT_CMD=$(command -v apt-get)

SOFTWARE_UPDATED=0

function update_software() {
  if [ ${SOFTWARE_UPDATED} -eq 1 ]; then
    return
  fi
  if [ -n "${YUM_CMD}" ]; then
    echo "Updating software repo via yum."
    ${YUM_CMD} -q makecache
  elif [ -n "${APT_CMD}" ]; then
    echo "Updating software repo via apt-get."
    ${APT_CMD} -qq update
  fi
  SOFTWARE_UPDATED=1
}

function install_component() {
  update_software
  local COMPONENT=$1
  if [ -n "${YUM_CMD}" ]; then
    echo "Installing ${COMPONENT} via yum."
    ${YUM_CMD} -y -q install $COMPONENT
  elif [ -n "${APT_CMD}" ]; then
    echo "Installing ${COMPONENT} via apt-get."
    ${APT_CMD} -y -qq install $COMPONENT
  fi
}

V2RAY_RUNNING=0
if pgrep "v2ray" > /dev/null ; then
  V2RAY_RUNNING=1
fi

VER="$(curl -s https://api.github.com/repos/v2ray/v2ray-core/releases/latest | grep 'tag_name' | cut -d\" -f4)"

ARCH=$(uname -m)
VDIS="64"

if [[ "$ARCH" == "i686" ]] || [[ "$ARCH" == "i386" ]]; then
  VDIS="32"
{'fraction_non_alphanumeric': 0.17585484996510817, 'fraction_numerical': 0.03314724354501047, 'mean_word_length': 2.8125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7218234', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1156, 'n_words': 303}