<commit_before>#!/bin/bash

# Apply Django migrations, if they are out of date.

cat <<EOF
# `whoami`@`hostname`:$PWD$ migrate.sh $@
EOF

set -e

DIR="${1:-$PWD}"

mkdir -p "$DIR"
cd "$DIR"

touch migrate.txt.md5
manage.py migrate --list > migrate.txt

if ! md5sum -c --status migrate.txt.md5 > /dev/null 2>&1; then
    echo 'Migrations are out of date.'
    manage.py migrate --noinput
    manage.py migrate --list > migrate.txt
    md5sum migrate.txt > migrate.txt.md5
else
    echo 'Migrations are already up to date.'
fi<commit_msg>Update `migrate.sh` script now that `manage.py` is not installed as a script, but must be executed from the ICEkit source or project root.<commit_after>#!/bin/bash

# Apply Django migrations, if they are out of date.

cat <<EOF
# `whoami`@`hostname`:$PWD$ migrate.sh $@
EOF

set -e

DIR="${1:-$PWD}"

mkdir -p "$DIR"

touch "$DIR/migrate.txt.md5"
python manage.py migrate --list > "$DIR/migrate.txt"

if ! md5sum -c --status "$DIR/migrate.txt.md5" > /dev/null 2>&1; then
    echo 'Migrations are out of date.'
    python manage.py migrate --noinput
    python manage.py migrate --list > "$DIR/migrate.txt"
    md5sum migrate.txt > "$DIR/migrate.txt.md5"
else
    echo 'Migrations are already up to date.'
fi
{'fraction_non_alphanumeric': 0.14561544650040226, 'fraction_numerical': 0.012872083668543845, 'mean_word_length': 3.3194444444444446, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '2523160', 'n_tokens_mistral': 473, 'n_tokens_neox': 450, 'n_words': 146}