<commit_before>#!/bin/bash

# at some point we could try to add packages for Cywgin or macports(?) to this
# script.
redhat_packages=
debian_packages=
opensuse_packages=

function add_packages {
  redhat_packages="$redhat_packages $1";
  debian_packages="$debian_packages $2";
  opensuse_packages="$opensuse_packages $3";
}

if ! which g++ >&/dev/null; then
  echo "$0: g++ is not installed."
  add_packages gcc-c++ g++ gcc-c++
fi

if ! echo "#include <zlib.h>" | gcc -E - >&/dev/null; then
  echo "$0: zlib is not installed."
  add_packages zlib-devel zlib1g-dev zlib-devel
fi

if ! which wget >&/dev/null; then
  if ! which curl >&/dev/null; then
    echo "$0: wget is not installed."
    add_packages wget wget wget
  fi
fi

for f in make gcc automake libtool autoconf patch grep bzip2 gzip git; do
  if ! which $f >&/dev/null; then
    echo "$0: $f is not installed."
    add_packages $f $f $f
  fi
done

if ! which svn >&/dev/null; then
  echo "$0: subversion is not installed"
  add_packages subversion subversion subversion
fi

if ! which awk >&/dev/null; then
  echo "$0: awk is not installed"
  add_packages gawk gawk gawk
fi

if which python >&/dev/null ; then
  version=`python 2>&1 --version | awk '{print $2}' `
  if [[ $version != "2."* ]] ; then
    if which python2.7 >&/dev/null  || which python2 >&/dev/null ; then
      echo "$0: python 2.7 is not the default python. You should either make it"
      echo "$0: default or create an bash alias for kaldi scripts to run correctly"
    else
      echo "$0: python 2.7 is not installed"
      add_packages python2.7 python2.7 python2.7
    fi
  fi
else
  echo "$0: python 2.7 is not installed"
  add_packages python2.7 python2.7 python2.7
fi

printed=false
status=0

if which apt-get >&/dev/null; then
  if [ ! -z "$debian_packages" ]; then
    echo "$0: we recommend that you run (our best guess):"<commit_msg>should add python-pip as dependency when python is missing<commit_after>#!/bin/bash

# at some point we could try to add packages for Cywgin or macports(?) to this
# script.
redhat_packages=
debian_packages=
opensuse_packages=

function add_packages {
  redhat_packages="$redhat_packages $1";
  debian_packages="$debian_packages $2";
  opensuse_packages="$opensuse_packages $3";
}

if ! which g++ >&/dev/null; then
  echo "$0: g++ is not installed."
  add_packages gcc-c++ g++ gcc-c++
fi

if ! echo "#include <zlib.h>" | gcc -E - >&/dev/null; then
  echo "$0: zlib is not installed."
  add_packages zlib-devel zlib1g-dev zlib-devel
fi

if ! which wget >&/dev/null; then
  if ! which curl >&/dev/null; then
    echo "$0: wget is not installed."
    add_packages wget wget wget
  fi
fi

for f in make gcc automake libtool autoconf patch grep bzip2 gzip git; do
  if ! which $f >&/dev/null; then
    echo "$0: $f is not installed."
    add_packages $f $f $f
  fi
done

if ! which svn >&/dev/null; then
  echo "$0: subversion is not installed"
  add_packages subversion subversion subversion
fi

if ! which awk >&/dev/null; then
  echo "$0: awk is not installed"
  add_packages gawk gawk gawk
fi

if which python >&/dev/null ; then
  version=`python 2>&1 --version | awk '{print $2}' `
  if [[ $version != "2."* ]] ; then
    if which python2.7 >&/dev/null  || which python2 >&/dev/null ; then
      echo "$0: python 2.7 is not the default python. You should either make it"
      echo "$0: default or create an bash alias for kaldi scripts to run correctly"
    else
      echo "$0: python 2.7 is not installed"
      add_packages python2.7 python2.7 python2.7
			add_packages python-pip python-pip python-pip
    fi
  fi
else
  echo "$0: python 2.7 is not installed"
  add_packages python2.7 python2.7 python2.7
	add_packages python-pip python-pip python-pip
fi

printed=false
status=0

if which apt-get >&/dev/null; then
  if [ ! -z "$debian_packages" ]; then
    echo "$0: we recommend that you run (our best guess):"
{'fraction_non_alphanumeric': 0.11841767274595427, 'fraction_numerical': 0.021577189827896224, 'mean_word_length': 3.345982142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '1767062', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1352, 'n_words': 509}