
    @g{                        d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZ ddlmZmZmZmZ dZdZ ej*                  dd	      Z ej*                  d
d      Z e eddd       eddd             e eddd       eddd             e eddd       eddd             e eddd        ed!d"d#             e ed$d%d&       ed'd(d)             e ed*d+d,       ed-d.d/             e ed0d1d2       ed3d4d5             e ed6d7d8       ed9d:d;            fZ ed<d=d<d<>       ed?d@d?d?>       edAdBdAdA>       edCdDdEdF>       edGddGdG>      fZ ed=dHdIdJgK       edLdMdNdOgK       ed@dPdQdRgK       edDdSdTg dUK       edVdWdXg dYK       edZd[d\d]gK       ed^d_d`dagK       edbdcdddegK       edfdgdhdigK      f	Zdj ZddkZdl ZddmZddnZ ddoZ!dp Z"ddqZ#ddrZ$ddsZ%dt Z&du Z'dv Z(dw Z) G dx dye*      Z+ G dz d{e,      Z- G d| d}e,      Z. G d~ de,      Z/ G d de,      Z0 edi de1dddddddddddddddddddddddddddddddd y)z/The main module of the `humanfriendly` package.    N)	is_string	monotonic)define_aliases)concatenateformat	pluralizetokenize)CombinedUnitInvalidDateInvalidLengthInvalidSizeInvalidTimespanSizeUnitTimer__version__coerce_booleancoerce_patterncoerce_secondsdisk_size_unitsformat_lengthformat_numberformat_pathformat_sizeformat_timespanlength_size_units
parse_dateparse_length
parse_path
parse_sizeparse_timespanround_number
time_unitsz10.0r   zdivider, symbol, namer
   zdecimal, binaryi  KBkilobytei   KiBkibibytei@B MBmegabytei   MiBmebibytei ʚ;GBgigabytei   @GiBgibibytel    J)TBterabytel        TiBtebibytel     I5 PBpetabytel           PiBpebibytel     NZoEBexabytel            EiBexbibytel     @=7M.cZB	zettabytel            ZiBzebibytel      B3v^!< YB	yottabytel               YiByobibytenmg&.>)prefixdividersingularpluralmmgMbP?cmg{Gz?m   metremetreskm
nanosecondnanosecondsns)rE   rF   rG   abbreviationsgư>microsecondmicrosecondsusmillisecondmillisecondsmssecondseconds)ssecsecs<   minuteminutes)rJ   minminsi  hourhourshiQ daydaysdi:	 weekweekswi yearyearsyc                     t        |       r?| j                         j                         }|dv ry|dv ryd}t        t	        ||             t        |       S )a8  
    Coerce any value to a boolean.

    :param value: Any Python value. If the value is a string:

                  - The strings '1', 'yes', 'true' and 'on' are coerced to :data:`True`.
                  - The strings '0', 'no', 'false' and 'off' are coerced to :data:`False`.
                  - Other strings raise an exception.

                  Other Python values are coerced using :class:`bool`.
    :returns: A proper boolean value.
    :raises: :exc:`exceptions.ValueError` when the value is a string but
             cannot be coerced with certainty.
    )1yestrueonT)0nofalseoff Fz(Failed to coerce string to boolean! (%r))r   striplower
ValueErrorr   bool)value
normalizedmsgs      K/var/www/openai/venv/lib/python3.12/site-packages/humanfriendly/__init__.pyr   r   [   sY     [[]((*
33::<CVC/00E{    c                     t        |       rt        j                  | |      } | S t        j                  d      }t        |      }t	        | |      sd}t        t        ||             | S )a  
    Coerce strings to compiled regular expressions.

    :param value: A string containing a regular expression pattern
                  or a compiled regular expression.
    :param flags: The flags used to compile the pattern (an integer).
    :returns: A compiled regular expression.
    :raises: :exc:`~exceptions.ValueError` when `value` isn't a string
             and also isn't a compiled regular expression.
    rx   z;Failed to coerce value to compiled regular expression! (%r))r   recompiletype
isinstancer{   r   )r}   flagsempty_patternpattern_typer   s        r   r   r   w   sb     

5%( L 

2M*%.OCVC/00Lr   c                     t        | t        j                        r| j                         S t        | t        j
                        sd}t        t        ||             | S )aU  
    Coerce a value to the number of seconds.

    :param value: An :class:`int`, :class:`float` or
                  :class:`datetime.timedelta` object.
    :returns: An :class:`int` or :class:`float` value.

    When `value` is a :class:`datetime.timedelta` object the
    :meth:`~datetime.timedelta.total_seconds()` method is called.
    z1Failed to coerce value to number of seconds! (%r))r   datetime	timedeltatotal_secondsnumbersNumberr{   r   )r}   r   s     r   r   r      sM     %++,""$$eW^^,AU+,,Lr   c                 B   t        t              D ]  }| |j                  j                  k\  rf|rdt	        t        |       |j                  j                  z  |      }t        ||j                  j                  |j                  j                        c S | |j                  j                  k\  s|rt	        t        |       |j                  j                  z  |      }t        ||j                  j                  |j                  j                        c S  t        | d      S )a  
    Format a byte count as a human readable file size.

    :param num_bytes: The size to format in bytes (an integer).
    :param keep_width: :data:`True` if trailing zeros should not be stripped,
                       :data:`False` if they can be stripped.
    :param binary: :data:`True` to use binary multiples of bytes (base-2),
                   :data:`False` to use decimal multiples of bytes (base-10).
    :returns: The corresponding human readable file size (a string).

    This function knows how to format sizes in bytes, kilobytes, megabytes,
    gigabytes, terabytes and petabytes. Some examples:

    >>> from humanfriendly import format_size
    >>> format_size(0)
    '0 bytes'
    >>> format_size(1)
    '1 byte'
    >>> format_size(5)
    '5 bytes'
    > format_size(1000)
    '1 KB'
    > format_size(1024, binary=True)
    '1 KiB'
    >>> format_size(1000 ** 3 * 4)
    '4 GB'
    
keep_widthbyte)	reversedr   binaryrE   r!   floatr   symboldecimal)	num_bytesr   r   unitnumbers        r   r   r      s    8 )+++!%	"2T[[5H5H"HU_`FVT[[%7%79K9KLL$,,...v!%	"2T\\5I5I"IV`aFVT\\%8%8$,,:M:MNN * Y''r   c                    t        |       }|rt        |d   t        j                        rt	        |      dk(  r!t        |d         r|d   j                         nd}t	        |      dk(  s|j                  d      rt        |d         S |rM|j                  d      }t        D ]2  }||j                  j                  j                         |j                  j                  j                         fv r't        |d   |j                  j                  z        c S ||j                  j                  j                         |j                  j                  j                         fv s7|j                  |j                  j                  d   j                               st        |d   |r|j                  j                  n|j                  j                  z        c S  d}t!        t#        || |            )a  
    Parse a human readable data size and return the number of bytes.

    :param size: The human readable file size to parse (a string).
    :param binary: :data:`True` to use binary multiples of bytes (base-2) for
                   ambiguous unit symbols and names, :data:`False` to use
                   decimal multiples of bytes (base-10).
    :returns: The corresponding size in bytes (an integer).
    :raises: :exc:`InvalidSize` when the input can't be parsed.

    This function knows how to parse sizes in bytes, kilobytes, megabytes,
    gigabytes, terabytes and petabytes. Some examples:

    >>> from humanfriendly import parse_size
    >>> parse_size('42')
    42
    >>> parse_size('13b')
    13
    >>> parse_size('5 bytes')
    5
    >>> parse_size('1 KB')
    1000
    >>> parse_size('1 kilobyte')
    1000
    >>> parse_size('1 KiB')
    1024
    >>> parse_size('1 KB', binary=True)
    1024
    >>> parse_size('1.5 GB')
    1500000000
    >>> parse_size('1.5 GB', binary=True)
    1610612736
    r      rK   rx   br[   z4Failed to parse size! (input %r was tokenized as %r))r	   r   r   r   lenr   rz   
startswithintrstripr   r   r   namerE   r   r   r   )sizer   tokensnormalized_unitr   r   s         r   r   r      s   D d^F*VAY7/26{a/?IfUViDX&)//+^` v;!99#>vay>! .44S9O' #t{{'9'9'?'?'A4;;CSCSCYCYC[&\\vay4;;+>+>>?? $(;(;(A(A(CT\\EVEVE\E\E^'__'224<<3F3Fq3I3O3O3QRvay6DKK,?,?t||OcOcdee ( AC
fS$/
00r   c                     t        t              D ];  }| |d   k\  st        t        |       |d   z  |      }t	        ||d   |d         c S  t	        | d      S )a  
    Format a metre count as a human readable length.

    :param num_metres: The length to format in metres (float / integer).
    :param keep_width: :data:`True` if trailing zeros should not be stripped,
                       :data:`False` if they can be stripped.
    :returns: The corresponding human readable length (a string).

    This function supports ranges from nanometres to kilometres.

    Some examples:

    >>> from humanfriendly import format_length
    >>> format_length(0)
    '0 metres'
    >>> format_length(1)
    '1 metre'
    >>> format_length(5)
    '5 metres'
    >>> format_length(1000)
    '1 km'
    >>> format_length(0.004)
    '4 mm'
    rE   r   rF   rG   rL   )r   r   r!   r   r   )
num_metresr   r   r   s       r   r   r     sb    2 *+i(!%
"3d9o"ER\]FVT*%5tH~FF , Z))r   c                 b   t        |       }|rt        |d   t        j                        rnt	        |      dk(  r|d   S t	        |      dk(  rMt        |d         r?|d   j                         }t        D ]#  }|j                  |d         s|d   |d   z  c S  d}t        t        || |            )a  
    Parse a human readable length and return the number of metres.

    :param length: The human readable length to parse (a string).
    :returns: The corresponding length in metres (a float).
    :raises: :exc:`InvalidLength` when the input can't be parsed.

    Some examples:

    >>> from humanfriendly import parse_length
    >>> parse_length('42')
    42
    >>> parse_length('1 km')
    1000
    >>> parse_length('5mm')
    0.005
    >>> parse_length('15.3cm')
    0.153
    r   rK   r   rD   rE   z6Failed to parse length! (input %r was tokenized as %r))r	   r   r   r   r   r   rz   r   r   r   r   )lengthr   r   r   r   s        r   r   r   &  s    ( fF*VAY7v;!!9v;!	&) 4$Qioo/O)"--d8n=!!9tI66 * CC
sFF3
44r   c                    t        t        |             j                  d      \  }}}|j                  d      }dj	                  t        |j                  d                  }g }|r|j                  |dd        |dd }|rdj	                  t        dj	                  |                  }|d| j                  d      }	|	r|d|	z   z  }|rd|z   }|S )aU  
    Format a number as a string including thousands separators.

    :param number: The number to format (a number like an :class:`int`,
                   :class:`long` or :class:`float`).
    :param num_decimals: The number of decimals to render (2 by default). If no
                         decimal places are required to represent the number
                         they will be omitted regardless of this argument.
    :returns: The formatted number (a string).

    This function is intended to make it easier to recognize the order of size
    of the number being formatted.

    Here's an example:

    >>> from humanfriendly import format_number
    >>> print(format_number(6000000))
    6,000,000
    > print(format_number(6000000000.42))
    6,000,000,000.42
    > print(format_number(6000000000.42, num_decimals=0))
    6,000,000,000
    .-rx   N   ,rt   )	strr   	partitionr   joinr   lstripappendr   )
r   num_decimalsinteger_part_decimal_partnegative_signreversed_digitspartsformatted_numberdecimals_to_adds
             r   r   r   K  s    0 %(f$6$@$@$E!L!\ ++C0Mggh|':':3'?@AOE
_Ra())!"-  wwx89"=L188=OC/11!11r   c                     dt        |       z  }|s.t        j                  dd|      }t        j                  dd|      }|S )a  
    Round a floating point number to two decimal places in a human friendly format.

    :param count: The number to format.
    :param keep_width: :data:`True` if trailing zeros should not be stripped,
                       :data:`False` if they can be stripped.
    :returns: The formatted number as a string. If no decimal places are
              required to represent the number, they will be omitted.

    The main purpose of this function is to be used by functions like
    :func:`format_length()`, :func:`format_size()` and
    :func:`format_timespan()`.

    Here are some examples:

    >>> from humanfriendly import round_number
    >>> round_number(1)
    '1'
    >>> round_number(math.pi)
    '3.14'
    >>> round_number(5.001)
    '5'
    z%.2fz0+$rx   z\.$)r   r   sub)countr   texts      r   r!   r!   s  s>    0 E%L DvveR&vvfb$'Kr   c           	         t        |       } | dk  r|st        t        |       d      S g }t        j                  t        |             } t        t        t        |rdndd             }|D ]s  }t        j                  t        |d               }| |z  }| |z  } ||d   k7  rt        |      }nt        |      }|dvsR|j                  t        ||d	   |d
                u t        |      dk(  r|d   S |s|d| }t        |      S )a  
    Format a timespan in seconds as a human readable string.

    :param num_seconds: Any value accepted by :func:`coerce_seconds()`.
    :param detailed: If :data:`True` milliseconds are represented separately
                     instead of being represented as fractional seconds
                     (defaults to :data:`False`).
    :param max_units: The maximum number of units to show in the formatted time
                      span (an integer, defaults to three).
    :returns: The formatted timespan as a string.
    :raise: See :func:`coerce_seconds()`.

    Some examples:

    >>> from humanfriendly import format_timespan
    >>> format_timespan(0)
    '0 seconds'
    >>> format_timespan(1)
    '1 second'
    >>> import math
    >>> format_timespan(math.pi)
    '3.14 seconds'
    >>> hour = 60 * 60
    >>> day = hour * 24
    >>> week = day * 7
    >>> format_timespan(week * 52 + day * 2 + hour * 3)
    '1 year, 2 days and 3 hours'
    r^   rY   r   r   NrE   )r   rt   rF   rG   rK   )r   r   r!   r   Decimalr   listr   r"   r   r   r   r   )num_secondsdetailed	max_unitsresultrelevant_unitsr   rE   r   s           r   r   r     s   : !-KRk2H== ooc+&67hzx!Q2G'HIJ"Dooc$y/&:;G')E7"K~b))E
 %U+H$itJ/?hPQ # v;!!9
+v&&r   c                    t        |       }|rt        |d   t        j                        rt	        |      dk(  rt        |d         S t	        |      dk(  rYt        |d         rK|d   j                         }t        D ]/  }||d   k(  s||d   k(  s||d   v st        |d         |d   z  c S  d}t        t        || |            )	a  
    Parse a "human friendly" timespan into the number of seconds.

    :param value: A string like ``5h`` (5 hours), ``10m`` (10 minutes) or
                  ``42s`` (42 seconds).
    :returns: The number of seconds as a floating point number.
    :raises: :exc:`InvalidTimespan` when the input can't be parsed.

    Note that the :func:`parse_timespan()` function is not meant to be the
    "mirror image" of the :func:`format_timespan()` function. Instead it's
    meant to allow humans to easily and succinctly specify a timespan with a
    minimal amount of typing. It's very useful to accept easy to write time
    spans as e.g. command line arguments to programs.

    The time units (and abbreviations) supported by this function are:

    - ms, millisecond, milliseconds
    - s, sec, secs, second, seconds
    - m, min, mins, minute, minutes
    - h, hour, hours
    - d, day, days
    - w, week, weeks
    - y, year, years

    Some examples:

    >>> from humanfriendly import parse_timespan
    >>> parse_timespan('42')
    42.0
    >>> parse_timespan('42s')
    42.0
    >>> parse_timespan('1m')
    60.0
    >>> parse_timespan('1h')
    3600.0
    >>> parse_timespan('1d')
    86400.0
    r   rK   r   rF   rG   rR   rE   z8Failed to parse timespan! (input %r was tokenized as %r))r	   r   r   r   r   r   r   rz   r"   r   r   )timespanr   r   r   r   s        r   r    r      s    N hF*VAY7v;!##v;!	&) 4$Qioo/O"#tJ'77'4>9'4+@@ +d9o==	 # EC
&h7
88r   c                 (   	 | j                         D cg c]  }|j                          }}t        |      dk\  rtt        t	        t
        |d   j                  d                  ddgz   }t        t	        t
        |d   j                  d                  g dz   }t        |dd |dd z         S t        t	        t
        | j                  d                  ddgz   dd \  }}}|||dddfS c c}w # t        $ r d}t        t        ||             w xY w)	a3  
    Parse a date/time string into a tuple of integers.

    :param datestring: The date/time string to parse.
    :returns: A tuple with the numbers ``(year, month, day, hour, minute,
              second)`` (all numbers are integers).
    :raises: :exc:`InvalidDate` when the date cannot be parsed.

    Supported date/time formats:

    - ``YYYY-MM-DD``
    - ``YYYY-MM-DD HH:MM:SS``

    .. note:: If you want to parse date/time strings with a fixed, known
              format and :func:`parse_date()` isn't useful to you, consider
              :func:`time.strptime()` or :meth:`datetime.datetime.strptime()`,
              both of which are included in the Python standard library.
              Alternatively for more complex tasks consider using the date/time
              parsing module in the dateutil_ package.

    Examples:

    >>> from humanfriendly import parse_date
    >>> parse_date('2013-06-17')
    (2013, 6, 17, 0, 0, 0)
    >>> parse_date('2013-06-17 02:47:42')
    (2013, 6, 17, 2, 47, 42)

    Here's how you convert the result to a number (`Unix time`_):

    >>> from humanfriendly import parse_date
    >>> from time import mktime
    >>> mktime(parse_date('2013-06-17 02:47:42') + (-1, -1, -1))
    1371430062.0

    And here's how you convert it to a :class:`datetime.datetime` object:

    >>> from humanfriendly import parse_date
    >>> from datetime import datetime
    >>> datetime(*parse_date('2013-06-17 02:47:42'))
    datetime.datetime(2013, 6, 17, 2, 47, 42)

    Here's an example that combines :func:`format_timespan()` and
    :func:`parse_date()` to calculate a human friendly timespan since a
    given date:

    >>> from humanfriendly import format_timespan, parse_date
    >>> from time import mktime, time
    >>> unix_time = mktime(parse_date('2013-06-17 02:47:42') + (-1, -1, -1))
    >>> seconds_since_then = time() - unix_time
    >>> print(format_timespan(seconds_since_then))
    1 year, 43 weeks and 1 day

    .. _dateutil: https://dateutil.readthedocs.io/en/latest/parser.html
    .. _Unix time: http://en.wikipedia.org/wiki/Unix_time
    r   r   r   rK   :)r   r   r   r   zJInvalid date! (expected 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' but got: %r))
splitry   r   r   mapr   tuple	Exceptionr   r   )	
datestringtr   
date_parts
time_partsrl   monthrf   r   s	            r   r   r     s   r3%/%5%5%78%7!'')%78v;!c#vays';<=AFJc#vays';<=	IJAa:a?:;; $Sj.>.>s.C%D EA NPQRSTD%%aA.. 9  3Z&j1223s"   C0 C+BC0 /;C0 +C0 0!Dc                 b   t         j                  j                  |       } t         j                  j	                  d      }|rnt         j                  j                  |      }| j                  |      r>t         j                  j                  dt         j                  j                  | |            } | S )a  
    Shorten a pathname to make it more human friendly.

    :param pathname: An absolute pathname (a string).
    :returns: The pathname with the user's home directory abbreviated.

    Given an absolute pathname, this function abbreviates the user's home
    directory to ``~/`` in order to shorten the pathname without losing
    information. It is not an error if the pathname is not relative to the
    current user's home directory.

    Here's an example of its usage:

    >>> from os import environ
    >>> from os.path import join
    >>> vimrc = join(environ['HOME'], '.vimrc')
    >>> vimrc
    '/home/peter/.vimrc'
    >>> from humanfriendly import format_path
    >>> format_path(vimrc)
    '~/.vimrc'
    HOME~)ospathabspathenvirongetr   r   relpath)pathnamehomes     r   r   r   R  ss    . wwx(H::>>&!Dwwt$t$ww||C4)HIHOr   c                     t         j                  j                  t         j                  j                  t         j                  j	                  |                   S )a~  
    Convert a human friendly pathname to an absolute pathname.

    Expands leading tildes using :func:`os.path.expanduser()` and
    environment variables using :func:`os.path.expandvars()` and makes the
    resulting pathname absolute using :func:`os.path.abspath()`.

    :param pathname: A human friendly pathname (a string).
    :returns: An absolute pathname (a string).
    )r   r   r   
expanduser
expandvars)r   s    r   r   r   r  s5     77??277--bgg.@.@.JKLLr   c                   R    e Zd ZdZd
dZd ZddZd Zed        Z	ed        Z
d	 Zy)r   zD
    Easy to use timer to keep track of long during operations.
    Nc                     |rd| _         d| _        d| _        d| _        y|rd| _         d| _        || _        yd| _         d| _        t               | _        y)a  
        Remember the time when the :class:`Timer` was created.

        :param start_time: The start time (a float, defaults to the current time).
        :param resumable: Create a resumable timer (defaults to :data:`False`).

        When `start_time` is given :class:`Timer` uses :func:`time.time()` as a
        clock source, otherwise it uses :func:`humanfriendly.compat.monotonic()`.
        T        FN)r   	resumable
start_time
total_time)selfr   r   s      r   __init__zTimer.__init__  sR     !DN!DN!DO!DO"DN"DN(DO!DN"DN'kDOr   c                 R    | j                   st        d      t               | _        | S )z
        Start or resume counting elapsed time.

        :returns: The :class:`Timer` object.
        :raises: :exc:`~exceptions.ValueError` when the timer isn't resumable.
        Timer is not resumable!)r   r{   r   r   r   s    r   	__enter__zTimer.__enter__  s%     ~~677#+r   c                     | j                   st        d      | j                  r2| xj                  t	               | j                  z
  z  c_        d| _        yy)z}
        Stop counting elapsed time.

        :raises: :exc:`~exceptions.ValueError` when the timer isn't resumable.
        r   r   N)r   r{   r   r   r   )r   exc_type	exc_value	tracebacks       r   __exit__zTimer.__exit__  sC     ~~677??OOy{T__<<O!DO r   c                 \    t        j                  t        d|| j                  z
               y)a^  
        Easy to use rate limiting of repeating actions.

        :param seconds: The number of seconds to sleep (an
                        integer or floating point number).

        This method sleeps for the given number of seconds minus the
        :attr:`elapsed_time`. If the resulting duration is negative
        :func:`time.sleep()` will still be called, but the argument
        given to it will be the number 0 (negative numbers cause
        :func:`time.sleep()` to raise an exception).

        The use case for this is to initialize a :class:`Timer` inside
        the body of a :keyword:`for` or :keyword:`while` loop and call
        :func:`Timer.sleep()` at the end of the loop body to rate limit
        whatever it is that is being done inside the loop body.

        For posterity: Although the implementation of :func:`sleep()` only
        requires a single line of code I've added it to :mod:`humanfriendly`
        anyway because now that I've thought about how to tackle this once I
        never want to have to think about it again :-P (unless I find ways to
        improve this).
        r   N)timesleepmaxelapsed_time)r   rZ   s     r   r   zTimer.sleep  s"    0 	

3q'D$5$5567r   c                     d}| j                   r|| j                  z  }| j                  r<| j                  r
t               nt	        j                         }||| j                  z
  z  }|S )z;
        Get the number of seconds counted so far.
        r   )r   r   r   r   r   )r   r   current_times      r   r   zTimer.elapsed_time  sS    
 >>DOO+L??*...9;diikLL4??::Lr   c                 >    t        t        | j                              S )z6Human readable timespan rounded to seconds (a string).)r   roundr   r   s    r   roundedzTimer.rounded  s     uT%6%6788r   c                 ,    t        | j                        S )z;Show the elapsed time since the :class:`Timer` was created.)r   r   r   s    r   __str__zTimer.__str__  s    t0011r   )NF)NNN)__name__
__module____qualname____doc__r   r   r   r   propertyr   r   r   r   r   r   r     sH    *0

"84 
 
 9 92r   r   c                       e Zd ZdZy)r   a  
    Raised when a string cannot be parsed into a date.

    For example:

    >>> from humanfriendly import parse_date
    >>> parse_date('2013-06-XY')
    Traceback (most recent call last):
      File "humanfriendly.py", line 206, in parse_date
        raise InvalidDate(format(msg, datestring))
    humanfriendly.InvalidDate: Invalid date! (expected 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' but got: '2013-06-XY')
    Nr  r  r  r  r  r   r   r   r         r   r   c                       e Zd ZdZy)r   a  
    Raised when a string cannot be parsed into a file size.

    For example:

    >>> from humanfriendly import parse_size
    >>> parse_size('5 Z')
    Traceback (most recent call last):
      File "humanfriendly/__init__.py", line 267, in parse_size
        raise InvalidSize(format(msg, size, tokens))
    humanfriendly.InvalidSize: Failed to parse size! (input '5 Z' was tokenized as [5, 'Z'])
    Nr
  r  r   r   r   r     r  r   r   c                       e Zd ZdZy)r   a  
    Raised when a string cannot be parsed into a length.

    For example:

    >>> from humanfriendly import parse_length
    >>> parse_length('5 Z')
    Traceback (most recent call last):
      File "humanfriendly/__init__.py", line 267, in parse_length
        raise InvalidLength(format(msg, length, tokens))
    humanfriendly.InvalidLength: Failed to parse length! (input '5 Z' was tokenized as [5, 'Z'])
    Nr
  r  r   r   r   r     r  r   r   c                       e Zd ZdZy)r   a  
    Raised when a string cannot be parsed into a timespan.

    For example:

    >>> from humanfriendly import parse_timespan
    >>> parse_timespan('1 age')
    Traceback (most recent call last):
      File "humanfriendly/__init__.py", line 419, in parse_timespan
        raise InvalidTimespan(format(msg, timespan, tokens))
    humanfriendly.InvalidTimespan: Failed to parse timespan! (input '1 age' was tokenized as [1, 'age'])
    Nr
  r  r   r   r   r     r  r   r   module_nameformat_tablez(humanfriendly.tables.format_pretty_tablecompactzhumanfriendly.text.compactr   zhumanfriendly.text.concatenatededentzhumanfriendly.text.dedentr   zhumanfriendly.text.formatis_empty_linez humanfriendly.text.is_empty_liner   zhumanfriendly.text.pluralizer	   zhumanfriendly.text.tokenizetrim_empty_linesz#humanfriendly.text.trim_empty_linesprompt_for_choicez'humanfriendly.prompts.prompt_for_choiceAutomaticSpinnerz0humanfriendly.terminal.spinners.AutomaticSpinnerSpinnerz'humanfriendly.terminal.spinners.Spinnererase_line_codez&humanfriendly.terminal.ANSI_ERASE_LINEhide_cursor_codez'humanfriendly.terminal.ANSI_SHOW_CURSORminimum_spinner_intervalz0humanfriendly.terminal.spinners.MINIMUM_INTERVALshow_cursor_codez'humanfriendly.terminal.ANSI_HIDE_CURSOR)r   )FF)F)r   )Fr   r  )2r  collectionsr   r   r   r   os.pathr   r   humanfriendly.compatr   r   humanfriendly.deprecationr   humanfriendly.textr   r   r   r	   __all__r   
namedtupler   r
   r   dictr   r"   r   r   r   r   r   r   r   r   r!   r   r    r   r   r   objectr   r   r   r   r   r   r  r  r   r   <module>r%     s   6     	  	  6 4 G G:  ";!!*.EF%{%%n6GH '44hwz6Z['44hwz6Z['44hwz6Z['44hwz6Z['44hwz6Z['43Xguj5YZ'45xPZ7[\'45xPZ7[\	 utDQutDQutDQa'(Std4P	R  4,}]a\bc4-_c^de4-_c^de1x	Qef2Rfg7VGTWSXY<%WZV[\+fW]`\ab06'beafgi
8,&#(L=1@*@"5J%P>='@69rD3N@Md2F d2N)  )  I  i "   < ) 1 ' ' 5 -  +!" ;#( @)0 H12 634 =56 ?78 P9: ?;r   