<commit_before># Database Toolkit for Ernest 2003 Ecological Archives
# Mammalian Life History Database

# Usage: python /file/path/to/dbtk_ernest2003.py

# TO DO: Replace -999 with Null

import urllib
import MySQLdb as dbapi
import dbtk_tools
import datacleanup

# Create the Database
databaseinfo = dbtk_tools.get_database_info()
connection = dbapi.connect(host = databaseinfo[2],
                           port = databaseinfo[3],
                           user = databaseinfo[0],
                           passwd = databaseinfo[1])
cursor = connection.cursor()
cursor.execute("DROP DATABASE IF EXISTS MammalLifeHistory")
cursor.execute("CREATE DATABASE MammalLifeHistory")
cursor.execute("USE MammalLifeHistory")
cursor.execute("""
    CREATE TABLE species(
          species_id INT(5) NOT NULL AUTO_INCREMENT,
          sporder CHAR(20),
          family CHAR(20),
          genus CHAR(20),
          species CHAR(20),
          mass DECIMAL(11,2),
          gestation_period DECIMAL(5,2),
          newborn_mass DECIMAL(9,2),
          wean_age DECIMAL(5,2),<commit_msg>Replaced completed "to do" comment<commit_after># Database Toolkit for Ernest 2003 Ecological Archives
# Mammalian Life History Database

# Usage: python /file/path/to/dbtk_ernest2003.py

import urllib
import MySQLdb as dbapi
import dbtk_tools
import datacleanup

# Create the Database
databaseinfo = dbtk_tools.get_database_info()
connection = dbapi.connect(host = databaseinfo[2],
                           port = databaseinfo[3],
                           user = databaseinfo[0],
                           passwd = databaseinfo[1])
cursor = connection.cursor()
cursor.execute("DROP DATABASE IF EXISTS MammalLifeHistory")
cursor.execute("CREATE DATABASE MammalLifeHistory")
cursor.execute("USE MammalLifeHistory")
cursor.execute("""
    CREATE TABLE species(
          species_id INT(5) NOT NULL AUTO_INCREMENT,
          sporder CHAR(20),
          family CHAR(20),
          genus CHAR(20),
          species CHAR(20),
          mass DECIMAL(11,2),
          gestation_period DECIMAL(5,2),
          newborn_mass DECIMAL(9,2),
          wean_age DECIMAL(5,2),
{'fraction_non_alphanumeric': 0.08815298507462686, 'fraction_numerical': 0.029384328358208957, 'mean_word_length': 2.8031914893617023, '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': '7614865', 'n_tokens_mistral': 691, 'n_tokens_neox': 634, 'n_words': 161}