<commit_before>#!/usr/bin/env python
import os, sys

############ to be deleted in the future
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "db_webcrawler.settings")
import django
django.setup()
import utils
###########

import argparse
import requests
import json

ATTEMPT_URL = "http://127.0.0.1:8000/api/attempt"

def parse_args():
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers()

    parser_info = subparsers.add_parser('info')
    parser_info.add_argument("-atempt", "--attempt", type=int, help='the id of the attempt')

    parser_benchmark = subparsers.add_parser('benchmark')
    parser_benchmark.add_argument('-attempt', '--attempt', type=int, help='the id of the attempt')
    parser_benchmark.add_argument('-database', '--database', type=str, help='the database you are using, e.g. mysql')
    parser_benchmark.add_argument('-host', '--host', type=str, help='the host address of your database server')
    parser_benchmark.add_argument('-port', '--port', type=int, help='the port of your database server')
    parser_benchmark.add_argument('-name', '--name', type=str, help='the name of your database')
    parser_benchmark.add_argument('-username', '--username', type=str, help='the username of your database server')
    parser_benchmark.add_argument('-password', '--password', type=str, help='the password of your database server')
    parser_benchmark.add_argument('-num_threads', '--num_threads', type=int, help='the number of threads you want to use to submit forms')
    parser_benchmark.add_argument('-timeout', '--timeout', type=int, help='the timeout for submitting forms')

    args = parser.parse_args()

    return args

def get_attempt_info(attempt_id):
    data = json.dumps({'id': attempt_id})
    response = requests.get(ATTEMPT_URL, data)
    return response.json()

def run_benchmark(atempt_id, database, benchmark):
    attempt_id = 4
    database = {
        'database': 'mysql',<commit_msg>fix typo<commit_after>#!/usr/bin/env python
import os, sys

############ to be deleted in the future
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "db_webcrawler.settings")
import django
django.setup()
import utils
###########

import argparse
import requests
import json

ATTEMPT_URL = "http://127.0.0.1:8000/api/attempt"

def parse_args():
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers()

    parser_info = subparsers.add_parser('info')
    parser_info.add_argument("-attempt", "--attempt", type=int, help='the id of the attempt')

    parser_benchmark = subparsers.add_parser('benchmark')
    parser_benchmark.add_argument('-attempt', '--attempt', type=int, help='the id of the attempt')
    parser_benchmark.add_argument('-database', '--database', type=str, help='the database you are using, e.g. mysql')
    parser_benchmark.add_argument('-host', '--host', type=str, help='the host address of your database server')
    parser_benchmark.add_argument('-port', '--port', type=int, help='the port of your database server')
    parser_benchmark.add_argument('-name', '--name', type=str, help='the name of your database')
    parser_benchmark.add_argument('-username', '--username', type=str, help='the username of your database server')
    parser_benchmark.add_argument('-password', '--password', type=str, help='the password of your database server')
    parser_benchmark.add_argument('-num_threads', '--num_threads', type=int, help='the number of threads you want to use to submit forms')
    parser_benchmark.add_argument('-timeout', '--timeout', type=int, help='the timeout for submitting forms')

    args = parser.parse_args()

    return args

def get_attempt_info(attempt_id):
    data = json.dumps({'id': attempt_id})
    response = requests.get(ATTEMPT_URL, data)
    return response.json()

def run_benchmark(atempt_id, database, benchmark):
    attempt_id = 4
    database = {
        'database': 'mysql',
{'fraction_non_alphanumeric': 0.15340638399237733, 'fraction_numerical': 0.005240590757503573, 'mean_word_length': 4.998571428571428, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6459352', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1311, 'n_words': 314}