https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/dateutil/tz/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/dateutil/tz/__pycache__/_common.cpython-310.pyc
o

��]�2�@s�ddlmZddlmZddlmZmZmZed�ZddgZdd�Z	e
ed�r-dd	d�Zn
Gd
d�de�Zddd�Zd
d�Z
Gdd�de�ZGdd�de�ZdS)�)�PY2��wraps)�datetime�	timedelta�tzinfo�tzname_in_python2�enfoldcs trt���fdd��}|S�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"�|i|��}|dur|��}|S�N)�encode)�args�kwargs�name��namefunc��5/usr/lib/python3/dist-packages/dateutil/tz/_common.py�adjust_encodingsz*tzname_in_python2.<locals>.adjust_encoding)rr)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	%sc@s(eZdZdZdZdd�Zedd��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
        rcOszd}t||�D]\}}||vrtd�|���|||<q|D]
}||vr*t||�||<q|�dd�r4|jnt}|di|��S)a�
            Return a datetime with the same attributes, except for those
            attributes given new values by whichever keyword arguments are
            specified. Note that tzinfo=None can be specified to create a naive
            datetime from an aware datetime with no conversion of date and time
            data.

            This is reimplemented in ``_DatetimeWithFold`` because pypy3 will
            return a ``datetime.datetime`` even if ``fold`` is unchanged.
            )�year�month�day�hour�minute�second�microsecondrzDuplicate argument: {}rrNr)�zip�	TypeError�format�getattr�get�	__class__r)�selfrr
�argnames�arg�argname�dt_classrrrrDs
�z_DatetimeWithFold.replacecCsdS)Nrr�r)rrrrbsz_DatetimeWithFold.foldN)�__name__�
__module__�__qualname__�__doc__�	__slots__r�propertyrrrrrr:srcCsHt|dd�|kr
|S|��dd�}||j|jf7}|r t|�St|�S)rrrN�)r&�	timetupler"rrr)rrrrrrr	fscst���fdd��}|S)z�
    The CPython version of ``fromutc`` checks that the input is a ``datetime``
    object and that ``self`` is attached as its ``tzinfo``.
    cs.t|t�s	td��|j|urtd���||�S)N�&fromutc() requires a datetime argument�dt.tzinfo is not self)�
isinstancerr$r�
ValueError�r)r��frr�fromutc�s



z)_validate_fromutc_inputs.<locals>.fromutcr)r=r>rr<r�_validate_fromutc_inputs�sr?c@s<eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	dS)
�_tzinfoz=
    Base class for all ``dateutil`` ``tzinfo`` objects.
    cCsV|j|d�}t|dd�}t|dd�}|��|��k}|jdd�|jdd�k}|o*|S)�6
        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)r)r�wall_0�wall_1�same_offset�same_dtrrr�is_ambiguous�s
z_tzinfo.is_ambiguouscCs6|�|�r||}t||��|��k�}|Sd}|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)rH�intrC�dst)r)�dt_utc�dt_wall�
delta_wall�_foldrrr�_fold_status�s
�z_tzinfo._fold_statuscCst|dd�S)Nrr)r&r;rrrrN��z
_tzinfo._foldcCsh|��}|durtd��|��}|durtd��||}||7}t|dd���}|dur0td��||S)�
        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
        occurrence, chronologically, of the ambiguous datetime).

        :param dt:
            A timezone-aware :class:`datetime.datetime` object.
        Nz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultrrz;fromutc(): dt.dst gave inconsistent results; cannot convert)rCr:rJr	)r)r�dtoff�dtdst�deltarrr�_fromutc�sz_tzinfo._fromutccCs"|�|�}|�||�}t||d�S)rQr)rUrOr	)r)rrLrNrrrr>�s
z_tzinfo.fromutcN)
r/r0r1r2rHrOrNrUr?r>rrrrr@�s%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
    cCstd��)Nz%tzrangebase is an abstract base class)�NotImplementedErrorr.rrr�__init__!sztzrangebase.__init__cCs&|�|�}|durdS|r|jS|jSr
)�_isdst�_dst_offset�_std_offset�r)r�isdstrrrrC$s
ztzrangebase.utcoffsetcCs$|�|�}|durdS|r|jStSr
)rY�_dst_base_offset�ZEROr\rrrrJ.s
ztzrangebase.dstcCs|�|�r|jS|jSr
)rY�	_dst_abbr�	_std_abbrr;rrr�tzname8s
ztzrangebase.tznamec
Cs�t|t�s	td��|j|urtd��|�|j�}|dur#||�|�S|\}}||j8}||j8}||f}|j	dd�}|�
||�}|rI||j}n||j}t|oV|�
|��}	t||	d�S)z, Given a datetime in UTC, return local time r7r8NrBr)r9rr$rr:�transitionsrrCr[r�_naive_isdstrZrIrHr	)
r)rrc�dston�dstoff�utc_transitionsrKr]rLrNrrrr>?s$




ztzrangebase.fromutccCsD|jsdS|�|j�\}}|jdd�}||ko||jkSS)rAFNrB)�hasdstrcrrr^)r)r�start�endrrrrH`s
ztzrangebase.is_ambiguouscCsd|jsdS|durdS|�|j�}|durdS|jdd�}|�||�}|s0|�|�r0|�|�S|S)NFrB)rhrcrrrdrHrN)r)rrcr]rrrrYvsztzrangebase._isdstcCsZ|\}}|jdd�}||kr||ko|k}|S}|S||ko'|kn}|S)NrBr)r)rrcrerfr]rrrrd�s��ztzrangebase._naive_isdstcCs|j|jSr
)rZr[r.rrrr^�sztzrangebase._dst_base_offsetNcCs
||kSr
r)r)�otherrrr�__ne__�s
ztzrangebase.__ne__cCsd|jjS)Nz%s(...))r(r/r.rrr�__repr__�rPztzrangebase.__repr__)r/r0r1r2rXrCrJrrbr>rHrYrdr4r^�__hash__rlrm�object�
__reduce__rrrrrVs"


!

rVN)r)�sixr�	functoolsrrrrr_�__all__r�hasattrr	rr?r@rVrrrr�<module>s

,v

https://t.me/RX1948 - 2025