<commit_before># Runs stuff in a wrapper. If exit code is not zero, it exits
#
# Usage:
#     function greet() {
#       echo "Hello $1"
#     }
#     try_run "greet Akash"
function try_run() {
  (eval $1)
  local cmd_result=$?
  if [[ $cmd_result != 0 ]] ; then
      echo "Exiting"
      exit $cmd_result
  fi
}


# Will exit if the file is present
#
# Usage:
#
#     exit_if_present path/to/file
#
function exit_if_file_exists() {
  test -f $1 && exit
}


# Outputs log line
#
# Usage:
#
#     output_line "Cloning repository"
#
function output_line() {
  local spacing="      "
  echo "${spacing} $1"
}

# Outputs section heading
#
# Usage:
#
#     output_section "Application tasks"
#
function output_section() {
  local indentation="----->"
  echo "${indentation} $1"
}


function ensure_erlang_path() {
  mkdir -p $erlang_path
}


# Gets the version, mentioned in the config for the tool
#
# Usage:
#
#     get_version "elixir"
#     get_version "erlang"
#
function get_version() {
  local version_var_name="$1_version"
  echo ${!version_var_name}
}


# Download archive of branch, tag or commit of a project from Github
#
# Usage:
#
#     github_download "elixir-lang" "elixir" "master"
#
function github_download() {
  # We don't use the -J option because curl on Heroku is really old.
  # So we pass a filename ourselves.
  curl -k -s -L "https://github.com/$1/$2/archive/$3.tar.gz" -o "${cache_dir}/$2-$3.tar.gz" || exit 1
}


function infer_versions() {
  output_section "Checking Erlang, Elixir and Rebar versions"

  local custom_language_versions_file="${build_path}/.language_versions"

  # Source for default versions file from buildpack first
  source "${build_pack_path}/.language_versions"

  if [ -f $custom_language_versions_file ];
  then
    source $custom_language_versions_file
  else
    output_line "WARNING: .language_versions wasn't found"
    output_line "Using default language versions from Elixir buildpack"
  fi

  output_line "Will use the following versions:"
  output_line "* Erlang ${erlang_version}"
  output_line "* Elixir ${elixir_version[0]} ${elixir_version[1]}"
  output_line "* Rebar ${rebar_version[0]} ${rebar_version[1]}"
}<commit_msg>Add some more debugging lines<commit_after># Runs stuff in a wrapper. If exit code is not zero, it exits
#
# Usage:
#     function greet() {
#       echo "Hello $1"
#     }
#     try_run "greet Akash"
function try_run() {
  (eval $1)
  local cmd_result=$?
  if [[ $cmd_result != 0 ]] ; then
      echo "Exiting"
      exit $cmd_result
  fi
}


# Will exit if the file is present
#
# Usage:
#
#     exit_if_present path/to/file
#
function exit_if_file_exists() {
  test -f $1 && exit
}


# Outputs log line
#
# Usage:
#
#     output_line "Cloning repository"
#
function output_line() {
  local spacing="      "
  echo "${spacing} $1"
}

# Outputs section heading
#
# Usage:
#
#     output_section "Application tasks"
#
function output_section() {
  local indentation="----->"
  echo "${indentation} $1"
}


function ensure_erlang_path() {
  mkdir -p $erlang_path
}


# Gets the version, mentioned in the config for the tool
#
# Usage:
#
#     get_version "elixir"
#     get_version "erlang"
#
function get_version() {
  local version_var_name="$1_version"
  echo ${!version_var_name}
}


# Download archive of branch, tag or commit of a project from Github
#
# Usage:
#
#     github_download "elixir-lang" "elixir" "master"
#
function github_download() {
  # We don't use the -J option because curl on Heroku is really old.
  # So we pass a filename ourselves.
  echo "https://github.com/$1/$2/archive/$3.tar.gz"
  echo "${cache_path}/$2-$3.tar.gz"
  curl -k -s -L "https://github.com/$1/$2/archive/$3.tar.gz" -o "${cache_path}/$2-$3.tar.gz" || exit 1
}


function infer_versions() {
  output_section "Checking Erlang, Elixir and Rebar versions"

  local custom_language_versions_file="${build_path}/.language_versions"

  # Source for default versions file from buildpack first
  source "${build_pack_path}/.language_versions"

  if [ -f $custom_language_versions_file ];
  then
    source $custom_language_versions_file
  else
    output_line "WARNING: .language_versions wasn't found"
    output_line "Using default language versions from Elixir buildpack"
  fi

  output_line "Will use the following versions:"
  output_line "* Erlang ${erlang_version}"
  output_line "* Elixir ${elixir_version[0]} ${elixir_version[1]}"
  output_line "* Rebar ${rebar_version[0]} ${rebar_version[1]}"
}
{'fraction_non_alphanumeric': 0.12608987256874582, 'fraction_numerical': 0.008718980549966466, 'mean_word_length': 3.7094736842105265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4847062', 'n_tokens_mistral': 1577, 'n_tokens_neox': 1520, 'n_words': 436}