<commit_before>#!/bin/bash

# Figure out what dependencies are needed
function get_package_names() {
  # Get the dependencies for each package
  packages=()
  for arg in $args; do
    packages+=($arg)
  done
  if [[ " ${packages[@]} " =~ " pyne " ]]; then
    packages+=(gcc)
    packages+=(cmake)
    packages+=(python)
    packages+=(hdf5)
    packages+=(setuptools)
    packages+=(cython)
    packages+=(numpy)
    packages+=(scipy)
    packages+=(pytables)
    packages+=(moab)
    packages+=(pytaps)
  fi
  if [[ " ${packages[@]} " =~ " dagmc " ]]; then
    packages+=(gcc)
    packages+=(cmake)
    packages+=(hdf5)
    packages+=(moab)
  fi
  if [[ " ${packages[@]} " =~ " fluka " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " geant4 " ]]; then
    packages+=(gcc)
    packages+=(cmake)
  fi
  if [[ " ${packages[@]} " =~ " mcnp5 " ]]; then
    : # no dependencies
  fi
  if [[ " ${packages[@]} " =~ " pytaps " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(hdf5)
    packages+=(numpy)
  fi
  if [[ " ${packages[@]} " =~ " moab " ]]; then
    packages+=(gcc)
    packages+=(hdf5)
  fi
  if [[ " ${packages[@]} " =~ " cgm " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " cubit " ]]; then
    : # no dependencies
  fi
  if [[ " ${packages[@]} " =~ " pytables " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(hdf5)
    packages+=(setuptools)
    packages+=(cython)
    packages+=(numpy)
  fi
  if [[ " ${packages[@]} " =~ " scipy " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(cython)
    packages+=(numpy)
  fi
  if [[ " ${packages[@]} " =~ " numpy " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(cython)
  fi
  if [[ " ${packages[@]} " =~ " cython " ]]; then
    packages+=(gcc)
    packages+=(python)
  fi
  if [[ " ${packages[@]} " =~ " setuptools " ]]; then
    packages+=(gcc)
    packages+=(python)
  fi
  if [[ " ${packages[@]} " =~ " hdf5 " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " python " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " cmake " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " openmpi " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " gcc " ]]; then
    packages+=(mpc)
  fi
  if [[ " ${packages[@]} " =~ " mpc " ]]; then
    packages+=(mpfr)
  fi
  if [[ " ${packages[@]} " =~ " mpfr " ]]; then
    packages+=(gmp)
  fi
  if [[ " ${packages[@]} " =~ " gmp " ]]; then
    : # no dependencies
  fi

  # Put the dependencies in the correct build order
  all_packages=" gmp mpfr mpc gcc openmpi cmake python hdf5 
                 setuptools numpy scipy cython pytables
                 cubit cgm moab pytaps mcnp5 geant4 fluka dagmc pyne "
  packages_ordered=()
  for package in $all_packages; do
    if [[ " ${packages[@]} " =~ " ${package} " ]]; then
      packages_ordered+=($package)
    fi
  done
  packages=("${packages_ordered[@]}")
}

# Delete unneeded stuff
function cleanup() {
  cd $orig_dir
  rm -rf $orig_dir/* $build_dir $install_dir
}

function main() {
  source ./dirs.bash
  source ./common.bash
  source ./build_funcs.bash
  set_versions
  set_env
  export jobs=12

  # Figure out which packages need to be built
  get_package_names

  # Cleanup directories
  #rm -rf $build_dir $install_dir
  #mkdir -p $dist_dir $build_dir $install_dir $copy_dir $DATAPATH

  # Build the packages
  for name in "${packages[@]}"; do
    eval version=\$"$name"_version
    echo Building $name-$version ...
    #build_$name
  done

  #cleanup
}

set -e
export args="$@"
export args=" "$args" "

main<commit_msg>uncommented things<commit_after>#!/bin/bash

# Figure out what dependencies are needed
function get_package_names() {
  # Get the dependencies for each package
  packages=()
  for arg in $args; do
    packages+=($arg)
  done
  if [[ " ${packages[@]} " =~ " pyne " ]]; then
    packages+=(gcc)
    packages+=(cmake)
    packages+=(python)
    packages+=(hdf5)
    packages+=(setuptools)
    packages+=(cython)
    packages+=(numpy)
    packages+=(scipy)
    packages+=(pytables)
    packages+=(moab)
    packages+=(pytaps)
  fi
  if [[ " ${packages[@]} " =~ " dagmc " ]]; then
    packages+=(gcc)
    packages+=(cmake)
    packages+=(hdf5)
    packages+=(moab)
  fi
  if [[ " ${packages[@]} " =~ " fluka " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " geant4 " ]]; then
    packages+=(gcc)
    packages+=(cmake)
  fi
  if [[ " ${packages[@]} " =~ " mcnp5 " ]]; then
    : # no dependencies
  fi
  if [[ " ${packages[@]} " =~ " pytaps " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(hdf5)
    packages+=(numpy)
  fi
  if [[ " ${packages[@]} " =~ " moab " ]]; then
    packages+=(gcc)
    packages+=(hdf5)
  fi
  if [[ " ${packages[@]} " =~ " cgm " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " cubit " ]]; then
    : # no dependencies
  fi
  if [[ " ${packages[@]} " =~ " pytables " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(hdf5)
    packages+=(setuptools)
    packages+=(cython)
    packages+=(numpy)
  fi
  if [[ " ${packages[@]} " =~ " scipy " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(cython)
    packages+=(numpy)
  fi
  if [[ " ${packages[@]} " =~ " numpy " ]]; then
    packages+=(gcc)
    packages+=(python)
    packages+=(cython)
  fi
  if [[ " ${packages[@]} " =~ " cython " ]]; then
    packages+=(gcc)
    packages+=(python)
  fi
  if [[ " ${packages[@]} " =~ " setuptools " ]]; then
    packages+=(gcc)
    packages+=(python)
  fi
  if [[ " ${packages[@]} " =~ " hdf5 " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " python " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " cmake " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " openmpi " ]]; then
    packages+=(gcc)
  fi
  if [[ " ${packages[@]} " =~ " gcc " ]]; then
    packages+=(mpc)
  fi
  if [[ " ${packages[@]} " =~ " mpc " ]]; then
    packages+=(mpfr)
  fi
  if [[ " ${packages[@]} " =~ " mpfr " ]]; then
    packages+=(gmp)
  fi
  if [[ " ${packages[@]} " =~ " gmp " ]]; then
    : # no dependencies
  fi

  # Put the dependencies in the correct build order
  all_packages=" gmp mpfr mpc gcc openmpi cmake python hdf5 
                 setuptools numpy scipy cython pytables
                 cubit cgm moab pytaps mcnp5 geant4 fluka dagmc pyne "
  packages_ordered=()
  for package in $all_packages; do
    if [[ " ${packages[@]} " =~ " ${package} " ]]; then
      packages_ordered+=($package)
    fi
  done
  packages=("${packages_ordered[@]}")
}

# Delete unneeded stuff
function cleanup() {
  cd $orig_dir
  rm -rf $orig_dir/* $build_dir $install_dir
}

function main() {
  source ./dirs.bash
  source ./common.bash
  source ./build_funcs.bash
  set_versions
  set_env
  export jobs=12

  # Figure out which packages need to be built
  get_package_names

  # Cleanup directories
  rm -rf $build_dir $install_dir
  mkdir -p $dist_dir $build_dir $install_dir $copy_dir $DATAPATH

  # Build the packages
  for name in "${packages[@]}"; do
    eval version=\$"$name"_version
    echo Building $name-$version ...
    build_$name
  done

  cleanup
}

set -e
export args="$@"
export args=" "$args" "

main
{'fraction_non_alphanumeric': 0.1971714952629411, 'fraction_numerical': 0.003569957435122889, 'mean_word_length': 2.907725321888412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3551396', 'n_tokens_mistral': 2700, 'n_tokens_neox': 2625, 'n_words': 606}