HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python38/lib/python3.8/site-packages/dateutil/tz/__pycache__/_common.cpython-38.pyc
U

�!X�-�@s�ddlmZddlmZddlmZmZmZddlZed�ZddgZ	dd�Z
eed�rbdd
d�ZnGdd�de�Z
dd
d�ZGdd�de�ZGdd�de�Zdd�Zeede�ZdS)�)�PY3)�_thread)�datetime�	timedelta�tzinfoN�tzname_in_python2�enfoldcs�fdd�}|S)z�Change unicode output into bytestrings in Python 2

    tzname() API changed in Python 3. It used to return bytes, but was changed
    to unicode strings
    cs"�||�}|dk	rts|��}|S�N)r�encode)�args�kwargs�name��namefunc��D/opt/alt/python38/lib/python3.8/site-packages/dateutil/tz/_common.py�adjust_encodings
z*tzname_in_python2.<locals>.adjust_encodingr)rrrrrrs�fold�cCs|j|d�S)�
        Provides a unified interface for assigning the ``fold`` attribute to
        datetimes both before and after the implementation of PEP-495.

        :param fold:
            The value for the ``fold`` attribute in the returned datetime. This
            should be either 0 or 1.

        :return:
            Returns an object for which ``getattr(dt, 'fold', 0)`` returns
            ``fold`` for all versions of Python. In versions prior to
            Python 3.6, this is a ``_DatetimeWithFold`` object, which is a
            subclass of :py:class:`datetime.datetime` with the ``fold``
            attribute added, if ``fold`` is 1.

        ..versionadded:: 2.6.0
        �r��replace)�dtrrrrr sc@s eZdZdZdZedd��ZdS)�_DatetimeWithFoldz�
        This is a class designed to provide a PEP 495-compliant interface for
        Python versions before 3.6. It is used only for dates in a fold, so
        the ``fold`` attribute is fixed at ``1``.

        ..versionadded:: 2.6.0
        rcCsdS)Nrr��selfrrrr?sz_DatetimeWithFold.foldN)�__name__�
__module__�__qualname__�__doc__�	__slots__�propertyrrrrrr5srcCsLt|dd�|kr|S|��dd�}||j|jf7}|r@t|�St|�SdS)rrrN�)�getattr�	timetuple�microsecondrrr)rrrrrrrCsc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_tzinfoz=
    Base class for all ``dateutil`` ``tzinfo`` objects.
    cCsV|j|d�}t|dd�}t|dd�}|��|��k}|jdd�|jdd�k}|oT|S)a5
        Whether or not the "wall time" of a given datetime is ambiguous in this
        zone.

        :param dt:
            A :py:class:`datetime.datetime`, naive or time zone aware.


        :return:
            Returns ``True`` if ambiguous, ``False`` otherwise.

        ..versionadded:: 2.6.0
        �rrrrN)rr�	utcoffset)rrZwall_0Zwall_1Zsame_offsetZsame_dtrrr�is_ambiguousfsz_tzinfo.is_ambiguouscCs4|�|�r,||}t||��|��k�}nd}|S)a�
        Determine the fold status of a "wall" datetime, given a representation
        of the same datetime as a (naive) UTC datetime. This is calculated based
        on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all
        datetimes, and that this offset is the actual number of hours separating
        ``dt_utc`` and ``dt_wall``.

        :param dt_utc:
            Representation of the datetime as UTC

        :param dt_wall:
            Representation of the datetime as "wall time". This parameter must
            either have a `fold` attribute or have a fold-naive
            :class:`datetime.tzinfo` attached, otherwise the calculation may
            fail.
        r)r*�intr)�dst)r�dt_utc�dt_wallZ
delta_wall�_foldrrr�_fold_statuss

z_tzinfo._fold_statuscCst|dd�S)Nrr)r$�rrrrrr/�sz
_tzinfo._foldcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}t|dd���}|dkr�td��||S)	a�
        Given a timezone-aware datetime in a given timezone, calculates a
        timezone-aware datetime in a new timezone.

        Since this is the one time that we *know* we have an unambiguous
        datetime object, we take this opportunity to determine whether the
        datetime is ambiguous and in a "fold" state (e.g. if it's the first
        occurence, chronologically, of the ambiguous datetime).

        :param dt:
            A timezone-aware :class:`datetime.dateime` object.
        �&fromutc() requires a datetime argument�dt.tzinfo is not selfNz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultrrz;fromutc(): dt.dst gave inconsistent results; cannot convert)�
isinstancer�	TypeErrorr�
ValueErrorr)r,r)rrZdtoffZdtdst�deltarrr�_fromutc�s"

z_tzinfo._fromutccCs"|�|�}|�||�}t||d�S)a�
        Given a timezone-aware datetime in a given timezone, calculates a
        timezone-aware datetime in a new timezone.

        Since this is the one time that we *know* we have an unambiguous
        datetime object, we take this opportunity to determine whether the
        datetime is ambiguous and in a "fold" state (e.g. if it's the first
        occurance, chronologically, of the ambiguous datetime).

        :param dt:
            A timezone-aware :class:`datetime.dateime` object.
        r)r8r0r)rrr.r/rrr�fromutc�s
z_tzinfo.fromutcN)	rrrr r*r0r/r8r9rrrrr'as*r'c@szeZdZdZdd�Zdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Ze
dd��ZdZdd�Zdd�ZejZdS)�tzrangebasea�
    This is an abstract base class for time zones represented by an annual
    transition into and out of DST. Child classes should implement the following
    methods:

        * ``__init__(self, *args, **kwargs)``
        * ``transitions(self, year)`` - this is expected to return a tuple of
          datetimes representing the DST on and off transitions in standard
          time.

    A fully initialized ``tzrangebase`` subclass should also provide the
    following attributes:
        * ``hasdst``: Boolean whether or not the zone uses DST.
        * ``_dst_offset`` / ``_std_offset``: :class:`datetime.timedelta` objects
          representing the respective UTC offsets.
        * ``_dst_abbr`` / ``_std_abbr``: Strings representing the timezone short
          abbreviations in DST and STD, respectively.
        * ``_hasdst``: Whether or not the zone has DST.

    ..versionadded:: 2.6.0
    cCstd��dS)Nz%tzrangebase is an abstract base class)�NotImplementedErrorrrrr�__init__�sztzrangebase.__init__cCs*|�|�}|dkrdS|r |jS|jSdSr	)�_isdst�_dst_offset�_std_offset�rr�isdstrrrr)�s
ztzrangebase.utcoffsetcCs(|�|�}|dkrdS|r |jStSdSr	)r=�_dst_base_offset�ZEROr@rrrr,�s
ztzrangebase.dstcCs|�|�r|jS|jSdSr	)r=Z	_dst_abbrZ	_std_abbrr1rrr�tznames
ztzrangebase.tznamec
Cs�t|t�std��|j|k	r$td��|�|j�}|dkrF||�|�S|\}}||j8}||j8}||f}|j	dd�}|�
||�}|r�||j}n
||j}t|o�|�
|��}	t||	d�S)z, Given a datetime in UTC, return local time r2r3Nr(r)r4rr5rr6�transitions�yearr)r?r�_naive_isdstr>r+r*r)
rrrE�dston�dstoffZutc_transitionsr-rAr.r/rrrr9s$




ztzrangebase.fromutccCsD|js
dS|�|j�\}}|jdd�}||ko>||jkSS)a6
        Whether or not the "wall time" of a given datetime is ambiguous in this
        zone.

        :param dt:
            A :py:class:`datetime.datetime`, naive or time zone aware.


        :return:
            Returns ``True`` if ambiguous, ``False`` otherwise.

        .. versionadded:: 2.6.0
        FNr()�hasdstrErFrrB)rr�start�endrrrr*1s
ztzrangebase.is_ambiguouscCsh|js
dS|dkrdS|�|j�}|dkr.dS|jdd�}|�||�}|s`|�|�r`|�|�S|SdS)NFr()rJrErFrrGr*r/)rrrErArrrr=Gsztzrangebase._isdstcCsT|\}}|jdd�}||kr6||ko.|kn}n||koH|kn}|S)Nr(r)rrrErHrIrArrrrG\sztzrangebase._naive_isdstcCs|j|jSr	)r>r?rrrrrBhsztzrangebase._dst_base_offsetNcCs
||kSr	r)r�otherrrr�__ne__nsztzrangebase.__ne__cCsd|jjS)Nz%s(...))�	__class__rrrrr�__repr__qsztzrangebase.__repr__)rrrr r<r)r,rrDr9r*r=rGr"rB�__hash__rNrP�object�
__reduce__rrrrr:�s 


"
r:cCs|j|jdd|jdS)Ni�Qi@B)�seconds�days�microseconds)�tdrrr�_total_secondsws
��rX�
total_seconds)r)r)�sixrZ	six.movesrrrr�copyrC�__all__r�hasattrrrr'r:rXr$rrrr�<module>s

z