<commit_before>from collections import namedtuple
import uuid
import sqlalchemy
from sqlalchemy import *
from django.conf import settings
from sqlalchemy.engine.url import make_url
from datetime import date, timedelta, datetime
from corehq.apps.sofabed.models import FormData, CaseData

metadata = sqlalchemy.MetaData()


def get_table(mapping):
    return Table(mapping.table_name, metadata, extend_existing=True, *[c.sql_column for c in mapping.columns])


def get_formdata(days_ago, domain, user_id, xmlns=None, duration=1):
    now = datetime.utcnow()
    time_end = now - timedelta(days=days_ago)
    time_start = time_end - timedelta(seconds=duration)
    return {
        '_id': uuid.uuid4().hex,
        'doc_type': 'XFormInstance',
        'domain': domain,
        'form': {<commit_msg>cleanup imports<commit_after>import uuid
from collections import namedtuple
from datetime import timedelta, datetime

import sqlalchemy
from sqlalchemy import *

metadata = sqlalchemy.MetaData()


def get_table(mapping):
    return Table(mapping.table_name, metadata, extend_existing=True, *[c.sql_column for c in mapping.columns])


def get_formdata(days_ago, domain, user_id, xmlns=None, duration=1):
    now = datetime.utcnow()
    time_end = now - timedelta(days=days_ago)
    time_start = time_end - timedelta(seconds=duration)
    return {
        '_id': uuid.uuid4().hex,
        'doc_type': 'XFormInstance',
        'domain': domain,
        'form': {
{'fraction_non_alphanumeric': 0.10171821305841924, 'fraction_numerical': 0.0027491408934707906, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1448854', 'n_tokens_mistral': 461, 'n_tokens_neox': 447, 'n_words': 117}