
    Mh                        d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z ddlmZ dd	lmZ dd
lmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddl m!Z!m"Z"m#Z#m$Z$ ddl%m&Z&m'Z' ddl(m)Z) ej*        dk     r	ddl+m,Z,m-Z- nddlm,Z,m-Z- eee.f         Z/e-d         Z0e-d         Z1e-d         Z2 G d d          Z3e34                    ej5                  e3_5        e34                    ej6                  e3_6        dS )z_
Provides the :class:`Arrow <arrow.arrow.Arrow>` class, an enhanced ``datetime``
replacement.

    Ndate)datetime)time)	timedeltatzinfo)trunc)struct_time)AnyClassVar	GeneratorIterableListMappingOptionalTupleUnioncastoverload)tz)relativedelta)	formatterlocalesparserutil)DEFAULT_LOCALEDEHUMANIZE_LOCALES)TimeFrameLiteral)      )FinalLiteral)yearyearsmonthmonthsdaydayshourhoursminuteminutessecondsecondsmicrosecondmicrosecondsweekweeksquarterquarters)[)()z(]z[])	autor.   r,   r*   r(   r2   r&   r4   r$   c                   p
   e Zd ZU dZej        Zee         ed<   ed          ed<   ed          ed<   g dZ	e
ee                  ed<   d e	D             Ze
ee                  ed<   d	Ze
e         ed
<   dZe
e         ed<   dZe
e         ed<   dZe
e         ed<   dZe
e         ed<   dZe
e         ed<   dZe
e         ed<   dZe
e         ed<   deeeeeeedZe
eeef                  ed<   eed<   	 	 	 	 	 dded ed!ed"ed#ed$ed%ed&ee         d'ed(dfd)Zedd&ee          d(d fd*            Z!edd+            Z"e	 dd,e#eeef         d&ee         d(d fd-            Z$ed,e#eeef         d(d fd.            Z%edd/ed&ee         d(d fd0            Z&edd1e'd&ee         d(d fd2            Z(e	 dd3ed4ed&ee         d(d fd5            Z)ed6ed(d fd7            Z*e	 	 	 dd8e+d9e#d ef         d:e#d edf         d;ee         d<ee         d(e,d=         fd>            Z-	 	 	 	 dd8e+dBedCe.dDe/dEed(e0dF         fdGZ1d8e+d(d fdHZ2d8e+d(d fdIZ3e	 	 	 	 dd8e+d9ed:ed;ee         d<ee         dCe.dDe/d(e4e0dF                  fdJ            Z5e	 	 	 	 dd8e+d9ed:edKed;ee         dCe.dDe/d(e4e0dF                  fdL            Z6d(efdMZ7d(efdNZ8dOed(efdPZ9d(efdQZ:dRed(efdSZ;e<d(e fdT            Z=e<d(efdU            Z>e<d(efdV            Z?d(efdWZ@e<d(efdX            ZAe<d(efdY            ZBe<d(efdZ            ZCe<d(e/fd[            ZDe<d(e/fd\            ZEdd]ZFd'ed(d fd^ZGd'ed(d fd_ZHd;ed(d fd`ZIdaeJfd4edbed(efdcZKdeJdAddfdee#d edf         dbedfe/dge#eLeeL         f         d(ef
dhZMddjedbed(d fdkZN	 dd9d d:d dCe.d(e/fdmZOd(e'fdnZ'd(ePfdoZQd(ePfdpZRd;ee          d(efdqZSd(ee         fdrZTd(ee         fdsZUd(eVfdtZWd(eVfduZXd(efdvZYd(efdwZZd(efdxZ[d(e0eeef         fdyZ\dd{ed|ed(efd}Z]d(efd~Z^ded(efdZ_d(efdZ`deed(d fdZadee#eebf         d(d fdZceddee#eebf         d(d fd            Zeeddee#ed f         d(efd            Zedeed(e#ed f         fdZedeed(efdZfdeed(e/fdZgdeed(e/fdZhdeed(e/fdZideed(e/fdZjdeed(e/fdZkdeed(e/fdZlemdee         d(e fd            Znede#d eeeef         d(efd            ZoedRe+d(e0eeef         fd            Zped:ed<ee         d(e0eef         fd            Zqemd1d d(e/fd            ZrdS )ArrowaZ  An :class:`Arrow <arrow.arrow.Arrow>` object.

    Implements the ``datetime`` interface, behaving as an aware ``datetime`` while implementing
    additional functionality.

    :param year: the calendar year.
    :param month: the calendar month.
    :param day: the calendar day.
    :param hour: (optional) the hour. Defaults to 0.
    :param minute: (optional) the minute, Defaults to 0.
    :param second: (optional) the second, Defaults to 0.
    :param microsecond: (optional) the microsecond. Defaults to 0.
    :param tzinfo: (optional) A timezone expression.  Defaults to UTC.
    :param fold: (optional) 0 or 1, used to disambiguate repeated wall times. Defaults to 0.

    .. _tz-expr:

    Recognized timezone expressions:

        - A ``tzinfo`` object.
        - A ``str`` describing a timezone, similar to 'US/Pacific', or 'Europe/Berlin'.
        - A ``str`` in ISO 8601 style, as in '+07:00'.
        - A ``str``, one of the following:  'local', 'utc', 'UTC'.

    Usage::

        >>> import arrow
        >>> arrow.Arrow(2013, 5, 5, 12, 30, 45)
        <Arrow [2013-05-05T12:30:45+00:00]>

    
resolutionminmax)r$   r&   r(   r*   r,   r.   r0   _ATTRSc                     g | ]}| d S )s ).0as     K/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/arrow/arrow.py
<listcomp>zArrow.<listcomp>   s    &?&?&?1!www&?&?&?    _ATTRS_PLURALr    _MONTHS_PER_QUARTER<   _SECS_PER_MINUTEi  _SECS_PER_HOURiQ _SECS_PER_DAYi:	 _SECS_PER_WEEKg    DA_SECS_PER_MONTHg    P(^A_SECS_PER_QUARTERi3_SECS_PER_YEARg      ?)r.   r,   r*   r(   r2   r&   r4   r$   	_SECS_MAP	_datetimer   Nr$   r&   r(   r*   r,   r.   r0   r	   kwargsreturnc	                    |t          j                    }nt          |t                    rLt	          |d          r<t	          |d          r,|j        r%t          j                            |j                  }n4t          |t                    rt          j                            |          }|	
                    dd          }
t          |||||||||
	  	        | _        d S )Nlocalizezonefoldr   rX   )dateutil_tztzutc
isinstance	dt_tzinfohasattrrW   r   TzinfoParserparsestrgetdt_datetimerR   )selfr$   r&   r(   r*   r,   r.   r0   r	   rS   rX   s              rD   __init__zArrow.__init__   s     > &((FF vy))	7
++	7 ''	7 		7 (..v{;;FF$$ 	7(..v66Fzz&!$$$%dFFKd
 
 
rF   c                     |t          j                    }t          j        |          } | |j        |j        |j        |j        |j        |j	        |j
        |j        t          |dd          	  	        S )a4  Constructs an :class:`Arrow <arrow.arrow.Arrow>` object, representing "now" in the given
        timezone.

        :param tzinfo: (optional) a ``tzinfo`` object. Defaults to local time.

        Usage::

            >>> arrow.now('Asia/Baku')
            <Arrow [2019-01-24T20:26:31.146412+04:00]>

        NrX   r   rY   )rZ   tzlocalrc   nowr$   r&   r(   r*   r,   r.   r0   r	   getattr)clsr	   dts      rD   rh   z	Arrow.now   sv     > (**F_V$$sGHFGIINIVQ''

 

 

 
	
rF   c                     t          j        t          j                              } | |j        |j        |j        |j        |j        |j	        |j
        |j        t          |dd          	  	        S )zConstructs an :class:`Arrow <arrow.arrow.Arrow>` object, representing "now" in UTC
        time.

        Usage::

            >>> arrow.utcnow()
            <Arrow [2019-01-24T16:31:40.651108+00:00]>

        rX   r   rY   )rc   rh   rZ   r[   r$   r&   r(   r*   r,   r.   r0   r	   ri   )rj   rk   s     rD   utcnowzArrow.utcnow   sl     _[.0011sGHFGIINIVQ''

 

 

 
	
rF   	timestampc                    |t          j                    }n4t          |t                    rt          j                            |          }t          j        |          st          d|d          t          j
        t          |                    }t          j        ||          } | |j        |j        |j        |j        |j        |j        |j        |j        t-          |dd          	  	        S )a0  Constructs an :class:`Arrow <arrow.arrow.Arrow>` object from a timestamp, converted to
        the given timezone.

        :param timestamp: an ``int`` or ``float`` timestamp, or a ``str`` that converts to either.
        :param tzinfo: (optional) a ``tzinfo`` object.  Defaults to local time.

        NThe provided timestamp  is invalid.rX   r   rY   )rZ   rg   r\   ra   r   r_   r`   r   is_timestamp
ValueErrornormalize_timestampfloatrc   fromtimestampr$   r&   r(   r*   r,   r.   r0   r	   ri   )rj   rn   r	   rk   s       rD   rv   zArrow.fromtimestamp   s     > (**FF$$ 	7(..v66F ++ 	RPyPPPQQQ,U9-=-=>>	&y&99sGHFGIINIVQ''

 

 

 
	
rF   c                 h   t          j        |          st          d|d          t          j        t	          |                    }t          j        |          } | |j        |j        |j	        |j
        |j        |j        |j        t          j                    t!          |dd          	  	        S )zConstructs an :class:`Arrow <arrow.arrow.Arrow>` object from a timestamp, in UTC time.

        :param timestamp: an ``int`` or ``float`` timestamp, or a ``str`` that converts to either.

        rp   rq   rX   r   rY   )r   rr   rs   rt   ru   rc   utcfromtimestampr$   r&   r(   r*   r,   r.   r0   rZ   r[   ri   )rj   rn   rk   s      rD   rx   zArrow.utcfromtimestamp  s      ++ 	RPyPPPQQQ,U9-=-=>>	))44sGHFGIINVQ''

 

 

 
	
rF   rk   c                     |"|j         t          j                    }n|j         } | |j        |j        |j        |j        |j        |j        |j	        |t          |dd          	  	        S )a  Constructs an :class:`Arrow <arrow.arrow.Arrow>` object from a ``datetime`` and
        optional replacement timezone.

        :param dt: the ``datetime``
        :param tzinfo: (optional) A :ref:`timezone expression <tz-expr>`.  Defaults to ``dt``'s
            timezone, or UTC if naive.

        Usage::

            >>> dt
            datetime.datetime(2021, 4, 7, 13, 48, tzinfo=tzfile('/usr/share/zoneinfo/US/Pacific'))
            >>> arrow.Arrow.fromdatetime(dt)
            <Arrow [2021-04-07T13:48:00-07:00]>

        NrX   r   rY   )r	   rZ   r[   r$   r&   r(   r*   r,   r.   r0   ri   )rj   rk   r	   s      rD   fromdatetimezArrow.fromdatetime1  sv    $ >y $*,,sGHFGIINVQ''

 

 

 
	
rF   r   c                 h    |t          j                    } | |j        |j        |j        |          S )a  Constructs an :class:`Arrow <arrow.arrow.Arrow>` object from a ``date`` and optional
        replacement timezone.  All time values are set to 0.

        :param date: the ``date``
        :param tzinfo: (optional) A :ref:`timezone expression <tz-expr>`.  Defaults to UTC.

        Nr   )rZ   r[   r$   r&   r(   )rj   r   r	   s      rD   fromdatezArrow.fromdateU  s6     > &((Fs49dj$(6BBBBrF   date_strfmtc                     t          j        ||          }||j        } | |j        |j        |j        |j        |j        |j        |j	        |t          |dd          	  	        S )aj  Constructs an :class:`Arrow <arrow.arrow.Arrow>` object from a date string and format,
        in the style of ``datetime.strptime``.  Optionally replaces the parsed timezone.

        :param date_str: the date string.
        :param fmt: the format string using datetime format codes.
        :param tzinfo: (optional) A :ref:`timezone expression <tz-expr>`.  Defaults to the parsed
            timezone if ``fmt`` contains a timezone directive, otherwise UTC.

        Usage::

            >>> arrow.Arrow.strptime('20-01-2019 15:49:10', '%d-%m-%Y %H:%M:%S')
            <Arrow [2019-01-20T15:49:10+00:00]>

        NrX   r   rY   )rc   strptimer	   r$   r&   r(   r*   r,   r.   r0   ri   )rj   r}   r~   r	   rk   s        rD   r   zArrow.strptimed  sp    & !(C00>YFsGHFGIINVQ''

 

 

 
	
rF   ordinalc                     t          j        |           t          j        |          } | |j        |j        |j        |j        |j        |j	        |j
        |j        t          |dd          	  	        S )a+  Constructs an :class:`Arrow <arrow.arrow.Arrow>` object corresponding
            to the Gregorian Ordinal.

        :param ordinal: an ``int`` corresponding to a Gregorian Ordinal.

        Usage::

            >>> arrow.fromordinal(737741)
            <Arrow [2020-11-12T00:00:00+00:00]>

        rX   r   rY   )r   validate_ordinalrc   fromordinalr$   r&   r(   r*   r,   r.   r0   r	   ri   )rj   r   rk   s      rD   r   zArrow.fromordinal  su     	g&&&$W--sGHFGIINIVQ''

 

 

 
	
rF   framestartendr   limit)r:   NNc              #     K   |                      |          \  }}}|                     ||j        n|          }	|                     |                              |	          }|                     ||          \  }}|                     |                              |	          }|                     |          |j        }
d}d}|k    r||k     r|dz  }V  fd| j        D             }  | |d|	ij	        di ||i|dv rj        |
k     rd	}|r+| 
                              s                    |

          |k    r||k     {dS dS dS dS )a  Returns an iterator of :class:`Arrow <arrow.arrow.Arrow>` objects, representing
        points in time between two inputs.

        :param frame: The timeframe.  Can be any ``datetime`` property (day, hour, minute...).
        :param start: A datetime expression, the start of the range.
        :param end: (optional) A datetime expression, the end of the range.
        :param tz: (optional) A :ref:`timezone expression <tz-expr>`.  Defaults to
            ``start``'s timezone, or UTC if ``start`` is naive.
        :param limit: (optional) A maximum number of tuples to return.

        **NOTE**: The ``end`` or ``limit`` must be provided.  Call with ``end`` alone to
        return the entire range.  Call with ``limit`` alone to return a maximum # of results from
        the start.  Call with both to cap a range at a maximum # of results.

        **NOTE**: ``tz`` internally **replaces** the timezones of both ``start`` and ``end`` before
        iterating.  As such, either call with naive objects and ``tz``, or aware objects from the
        same timezone and no ``tz``.

        Supported frame values: year, quarter, month, week, day, hour, minute, second, microsecond.

        Recognized datetime expressions:

            - An :class:`Arrow <arrow.arrow.Arrow>` object.
            - A ``datetime`` object.

        Usage::

            >>> start = datetime(2013, 5, 5, 12, 30)
            >>> end = datetime(2013, 5, 5, 17, 15)
            >>> for r in arrow.Arrow.range('hour', start, end):
            ...     print(repr(r))
            ...
            <Arrow [2013-05-05T12:30:00+00:00]>
            <Arrow [2013-05-05T13:30:00+00:00]>
            <Arrow [2013-05-05T14:30:00+00:00]>
            <Arrow [2013-05-05T15:30:00+00:00]>
            <Arrow [2013-05-05T16:30:00+00:00]>

        **NOTE**: Unlike Python's ``range``, ``end`` *may* be included in the returned iterator::

            >>> start = datetime(2013, 5, 5, 12, 30)
            >>> end = datetime(2013, 5, 5, 13, 30)
            >>> for r in arrow.Arrow.range('hour', start, end):
            ...     print(repr(r))
            ...
            <Arrow [2013-05-05T12:30:00+00:00]>
            <Arrow [2013-05-05T13:30:00+00:00]>

        Nr   Fr      c                 0    g | ]}t          |          S rA   ri   )rB   fcurrents     rD   rE   zArrow.range.<locals>.<listcomp>  s#    >>>aggq))>>>rF   r	   )r&   r4   r$   T)r(   rA   )_get_frames_get_tzinfor	   _get_datetimereplace_get_iteration_paramsrz   r(   r>   shift_is_last_day_of_month)rj   r   r   r   r   r   _frame_relativerelative_stepsr	   original_dayday_is_clippedivaluesr   s                 @rD   rangezArrow.range  s     v -0OOE,B,B)>>DD!!%((000??..sE::
U$$,,F,;;""5))ynnUFAMMM>>>>3:>>>F7cc61&117  !>2 G 444|9S9S!% <c&?&?&H&H <!//l/;; nnUnnnnrF   r   r6   Fcountboundsexact
week_start)r:   r:   c                 x    d|cxk    rdk    sn t          d          t          j        |                                |          \  }}}|dk    rd}	n|dk    rd}	n|}	 }
|s j                            |	          } j        d|dz            } fd	|D             }t          d
t          |          z
            D ]}|                    d             j	        |d j
        i}
|dk    rL|                                 k    rdnd}|
                                                     |z
   |z
            }
n(|dk    r"|
                     j        dz
  d
z             }
 |
j        di |||z  i}|d         dk    r|
                    d          }
|d         dk    r|                    d          }|
|fS )aV  Returns a tuple of two new :class:`Arrow <arrow.arrow.Arrow>` objects, representing the timespan
        of the :class:`Arrow <arrow.arrow.Arrow>` object in a given timeframe.

        :param frame: the timeframe.  Can be any ``datetime`` property (day, hour, minute...).
        :param count: (optional) the number of frames to span.
        :param bounds: (optional) a ``str`` of either '()', '(]', '[)', or '[]' that specifies
            whether to include or exclude the start and end values in the span. '(' excludes
            the start, '[' includes the start, ')' excludes the end, and ']' includes the end.
            If the bounds are not specified, the default bound '[)' is used.
        :param exact: (optional) whether to have the start of the timespan begin exactly
            at the time specified by ``start`` and the end of the timespan truncated
            so as not to extend beyond ``end``.
        :param week_start: (optional) only used in combination with the week timeframe. Follows isoweekday() where
            Monday is 1 and Sunday is 7.

        Supported frame values: year, quarter, month, week, day, hour, minute, second.

        Usage::

            >>> arrow.utcnow()
            <Arrow [2013-05-09T03:32:36.186203+00:00]>

            >>> arrow.utcnow().span('hour')
            (<Arrow [2013-05-09T03:00:00+00:00]>, <Arrow [2013-05-09T03:59:59.999999+00:00]>)

            >>> arrow.utcnow().span('day')
            (<Arrow [2013-05-09T00:00:00+00:00]>, <Arrow [2013-05-09T23:59:59.999999+00:00]>)

            >>> arrow.utcnow().span('day', count=2)
            (<Arrow [2013-05-09T00:00:00+00:00]>, <Arrow [2013-05-10T23:59:59.999999+00:00]>)

            >>> arrow.utcnow().span('day', bounds='[]')
            (<Arrow [2013-05-09T00:00:00+00:00]>, <Arrow [2013-05-10T00:00:00+00:00]>)

            >>> arrow.utcnow().span('week')
            (<Arrow [2021-02-22T00:00:00+00:00]>, <Arrow [2021-02-28T23:59:59.999999+00:00]>)

            >>> arrow.utcnow().span('week', week_start=6)
            (<Arrow [2021-02-20T00:00:00+00:00]>, <Arrow [2021-02-26T23:59:59.999999+00:00]>)

        r      z,week_start argument must be between 1 and 7.r2   r(   r4   r&   Nc                 0    g | ]}t          |          S rA   r   )rB   r   rd   s     rD   rE   zArrow.span.<locals>.<listcomp>@  s#    7771gdA&&777rF   r    r	   r   )r)   )r'   (r1   )rA   )rs   r   validate_boundsr   r>   indexr   lenappend	__class__r	   
isoweekdayr   r&   )rd   r   r   r   r   r   frame_absoluter   r   attrfloorr   framesr   r   deltaceils   `                rD   spanz
Arrow.span  s   b J####!####KLLLV$$$9=9I9I%9P9P6V##DDy((DD!D 	DK%%d++E[519-F7777777F1s6{{?++ ! !a    "DNF?4;??E'''$//*;*;;;4??+<+<z+I)JU)RSS9,,dj1n-A+BCCu{FFnen.DEFF!9KKRK00E!9::2:..Dd{rF   c                 8    |                      |          d         S )a  Returns a new :class:`Arrow <arrow.arrow.Arrow>` object, representing the "floor"
        of the timespan of the :class:`Arrow <arrow.arrow.Arrow>` object in a given timeframe.
        Equivalent to the first element in the 2-tuple returned by
        :func:`span <arrow.arrow.Arrow.span>`.

        :param frame: the timeframe.  Can be any ``datetime`` property (day, hour, minute...).

        Usage::

            >>> arrow.utcnow().floor('hour')
            <Arrow [2013-05-09T03:00:00+00:00]>

        r   r   rd   r   s     rD   r   zArrow.floorX       yy""rF   c                 8    |                      |          d         S )a  Returns a new :class:`Arrow <arrow.arrow.Arrow>` object, representing the "ceiling"
        of the timespan of the :class:`Arrow <arrow.arrow.Arrow>` object in a given timeframe.
        Equivalent to the second element in the 2-tuple returned by
        :func:`span <arrow.arrow.Arrow.span>`.

        :param frame: the timeframe.  Can be any ``datetime`` property (day, hour, minute...).

        Usage::

            >>> arrow.utcnow().ceil('hour')
            <Arrow [2013-05-09T03:59:59.999999+00:00]>

        r   r   r   s     rD   r   z
Arrow.ceili  r   rF   c              #   (  K   |                      ||j        n|          }|                     ||                              ||          d         }|                     ||          }|                     |||||          }	|s|	D ]}
|
                    |||          V  |	D ]m}
|
                    |||          \  }}||k    r!|}|d         dk    r|t          d          z  }||k    r dS |t          d          z   |k    r dS ||fV  ndS )	a+  Returns an iterator of tuples, each :class:`Arrow <arrow.arrow.Arrow>` objects,
        representing a series of timespans between two inputs.

        :param frame: The timeframe.  Can be any ``datetime`` property (day, hour, minute...).
        :param start: A datetime expression, the start of the range.
        :param end: (optional) A datetime expression, the end of the range.
        :param tz: (optional) A :ref:`timezone expression <tz-expr>`.  Defaults to
            ``start``'s timezone, or UTC if ``start`` is naive.
        :param limit: (optional) A maximum number of tuples to return.
        :param bounds: (optional) a ``str`` of either '()', '(]', '[)', or '[]' that specifies
            whether to include or exclude the start and end values in each span in the range. '(' excludes
            the start, '[' includes the start, ')' excludes the end, and ']' includes the end.
            If the bounds are not specified, the default bound '[)' is used.
        :param exact: (optional) whether to have the first timespan start exactly
            at the time specified by ``start`` and the final span truncated
            so as not to extend beyond ``end``.

        **NOTE**: The ``end`` or ``limit`` must be provided.  Call with ``end`` alone to
        return the entire range.  Call with ``limit`` alone to return a maximum # of results from
        the start.  Call with both to cap a range at a maximum # of results.

        **NOTE**: ``tz`` internally **replaces** the timezones of both ``start`` and ``end`` before
        iterating.  As such, either call with naive objects and ``tz``, or aware objects from the
        same timezone and no ``tz``.

        Supported frame values: year, quarter, month, week, day, hour, minute, second, microsecond.

        Recognized datetime expressions:

            - An :class:`Arrow <arrow.arrow.Arrow>` object.
            - A ``datetime`` object.

        **NOTE**: Unlike Python's ``range``, ``end`` will *always* be included in the returned
        iterator of timespans.

        Usage:

            >>> start = datetime(2013, 5, 5, 12, 30)
            >>> end = datetime(2013, 5, 5, 17, 15)
            >>> for r in arrow.Arrow.span_range('hour', start, end):
            ...     print(r)
            ...
            (<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T12:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T13:00:00+00:00]>, <Arrow [2013-05-05T13:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T14:00:00+00:00]>, <Arrow [2013-05-05T14:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T15:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T16:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T17:00:00+00:00]>, <Arrow [2013-05-05T17:59:59.999999+00:00]>)

        N)r   r   r   r   r   r   r   r   )r   r	   rz   r   r   r   )rj   r   r   r   r   r   r   r   r	   _rangerr   r   s                rD   
span_rangezArrow.span_rangez  se     | DD  //44U%4HHKsF++5%b%88 	@ @ @ffU6f?????? 
	 
	A&&vU&CCKE4czz!9##Mr::::D||B77773>>+
	 
	rF   intervalc           
   #   J  K   |dk     rt          d          t          |                     ||||||                    }	 	 t          |          \  }	}
t	          |dz
            D ]%}	 t          |          \  }}
# t
          $ r Y "w xY w|	|
fV  n# t
          $ r Y dS w xY wd)an  Returns an iterator of tuples, each :class:`Arrow <arrow.arrow.Arrow>` objects,
        representing a series of intervals between two inputs.

        :param frame: The timeframe.  Can be any ``datetime`` property (day, hour, minute...).
        :param start: A datetime expression, the start of the range.
        :param end: (optional) A datetime expression, the end of the range.
        :param interval: (optional) Time interval for the given time frame.
        :param tz: (optional) A timezone expression.  Defaults to UTC.
        :param bounds: (optional) a ``str`` of either '()', '(]', '[)', or '[]' that specifies
            whether to include or exclude the start and end values in the intervals. '(' excludes
            the start, '[' includes the start, ')' excludes the end, and ']' includes the end.
            If the bounds are not specified, the default bound '[)' is used.
        :param exact: (optional) whether to have the first timespan start exactly
            at the time specified by ``start`` and the final interval truncated
            so as not to extend beyond ``end``.

        Supported frame values: year, quarter, month, week, day, hour, minute, second

        Recognized datetime expressions:

            - An :class:`Arrow <arrow.arrow.Arrow>` object.
            - A ``datetime`` object.

        Recognized timezone expressions:

            - A ``tzinfo`` object.
            - A ``str`` describing a timezone, similar to 'US/Pacific', or 'Europe/Berlin'.
            - A ``str`` in ISO 8601 style, as in '+07:00'.
            - A ``str``, one of the following:  'local', 'utc', 'UTC'.

        Usage:

            >>> start = datetime(2013, 5, 5, 12, 30)
            >>> end = datetime(2013, 5, 5, 17, 15)
            >>> for r in arrow.Arrow.interval('hour', start, end, 2):
            ...     print(r)
            ...
            (<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T13:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T14:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>)
            (<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T17:59:59.999999+00:0]>)
        r   z%interval has to be a positive integerr   TN)rs   iterr   nextr   StopIteration)rj   r   r   r   r   r   r   r   	spanRange
intvlStartintvlEndr   s               rD   r   zArrow.interval  s      h a<<DEEENN5%buNMM
 
	
		'+I$
Hx!|,, ! !A!&*9oo88( ! ! ! ! (*****    
	s6   &B )A<;B <
B	B B			B 
B! B!c                 L    d| j         j         d|                                  dS )N<z [z]>)r   __name____str__rd   s    rD   __repr__zArrow.__repr__  s(    @4>*@@dllnn@@@@rF   c                 4    | j                                         S NrR   	isoformatr   s    rD   r   zArrow.__str__  s    ~'')))rF   	formatstrc                 p    t          |          dk    r|                     |          S t          |           S )Nr   )r   formatra   )rd   r   s     rD   
__format__zArrow.__format__  s1    y>>A;;y)))4yyrF   c                 4    | j                                         S r   )rR   __hash__r   s    rD   r   zArrow.__hash__   s    ~&&(((rF   namec                 L   |dk    r|                                  d         S |dk    r"t          | j        dz
  | j        z            dz   S |                    d          st          | j        |d           }||S t          t          t          	                    | |                    S )Nr2   r   r4   r   )
isocalendarintr&   rH   
startswithri   rR   r   object__getattribute__)rd   r   values      rD   __getattr__zArrow.__getattr__%  s    6>>##%%a((9
Q$*BBCCaGGs## 	#*4>4#F#FE C00t<<===rF   c                 @    t          t          | j        j                  S )zGets the ``tzinfo`` of the :class:`Arrow <arrow.arrow.Arrow>` object.

        Usage::

            >>> arw=arrow.utcnow()
            >>> arw.tzinfo
            tzutc()

        )r   r]   rR   r	   r   s    rD   r	   zArrow.tzinfo4  s     It~4555rF   c                     | j         S )zReturns a datetime representation of the :class:`Arrow <arrow.arrow.Arrow>` object.

        Usage::

            >>> arw=arrow.utcnow()
            >>> arw.datetime
            datetime.datetime(2019, 1, 24, 16, 35, 27, 276649, tzinfo=tzutc())

        )rR   r   s    rD   r   zArrow.datetimeC  s     ~rF   c                 8    | j                             d          S )a_  Returns a naive datetime representation of the :class:`Arrow <arrow.arrow.Arrow>`
        object.

        Usage::

            >>> nairobi = arrow.now('Africa/Nairobi')
            >>> nairobi
            <Arrow [2019-01-23T19:27:12.297999+03:00]>
            >>> nairobi.naive
            datetime.datetime(2019, 1, 23, 19, 27, 12, 297999)

        Nr   )rR   r   r   s    rD   naivezArrow.naiveQ  s     ~%%T%222rF   c                 4    | j                                         S )zReturns a timestamp representation of the :class:`Arrow <arrow.arrow.Arrow>` object, in
        UTC time.

        Usage::

            >>> arrow.utcnow().timestamp()
            1616882340.256501

        )rR   rn   r   s    rD   rn   zArrow.timestampb       ~'')))rF   c                 D    t          |                                           S )zReturns an integer timestamp representation of the :class:`Arrow <arrow.arrow.Arrow>` object, in
        UTC time.

        Usage::

            >>> arrow.utcnow().int_timestamp
            1548260567

        )r   rn   r   s    rD   int_timestampzArrow.int_timestampo  s     4>>##$$$rF   c                 *    |                                  S )zReturns a floating-point timestamp representation of the :class:`Arrow <arrow.arrow.Arrow>`
        object, in UTC time.

        Usage::

            >>> arrow.utcnow().float_timestamp
            1548260516.830896

        )rn   r   s    rD   float_timestampzArrow.float_timestamp}  s     ~~rF   c                     | j         j        S )zLReturns the ``fold`` value of the :class:`Arrow <arrow.arrow.Arrow>` object.)rR   rX   r   s    rD   rX   z
Arrow.fold  s     ~""rF   c                 4    t          j        | j                  S )zIndicates whether the :class:`Arrow <arrow.arrow.Arrow>` object is a repeated wall time in the current
        timezone.

        )rZ   datetime_ambiguousrR   r   s    rD   	ambiguouszArrow.ambiguous  s     -dn===rF   c                 6    t          j        | j                   S )z`Indicates whether the :class: `Arrow <arrow.arrow.Arrow>` object exists in the current timezone.)rZ   datetime_existsrR   r   s    rD   	imaginaryzArrow.imaginary  s     .t~>>>>rF   c                 6    |                      | j                  S )zReturns a new :class:`Arrow <arrow.arrow.Arrow>` object, cloned from the current one.

        Usage:

            >>> arw = arrow.utcnow()
            >>> cloned = arw.clone()

        )rz   rR   r   s    rD   clonezArrow.clone  s       000rF   c                    i }|                                 D ]B\  }}|| j        v r|||<   |dv rt          d| d          |dvrt          d|d          C | j        j        di |}|                    d          }|+|                     |          }|                    |	          }|                    d
          }||                    |          }|                     |          S )a  Returns a new :class:`Arrow <arrow.arrow.Arrow>` object with attributes updated
        according to inputs.

        Use property names to set their value absolutely::

            >>> import arrow
            >>> arw = arrow.utcnow()
            >>> arw
            <Arrow [2013-05-11T22:27:34.787885+00:00]>
            >>> arw.replace(year=2014, month=6)
            <Arrow [2014-06-11T22:27:34.787885+00:00]>

        You can also replace the timezone without conversion, using a
        :ref:`timezone expression <tz-expr>`::

            >>> arw.replace(tzinfo=tz.tzlocal())
            <Arrow [2013-05-11T22:27:34.787885-07:00]>

        )r2   r4   zSetting absolute z is not supported.)r	   rX   zUnknown attribute: .r	   Nr   rX   rY   rA   )itemsr>   rs   rR   r   rb   r   rz   )rd   rS   absolute_kwargskeyr   r   r	   rX   s           rD   r   zArrow.replace  s(   *  ,,.. 	A 	AJCdk!!',$$+++ !LS!L!L!LMMM... !?s!?!?!?@@@ / )$.(;;?;;H%%%%f--FooVo44Gzz&!!oo4o00G  )))rF   c                    i }g d}|                                 D ]G\  }}|| j        v s||v r|||<   d                    | j        |z             }t          d| d          |                    dd           |dxx         |                    dd          | j        z  z  cc<   | j        t          di |z   }t          j
        |          st          j        |          }|                     |          S )	a  Returns a new :class:`Arrow <arrow.arrow.Arrow>` object with attributes updated
        according to inputs.

        Use pluralized property names to relatively shift their current value:

        >>> import arrow
        >>> arw = arrow.utcnow()
        >>> arw
        <Arrow [2013-05-11T22:27:34.787885+00:00]>
        >>> arw.shift(years=1, months=-1)
        <Arrow [2014-04-11T22:27:34.787885+00:00]>

        Day-of-the-week relative shifting can use either Python's weekday numbers
        (Monday = 0, Tuesday = 1 .. Sunday = 6) or using dateutil.relativedelta's
        day instances (MO, TU .. SU).  When using weekday numbers, the returned
        date will always be greater than or equal to the starting date.

        Using the above code (which is a Saturday) and asking it to shift to Saturday:

        >>> arw.shift(weekday=5)
        <Arrow [2013-05-11T22:27:34.787885+00:00]>

        While asking for a Monday:

        >>> arw.shift(weekday=0)
        <Arrow [2013-05-13T22:27:34.787885+00:00]>

        )r3   r5   weekday, z>Invalid shift time frame. Please select one of the following: r   r'   r   r5   rA   )r   rG   joinrs   
setdefaultpoprH   rR   r   rZ   r   resolve_imaginaryrz   )rd   rS   relative_kwargsadditional_attrsr   r   supported_attrr   s           rD   r   zArrow.shift  s3   < ;;; ,,.. 	 	JCd(((C3C,C,C',$$!%4+=@P+P!Q!Q fUcfff  
 	""8Q///!!!
A..1II	
!!! .=#C#C?#C#CC*733 	=!3G<<G  )))rF   c                 H   t          |t                    st          j                            |          }| j                            |          }|                     |j        |j	        |j
        |j        |j        |j        |j        |j        t!          |dd          	  	        S )a  Returns a new :class:`Arrow <arrow.arrow.Arrow>` object, converted
        to the target timezone.

        :param tz: A :ref:`timezone expression <tz-expr>`.

        Usage::

            >>> utc = arrow.utcnow()
            >>> utc
            <Arrow [2013-05-09T03:49:12.311072+00:00]>

            >>> utc.to('US/Pacific')
            <Arrow [2013-05-08T20:49:12.311072-07:00]>

            >>> utc.to(tz.tzlocal())
            <Arrow [2013-05-08T20:49:12.311072-07:00]>

            >>> utc.to('-07:00')
            <Arrow [2013-05-08T20:49:12.311072-07:00]>

            >>> utc.to('local')
            <Arrow [2013-05-08T20:49:12.311072-07:00]>

            >>> utc.to('local').to('utc')
            <Arrow [2013-05-09T03:49:12.311072+00:00]>

        rX   r   rY   )r\   r]   r   r_   r`   rR   
astimezoner   r$   r&   r(   r*   r,   r.   r0   r	   ri   )rd   r   rk   s      rD   tozArrow.to  s    : "i(( 	/$**2..B^&&r**~~GHFGIINIVQ''  

 

 
	
rF   zYYYY-MM-DD HH:mm:ssZZlocalec                 \    t          j        |                              | j        |          S )aP  Returns a string representation of the :class:`Arrow <arrow.arrow.Arrow>` object,
        formatted according to the provided format string.

        :param fmt: the format string.
        :param locale: the locale to format.

        Usage::

            >>> arrow.utcnow().format('YYYY-MM-DD HH:mm:ss ZZ')
            '2013-05-09 03:56:47 -00:00'

            >>> arrow.utcnow().format('X')
            '1368071882'

            >>> arrow.utcnow().format('MMMM DD, YYYY')
            'May 09, 2013'

            >>> arrow.utcnow().format()
            '2013-05-09 03:56:47 -00:00'

        )r   DateTimeFormatterr   rR   )rd   r~   r  s      rD   r   zArrow.formatC  s'    2 *62299$.#NNNrF   r8   otheronly_distancegranularityc                     |}t          j        |          }|Xt          j                                        t          j                              }|                     j        j	                  }nt          |t                    r|j        }nt          |t                    rH|j	        !|                     j        j	                  }nE|                     j        j	                  }n%t          dt          |          j        d          t          t                    rt!                    dk    rd         t#          t%           j        |z
                                                      }|dk     rdndt)          |          x}	}
	 dk    r|
d	k     r|                    d
|          S |
 j        k     r|	z  }|                    d||          S |
 j        dz  k     r|                    d|          S |
 j        k     r3t1          |	 j        z  d          z  }|                    d||          S |
 j        dz  k     r|                    d|          S |
 j        k     r3t1          |	 j        z  d          z  }|                    d||          S |
 j        dz  k     r|                    d|          S |
 j        k     r3t1          |	 j        z  d          z  }|                    d||          S |
 j        dz  k     r|                    d|          S |
 j        k     r3t1          |	 j        z  d          z  }|                    d||          S |
 j        dz  k     r|                    d|          S |
 j        k     ri j        j        dz   j        j        z   }|j        dz  |j        z   }t1          t)          ||z
            d          z  }|                    d||          S |
 j        dz  k     r|                    d|          S t1          |	 j        z  d          z  }|                    d||          S t          t>                    r0tA          tB                    dk    r=tE          |	          z  }t)          |          dk     r|                    d
|          S ndk    r|	z   j        z  }ndk    r|	z   j        z  }nsdk    r|	z   j        z  }n_dk    r|	z   j        z  }nKdk    r|	z   j        z  }n7dk    r|	z   j#        z  }n#dk    r|	z   j        z  }ntI          d          tK          t)          |                    dk    rdz  |                    ||          S stI          d          g d tD          d!tB          d"tD          f fd#}tE          |	          }d$}|D ]} |||          }t!                    t!                    k     rtI          d          |&                    |          S # tN          $ r}tI          d%| d&|d'          d}~ww xY w)(a  Returns a localized, humanized representation of a relative difference in time.

        :param other: (optional) an :class:`Arrow <arrow.arrow.Arrow>` or ``datetime`` object.
            Defaults to now in the current :class:`Arrow <arrow.arrow.Arrow>` object's timezone.
        :param locale: (optional) a ``str`` specifying a locale.  Defaults to 'en-us'.
        :param only_distance: (optional) returns only time difference eg: "11 seconds" without "in" or "ago" part.
        :param granularity: (optional) defines the precision of the output. Set it to strings 'second', 'minute',
                           'hour', 'day', 'week', 'month' or 'year' or a list of any combination of these strings

        Usage::

            >>> earlier = arrow.utcnow().shift(hours=-2)
            >>> earlier.humanize()
            '2 hours ago'

            >>> later = earlier.shift(hours=4)
            >>> later.humanize(earlier)
            'in 4 hours'

        Nr   z!Invalid 'other' argument of type z4. Argument must be of type None, Arrow, or datetime.r   r   r   r8   
   rh   )r
  r/      r,   r-   r*   r+   r(   r)   r2   r3   r&      r'   r$   r%   r.   r4   z|Invalid level of granularity. Please select between 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'.r@   zEmpty granularity list provided. Please select one or more from 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'._delta_framerT   c                     |v r| z  j         |         z  }| j         |         z  } t          t          |                    dk    r.                    t	          t
          |dz             |f           n                    ||f           | S )Nr   r@   )rQ   r
   absr   r   r   )r  r  r   r  rd   sign
timeframess      rD   gather_timeframesz)Arrow.humanize.<locals>.gather_timeframes  s    ,, $vv0F F$."88 U,,11&--!%&6!E!Eu M    '--vuo>>>!MrF   )r$   r4   r&   r2   r(   r*   r,   r.   zHumanization of the z0 granularity is not currently translated in the z> locale. Please consider making a contribution to this locale.)(r   
get_localerc   rm   r   rZ   r[   r  rR   r	   r\   r:   	TypeErrortyper   listr   r   roundtotal_secondsr  describerJ   rK   r=   rL   rM   rN   rP   r$   r&   ra   r   r   ru   rO   rs   r
   describe_multiKeyError)rd   r	  r  r
  r  locale_nameutcrk   r  delta_seconddiffr/   r-   r+   r)   r3   self_monthsother_monthsr'   r%   r   r  r   r   er  r  s   `   `                    @@rD   humanizezArrow.humanize^  s   8 #F++=$&&..k6G6I6I.JJC 566BBu%% 	BB{++ 
	|#]]$.*?]@@%%dn&;<< EDKK4H E E E  
 k4(( 	)S-=-=-B-B%a.KUDNR/>>@@AABBaZZrrQ!&kk)tE	f$$"99!??5?NNN$///"\1G!??!7- +    D1A555!??8T?WWWD///"S9N)NPQ%R%RRG!??!7- +    D/!333!??64}?UUUD... 3|t7J'JA#N#NNE!??7E?WWWD.222!??5$m?TTTD///#ld6H&H!"L"LLD!??64}?UUUD/!333!??64}?UUUD000 3|t7J'JA#N#NNE!??7E?WWWD01444!??7D?VVVD///"&."5":T^=Q"QK#%7R<"(#:L!CL;,F(G(G$K$KKF!?? & +    D/!333!??64}?UUU 3|t7J'JA#N#NNE!??7E?WWWK-- HV"#3[AA(** 5#6#66E5zzA~~%uMRRR & H,, </$2GGEE F** </$2EEEE E)) </$2DDEE F** </$2EEEE G++ </$2FFEE I-- </$2HHEE F** </$2EEEE$y  
 U$$))3&K{EWWW # $@  
 DF

"e 
"=M 
"RW 
" 
" 
" 
" 
" 
" 
" 
" 
" l++	8 $ < <E--eU;;EEz??S%5%555$y  
 ,,Z},UUU 	 	 	Hq H HZe H H H  	s|   #Y :'Y "%Y =Y %Y ,=Y *%Y =Y %Y 4=Y 2%Y A3Y %Y 22Y %A,Y CY +BY 
Y)Y$$Y)en_usinput_stringc                    t          j        |          }|                                                    dd          }|t          vrt          d| d          |                     | j                  }t          	                    g dd          }t          	                    g dd          }t          j        d	          }|j                                        D ]b\  }	}
t          |
t                    r|
}n|	t!          |
          i}|                                D ]\  }}t!          |          }|                    d	          }t          j        d
|           }|                    |          }|sY|                                }|                    |          }|s3|                                sdnt+          t-          |                    }n!t-          |                                          }|	dk    rd||	<   t!          |	          }|t!          |          d         dk    rdndz  }|||<   d||<   dt/          d |                                D                       st          d          |j        }|                    d          }t          j        d| d          }|                    |          }|j        }|                    d          }t          j        d| d          }|                    |          }|rdn|rdn|d         rdnt          d          fd|                                D             } |j        di |S )a  Returns a new :class:`Arrow <arrow.arrow.Arrow>` object, that represents
        the time difference relative to the attributes of the
        :class:`Arrow <arrow.arrow.Arrow>` object.

        :param timestring: a ``str`` representing a humanized relative time.
        :param locale: (optional) a ``str`` specifying a locale.  Defaults to 'en-us'.

        Usage::

                >>> arw = arrow.utcnow()
                >>> arw
                <Arrow [2021-04-20T22:27:34.787885+00:00]>
                >>> earlier = arw.dehumanize("2 days ago")
                >>> earlier
                <Arrow [2021-04-18T22:27:34.787885+00:00]>

                >>> arw = arrow.utcnow()
                >>> arw
                <Arrow [2021-04-20T22:27:34.787885+00:00]>
                >>> later = arw.dehumanize("in a month")
                >>> later
                <Arrow [2021-05-18T22:27:34.787885+00:00]>

        r   -z*Dehumanize does not currently support the zN locale, please consider making a contribution to add support for this locale.)r/   r-   r+   r)   r3   r'   r%   r   )rh   r/   r-   r+   r)   r3   r'   r%   Fz\d+z	(^|\b|\d)r   rh   Tr   r@    c                     g | ]	\  }}|d 
S )TrA   )rB   kvs      rD   rE   z$Arrow.dehumanize.<locals>.<listcomp>  s!    ???TQQ?D???rF   zInput string not valid. Note: Some locales do not support the week granularity in Arrow. If you are attempting to use the week granularity on an unsupported locale, this could be the cause of this error.z.*^$zInvalid input String. String does not contain any relative time information. String should either represent a time in the future or a time in the past. Ex: 'in 5 seconds' or '5 seconds ago'.c                 "    i | ]\  }}||z  S rA   rA   )rB   r.  r/  sign_vals      rD   
<dictcomp>z$Arrow.dehumanize.<locals>.<dictcomp>  s#    MMMDAq8a<MMMrF   rA   )r   r  lowerr   r   rs   rz   rR   dictfromkeysrecompiler  r   r\   r   ra   r   searchgroup	isnumericr  r   anyfuturefindallpastr   )rd   r)  r  
locale_objnormalized_locale_namecurrent_timetime_object_infounit_visitednum_patternunitunit_objectstrings_to_search
time_deltatime_stringsearch_stringpatternmatchmatch_string	num_matchchange_valuetime_unit_to_changefuture_stringfuture_patternfuture_pattern_matchpast_stringpast_patternpast_pattern_matchtime_changesr3  s                               @rD   
dehumanizezArrow.dehumanize  s   6 '//
 "(!7!7S!A!A!);;; TV  T  T  T   ((88  ==OOOQR
 

 }}VVV
 
 j(( ",!6!<!<!>!> .	9 .	9D++w// =$/!!%)3{+;+;$<!
 ,=+B+B+D+D $9 $9'
K #K 0 0 - 4 4V < < *%A-%A%ABB|44  ${{}}'..|<<	 ! :!+!5!5!7!7QSZ=Q=Q !L $'y'8'8#9#9L 5==)-L& '*$ii## 344R8C??CCb# 9E !4548011I$9N ??\%7%7%9%9???@@ 	E   #)%,,T22$9$9$9$9::-55lCC o!((..z"5{"5"5"566)11,??  	HH! 		HH%  	HH9   NMMM4D4J4J4L4LMMM!|!11L111rF   r7   c                    t          j        |           t          |t                    s t	          dt          |          d          t          |t                    s t	          dt          |          d          |d         dk    }|d         dk    }| j        }|j        }|j        }||cxk    o|k    nc o|p||k     o|p||k     S )a  Returns a boolean denoting whether the :class:`Arrow <arrow.arrow.Arrow>` object is between
        the start and end limits.

        :param start: an :class:`Arrow <arrow.arrow.Arrow>` object.
        :param end: an :class:`Arrow <arrow.arrow.Arrow>` object.
        :param bounds: (optional) a ``str`` of either '()', '(]', '[)', or '[]' that specifies
            whether to include or exclude the start and end values in the range. '(' excludes
            the start, '[' includes the start, ')' excludes the end, and ']' includes the end.
            If the bounds are not specified, the default bound '()' is used.

        Usage::

            >>> start = arrow.get(datetime(2013, 5, 5, 12, 30, 10))
            >>> end = arrow.get(datetime(2013, 5, 5, 12, 30, 36))
            >>> arrow.get(datetime(2013, 5, 5, 12, 30, 27)).is_between(start, end)
            True

            >>> start = arrow.get(datetime(2013, 5, 5))
            >>> end = arrow.get(datetime(2013, 5, 8))
            >>> arrow.get(datetime(2013, 5, 8)).is_between(start, end, '[]')
            True

            >>> start = arrow.get(datetime(2013, 5, 5))
            >>> end = arrow.get(datetime(2013, 5, 8))
            >>> arrow.get(datetime(2013, 5, 8)).is_between(start, end, '[)')
            False

        z)Cannot parse start date argument type of r   z'Cannot parse end date argument type of r   [r   ])r   r   r\   r:   r  r  r   )	rd   r   r   r   include_startinclude_end	target_tsstart_tsend_tss	            rD   
is_betweenzArrow.is_between  s   F 	V$$$%'' 	LDKKLLL   #u%% 	XVd5kkVVVWWWq	S(Qi3&(	($ ,,,,f,,,, 46(Y"642	F 2	
rF   c                 4    | j                                         S )zReturns a ``date`` object with the same year, month and day.

        Usage::

            >>> arrow.utcnow().date()
            datetime.date(2019, 1, 23)

        )rR   r   r   s    rD   r   z
Arrow.date       ~""$$$rF   c                 4    | j                                         S )zReturns a ``time`` object with the same hour, minute, second, microsecond.

        Usage::

            >>> arrow.utcnow().time()
            datetime.time(12, 15, 34, 68352)

        )rR   r   r   s    rD   r   z
Arrow.time  re  rF   c                 4    | j                                         S )zReturns a ``time`` object with the same hour, minute, second, microsecond and
        tzinfo.

        Usage::

            >>> arrow.utcnow().timetz()
            datetime.time(12, 5, 18, 298893, tzinfo=tzutc())

        )rR   timetzr   s    rD   rh  zArrow.timetz  s     ~$$&&&rF   c                 6    | j                             |          S )a  Returns a ``datetime`` object, converted to the specified timezone.

        :param tz: a ``tzinfo`` object.

        Usage::

            >>> pacific=arrow.now('US/Pacific')
            >>> nyc=arrow.now('America/New_York').tzinfo
            >>> pacific.astimezone(nyc)
            datetime.datetime(2019, 1, 20, 10, 24, 22, 328172, tzinfo=tzfile('/usr/share/zoneinfo/America/New_York'))

        )rR   r  )rd   r   s     rD   r  zArrow.astimezone  s     ~((,,,rF   c                 4    | j                                         S )zReturns a ``timedelta`` object representing the whole number of minutes difference from
        UTC time.

        Usage::

            >>> arrow.now('US/Pacific').utcoffset()
            datetime.timedelta(-1, 57600)

        )rR   	utcoffsetr   s    rD   rk  zArrow.utcoffset  r   rF   c                 4    | j                                         S )zReturns the daylight savings time adjustment.

        Usage::

            >>> arrow.utcnow().dst()
            datetime.timedelta(0)

        )rR   dstr   s    rD   rm  z	Arrow.dst)  s     ~!!###rF   c                 4    | j                                         S )a  Returns a ``time.struct_time``, in the current timezone.

        Usage::

            >>> arrow.utcnow().timetuple()
            time.struct_time(tm_year=2019, tm_mon=1, tm_mday=20, tm_hour=15, tm_min=17, tm_sec=8, tm_wday=6, tm_yday=20, tm_isdst=0)

        )rR   	timetupler   s    rD   ro  zArrow.timetuple5       ~'')))rF   c                 4    | j                                         S )zReturns a ``time.struct_time``, in UTC time.

        Usage::

            >>> arrow.utcnow().utctimetuple()
            time.struct_time(tm_year=2019, tm_mon=1, tm_mday=19, tm_hour=21, tm_min=41, tm_sec=7, tm_wday=5, tm_yday=19, tm_isdst=0)

        )rR   utctimetupler   s    rD   rr  zArrow.utctimetupleA  s     ~**,,,rF   c                 4    | j                                         S )zReturns the proleptic Gregorian ordinal of the date.

        Usage::

            >>> arrow.utcnow().toordinal()
            737078

        )rR   	toordinalr   s    rD   rt  zArrow.toordinalM  rp  rF   c                 4    | j                                         S )zReturns the day of the week as an integer (0-6).

        Usage::

            >>> arrow.utcnow().weekday()
            5

        )rR   r   r   s    rD   r   zArrow.weekdayY  s     ~%%'''rF   c                 4    | j                                         S )zReturns the ISO day of the week as an integer (1-7).

        Usage::

            >>> arrow.utcnow().isoweekday()
            6

        )rR   r   r   s    rD   r   zArrow.isoweekdaye  s     ~((***rF   c                 4    | j                                         S )zReturns a 3-tuple, (ISO year, ISO week number, ISO weekday).

        Usage::

            >>> arrow.utcnow().isocalendar()
            (2019, 3, 6)

        )rR   r   r   s    rD   r   zArrow.isocalendarq  s     ~))+++rF   Tseptimespecc                 8    | j                             ||          S )zReturns an ISO 8601 formatted representation of the date and time.

        Usage::

            >>> arrow.utcnow().isoformat()
            '2019-01-19T18:30:52.442118+00:00'

        r   )rd   ry  rz  s      rD   r   zArrow.isoformat}  s     ~''X666rF   c                 4    | j                                         S )zReturns a ctime formatted representation of the date and time.

        Usage::

            >>> arrow.utcnow().ctime()
            'Sat Jan 19 18:26:50 2019'

        )rR   ctimer   s    rD   r}  zArrow.ctime  s     ~##%%%rF   r   c                 6    | j                             |          S )zFormats in the style of ``datetime.strftime``.

        :param format: the format string.

        Usage::

            >>> arrow.utcnow().strftime('%d-%m-%Y %H:%M:%S')
            '23-01-2019 12:28:17'

        )rR   strftime)rd   r   s     rD   r  zArrow.strftime  s     ~&&v...rF   c                 *    |                                  S )zSerializes for the ``for_json`` protocol of simplejson.

        Usage::

            >>> arrow.utcnow().for_json()
            '2019-01-19T18:25:36.760079+00:00'

        )r   r   s    rD   for_jsonzArrow.for_json  s     ~~rF   c                     t          |t          t          f          r(|                     | j        |z   | j        j                  S t          S r   )r\   r   r   rz   rR   r	   NotImplementedrd   r	  s     rD   __add__zArrow.__add__  sB    ei788 	T$$T^e%;T^=RSSSrF   c                 ,    |                      |          S r   )r  r  s     rD   __radd__zArrow.__radd__  s    ||E"""rF   c                     d S r   rA   r  s     rD   __sub__zArrow.__sub__      rF   c                     d S r   rA   r  s     rD   r  zArrow.__sub__  r  rF   c                    t          |t          t          f          r(|                     | j        |z
  | j        j                  S t          |t                    r
| j        |z
  S t          |t                    r| j        |j        z
  S t          S r   )	r\   r   r   rz   rR   r	   rc   r:   r  r  s     rD   r  zArrow.__sub__  s    ei788 	4$$T^e%;T^=RSSS{++ 	4>E))u%% 	4>EO33rF   c                 N    t          |t                    r
|| j        z
  S t          S r   )r\   rc   rR   r  r  s     rD   __rsub__zArrow.__rsub__  s'    e[)) 	*4>))rF   c                 z    t          |t          t          f          sdS | j        |                     |          k    S )NF)r\   r:   rc   rR   r   r  s     rD   __eq__zArrow.__eq__  s9    %%!566 	5~!3!3E!:!:::rF   c                 j    t          |t          t          f          sdS |                     |           S )NT)r\   r:   rc   r  r  s     rD   __ne__zArrow.__ne__  s3    %%!566 	4;;u%%%%rF   c                     t          |t          t          f          st          S | j        |                     |          k    S r   r\   r:   rc   r  rR   r   r  s     rD   __gt__zArrow.__gt__  :    %%!566 	"!!~ 2 25 9 999rF   c                     t          |t          t          f          st          S | j        |                     |          k    S r   r  r  s     rD   __ge__zArrow.__ge__  :    %%!566 	"!!~!3!3E!:!:::rF   c                     t          |t          t          f          st          S | j        |                     |          k     S r   r  r  s     rD   __lt__zArrow.__lt__  r  rF   c                     t          |t          t          f          st          S | j        |                     |          k    S r   r  r  s     rD   __le__zArrow.__le__  r  rF   tz_exprc                     | t          j                    S t          | t                    r| S 	 t          j                            |           S # t          j        $ r t          | d          w xY w)z1Get normalized tzinfo object from various inputs.Nz not recognized as a timezone.)	rZ   r[   r\   r]   r   r_   r`   ParserErrorrs   )r  s    rD   r   zArrow._get_tzinfo  s     ?$&&&gy)) 	ONO*00999% O O O G!M!M!MNNNOs   A "A/exprc                    t          |t                    r|j        S t          |t                    r|S t	          j        |          r)t          |          }|                     |          j        S t          |d          )z0Get datetime object from a specified expression.z+ not recognized as a datetime or timestamp.)	r\   r:   r   rc   r   rr   ru   rx   rs   )rj   r  rn   s      rD   r   zArrow._get_datetime  s    
 dE"" 	U= k** 	UKt$$ 	UdI''	22;;SSSTTTrF   c                     || j         v r|| ddfS |d         dk    r|dd         | j         v r|dd         |dfS |dv rdS |dv rdS d	                    g d
          }t          d| d| d          )zFinds relevant timeframe and steps for use in range and span methods.

        Returns a 3 element tuple in the form (frame, plural frame, step), for example ("day", "days", 1)

        r@   r   r   N)r2   r3   )r2   r3   r   )r4   r5   )r4   r'   r    r   )	zyear(s)zmonth(s)zday(s)zhour(s)z	minute(s)z	second(s)zmicrosecond(s)zweek(s)z
quarter(s)zRange or span over frame z" not supported. Supported frames: r   )r>   r   rs   )rj   r   	supporteds      rD   r   zArrow._get_frames  s     3:DQ&&"X__crccj!8!89dA%%&&&%%,,,))		
 
 
 I `D``T]```  rF   c                 b    ||t          d          | j        |fS ||t          j        fS ||fS )z3Sets default end and limit values for range method.Nz$One of 'end' or 'limit' is required.)rs   r=   sysmaxsize)rj   r   r   s      rD   r   zArrow._get_iteration_params8  sG     ;} !GHHH7E>! }CK'':rF   c                 ^    | j         t          j        | j        | j                  d         k    S )zOReturns a boolean indicating whether the datetime is the last day of the month.r   )r(   calendar
monthranger$   r&   r   s    rD   r   zArrow._is_last_day_of_monthF  s'     x8.ty$*EEaHHHrF   )r   r   r   r   Nr   )rT   r:   )NNN)r   r6   Fr   )NNr6   F)r   Nr6   F)r(  )r7   )rx  r8   )sr   
__module____qualname____doc__rc   r;   r   r   __annotations__r>   r"   r   ra   rG   rH   r   rJ   rK   rL   rM   rN   ru   rO   rP   rQ   r   r   r   TZ_EXPRr   re   classmethodr]   rh   rm   r   rv   rx   rz   r   r|   r   r   	_T_FRAMESr   r   _BOUNDSboolr   r   r   r   r   r   r   r   r   r   r   r   propertyr	   r   r   rn   r   r   rX   r   r   r   r   r   r  r   r   _GRANULARITYr'  rZ  rc  dt_timer   rh  r  rk  rm  r   ro  rr  rt  r   r   r   r   r}  r  r  r  r   r  r   r  r  r  r  r  r  r  r  staticmethodr   r   r   r   r   rA   rF   rD   r:   r:   S   sS         @ '2&<J#<<<	'		'	     FE$s)    '@&?&?&?&?M5c#???&'s'''#%eCj%%%!(NE#J((( ,M5:,,,!1NE#J111$7OU5\777&=uU|===!3NE#J333 " $	: 	:IuW-u456 	 	 	  $(
 

 
 	

 
 
 
 
 !
 
 

 
 
 
B 
 
), 
 
 
 
 [
< 
 
 
 [
2  %)"
 "
eS)"
 !"
 
	"
 "
 "
 ["
H 
sE3)? 
G 
 
 
 [
2 !
 !
k !
8G3D !
PW !
 !
 !
 [!
F C CD C(7*; Cw C C C [C BF 
  
 
!$ 
.6w.? 
	 
  
  
 [ 
D 
# 
' 
 
 
 [
: 
 26 $#T< T<T< Wk)*T< 7K-.	T<
 WT< }T< 
&	'T< T< T< [T<r Z ZZ Z 	Z
 Z Z 
	 Z Z Z Zx#9 # # # # #"#) # # # # #"  !%#O OO O 	O
 WO }O O O 
%()	*O O O [Ob   $C CC C 	C
 C WC C C 
%()	*C C C [CNA# A A A A* * * * *C C    )# ) ) ) )
> > > > > > 6	 6 6 6 X6 +    X 3{ 3 3 3 X3 *5 * * * * %s % % % X%         X  #c # # # X#
 >4 > > > X> ?4 ? ? ? X?
1 
1 
1 
1,* ,* ,* ,* ,* ,*\5*c 5*g 5* 5* 5* 5*n,
W ,
 ,
 ,
 ,
 ,
b 1O OO:=O	O O O O: 48$#?E~ ~Wk4/0~ ~ 	~
 <l);;<~ 
~ ~ ~ ~@I2 I2s I2C I2g I2 I2 I2 I2b 	8
 8
8
 8
 	8

 
8
 8
 8
 8
x
%d 
% 
% 
% 
%
%g 
% 
% 
% 
%' ' ' ' '-Xi0 -[ - - - - *8I. * * * *
$Xi( 
$ 
$ 
$ 
$
*; 
* 
* 
* 
*
-k 
- 
- 
- 
-
*3 
* 
* 
* 
*
( 
( 
( 
( 
(
+C 
+ 
+ 
+ 
+
,U3S=1 
, 
, 
, 
,
7 
7S 
7# 
73 
7 
7 
7 
7
&s 
& 
& 
& 
&/s /s / / / /
 # 
  
  
  
 S W    #eI}$<= #' # # # # U9m#;<     X U;#78 Y    X
S 
U9g+=%> 
 
 
 
c i    ;C ;D ; ; ; ;&C &D & & & &:C :D : : : :;C ;D ; ; ; ;:C :D : : : :;C ;D ; ; ; ; 
OXg. 
O9 
O 
O 
O \
O U+sE3>?U	U U U [U y U3S=-A    [@  HSM eCQTHo    [ IG I I I I \I I IrF   r:   )7r  r  r8  r  r   r   rc   r   r  r   r	   r]   mathr
   r   typingr   r   r   r   r   r   r   r   r   r   r   dateutilr   rZ   dateutil.relativedeltar   arrowr   r   r   r   arrow.constantsr   r   arrow.localesr   version_infotyping_extensionsr"   r#   ra   r  r  r  r  r:   rz   r<   r=   rA   rF   rD   <module>r     s     				 



       , , , , , , $ $ $ $ $ $       ( ( ( ( ( (                                      ' & & & & & 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 > > > > > > > > * * * * * *f000000000%%%%%%%% 	3
	* (
)
vI vI vI vI vI vI vI vIr7 {//	{//			rF   