<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import

import unittest
import datetime
from channelarchiver import utils

class AEST(datetime.tzinfo):

    def utcoffset(self, dt):
        return datetime.timedelta(hours=10)

    def dst(self, dt):
        return datetime.timedelta(0)


class TestUtils(unittest.TestCase):

    def test_datetime_from_sec_and_nano(self):
        seconds = 1376706013
        nanoseconds = 123456789
        dt = utils.datetime_from_sec_and_nano(seconds, nanoseconds)
        # Note nanoseconds get rounded off in conversion to microseconds
        self.assertEqual(dt, datetime.datetime(2013, 8, 17, 2, 20, 13, 123457, utils.UTC()))

    def test_datetime_from_sec_and_nano_with_tz(self):
        seconds = 1376706013
        nanoseconds = 123456789
        tz = AEST()<commit_msg>Remove unneeded import<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest
import datetime
from channelarchiver import utils

class AEST(datetime.tzinfo):

    def utcoffset(self, dt):
        return datetime.timedelta(hours=10)

    def dst(self, dt):
        return datetime.timedelta(0)


class TestUtils(unittest.TestCase):

    def test_datetime_from_sec_and_nano(self):
        seconds = 1376706013
        nanoseconds = 123456789
        dt = utils.datetime_from_sec_and_nano(seconds, nanoseconds)
        # Note nanoseconds get rounded off in conversion to microseconds
        self.assertEqual(dt, datetime.datetime(2013, 8, 17, 2, 20, 13, 123457, utils.UTC()))

    def test_datetime_from_sec_and_nano_with_tz(self):
        seconds = 1376706013
        nanoseconds = 123456789
        tz = AEST()
{'fraction_non_alphanumeric': 0.0897814530419374, 'fraction_numerical': 0.07088009450679268, 'mean_word_length': 3.365979381443299, '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': '3264227', 'n_tokens_mistral': 643, 'n_tokens_neox': 535, 'n_words': 127}