<commit_before>import logging
import datetime
import sys
import sqlite3

logger = logging.getLogger(__name__)
FAKE = True


def fail(table, fields, exc):
    '''Report failure.'''
    logger.error("Failing on {table} with {fields} because {error}".format(
        table=table, fields=fields, error=e))
    sys.exit(1)


def info(table):
    '''Report successful migration of given table.'''
    logger.info("Successfully migrated '{table}' table".format(table=table))


def fake(i, slug, personal, middle, family, email, gender, github, twitter, url):
    '''Redact personal identifying information.'''
    if not FAKE:
        return slug, personal, middle, family, email, gender, github, twitter, url
    where = 'I{0}.edu'.format(i)
    return 'S{0}'.format(i), \
           'F{0}'.format(i), \
           'M{0}'.format(i), \
           'L{0}'.format(i), \
           '{0}@{1}'.format(i, where), \
           ('M', 'F', 'O')[i % 3], \
           'U_{0}'.format(i), \<commit_msg>Change default logger name in migrater script<commit_after>import logging
import datetime
import sys
import sqlite3

# stick to string name of the logger because it's better than "__main__"
# (what __name__ defaults to)
logger = logging.getLogger("amy-migrater")
FAKE = True


def fail(table, fields, exc):
    '''Report failure.'''
    logger.error("Failing on {table} with {fields} because {error}".format(
        table=table, fields=fields, error=e))
    sys.exit(1)


def info(table):
    '''Report successful migration of given table.'''
    logger.info("Successfully migrated '{table}' table".format(table=table))


def fake(i, slug, personal, middle, family, email, gender, github, twitter, url):
    '''Redact personal identifying information.'''
    if not FAKE:
        return slug, personal, middle, family, email, gender, github, twitter, url
    where = 'I{0}.edu'.format(i)
    return 'S{0}'.format(i), \
           'F{0}'.format(i), \
           'M{0}'.format(i), \
           'L{0}'.format(i), \
           '{0}@{1}'.format(i, where), \
           ('M', 'F', 'O')[i % 3], \
           'U_{0}'.format(i), \
{'fraction_non_alphanumeric': 0.17118402282453637, 'fraction_numerical': 0.010461245839277223, 'mean_word_length': 3.1254901960784314, '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': '5035652', 'n_tokens_mistral': 690, 'n_tokens_neox': 667, 'n_words': 188}