<commit_before>#!/bin/bash

script_dir="$( cd "$( dirname "$0" )" && pwd )"

check_errors () {
 local status="$?"
 local msg="$@"
 if [ "$status" != "0" ]; then
  echo "ERROR: operation finished with error code $status"
  test ! -z "$msg" && echo "$msg"
  exit "$status"
 fi
}

test ! -d "$script_dir/ubuntu_yakkety_chroot" || check_errors "directory $script_dir/ubuntu_yakkety_chroot already exist!"

wget -O /tmp/ubuntu-root.tar.gz https://partner-images.canonical.com/core/yakkety/current/ubuntu-yakkety-core-cloudimg-amd64-root.tar.gz
check_errors

mkdir -p "$script_dir/ubuntu_yakkety_chroot"
check_errors

cd "$script_dir/ubuntu_yakkety_chroot"
check_errors

gunzip -c /tmp/ubuntu-root.tar.gz | tar xf - --no-same-owner --preserve-permissions --exclude='dev'
check_errors

rm /tmp/ubuntu-root.tar.gz
check_errors<commit_msg>fixup! Added script to download minimal ubuntu 16.10 chroot<commit_after>#!/bin/bash

script_dir="$( cd "$( dirname "$0" )" && pwd )"

check_errors () {
 local status="$?"
 local msg="$@"
 if [ "$status" != "0" ]; then
  echo "ERROR: operation finished with error code $status"
  test ! -z "$msg" && echo "$msg"
  exit "$status"
 fi
}

test ! -d "$script_dir/ubuntu_chroot" || check_errors "directory $script_dir/ubuntu_chroot already exist!"

wget -O /tmp/ubuntu-root.tar.gz https://partner-images.canonical.com/core/yakkety/current/ubuntu-yakkety-core-cloudimg-amd64-root.tar.gz
check_errors

mkdir -p "$script_dir/ubuntu_chroot"
check_errors

cd "$script_dir/ubuntu_chroot"
check_errors

gunzip -c /tmp/ubuntu-root.tar.gz | tar xf - --no-same-owner --preserve-permissions --exclude='dev'
check_errors

rm /tmp/ubuntu-root.tar.gz
check_errors
{'fraction_non_alphanumeric': 0.16129032258064516, 'fraction_numerical': 0.007168458781362007, 'mean_word_length': 4.473856209150327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5923316', 'n_tokens_mistral': 668, 'n_tokens_neox': 597, 'n_words': 133}