<commit_before>import email.utils
from datetime import datetime, timedelta, tzinfo

def rfc_2822_datetime(value):
    time_tz = email.utils.parsedate_tz(value)

    class tz(tzinfo):
        def utcoffset(self, dt):
            return timedelta(seconds=time_tz[9])
        def dst(self, dt):
            return timedelta(0)
        def __repr__(self):
            return "%02d%02d" % (time_tz[9]//3600, (time_tz[9]//60) % 60)

    return datetime(*(time_tz[:6] + (0, tz())))<commit_msg>date_parsing needs to use absolute_import to pull in email, given we'll soon have a molly.utils.email module.<commit_after>from __future__ import absolute_import

import email.utils
from datetime import datetime, timedelta, tzinfo

def rfc_2822_datetime(value):
    time_tz = email.utils.parsedate_tz(value)

    class tz(tzinfo):
        def utcoffset(self, dt):
            return timedelta(seconds=time_tz[9])
        def dst(self, dt):
            return timedelta(0)
        def __repr__(self):
            return "%02d%02d" % (time_tz[9]//3600, (time_tz[9]//60) % 60)

    return datetime(*(time_tz[:6] + (0, tz())))
{'fraction_non_alphanumeric': 0.1272563176895307, 'fraction_numerical': 0.039711191335740074, 'mean_word_length': 3.2007575757575757, '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': '7299611', 'n_tokens_mistral': 407, 'n_tokens_neox': 373, 'n_words': 88}