<commit_before>#! /usr/bin/env python

# bedquilt installer script


import argparse
import subprocess
import os
import glob


SCRIPT_LOCATION = os.path.dirname(os.path.realpath(__file__))
SQL_DIR = os.path.realpath(os.path.join(SCRIPT_LOCATION, '../sql'))


def get_sql_files():
    return sorted(glob.glob(os.path.join(SQL_DIR, '*.sql')))


def main():
    parser = argparse.ArgumentParser(description='Bedquilt installer')
    parser.add_argument('--database',
                        dest='database',
                        metavar='database',
                        type=str,
                        nargs=1,
                        help='the database to install to')

    args = parser.parse_args()
    database = args.database[0]

    sql_files = get_sql_files()

    for sql_file in sql_files:
        print "Installing {0} to {1}".format(sql_file, database)
        subprocess.call(
            "psql {0} < {1}".format(database, sql_file),
            shell=True
        )


if __name__ == "__main__":
    main()<commit_msg>terser<commit_after>#! /usr/bin/env python

# bedquilt installer script


import argparse
import subprocess
import os
import glob


SCRIPT_LOCATION = os.path.dirname(os.path.realpath(__file__))
SQL_DIR = os.path.realpath(os.path.join(SCRIPT_LOCATION, '../sql'))


def get_sql_files():
    return sorted(glob.glob(os.path.join(SQL_DIR, '*.sql')))


def main():
    parser = argparse.ArgumentParser(description='Bedquilt installer')
    parser.add_argument('--database',
                        dest='database',
                        metavar='database',
                        type=str,
                        nargs=1,
                        help='the database to install to')

    args = parser.parse_args()
    database = args.database[0]

    for sql_file in get_sql_files():
        print "Installing {0} to {1}".format(sql_file, database)
        subprocess.call(
            "psql {0} < {1}".format(database, sql_file),
            shell=True
        )


if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.12524557956777996, 'fraction_numerical': 0.005893909626719057, 'mean_word_length': 2.269662921348315, 'pattern_counts': {'":': 2, '<': 5, '<?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': '2678868', 'n_tokens_mistral': 647, 'n_tokens_neox': 613, 'n_words': 127}