<commit_before>import json
import os
import psycopg2
import urlparse

# Open DB connection
url = urlparse.urlparse(os.environ["HEROKU_POSTGRESQL_PUCE_URL"])
conn = psycopg2.connect(
        database=url.path[1:],
        user=url.username,
        password=url.password,
        host=url.hostname,
        port=url.port
    )
cur = conn.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS obdreadings(vehicleid TEXT, unix_timestamp BIGINT, latitude DECIMAL(11,8), longitude DECIMAL(11,8), readings JSON);""")
print('Database ready to go!')


def put(json_data):<commit_msg>(vehicleid, unix_timestamp) is now a primary key.<commit_after>import json
import os
import psycopg2
import urlparse

# Open DB connection
url = urlparse.urlparse(os.environ["DATABASE_URL"])
conn = psycopg2.connect(
        database=url.path[1:],
        user=url.username,
        password=url.password,
        host=url.hostname,
        port=url.port
    )
cur = conn.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS obdreadings(
                      vehicleid TEXT           NOT NULL,
                      unix_timestamp BIGINT    NOT NULL,
                      latitude DECIMAL(11,8),
                      longitude DECIMAL(11,8),
                      readings JSON,
                      PRIMARY KEY (vehicleid, unix_timestamp));""")
conn.commit();
print('Database ready to go!')


def put(json_data):
{'fraction_non_alphanumeric': 0.10678210678210678, 'fraction_numerical': 0.012987012987012988, 'mean_word_length': 2.728494623655914, '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': '6006306', 'n_tokens_mistral': 444, 'n_tokens_neox': 420, 'n_words': 101}