<commit_before># -*- coding: utf-8 -*-
"""The Python :mod:`datetime` module's documentation describes how
to create a :class:`datetime.datetime`-compatible
:class:`datetime.tzinfo` subtype. It even provides a few examples.

The following module defines usable forms of the timezones in those
docs, as well as a couple other useful ones, :data:`UTC` (aka GMT) and
:data:`LocalTZ` (representing the local timezone). For timezones
beyond these, as well as a higher degree of accuracy, check out `pytz`_.

.. _pytz: https://pypi.python.org/pypi/pytz

"""


import time
from datetime import tzinfo, timedelta, datetime

# Basic timezones cribbed from etavta and Python docs.

ZERO = timedelta(0)
HOUR = timedelta(hours=1)


# copied from timeutils for tzutils independence:
def total_seconds(td):
    """For those with older versions of Python, a pure-Python
    implementation of Python 2.7's :meth:`timedelta.total_seconds`.

    Args:
        td (datetime.timedelta): The timedelta to convert to seconds.
    Returns:
        float: total number of seconds

    >>> td = datetime.timedelta(days=4, seconds=33)
    >>> total_seconds(td)
    345633.0
    """
    a_milli = 1000000.0
    td_ds = td.seconds + (td.days * 86400)  # 24 * 60 * 60
    td_micro = td.microseconds + (td_ds * a_milli)
    return td_micro / a_milli


class ConstantTZInfo(tzinfo):
    """
    A :class:`datetime.tzinfo` subtype whose *offset* remains constant
    (no daylight savings).

    Args:
        name (str): Name of the timezone.
        offset (datetime.timedelta): Offset of the timezone.
    """
    def __init__(self, name="ConstantTZ", offset=ZERO):
        self.name = name
        self.offset = offset

    @property
    def utcoffset_hours(self):
        return total_seconds(self.offset) / (60 * 60)<commit_msg>correcting tzutils.total_seconds doctest for different imports (should the doc be removed since it's a copy?)<commit_after># -*- coding: utf-8 -*-
"""The Python :mod:`datetime` module's documentation describes how
to create a :class:`datetime.datetime`-compatible
:class:`datetime.tzinfo` subtype. It even provides a few examples.

The following module defines usable forms of the timezones in those
docs, as well as a couple other useful ones, :data:`UTC` (aka GMT) and
:data:`LocalTZ` (representing the local timezone). For timezones
beyond these, as well as a higher degree of accuracy, check out `pytz`_.

.. _pytz: https://pypi.python.org/pypi/pytz

"""


import time
from datetime import tzinfo, timedelta, datetime

# Basic timezones cribbed from etavta and Python docs.

ZERO = timedelta(0)
HOUR = timedelta(hours=1)


# copied from timeutils for tzutils independence:
def total_seconds(td):
    """For those with older versions of Python, a pure-Python
    implementation of Python 2.7's :meth:`timedelta.total_seconds`.

    Args:
        td (datetime.timedelta): The timedelta to convert to seconds.
    Returns:
        float: total number of seconds

    >>> td = timedelta(days=4, seconds=33)
    >>> total_seconds(td)
    345633.0
    """
    a_milli = 1000000.0
    td_ds = td.seconds + (td.days * 86400)  # 24 * 60 * 60
    td_micro = td.microseconds + (td_ds * a_milli)
    return td_micro / a_milli


class ConstantTZInfo(tzinfo):
    """
    A :class:`datetime.tzinfo` subtype whose *offset* remains constant
    (no daylight savings).

    Args:
        name (str): Name of the timezone.
        offset (datetime.timedelta): Offset of the timezone.
    """
    def __init__(self, name="ConstantTZ", offset=ZERO):
        self.name = name
        self.offset = offset

    @property
    def utcoffset_hours(self):
        return total_seconds(self.offset) / (60 * 60)
{'fraction_non_alphanumeric': 0.10631950094928126, 'fraction_numerical': 0.02061296446975861, 'mean_word_length': 3.4273709483793517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '2711793', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1122, 'n_words': 385}