<commit_before>"""A module to clone the FERC Form 1 Database from FoxPro to Postgres."""
import os.path
from pudl import settings
import pudl.constants as pc
import pandas as pd
import sqlalchemy as sa
import dbfread
import string
import re

# MetaData object will contain the ferc1 database schema.
ferc1_meta = sa.MetaData()

###########################################################################
# Functions related to ingest & processing of FERC Form 1 data.
###########################################################################


def connect_db(testing=False):
    """
    Connect to the FERC Form 1 DB using global settings from settings.py.

    Returns sqlalchemy engine instance.
    """
    if testing:
        return sa.create_engine(sa.engine.url.URL(**settings.DB_FERC1_TEST))
    else:
        return sa.create_engine(sa.engine.url.URL(**settings.DB_FERC1))

<commit_msg>Fixed minor formatting issues.<commit_after>"""A module to clone the FERC Form 1 Database from FoxPro to Postgres."""
import os.path
import string
import re
import pandas as pd
import sqlalchemy as sa
import dbfread
from pudl import settings
import pudl.constants as pc

# MetaData object will contain the ferc1 database schema.
ferc1_meta = sa.MetaData()

###########################################################################
# Functions related to ingest & processing of FERC Form 1 data.
###########################################################################


def connect_db(testing=False):
    """
    Connect to the FERC Form 1 DB using global settings from settings.py.

    Returns sqlalchemy engine instance.
    """
    if testing:
        return sa.create_engine(sa.engine.url.URL(**settings.DB_FERC1_TEST))

    return sa.create_engine(sa.engine.url.URL(**settings.DB_FERC1))


{'fraction_non_alphanumeric': 0.23162583518930957, 'fraction_numerical': 0.0077951002227171495, 'mean_word_length': 4.85342019543974, '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': '1510906', 'n_tokens_mistral': 498, 'n_tokens_neox': 458, 'n_words': 166}