<commit_before># -*- coding: utf-8 -*-

"""
star.utils
~~~~~~~~~~

Utilities.
"""

import datetime
import dateutil.parser
import pytz


def date(date):
    """Convert string dates (for the lazy)."""
    if isinstance(date, basestring):
        date = dateutil.parser.parse(unicode(date))

    # Provided dates are in EST.
    date = date.replace(tzinfo=pytz.timezone('US/Eastern'))

    # Dates only, please.
    assert isinstance(date, datetime.datetime)

    return date


def date_range(start, end):
    """Returns a list of dates."""
    start = date(start)
    end = date(end)

    r = (end + datetime.timedelta(days=1) - start).days
    return [start + datetime.timedelta(days=i) for i in range(r)]<commit_msg>localize<commit_after># -*- coding: utf-8 -*-

"""
star.utils
~~~~~~~~~~

Utilities.
"""

import datetime
import dateutil.parser
import pytz


def date(date):
    """Convert string dates (for the lazy)."""
    if isinstance(date, basestring):
        date = dateutil.parser.parse(unicode(date))

    # Provided dates are in EST.
    date = pytz.est.localize(date)
    # date = date.replace(tzinfo=pytz.timezone('US/Eastern'))

    # Dates only, please.
    assert isinstance(date, datetime.datetime)

    return date


def date_range(start, end):
    """Returns a list of dates."""
    start = date(start)
    end = date(end)

    r = (end + datetime.timedelta(days=1) - start).days
    return [start + datetime.timedelta(days=i) for i in range(r)]
{'fraction_non_alphanumeric': 0.15437158469945356, 'fraction_numerical': 0.00273224043715847, 'mean_word_length': 3.2961876832844577, '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': '2678110', 'n_tokens_mistral': 490, 'n_tokens_neox': 477, 'n_words': 125}