o
    ß¥µiM  ã                   @   s2  d Z ddlZddlmZmZmZ ddlmZ g d¢Ze 	dd„ eD ƒdd„ eD ƒ ¡ e
eƒZd	Ze
eeed
 ƒ ƒZeeef Zeeef Zdd„ edƒejeefdedeegef dedeeegef dee dee defdd„Zdd„ ejefdedeegef deeegef dee def
dd„ZdS )z‡
This module is intended to replicate some of the functionality
from the fastnumbers module in the event that module is not installed.
é    N)ÚCallableÚ	FrozenSetÚUnion)Údecimal_chars)ÚINFÚINfÚInfÚinFÚiNFÚInFÚinfÚiNfÚNANÚnanÚNaNÚnAnÚnaNÚNAnÚnANÚNanc                 C   ó   g | ]
}d |dd…  ‘qS )ú+Né   © ©Ú.0Úxr   r   úS/home/ubuntu/.local/lib/python3.10/site-packages/natsort/compat/fake_fastnumbers.pyÚ
<listcomp>   ó    r   c                 C   r   )ú-Nr   r   r   r   r   r   r      r   z0123456789+-Ú.c                 C   ó   | S ©Nr   ©r   r   r   r   Ú<lambda>(   ó    r%   r   r   Úkeyr   Ú_uniÚ_nan_infÚ_first_charÚreturnc                 C   sÜ   | d |v s|   ¡ dd… |v rMzt| ƒ}||kr|W S |W S  tyL   zt| ƒdkr6|| || ƒƒW  Y S || ƒW  Y S  tyK   || ƒ Y  Y S w w zt| ƒdkr\|| || ƒƒW S || ƒW S  tym   || ƒ Y S w )a  
    Convert a string to a float quickly, return input as-is if not possible.

    We don't need to accept all input that the real fast_int accepts because
    natsort is controlling what is passed to this function.

    Parameters
    ----------
    x : str
        String to attempt to convert to a float.
    key : callable
        Single-argument function to apply to *x* if conversion fails.
    nan : float
        Value to return instead of NaN if NaN would be returned.

    Returns
    -------
    *str* or *float*

    r   Né   é   )ÚlstripÚfloatÚ
ValueErrorÚlenÚ	TypeError)r   r'   r   r(   r)   r*   Úretr   r   r   Ú
fast_float&   s     .ÿý&ÿr4   c                 C   r"   r#   r   r$   r   r   r   r%   T   r&   c                 C   s¶   | d |v r:zt | ƒW S  ty9   zt| ƒdkr#|| || ƒƒW  Y S || ƒW  Y S  ty8   || ƒ Y  Y S w w zt| ƒdkrI|| || ƒƒW S || ƒW S  tyZ   || ƒ Y S w )a»  
    Convert a string to a int quickly, return input as-is if not possible.

    We don't need to accept all input that the real fast_int accepts because
    natsort is controlling what is passed to this function.

    Parameters
    ----------
    x : str
        String to attempt to convert to an int.
    key : callable
        Single-argument function to apply to *x* if conversion fails.

    Returns
    -------
    *str* or *int*

    r   r-   )Úintr0   r1   r2   )r   r'   r(   r*   r   r   r   Úfast_intR   s   
.ÿý&ÿr6   )Ú__doc__ÚunicodedataÚtypingr   r   r   Únatsort.unicode_numbersr   Ú_NAN_INFÚextendÚ	frozensetÚNAN_INFÚ
ASCII_NUMSÚlistÚPOTENTIAL_FIRST_CHARÚstrr/   Ú
StrOrFloatr5   ÚStrOrIntÚnumericr4   Údigitr6   r   r   r   r   Ú<module>   sZ   "úÿþýüûú
ù.üÿþýüû