<commit_before>import sys
if sys.hexversion < 0x02070000:
    import unittest2 as unittest
else:
    import unittest

from hypothesis import given, example
from hypothesis.extra.datetime import datetimes

from datetime import date as vanilla_date, datetime

from calexicon.calendars.tests.test_calendar import JulianGregorianConversion

from calexicon.fn import julian_to_gregorian, gregorian_to_julian
from calexicon.fn import julian_to_julian_day_number, julian_day_number_to_julian


class TestJulianConversion(JulianGregorianConversion):
    def setUp(self):
        pass

    def Julian_to_Gregorian_conversion(self, julian_args, gregorian_args):
        result = julian_to_gregorian(*julian_args)
        self.assertEqual(
            result,
            gregorian_args,
        )

    def Gregorian_to_Julian_conversion(self, julian_args, gregorian_args):
        result = gregorian_to_julian(*gregorian_args)
        self.assertEqual(
            result,
            julian_args,
        )


class TestJulianNumberConversion(unittest.TestCase):
    def test_number_to_julian_date(self):
        self.assertEqual(julian_to_julian_day_number(-4713, 1, 1), 0)
        self.assertEqual(julian_to_julian_day_number(-4712, 1, 1), 365)
        self.assertEqual(julian_to_julian_day_number(9999, 12 ,1), 5373451)

    def test_julian_date_to_number(self):
        self.assertEqual(julian_day_number_to_julian(0), (-4713, 1, 1))
        self.assertEqual(julian_day_number_to_julian(365), (-4712, 1, 1))
        self.assertEqual(julian_day_number_to_julian(5373482), (9999, 1, 1))

    @example(datetime(9999, 12, 1, 0, 0, 0))
    @given(datetimes(timezones=[]))
    def test_round_trip_from_date_compare_tuples(self, dt):
        vd = dt.date()
        (y, m, d) = (vd.year, vd.month, vd.day)<commit_msg>Swap test names round.<commit_after>import sys
if sys.hexversion < 0x02070000:
    import unittest2 as unittest
else:
    import unittest

from hypothesis import given, example
from hypothesis.extra.datetime import datetimes

from datetime import date as vanilla_date, datetime

from calexicon.calendars.tests.test_calendar import JulianGregorianConversion

from calexicon.fn import julian_to_gregorian, gregorian_to_julian
from calexicon.fn import julian_to_julian_day_number, julian_day_number_to_julian


class TestJulianConversion(JulianGregorianConversion):
    def setUp(self):
        pass

    def Julian_to_Gregorian_conversion(self, julian_args, gregorian_args):
        result = julian_to_gregorian(*julian_args)
        self.assertEqual(
            result,
            gregorian_args,
        )

    def Gregorian_to_Julian_conversion(self, julian_args, gregorian_args):
        result = gregorian_to_julian(*gregorian_args)
        self.assertEqual(
            result,
            julian_args,
        )


class TestJulianNumberConversion(unittest.TestCase):
    def test_julian_date_to_number(self):
        self.assertEqual(julian_to_julian_day_number(-4713, 1, 1), 0)
        self.assertEqual(julian_to_julian_day_number(-4712, 1, 1), 365)
        self.assertEqual(julian_to_julian_day_number(9999, 12 ,1), 5373451)

    def test_number_to_julian_date(self):
        self.assertEqual(julian_day_number_to_julian(0), (-4713, 1, 1))
        self.assertEqual(julian_day_number_to_julian(365), (-4712, 1, 1))
        self.assertEqual(julian_day_number_to_julian(5373482), (9999, 1, 1))

    @example(datetime(9999, 12, 1, 0, 0, 0))
    @given(datetimes(timezones=[]))
    def test_round_trip_from_date_compare_tuples(self, dt):
        vd = dt.date()
        (y, m, d) = (vd.year, vd.month, vd.day)
{'fraction_non_alphanumeric': 0.08769017980636237, 'fraction_numerical': 0.04370677731673582, 'mean_word_length': 3.9331514324693044, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1862352', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1249, 'n_words': 228}