<commit_before>calculate_concurrency() {
  MEMORY_AVAILABLE=${MEMORY_AVAILABLE-$(detect_memory 512)}
  WEB_MEMORY=${WEB_MEMORY-512}
  WEB_CONCURRENCY=${WEB_CONCURRENCY-$((MEMORY_AVAILABLE/WEB_MEMORY))}
  if (( WEB_CONCURRENCY < 1 )); then
    WEB_CONCURRENCY=1
  elif (( WEB_CONCURRENCY > 32 )); then
    WEB_CONCURRENCY=32
  fi
  WEB_CONCURRENCY=$WEB_CONCURRENCY
}

log_concurrency() {
  echo "Detected $MEMORY_AVAILABLE MB available memory, $WEB_MEMORY MB limit per process (WEB_MEMORY)"
  echo "Recommending WEB_CONCURRENCY=$WEB_CONCURRENCY"
}

detect_memory() {
  local default=$1
  local limit=$(ulimit -u)

  case $limit in
    256) echo "512";;
    512) echo "1024";;
    32768) echo "6144";;
    *) echo "$default";;
  esac
}


export PATH="$HOME/.heroku/node/bin:$HOME/bin:$HOME/node_modules/.bin:$oracle_home:$PATH"
export NODE_HOME="$HOME/.heroku/node"

export ORACLE_HOME="$oracle_home"
export LD_LIBRARY_PATH="$oracle_home:$LD_LIBRARY_PATH"
export TNS_ADMIN="$oracle_home/network/admin"
export OCI_LIB_DIR="$oracle_home"
export OCI_INC_DIR="$oracle_home/sdk/include"

calculate_concurrency
log_concurrency

export MEMORY_AVAILABLE=$MEMORY_AVAILABLE
export WEB_MEMORY=$WEB_MEMORY
export WEB_CONCURRENCY=$WEB_CONCURRENCY<commit_msg>set variable before using<commit_after>calculate_concurrency() {
  MEMORY_AVAILABLE=${MEMORY_AVAILABLE-$(detect_memory 512)}
  WEB_MEMORY=${WEB_MEMORY-512}
  WEB_CONCURRENCY=${WEB_CONCURRENCY-$((MEMORY_AVAILABLE/WEB_MEMORY))}
  if (( WEB_CONCURRENCY < 1 )); then
    WEB_CONCURRENCY=1
  elif (( WEB_CONCURRENCY > 32 )); then
    WEB_CONCURRENCY=32
  fi
  WEB_CONCURRENCY=$WEB_CONCURRENCY
}

log_concurrency() {
  echo "Detected $MEMORY_AVAILABLE MB available memory, $WEB_MEMORY MB limit per process (WEB_MEMORY)"
  echo "Recommending WEB_CONCURRENCY=$WEB_CONCURRENCY"
}

detect_memory() {
  local default=$1
  local limit=$(ulimit -u)

  case $limit in
    256) echo "512";;
    512) echo "1024";;
    32768) echo "6144";;
    *) echo "$default";;
  esac
}

local oracle_home="$HOME/.oracle/"

export PATH="$HOME/.heroku/node/bin:$HOME/bin:$HOME/node_modules/.bin:$oracle_home:$PATH"
export NODE_HOME="$HOME/.heroku/node"

export ORACLE_HOME="$oracle_home"
export LD_LIBRARY_PATH="$oracle_home:$LD_LIBRARY_PATH"
export TNS_ADMIN="$oracle_home/network/admin"
export OCI_LIB_DIR="$oracle_home"
export OCI_INC_DIR="$oracle_home/sdk/include"

calculate_concurrency
log_concurrency

export MEMORY_AVAILABLE=$MEMORY_AVAILABLE
export WEB_MEMORY=$WEB_MEMORY
export WEB_CONCURRENCY=$WEB_CONCURRENCY
{'fraction_non_alphanumeric': 0.1251480457954994, 'fraction_numerical': 0.02763521515988946, 'mean_word_length': 6.431085043988269, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3695283', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1006, 'n_words': 156}