
    i                       d Z ddlmZ ddlmZmZ ddlZddlmZ ddl	Z	ddl
Z
ddlZddlmZ ddlZddlmZ ddlZdd	lmZmZmZmZmZmZ ej6                  rdd
lmZmZmZm Z m!Z! dZ" ejF                  d      Z$ ejF                  d      Z% ejF                  d      Z& e' ejP                  d            Z)dKdZ*dLdZ+dMdZ,dNdZ-dOdZ.dPdZ/dQdZ0dRdZ1dSdZ2dTdZ3dUdVdZ4dUdWdZ5dXdZ6dYdZ7dZdZ8dXdZ9dXd Z:	 	 	 	 d[d!Z;dXd"Z<dXd#Z=dKd$Z>dLd%Z?ej                  d\d&       ZAej                  d]d'       ZAej                  d^d(       ZAd) ZAd_d*ZBdXd+ZCdXd,ZDd`d-ZEdXd.ZF	 	 	 	 d[d/ZGdXd0ZHdad1ZI	 	 	 	 dbd2ZJdcd3ZKdXd4ZLdXd5ZMdXd6ZNddd7ZOded8ZPdeeef	 	 	 	 	 	 	 	 	 	 	 	 	 dfd9ZQdgdhd:ZRdid;ZS	 	 	 	 djd<ZTdXd=ZUdXd>ZVdkd?ZWdXd@ZXdXdAZYdXdBZZdXdCZ[dldDZ\dXdEZ]	 	 	 	 d[dFZ^	 	 	 	 d[dGZ_dmdHZ`dXdIZadcdJZby)nzZ
Predicate functions that return boolean evaluations of objects.

.. versionadded:: 2.0.0
    )annotations)IterableMappingN)islice)BuiltinFunctionType)	TypeGuard   )BUILTINSNUMBER_TYPESUNSETbase_getcallititerator)SupportsDunderGESupportsDunderGTSupportsDunderLESupportsDunderLTSupportsRichComparison)8eqeq_cmpgtgt_cmpgtegte_cmpltlt_cmpltelte_cmpin_rangein_range_cmpis_associativeis_blank
is_boolean
is_builtinis_dateis_decreasingis_dictis_emptyis_equalis_equal_cmpis_equal_withis_equal_with_cmpis_erroris_evenis_floatis_functionis_increasing
is_indexedis_instance_ofis_instance_of_cmp
is_integeris_iterableis_jsonis_listis_matchis_match_cmpis_match_withis_match_with_cmpis_monotoneis_monotone_cmpis_nanis_negativeis_none	is_number	is_objectis_oddis_positive
is_reg_expis_setis_strictly_decreasingis_strictly_increasing	is_stringis_tupleis_zeroTT2T3 c                
    | |u S )a  
    Checks if :attr:`value` is equal to :attr:`other`.

    Args:
        value: Value to compare.
        other: Other value to compare.

    Returns:
        Whether :attr:`value` is equal to :attr:`other`.

    Example:

        >>> eq(None, None)
        True
        >>> eq(None, "")
        False
        >>> eq("a", "a")
        True
        >>> eq(1, str(1))
        False

    .. versionadded:: 4.0.0
     valueothers     I/home/Script/Script_env/lib/python3.12/site-packages/pydash/predicates.pyr   r   e   s    0 E>    c                      fdS )a  
    Curried version of :func:`eq`.

    Args:
        other: Value to compare.

    Returns:
        A predicate checking whether passed :attr:`value` is equal to :attr:`other`.

    Example:

        >>> eq_cmp(None)(None)
        True
        >>> eq_cmp(None)("")
        False
        >>> eq_cmp("a")("a")
        True
        >>> eq_cmp(1)(str(1))
        False

    .. versionadded:: 7.1.0
    c                    t        |       S N)r   rS   s    rV   <lambda>zeq_cmp.<locals>.<lambda>       E5) rW   rR   rU   s   `rV   r   r      s    . *)rW   c                    t        | |kD        S )aZ  
    Checks if `value` is greater than `other`.

    Args:
        value: Value to compare.
        other: Other value to compare.

    Returns:
        Whether `value` is greater than `other`.

    Example:

        >>> gt(5, 3)
        True
        >>> gt(3, 5)
        False
        >>> gt(5, 5)
        False

    .. versionadded:: 3.3.0
    boolrS   s     rV   r   r          , rW   c                      fdS )a[  
    Curried version of :func:`gt`.

    Args:
        other: Value to compare.

    Returns:
        A predicate checking whether passed :attr:`value` is greater than :attr:`other`.

    Example:

        >>> gt_cmp(3)(5)
        True
        >>> gt_cmp(5)(3)
        False
        >>> gt_cmp(5)(5)
        False

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r   rS   s    rV   r[   zgt_cmp.<locals>.<lambda>   r\   rW   rR   r]   s   `rV   r   r          * *)rW   c                    t        | |k\        S )at  
    Checks if `value` is greater than or equal to `other`.

    Args:
        value: Value to compare.
        other: Other value to compare.

    Returns:
        Whether `value` is greater than or equal to `other`.

    Example:

        >>> gte(5, 3)
        True
        >>> gte(3, 5)
        False
        >>> gte(5, 5)
        True

    .. versionadded:: 3.3.0
    r_   rS   s     rV   r   r          , rW   c                      fdS )aj  
    Curried version of :func:`gte`.

    Args:
        other: Value to compare.

    Returns:
        A predicate checking whether passed :attr:`value` is greater than or equal to :attr:`other`.

    Example:

        >>> gte_cmp(3)(5)
        True
        >>> gte_cmp(5)(3)
        False
        >>> gte_cmp(5)(5)
        True

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r   rS   s    rV   r[   zgte_cmp.<locals>.<lambda>       UE* rW   rR   r]   s   `rV   r   r          * +*rW   c                    t        | |k        S )aT  
    Checks if `value` is less than `other`.

    Args:
        value: Value to compare.
        other: Other value to compare.

    Returns:
        Whether `value` is less than `other`.

    Example:

        >>> lt(5, 3)
        False
        >>> lt(3, 5)
        True
        >>> lt(5, 5)
        False

    .. versionadded:: 3.3.0
    r_   rS   s     rV   r   r      ra   rW   c                      fdS )aX  
    Curried version of :func:`lt`.

    Args:
        other: Value to compare.

    Returns:
        A predicate checking whether passed :attr:`value` is less than :attr:`other`.

    Example:

        >>> lt_cmp(3)(5)
        False
        >>> lt_cmp(5)(3)
        True
        >>> lt_cmp(5)(5)
        False

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r   rS   s    rV   r[   zlt_cmp.<locals>.<lambda>*  r\   rW   rR   r]   s   `rV   r   r     rd   rW   c                    t        | |k        S )an  
    Checks if `value` is less than or equal to `other`.

    Args:
        value: Value to compare.
        other: Other value to compare.

    Returns:
        Whether `value` is less than or equal to `other`.

    Example:

        >>> lte(5, 3)
        False
        >>> lte(3, 5)
        True
        >>> lte(5, 5)
        True

    .. versionadded:: 3.3.0
    r_   rS   s     rV   r   r   -  rf   rW   c                      fdS )ag  
    Curried version of :func:`lte`.

    Args:
        other: Value to compare.

    Returns:
        A predicate checking whether passed :attr:`value` is less than or equal to :attr:`other`.

    Example:

        >>> lte_cmp(3)(5)
        False
        >>> lte_cmp(5)(3)
        True
        >>> lte_cmp(5)(5)
        True

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r   rS   s    rV   r[   zlte_cmp.<locals>.<lambda>[  ri   rW   rR   r]   s   `rV   r   r   F  rj   rW   c                |    t        |       syt        |      sd}||}d}nt        |      sd}|| cxk  xr |k  S c S )a  
    Checks if `value` is between `start` and up to but not including `end`. If `end` is not
    specified it defaults to `start` with `start` becoming ``0``.

    Args:

        value: Number to check.
        start: Start of range inclusive. Defaults to ``0``.
        end: End of range exclusive. Defaults to `start`.

    Returns:
        Whether `value` is in range.

    Example:

        >>> in_range(2, 4)
        True
        >>> in_range(4, 2)
        False
        >>> in_range(2, 1, 3)
        True
        >>> in_range(3, 1, 2)
        False
        >>> in_range(2.5, 3.5)
        True
        >>> in_range(3.5, 2.5)
        False

    .. versionadded:: 3.1.0
    Fr   rB   )rT   startends      rV   r   r   ^  sM    > UU
{s^ECrW   c                      fdS )aI  
    Curried version of :func:`in_range`.

    Args:
        start: Start of range inclusive. Defaults to ``0``.
        end: End of range exclusive. Defaults to `start`.

    Returns:
        A predicate checking whether passed :attr:`value` is in range.

    Example:

        >>> in_range_cmp(4)(2)
        True
        >>> in_range_cmp(2)(4)
        False
        >>> in_range_cmp(1, 3)(2)
        True
        >>> in_range_cmp(1, 2)(3)
        False
        >>> in_range_cmp(3.5)(2.5)
        True
        >>> in_range_cmp(2.5)(3.5)
        False

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r   )rT   rt   rs   s    rV   r[   zin_range_cmp.<locals>.<lambda>  s    %4 rW   rR   )rs   rt   s   ``rV   r    r      s    8 54rW   c                    t        | d      S )a  
    Checks if `value` is an associative object meaning that it can be accessed via an index or key.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is associative.

    Example:

        >>> is_associative([])
        True
        >>> is_associative({})
        True
        >>> is_associative(1)
        False
        >>> is_associative(True)
        False

    .. versionadded:: 2.0.0
    __getitem__)hasattrrT   s    rV   r!   r!     s    . 5-((rW   c                j    	 t        t        j                  d|             }|S # t        $ r d}Y |S w xY w)a?  
    Checks if `text` contains only whitespace characters.

    Args:
        text: String to test.

    Returns:
        Whether `text` is blank.

    Example:

        >>> is_blank("")
        True
        >>> is_blank(" \r\n ")
        True
        >>> is_blank(False)
        False

    .. versionadded:: 3.0.0
    z^(\s+)?$F)r`   rematch	TypeError)textrets     rV   r"   r"     s>    *288K./ J  Js   # 22c                "    t        | t              S )a  
    Checks if `value` is a boolean value.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a boolean.

    Example:

        >>> is_boolean(True)
        True
        >>> is_boolean(False)
        True
        >>> is_boolean(0)
        False

    .. versionadded:: 1.0.0

    .. versionchanged:: 3.0.0
        Added ``is_bool`` as alias.

    .. versionchanged:: 4.0.0
        Removed alias ``is_bool``.
    )
isinstancer`   rz   s    rV   r#   r#     s    6 eT""rW   c                V    	 t        | t              xs | t        v S # t        $ r Y yw xY w)a  
    Checks if `value` is a Python builtin function or method.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a Python builtin function or method.

    Example:

        >>> is_builtin(1)
        True
        >>> is_builtin(list)
        True
        >>> is_builtin("foo")
        False

    .. versionadded:: 3.0.0

    .. versionchanged:: 4.0.0
        Removed alias ``is_native``.
    F)r   r   r
   r~   rz   s    rV   r$   r$      s1    0%!45J(9JJ s    	((c                6    t        | t        j                        S )a  
    Check if `value` is a date object.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a date object.

    Example:

        >>> import datetime
        >>> is_date(datetime.date.today())
        True
        >>> is_date(datetime.datetime.today())
        True
        >>> is_date("2014-01-01")
        False

    Note:
        This will also return ``True`` for datetime objects.

    .. versionadded:: 1.0.0
    )r   datetimedaterz   s    rV   r%   r%     s    2 eX]]++rW   c                6    t        | t        j                        S )aj  
    Check if `value` is monotonically decreasing.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is monotonically decreasing.

    Example:

        >>> is_decreasing([5, 4, 4, 3])
        True
        >>> is_decreasing([5, 5, 5])
        True
        >>> is_decreasing([5, 4, 5])
        False

    .. versionadded:: 2.0.0
    )r=   operatorgerz   s    rV   r&   r&   :  s    . uhkk**rW   c                "    t        | t              S )a  
    Checks if `value` is a ``dict``.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a ``dict``.

    Example:

        >>> is_dict({})
        True
        >>> is_dict([])
        False

    .. versionadded:: 1.0.0

    .. versionchanged:: 3.0.0
        Added :func:`is_dict` as main definition and made `is_plain_object`` an alias.

    .. versionchanged:: 4.0.0
        Removed alias ``is_plain_object``.
    )r   dictrz   s    rV   r'   r'   T  s    2 eT""rW   c                <    t        |       xs t        |       xs |  S )a  
    Checks if `value` is empty.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is empty.

    Example:

        >>> is_empty(0)
        True
        >>> is_empty(1)
        True
        >>> is_empty(True)
        True
        >>> is_empty("foo")
        False
        >>> is_empty(None)
        True
        >>> is_empty({})
        True

    Note:
        Returns ``True`` for booleans and numbers.

    .. versionadded:: 1.0.0
    )r#   rB   rz   s    rV   r(   r(   p  s     < e=	% 0=I=rW   c                    t        | |d      S )a  
    Performs a comparison between two values to determine if they are equivalent to each other.

    Args:
        value: Object to compare.
        other: Object to compare.

    Returns:
        Whether `value` and `other` are equal.

    Example:

        >>> is_equal([1, 2, 3], [1, 2, 3])
        True
        >>> is_equal("a", "A")
        False

    .. versionadded:: 1.0.0

    .. versionchanged:: 4.0.0
        Removed :attr:`iteratee` from :func:`is_equal` and added it in
        :func:`is_equal_with`.
    N)
customizerr+   rS   s     rV   r)   r)     s    0 $77rW   c                      fdS )aV  
    Curried version of :func:`is_equal`.

    Args:
        other: Value to compare.

    Returns:
        A predicate checking whether passed :attr:`value` is equal to :attr:`other`.

    Example:

        >>> is_equal_cmp([1, 2, 3])([1, 2, 3])
        True
        >>> is_equal_cmp("a")("A")
        False

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r)   rS   s    rV   r[   zis_equal_cmp.<locals>.<lambda>  s    %/ rW   rR   r]   s   `rV   r*   r*     s    & 0/rW   c                     y rZ   rR   rT   rU   r   s      rV   r+   r+     s    SVrW   c                     y rZ   rR   r   s      rV   r+   r+     s    [^rW   c                     y rZ   rR   r   s      rV   r+   r+     s    ILrW   c                   t        |      r	 || |      nd}|	 |S t        |      rt        |       t        |      u rt        | t        t        f      rpt        |t        t        f      rZt        |       t        |      k(  rCt        |       D ]3  \  }}t        j                  ||      rt        |||   |      }nd}|r2 |S  |S | |k(  }|S )a5  
    This method is like :func:`is_equal` except that it accepts customizer which is invoked to
    compare values. A customizer is provided which will be executed to compare values. If the
    customizer returns ``None``, comparisons will be handled by the method instead. The customizer
    is invoked with two arguments: ``(value, other)``.

    Args:
        value: Object to compare.
        other: Object to compare.
        customizer: Customizer used to compare values from `value` and `other`.

    Returns:
        Whether `value` and `other` are equal.

    Example:

        >>> is_equal_with([1, 2, 3], [1, 2, 3], None)
        True
        >>> is_equal_with("a", "A", None)
        False
        >>> is_equal_with("a", "A", lambda a, b: a.lower() == b.lower())
        True

    .. versionadded:: 4.0.0
    NF)
callabletyper   listr   lenr   pydhasr+   )rT   rU   r   equalkeyvals         rV   r+   r+     s    6 )1(<Jue$$E * L' 	K4;&utTl+utTl+J#e*$ ! 	HCwwuc"%c5:zB
 L	 L LrW   c                      fdS )a  
    Curried version of :func:`is_equal_with`.

    Args:
        other: Value to compare.
        customizer: Customizer used to compare values from `value` and `other`.

    Returns:
        A predicate checking whether passed :attr:`value` and :attr:`other` are equal.

    Example:

        >>> is_equal_with_cmp([1, 2, 3], None)([1, 2, 3])
        True
        >>> is_equal_with_cmp("a", None)("A")
        False
        >>> is_equal_with_cmp("a", lambda a, b: a.lower() == b.lower())("A")
        True

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   r   )rT   r   rU   s    rV   r[   z#is_equal_with_cmp.<locals>.<lambda>  s    ueZ@ rW   rR   )rU   r   s   ``rV   r,   r,     s    , A@rW   c                "    t        | t              S )aC  
    Checks if `value` is an ``Exception``.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is an exception.

    Example:

        >>> is_error(Exception())
        True
        >>> is_error(Exception)
        False
        >>> is_error(None)
        False

    .. versionadded:: 1.1.0
    )r   	Exceptionrz   s    rV   r-   r-     s    * eY''rW   c                ,    t        |       xr | dz  dk(  S )a  
    Checks if `value` is even.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is even.

    Example:

        >>> is_even(2)
        True
        >>> is_even(3)
        False
        >>> is_even(False)
        False

    .. versionadded:: 2.0.0
       r   rr   rz   s    rV   r.   r.   6      * U.	Q.rW   c                "    t        | t              S )z
    Checks if `value` is a float.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a float.

    Example:

        >>> is_float(1.0)
        True
        >>> is_float(1)
        False

    .. versionadded:: 2.0.0
    )r   floatrz   s    rV   r/   r/   N  s    & eU##rW   c                    t        |       S )a:  
    Checks if `value` is a function.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is callable.

    Example:

        >>> is_function(list)
        True
        >>> is_function(lambda: True)
        True
        >>> is_function(1)
        False

    .. versionadded:: 1.0.0
    )r   rz   s    rV   r0   r0   d  s    * E?rW   c                6    t        | t        j                        S )a  
    Check if `value` is monotonically increasing.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is monotonically increasing.

    Example:

        >>> is_increasing([1, 3, 5])
        True
        >>> is_increasing([1, 1, 2, 3, 3])
        True
        >>> is_increasing([5, 5, 5])
        True
        >>> is_increasing([1, 2, 4, 3])
        False

    .. versionadded:: 2.0.0
    )r=   r   lerz   s    rV   r1   r1   |  s    2 uhkk**rW   c                8    t        | t        t        t        f      S )a  
    Checks if `value` is integer indexed, i.e., ``list``, ``str`` or ``tuple``.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is integer indexed.

    Example:

        >>> is_indexed("")
        True
        >>> is_indexed([])
        True
        >>> is_indexed(())
        True
        >>> is_indexed({})
        False

    .. versionadded:: 2.0.0

    .. versionchanged:: 3.0.0
        Return ``True`` for tuples.
    )r   r   tuplestrrz   s    rV   r2   r2     s    4 edE3/00rW   c                    t        | |      S )a  
    Checks if `value` is an instance of `types`.

    Args:
        value: Value to check.
        types: Types to check against. Pass as ``tuple`` to check if `value` is one of
            multiple types.

    Returns:
        Whether `value` is an instance of `types`.

    Example:

        >>> is_instance_of({}, dict)
        True
        >>> is_instance_of({}, list)
        False

    .. versionadded:: 2.0.0
    )r   rT   typess     rV   r3   r3     s    * eU##rW   c                      fdS )a  
    Curried version of :func:`is_instance_of`.

    Args:
        types: Types to check against. Pass as ``tuple`` to check if `value` is one of
            multiple types.

    Returns:
        A predicate checking whether passed :attr:`value` is an instance of :attr:`types`.

    Example:

        >>> is_instance_of_cmp(dict)({})
        True
        >>> is_instance_of_cmp(list)({})
        False

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r3   r   s    rV   r[   z$is_instance_of_cmp.<locals>.<lambda>  s    u5 rW   rR   )r   s   `rV   r4   r4     s    , 65rW   c                <    t        |       xr t        | t              S )a  
    Checks if `value` is a integer.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is an integer.

    Example:

        >>> is_integer(1)
        True
        >>> is_integer(1.0)
        False
        >>> is_integer(True)
        False

    .. versionadded:: 2.0.0

    .. versionchanged:: 3.0.0
        Added ``is_int`` as alias.

    .. versionchanged:: 4.0.0
        Removed alias ``is_int``.
    )rB   r   intrz   s    rV   r5   r5     s    6 U6
5# 66rW   c                :    	 t        |        y# t        $ r Y yw xY w)a  
    Checks if `value` is an iterable.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is an iterable.

    Example:

        >>> is_iterable([])
        True
        >>> is_iterable({})
        True
        >>> is_iterable(())
        True
        >>> is_iterable(5)
        False
        >>> is_iterable(True)
        False

    .. versionadded:: 3.3.0
    TF)iterr~   rz   s    rV   r6   r6     s'    2U   s    	c                N    	 t        j                  |        y# t        $ r Y yw xY w)a~  
    Checks if `value` is a valid JSON string.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is JSON.

    Example:

        >>> is_json({})
        False
        >>> is_json("{}")
        True
        >>> is_json({"hello": 1, "world": 2})
        False
        >>> is_json('{"hello": 1, "world": 2}')
        True

    .. versionadded:: 2.0.0
    TF)jsonloadsr   rz   s    rV   r7   r7   %  s(    .

5 s    	$$c                "    t        | t              S )a  
    Checks if `value` is a list.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a list.

    Example:

        >>> is_list([])
        True
        >>> is_list({})
        False
        >>> is_list(())
        False

    .. versionadded:: 1.0.0
    )r   r   rz   s    rV   r8   r8   C  s    * eT""rW   c                    t        | |      S )a  
    Performs a partial deep comparison between `obj` and `source` to determine if `obj` contains
    equivalent property values.

    Args:
        obj: Object to compare.
        source: Object of property values to match.

    Returns:
        Whether `obj` is a match or not.

    Example:

        >>> is_match({'a': 1, 'b': 2}, {'b': 2})
        True
        >>> is_match({'a': 1, 'b': 2}, {'b': 3})
        False
        >>> is_match({'a': [{'b': [{'c': 3, 'd': 4}]}]},                     {'a': [{'b': [{'d': 4}]}]})
        True

    .. versionadded:: 3.0.0

    .. versionchanged:: 3.2.0
        Don't compare `obj` and `source` using ``type``. Use ``isinstance``
        exclusively.

    .. versionchanged:: 4.0.0
        Move `iteratee` argument to :func:`is_match_with`.
    r;   objsources     rV   r9   r9   [  s    > f%%rW   c                      fdS )a  
    Curried version of :func:`is_match`.

    Args:
        source: Object of property values to match.

    Returns:
        A predicate checking whether passed :attr:`obj` is a match or not.

    Example:

        >>> is_match_cmp({"b": 2})({"a": 1, "b": 2})
        True
        >>> is_match_cmp({"b": 3})({"a": 1, "b": 2})
        False
        >>> is_match_cmp({"a": [{"b": [{"d": 4}]}]})({"a": [{"b": [{"c": 3, "d": 4}]}]})
        True

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r9   r   s    rV   r[   zis_match_cmp.<locals>.<lambda>  s    xV, rW   rR   )r   s   `rV   r:   r:   }  s    * -,rW   c           	     b   |t         u r| }|t         u r|}t        |      sd }d|_        n|}t        |t        t
        f      rKt        |t              s;| }t        |      D ](  \  }}		 t        | |      }
t        |
|	||||      }|r' |S  |S t        || ||||      }|S # t        $ r d}Y (w xY w)aV  
    This method is like :func:`is_match` except that it accepts customizer which is invoked to
    compare values. If customizer returns ``None``, comparisons are handled by the method instead.
    The customizer is invoked with five arguments: ``(obj_value, src_value, index|key, obj,
    source)``.

    Args:
        obj: Object to compare.
        source: Object of property values to match.
        customizer: Customizer used to compare values from `obj` and `source`.

    Returns:
        Whether `obj` is a match or not.

    Example:

        >>> is_greeting = lambda val: val in ("hello", "hi")
        >>> customizer = lambda ov, sv: is_greeting(ov) and is_greeting(sv)
        >>> obj = {"greeting": "hello"}
        >>> src = {"greeting": "hi"}
        >>> is_match_with(obj, src, customizer)
        True

    .. versionadded:: 4.0.0
    c                    | |k(  S rZ   rR   )	obj_value	src_values     rV   cbkzis_match_with.<locals>.cbk  s    	))rW   r   )_key_obj_sourceF)r   r   	_argcountr   r   r   r   r   r   r;   r   r   )r   r   r   r   r   r   r   r   r   rT   r   s              rV   r;   r;     s    B u}%J	* &7H-.z&#7N 
 #6* 	JC$S#.	%i#DZab  L	 L sCtW=L  s   (B  B.-B.c                      fdS )a]  
    Curried version of :func:`is_match_with`.

    Args:
        source: Object of property values to match.
        customizer: Customizer used to compare values from `obj` and `source`.

    Returns:
        A predicate checking whether passed :attr:`obj` is a match or not.

    Example:

        >>> is_greeting = lambda val: val in ("hello", "hi")
        >>> customizer = lambda ov, sv: is_greeting(ov) and is_greeting(sv)
        >>> obj = {"greeting": "hello"}
        >>> src = {"greeting": "hi"}
        >>> is_match_with_cmp(src, customizer)(obj)
        True

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   r   )r   r   r   s    rV   r[   z#is_match_with_cmp.<locals>.<lambda>  s    }S&*= rW   rR   )r   r   s   ``rV   r<   r<     s    , >=rW   c           	     ~    t        |       s| g}n| }fdt        |t        |dd            D        }t        |d      S )a  
    Checks if `value` is monotonic when `operator` used for comparison.

    Args:
        value: Value to check.
        op: Operation to used for comparison.

    Returns:
        Whether `value` is monotone.

    Example:

        >>> is_monotone([1, 1, 2, 3], operator.le)
        True
        >>> is_monotone([1, 1, 2, 3], operator.lt)
        False

    .. versionadded:: 2.0.0
    c              3  :   K   | ]  \  }} ||      sd   yw)FNrR   ).0xyops      rV   	<genexpr>zis_monotone.<locals>.<genexpr>  s&      Aq!Qx 	s   r	   NT)r8   zipr   next)rT   r   l_valuesearchs    `  rV   r=   r=     sF    ( 5>'D!9:F rW   c                      fdS )at  
    Curried version of :func:`is_monotone`.

    Args:
        op: Operation to used for comparison.

    Returns:
        A predicate checking whether passed :attr:`value` is monotone.

    Example:

        >>> is_monotone_cmp(operator.le)([1, 1, 2, 3])
        True
        >>> is_monotone_cmp(operator.lt)([1, 1, 2, 3])
        False

    .. versionadded:: 7.1.0
    c                    t        |       S rZ   )r=   )rT   r   s    rV   r[   z!is_monotone_cmp.<locals>.<lambda>+  s    UB/ rW   rR   )r   s   `rV   r>   r>     s    * 0/rW   c                    t        |        S )a(  
    Checks if `value` is not a number.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is not a number.

    Example:

        >>> is_nan("a")
        True
        >>> is_nan(1)
        False
        >>> is_nan(1.0)
        False

    .. versionadded:: 1.0.0
    rr   rz   s    rV   r?   r?   .  s    * rW   c                &    t        |       xr | dk  S )a,  
    Checks if `value` is negative.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is negative.

    Example:

        >>> is_negative(-1)
        True
        >>> is_negative(0)
        False
        >>> is_negative(1)
        False

    .. versionadded:: 2.0.0
    r   rr   rz   s    rV   r@   r@   F      * U)	)rW   c                
    | du S )z
    Checks if `value` is `None`.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is ``None``.

    Example:

        >>> is_none(None)
        True
        >>> is_none(False)
        False

    .. versionadded:: 1.0.0
    NrR   rz   s    rV   rA   rA   ^  s    & D=rW   c                >    t        |        xr t        | t              S )a  
    Checks if `value` is a number.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a number.

    Note:
        Returns ``True`` for ``int``, ``long`` (PY2), ``float``, and
        ``decimal.Decimal``.

    Example:

        >>> is_number(1)
        True
        >>> is_number(1.0)
        True
        >>> is_number("a")
        False

    .. versionadded:: 1.0.0

    .. versionchanged:: 3.0.0
        Added ``is_num`` as alias.

    .. versionchanged:: 4.0.0
        Removed alias ``is_num``.
    )r#   r   r   rz   s    rV   rB   rB   t  s    > %  DZ|%DDrW   c                .    t        | t        t        f      S )ah  
    Checks if `value` is a ``list`` or ``dict``.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is ``list`` or ``dict``.

    Example:

        >>> is_object([])
        True
        >>> is_object({})
        True
        >>> is_object(())
        False
        >>> is_object(1)
        False

    .. versionadded:: 1.0.0
    )r   r   r   rz   s    rV   rC   rC     s    . edD\**rW   c                ,    t        |       xr | dz  dk7  S )a  
    Checks if `value` is odd.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is odd.

    Example:

        >>> is_odd(3)
        True
        >>> is_odd(2)
        False
        >>> is_odd("a")
        False

    .. versionadded:: 2.0.0
    r   r   rr   rz   s    rV   rD   rD     r   rW   c                &    t        |       xr | dkD  S )a,  
    Checks if `value` is positive.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is positive.

    Example:

        >>> is_positive(1)
        True
        >>> is_positive(0)
        False
        >>> is_positive(-1)
        False

    .. versionadded:: 2.0.0
    r   rr   rz   s    rV   rE   rE     r   rW   c                "    t        | t              S )a`  
    Checks if `value` is a ``RegExp`` object.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a RegExp object.

    Example:

        >>> is_reg_exp(re.compile(""))
        True
        >>> is_reg_exp("")
        False

    .. versionadded:: 1.1.0

    .. versionchanged:: 4.0.0
        Removed alias ``is_re``.
    )r   RegExprz   s    rV   rF   rF     s    , eV$$rW   c                "    t        | t              S )a:  
    Checks if the given value is a set object or not.

    Args:
        value: Value passed in by the user.

    Returns:
        True if the given value is a set else False.

    Example:

        >>> is_set(set([1, 2]))
        True
        >>> is_set([1, 2, 3])
        False

    .. versionadded:: 4.0.0
    )r   setrz   s    rV   rG   rG         & eS!!rW   c                6    t        | t        j                        S )aC  
    Check if `value` is strictly decreasing.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is strictly decreasing.

    Example:

        >>> is_strictly_decreasing([4, 3, 2, 1])
        True
        >>> is_strictly_decreasing([4, 4, 2, 1])
        False

    .. versionadded:: 2.0.0
    )r=   r   r   rz   s    rV   rH   rH         * uhkk**rW   c                6    t        | t        j                        S )aC  
    Check if `value` is strictly increasing.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is strictly increasing.

    Example:

        >>> is_strictly_increasing([1, 2, 3, 4])
        True
        >>> is_strictly_increasing([1, 1, 3, 4])
        False

    .. versionadded:: 2.0.0
    )r=   r   r   rz   s    rV   rI   rI   '  r   rW   c                "    t        | t              S )z
    Checks if `value` is a string.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a string.

    Example:

        >>> is_string("")
        True
        >>> is_string(1)
        False

    .. versionadded:: 1.0.0
    )r   r   rz   s    rV   rJ   rJ   ?  r   rW   c                "    t        | t              S )a#  
    Checks if `value` is a tuple.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is a tuple.

    Example:

        >>> is_tuple(())
        True
        >>> is_tuple({})
        False
        >>> is_tuple([])
        False

    .. versionadded:: 3.0.0
    )r   r   rz   s    rV   rK   rK   U  s    * eU##rW   c                &    | dk(  xr t        |       S )z
    Checks if `value` is ``0``.

    Args:
        value: Value to check.

    Returns:
        Whether `value` is ``0``.

    Example:

        >>> is_zero(0)
        True
        >>> is_zero(1)
        False

    .. versionadded:: 2.0.0
    r   )r5   rz   s    rV   rL   rL   m  s    & A:+*U++rW   )rT   t.AnyrU   r   returnr`   )rU   rM   r   zt.Callable[[T], bool])rT   z'SupportsDunderGT[T]'rU   rM   r   r`   )rU   rM   r   z)t.Callable[['SupportsDunderGT[T]'], bool])rT   z'SupportsDunderGE[T]'rU   rM   r   r`   )rU   rM   r   z)t.Callable[['SupportsDunderGE[T]'], bool])rT   z'SupportsDunderLT[T]'rU   rM   r   r`   )rU   rM   r   z)t.Callable[['SupportsDunderLT[T]'], bool])rT   z'SupportsDunderLE[T]'rU   rM   r   r`   )rU   rM   r   z)t.Callable[['SupportsDunderLE[T]'], bool])r   N)rT   r   rs   r   rt   r   r   r`   )rs   r   rt   r   r   t.Callable[[t.Any], bool])rT   r   r   r`   )r   r   r   TypeGuard[str])rT   r   r   zTypeGuard[bool])rT   zCt.Union['SupportsRichComparison', t.List['SupportsRichComparison']]r   r`   )rT   rM   rU   rN   r   zt.Callable[[T, T2], T3]r   rO   )rT   r   rU   r   r   zt.Callable[..., t.Any]r   r`   )rT   r   rU   r   r   Noner   r`   )rU   rM   r   zt.Callable[[T, T], T3]r   zt.Callable[[T], T3])rT   r   r   zTypeGuard[float])rT   r   r   !t.Union[type, t.Tuple[type, ...]]r   r`   )r   r   r   r   )rT   r   r   zTypeGuard[int])r   r   r   r   r   r`   )r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r`   rZ   )r   r   r   r   r   r   )rT   zt.Union[T, t.List[T]]r   t.Callable[[T, T], t.Any]r   r`   )r   r   r   z)t.Callable[[t.Union[T, t.List[T]]], bool])rT   r   r   zTypeGuard[None])rT   r   r   zTypeGuard[re.Pattern[t.Any]])rT   r   r   r   )c__doc__
__future__r   collections.abcr   r   r   	itertoolsr   r   r   r|   r   r   typingttyping_extensionsr   pydashr   helpersr
   r   r   r   r   r   TYPE_CHECKING	_typeshedr   r   r   r   r   __all__TypeVarrM   rN   rO   r   compiler   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   overloadr+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rR   rW   rV   <module>r     s   # -     	 %  '  N N ?? 9v AIIcNQYYt_QYYt_	jbjjn	6*42*0 2+02*0 2+0+ \5>)4:#<<,8+N+	+4#8>B860,  V  V  ^  ^  L  L4nA2(0/0$,0+N+	+81:$06,6627<B<#0&D-6 C	CC C 	C
 C C 
CL>2D0!0.00 0*0,ED+4/0*0%2",+N+	+0+N+	+0",$0,rW   