Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/dateutil/tz/__pycache__/_common.cpython-311.pyc



]j2ddlmZddlmZddlmZmZmZedZddgZdZ	e
edrdd	ZnGd
deZddZd
Z
GddeZGddeZdS))PY2wraps)datetime	timedeltatzinfotzname_in_python2enfoldcNtrtfd}|SS)zChange unicode output into bytestrings in Python 2

    tzname() API changed in Python 3. It used to return bytes, but was changed
    to unicode strings
    cD|i|}||}|SN)encode)argskwargsnamenamefuncs   s/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/dateutil/tz/_common.pyadjust_encodingz*tzname_in_python2.<locals>.adjust_encodings/8T,V,,D{{}}K)rr)rrs` rr	r	
sC	x				
	rfoldc.||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
        rreplace)dtrs  rr
r
%s$zztz$$$rc2eZdZdZdZdZedZdS)_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
        cd}t||D]0\}}||vr"td||||<1|D]}||vrt||||<|ddr|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.
            )yearmonthdayhourminutesecondmicrosecondrzDuplicate argument: {}rrr )zip	TypeErrorformatgetattrget	__class__r)selfrrargnamesargargnamedt_classs       rrz_DatetimeWithFold.replaceDsH
!$D( 3 3
&
&Wf$$#$<$C$CG$L$LMMM"%w#
=
=&((&-dG&<&<F7O)/FA)>)>Lt~~HH8%%f%%%rcdS)Nrr r/s rrz_DatetimeWithFold.foldbs1rN)__name__
__module____qualname____doc__	__slots__rpropertyrr rrrr:sO				&	&	&<
		
			rrct|dd|kr|S|dd}||j|jfz
}|r	t	|St|S)rrrN)r,	timetupler(rrr)rrrs   rr
r
fsf$2vq!!T))I||~~bqb!++	#$d++T?"rc<tfd}|S)z
    The CPython version of ``fromutc`` checks that the input is a ``datetime``
    object and that ``self`` is attached as its ``tzinfo``.
    ct|tstd|j|urt	d||S)N&fromutc() requires a datetime argumentdt.tzinfo is not self)
isinstancerr*r
ValueError)r/rfs  rfromutcz)_validate_fromutc_inputs.<locals>.fromutcsQ"h''	FDEEE
9D  4555qr{{rr)rErFs` r_validate_fromutc_inputsrGs5
1XXXNrc@eZdZdZdZdZdZdZedZ	dS)_tzinfoz=
    Base class for all ``dateutil`` ``tzinfo`` objects.
    c,||}t|d}t|d}||k}|d|dk}|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/rwall_0wall_1same_offsetsame_dts      ris_ambiguousz_tzinfo.is_ambiguoussZZtZ
$
$######&&((F,<,<,>,>>...--t1L1LL*{?*rc||r@||z
}t|||z
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)rRintrMdst)r/dt_utcdt_wall
delta_wall_folds     r_fold_statusz_tzinfo._fold_statuss["W%%	 6)J
v'7'7'9'9FJJLL'HIJJEEErc$t|ddS)Nrr)r,r/rs  rrYz
_tzinfo._foldsr61%%%rc|}|td|}|td||z
}||z
}t|d}|td||zS)
        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)rMrDrUr
)r/rdtoffdtdstdeltas     r_fromutcz_tzinfo._fromutcs=&''
'=IJJJ

er"""&&((=788
8Ezrcz||}|||}t||S)r^r)rbrZr
)r/rrWrYs    rrFz_tzinfo.fromutcsA--##!!"g..gE****rN)
r6r7r8r9rRrZrYrbrGrFr rrrIrIsw+++22&&&###J+++++rrIceZdZdZdZdZdZedZdZ	dZ
dZd	Ze
d
ZdZdZd
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
    c td)Nz%tzrangebase is an abstract base class)NotImplementedErrorr5s r__init__ztzrangebase.__init__!s!"IJJJrcT||}|dS|r|jS|jSr
)_isdst_dst_offset_std_offsetr/risdsts   rrMztzrangebase.utcoffset$s5B=4
	$####rcT||}|dS|r|jStSr
)rj_dst_base_offsetZEROrms   rrUztzrangebase.dst.s1B=4
	((KrcH||r|jS|jSr
)rj	_dst_abbr	_std_abbrr\s  rtznameztzrangebase.tzname8s$;;r??	">!>!rct|tstd|j|urt	d||j}||||zS|\}}||jz}||jz}||f}|	d}|
||}|r||jz}n
||jz}t|o|
|}	t||	S)z, Given a datetime in UTC, return local time rArBNrLr)rCrr*rrDtransitionsr"rMrlr_naive_isdstrkrTrRr
)
r/rrwdstondstoffutc_transitionsrVrnrWrYs
          rrFztzrangebase.fromutc?s#"h''	FDEEE
9D  4555&&rw//r****$
v
!!$"" &/4((!!&/::	,4++GG4++GI<$"3"3G"<"<==gE****rc|jsdS||j\}}|d}||cxko
||jzkncS)rKFNrL)hasdstrwr"rrp)r/rstartends    rrRztzrangebase.is_ambiguous`si{	5%%bg..
s
ZZtZ
$
$r7777C$"7777778rc|jsdS|dS||j}|dS|d}|||}|s+||r||S|S)NFrL)r}rwr"rrxrRrY)r/rrwrns    rrjztzrangebase._isdstvs{	5
Z4&&rw//5
ZZtZ
$
$!!"k22	**2..	zz"~~%%Lrc|\}}|d}||kr||cxko|knc}n||cxko|knc}|S)NrLr)r/rrwryrzrns      rrxztzrangebase._naive_isdstss#
v
ZZtZ
$
$6>>R((((&((((EE",,,,u,,,,,Erc |j|jz
Sr
)rkrlr5s rrpztzrangebase._dst_base_offsets$"222rNc||kSr
r )r/others  r__ne__ztzrangebase.__ne__sEM""rc d|jjzS)Nz%s(...))r.r6r5s r__repr__ztzrangebase.__repr__s4>222r)r6r7r8r9rhrMrUr	rurFrRrjrxr;rp__hash__rrobject
__reduce__r rrreres*KKK$$$"""+++B999,*


33X3H###333"JJJrreN)r)sixr	functoolsrrrrrq__all__r	hasattrr
rrGrIrer rr<module>rs^0000000000y||
),78V^#%%%%%******H***X####<"s+s+s+s+s+fs+s+s+lX#X#X#X#X#'X#X#X#X#X#r
Back to Directory File Manager