<commit_before>#!/bin/bash

CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BASE_DIR=$(pwd)

source "$CUR_DIR/common/include_import.sh"
source "$CUR_DIR/common/import_functions.sh"

INSERT_DB="1" #if to dump CSV into the DB
REDO_ALL="" #if to redo folders that have source files and IDs in DB
REDO_UNTARS="" #if to redo the untars for folders that have it
PARALLEL_INSERTS="1" #if to fork subprocecess when inserting data
MOVE_TO_DONE="1" #if set moves completed folders to DONE

#TODO check if these variables are still needed
first_host=""
hostn=""


#logger "Dropping database $DB"
#sudo mysql $MYSQL_CREDENTIALS -e "DROP database $DB;"

if [ "$INSERT_DB" == "1" ] ; then
  sudo mysql $MYSQL_CREDENTIALS -e "CREATE DATABASE IF NOT EXISTS \`$DB\`;"
  source "$CUR_DIR/common/create_db.sh"
fi

######################################

#filter folders by date
min_date="20120101"
min_time="$(date --utc --date "$min_date" +%s)"
<commit_msg>Moved DB create to create_db.sh script<commit_after>#!/bin/bash

CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BASE_DIR=$(pwd)

source "$CUR_DIR/common/include_import.sh"
source "$CUR_DIR/common/import_functions.sh"

INSERT_DB="1" #if to dump CSV into the DB
REDO_ALL="" #if to redo folders that have source files and IDs in DB
REDO_UNTARS="" #if to redo the untars for folders that have it
PARALLEL_INSERTS="1" #if to fork subprocecess when inserting data
MOVE_TO_DONE="1" #if set moves completed folders to DONE

#TODO check if these variables are still needed
first_host=""
hostn=""


#logger "Dropping database $DB"
#sudo mysql $MYSQL_CREDENTIALS -e "DROP database $DB;"

if [ "$INSERT_DB" == "1" ] ; then
  source "$CUR_DIR/common/create_db.sh"
fi

######################################

#filter folders by date
min_date="20120101"
min_time="$(date --utc --date "$min_date" +%s)"

{'fraction_non_alphanumeric': 0.17233927606699082, 'fraction_numerical': 0.014046461372231226, 'mean_word_length': 5.430555555555555, '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': '2849999', 'n_tokens_mistral': 696, 'n_tokens_neox': 651, 'n_words': 209}