<commit_before>import hashlib
from StringIO import StringIO

from csvkit import convert
from csvkit.unicsv import UnicodeCSVReader
from django.core import exceptions

from .transformers import TRANSFORMERS


def convert_to_csv_reader(filename, sheet):
    format = convert.guess_format(filename)
    f = open(filename, "rb")
    if sheet is None:
        converted = StringIO(convert.convert(f, format))
    else:
        converted = StringIO(convert.convert(f, format, sheet=sheet))
    reader = UnicodeCSVReader(converted)
    return reader


def transform(filename, sheet):
    reader = convert_to_csv_reader(filename, sheet=sheet)
    labels = reader.next()
    transformers = get_transformers(labels)

    if len(transformers) > 1:<commit_msg>Be explicit about what the default is<commit_after>import hashlib
from StringIO import StringIO

from csvkit import convert
from csvkit.unicsv import UnicodeCSVReader
from django.core import exceptions

from .transformers import TRANSFORMERS


def convert_to_csv_reader(filename, sheet=None):
    format = convert.guess_format(filename)
    f = open(filename, "rb")
    if sheet is None:
        converted = StringIO(convert.convert(f, format))
    else:
        converted = StringIO(convert.convert(f, format, sheet=sheet))
    reader = UnicodeCSVReader(converted)
    return reader


def transform(filename, sheet=None):
    reader = convert_to_csv_reader(filename, sheet=sheet)
    labels = reader.next()
    transformers = get_transformers(labels)

    if len(transformers) > 1:
{'fraction_non_alphanumeric': 0.08104575163398693, 'fraction_numerical': 0.00130718954248366, 'mean_word_length': 4.448398576512456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '906946', 'n_tokens_mistral': 457, 'n_tokens_neox': 442, 'n_words': 123}