
    O=dj                        d Z ddlmZ ddlZddlZddlZdZ G d de          Z	 G d de          Z
 G d	 d
e	          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d d e          Z G d! d"e          Z G d# d$e          Z G d% d&e          Z G d' d(e          Z G d) d*e          Zd+ Zd, Zd- Zd. ZdDd/Z dDd0Z!dEd2Z"d3 Z#d4 Z$d5 Z%d6 Z&d7 Z'd8 Z(d9 Z)d: Z*d; Z+d< Z,d= Z-d> Z.d? Z/d@ Z0dA Z1dB Z2dC Z3dS )Fz?
Functions that wrap other functions.

.. versionadded:: 1.0.0
    )getfullargspecN)afterarybeforeconjoincurrycurry_rightdebouncedelaydisjoinflipflow
flow_rightiterated	juxtaposenegateonce	over_argspartialpartial_rightreargspreadthrottleunarywrapc                       e Zd ZdZd Zd ZdS )Afterz$Wrap a function in an after context.c                     	 t          |          }|dk    sJ n# t          t          t          f$ r d}Y nw xY w|| _        || _        d S Nr   int
ValueError	TypeErrorAssertionErrornfuncselfr&   r%   s      :D:\Sites\api_v1\venv\Lib\site-packages\pydash/functions.py__init__zAfter.__init__-   s`    	AA66666I~6 	 	 	AAA	 			    66c                 V    | xj         dz  c_         | j         dk    r | j        |i |S dS )z5Return results of :attr:`func` after :attr:`n` calls.   r   Nr%   r&   r(   argskwargss      r)   __call__zAfter.__call__7   s:    !6Q;;49d-f--- ;    N__name__
__module____qualname____doc__r*   r2    r3   r)   r   r   *   s8        ..  . . . . .r3   r   c                       e Zd ZdZd Zd ZdS )Aryz"Wrap a function in an ary context.c                     	 t          |          }|dk    sJ n# t          t          t          f$ r d }Y nw xY w|| _        || _        d S r   r    r'   s      r)   r*   zAry.__init__B   s`    	AA66666I~6 	 	 	AAA	 			r+   c                 H    | j         |d| j                  } | j        |i |S )z
        Return results of :attr:`func` with arguments capped to :attr:`n`.

        Only positional arguments are capped. Any number of keyword arguments are allowed.
        Nr.   r/   s      r)   r2   zAry.__call__L   s2     6$&>Dty$)&)))r3   Nr4   r9   r3   r)   r;   r;   ?   s8        ,,  	* 	* 	* 	* 	*r3   r;   c                       e Zd ZdZd ZdS )Beforez$Wrap a function in a before context.c                 V    | xj         dz  c_         | j         dk    r | j        |i |S d S )Nr-   r   r.   r/   s      r)   r2   zBefore.__call__[   s:    !6A::49d-f--- :r3   N)r5   r6   r7   r8   r2   r9   r3   r)   r?   r?   X   s)        ... . . . .r3   r?   c                       e Zd ZdZd Zd ZdS )Flowz"Wrap a function in a flow context.c                 J    || _         |                    dd          | _        d S )N
from_rightT)funcsgetrD   )r(   rE   r1   s      r)   r*   zFlow.__init__e   s"    
 **\488r3   c                     t          | j                  }| j        rdnd}d}|r" |                    |          |i |}|f}i }|"|S )z*Return results of composing :attr:`funcs`.r   N)listrE   rD   pop)r(   r0   r1   rE   
from_indexresults         r)   r2   zFlow.__call__i   sk    TZ  ?1RR
 	*UYYz**D;F;;F9DF  	
 r3   Nr4   r9   r3   r)   rB   rB   b   s8        ,,9 9 9    r3   rB   c                       e Zd ZdZd Zd ZdS )Conjoinz-Wrap a set of functions in a conjoin context.c                     || _         d S NrE   r(   rE   s     r)   r*   zConjoin.__init__{       


r3   c                 8      fd}t          j        ||          S )z=Return result of conjoin `obj` with :attr:`funcs` predicates.c                 @     t          j        j         fd          S )Nc                      |           S rP   r9   r&   items    r)   <lambda>z4Conjoin.__call__.<locals>.iteratee.<locals>.<lambda>   s    dd4jj r3   )pydeveryrE   rX   r(   s   `r)   iterateez"Conjoin.__call__.<locals>.iteratee   s"    9TZ)@)@)@)@AAAr3   )rZ   r[   r(   objr]   s   `  r)   r2   zConjoin.__call__~   s5    	B 	B 	B 	B 	B yh'''r3   Nr4   r9   r3   r)   rN   rN   x   s8        77  ( ( ( ( (r3   rN   c                   &    e Zd ZdZddZd Zd ZdS )Curryz#Wrap a function in a curry context.Nc                     || _         |!t          t          |          j                  n|| _        |dn|| _        |i n|| _        d S )Nr9   )r&   lenr   r0   arityr1   )r(   r&   rd   r0   r1   s        r)   r*   zCurry.__init__   sN    	7<}S--2333%
,BBD	"Nbbr3   c                 f   |                      |          }|                    | j                   t          |          t          |          z   | j        k    r7| j        t          |          z
  }|d|dk    r|nd         } | j        |i |}n"|                     | j        | j        ||          }|S )zhStore `args` and `kwargs` and call :attr:`func` if we've reached or exceeded the function
        arity.Nr   )compose_argsupdater1   rc   rd   r&   	__class__)r(   r0   r1   
args_aritycurrieds        r)   r2   zCurry.__call__   s       &&dk"""IIF#
22c&kk1J?a::Q?@Ddi000GG nnTY
D&IIGr3   c                 d    t          t          | j                  t          |          z             S )z/Combine `self.args` with `new_args` and return.tuplerI   r0   r(   new_argss     r)   rf   zCurry.compose_args   s#    T$)__tH~~5666r3   )NN)r5   r6   r7   r8   r*   r2   rf   r9   r3   r)   ra   ra      sL        --7 7 7 7  "7 7 7 7 7r3   ra   c                       e Zd ZdZd ZdS )
CurryRightz)Wrap a function in a curry-right context.c                 d    t          t          |          t          | j                  z             S rP   rl   rn   s     r)   rf   zCurryRight.compose_args   s#    T(^^d49oo5666r3   N)r5   r6   r7   r8   rf   r9   r3   r)   rq   rq      s)        337 7 7 7 7r3   rq   c                        e Zd ZdZddZd ZdS )Debouncez&Wrap a function in a debounce context.Fc                     || _         || _        || _        d | _        t	          j                    | j        z
  | _        t	          j        |          rt	          j                    |z
  nd | _        d S rP   )	r&   waitmax_waitlast_resultrZ   now	last_call	is_numberlast_execution)r(   r&   rv   rw   s       r)   r*   zDebounce.__init__   sc    		  TY.69mH6M6MWcgii(22SWr3   c                     t          j                    }|| j        z
  | j        k    s| j        r,|| j        z
  | j        k    r | j        |i || _        || _        || _        | j        S )z
        Execute :attr:`func` if function hasn't been called within last :attr:`wait` milliseconds or
        in last :attr:`max_wait` milliseconds.

        Return results of last successful call.
        )rZ   ry   rz   rv   rw   r|   r&   rx   r(   r0   r1   presents       r)   r2   zDebounce.__call__   ss     '))dn$22M 3&)<<NN(ty$9&99D")D r3   NFr4   r9   r3   r)   rt   rt      sA        00
X 
X 
X 
X         r3   rt   c                       e Zd ZdZd Zd ZdS )Disjoinz-Wrap a set of functions in a disjoin context.c                     || _         d S rP   rQ   rR   s     r)   r*   zDisjoin.__init__   rS   r3   c                 8      fd}t          j        ||          S )z=Return result of disjoin `obj` with :attr:`funcs` predicates.c                 @     t          j        j         fd          S )Nc                      |           S rP   r9   rW   s    r)   rY   z4Disjoin.__call__.<locals>.iteratee.<locals>.<lambda>   s    TT$ZZ r3   )rZ   somerE   r\   s   `r)   r]   z"Disjoin.__call__.<locals>.iteratee   s"    8DJ(?(?(?(?@@@r3   )rZ   r   r^   s   `  r)   r2   zDisjoin.__call__   s5    	A 	A 	A 	A 	A xX&&&r3   Nr4   r9   r3   r)   r   r      s8        77  ' ' ' ' 'r3   r   c                       e Zd ZdZd Zd ZdS )Flipz"Wrap a function in a flip context.c                     || _         d S rP   r&   r(   r&   s     r)   r*   zFlip.__init__       			r3   c                 6     | j         t          |          i |S rP   )r&   reversedr/   s      r)   r2   zFlip.__call__   s    ty(4..3F333r3   Nr4   r9   r3   r)   r   r      s8        ,,  4 4 4 4 4r3   r   c                   $    e Zd ZdZd Zd Zd ZdS )Iteratedz'Wrap a function in an iterated context.c                     || _         d S rP   r   r   s     r)   r*   zIterated.__init__   r   r3   c              #   @   K   |}	 |                      |          }|V  )z1Iterator that composing :attr:`func` with itself.r   )r(   initialvalues      r)   
_iterationzIterated._iteration   s/      	IIe$$EKKK	r3   c                 v    |}|                      |          }t          |          D ]}t          |          }|S )zMReturn value of calling :attr:`func` `n` times using `initial` as seed value.)r   rangenext)r(   r   r%   r   	iteration_s         r)   r2   zIterated.__call__   s?    OOE**	q 	$ 	$AOOEEr3   N)r5   r6   r7   r8   r*   r   r2   r9   r3   r)   r   r      sG        11        r3   r   c                       e Zd ZdZd Zd ZdS )	Juxtaposez'Wrap a function in a juxtapose context.c                     || _         d S rP   rQ   rR   s     r)   r*   zJuxtapose.__init__  rS   r3   c                 *    fd| j         D             S )Nc                     g | ]} | S r9   r9   ).0r&   objss     r)   
<listcomp>z&Juxtapose.__call__.<locals>.<listcomp>  s    333d333r3   rQ   )r(   r   s    `r)   r2   zJuxtapose.__call__  s    3333
3333r3   Nr4   r9   r3   r)   r   r     s8        11  4 4 4 4 4r3   r   c                       e Zd ZdZd Zd ZdS )OverArgsz'Wrap a function in a over_args context.c                 F    || _         t          j        |          | _        d S rP   )r&   rZ   flatten
transforms)r(   r&   r   s      r)   r*   zOverArgs.__init__  s    	+j11r3   c                 N      fdt          |          D             }  j        | S )Nc              3   J   K   | ]\  }} j         |         |          V  d S rP   )r   )r   idxr0   r(   s      r)   	<genexpr>z$OverArgs.__call__.<locals>.<genexpr>  s9      LLysD$$T**LLLLLLr3   )	enumerater&   r(   r0   s   ` r)   r2   zOverArgs.__call__  s1    LLLLIdOOLLLty$r3   Nr4   r9   r3   r)   r   r     s8        112 2 2         r3   r   c                       e Zd ZdZd Zd ZdS )Negatez$Wrap a function in a negate context.c                     || _         d S rP   r   r   s     r)   r*   zNegate.__init__  r   r3   c                      | j         |i | S )z/Return negated results of calling :attr:`func`.r   r/   s      r)   r2   zNegate.__call__  s    49d-f----r3   Nr4   r9   r3   r)   r   r     s8        ..  . . . . .r3   r   c                       e Zd ZdZd Zd ZdS )Oncez"Wrap a function in a once context.c                 0    || _         d | _        d| _        d S NF)r&   rL   calledr   s     r)   r*   zOnce.__init__%  s    	r3   c                 P    | j         s | j        |i || _        d| _         | j        S )z3Return results from the first call of :attr:`func`.T)r   r&   rL   r/   s      r)   r2   zOnce.__call__*  s3    { 	#$)T4V44DKDK{r3   Nr4   r9   r3   r)   r   r   "  s8        ,,  
    r3   r   c                        e Zd ZdZddZd ZdS )Partialz%Wrap a function in a partial context.NFc                 B    || _         || _        |pi | _        || _        d S rP   )r&   r0   r1   rD   )r(   r&   r0   r1   rD   s        r)   r*   zPartial.__init__6  s&    		l$r3   c                     | j         rt          j        || j                  }nt          j        | j        |          }i | j        |} | j        |i |S )z
        Return results from :attr:`func` with :attr:`args` + `args`.

        Apply arguments from left or right depending on :attr:`from_right`.
        )rD   	itertoolschainr0   r1   r&   r/   s      r)   r2   zPartial.__call__<  s^     ? 	4?433DD?49d33D*DK*6*ty$)&)))r3   r   r4   r9   r3   r)   r   r   3  s=        //% % % %* * * * *r3   r   c                       e Zd ZdZd Zd ZdS )Reargz#Wrap a function in a rearg context.c                 t    || _         d t          t          j        |                    D             | _        d S )Nc                     i | ]\  }}||	S r9   r9   )r   
dest_index	src_indexs      r)   
<dictcomp>z"Rearg.__init__.<locals>.<dictcomp>T  s+     
 
 
&;j)Iz
 
 
r3   )r&   r   rZ   r   indexes)r(   r&   r   s      r)   r*   zRearg.__init__O  s@    	
 
?HU\I]I]?^?^
 
 
r3   c                    i g }t          |          D ]<\  }}| j                            |          }|||<   '|                    |           =t	          j        fdt                    D             |          } | j        |i |S )z<Return results from :attr:`func` using rearranged arguments.Nc              3   (   K   | ]}|         V  d S rP   r9   )r   keyreargss     r)   r   z!Rearg.__call__.<locals>.<genexpr>i  s'      FFsFFFFFFr3   )r   r   rF   appendr   r   sortedr&   )r(   r0   r1   restr   argr   r   s          @r)   r2   zRearg.__call__X  s     (oo 		! 		!NIs)))44J%%(z"" C    FFFFvf~~FFFMMty$)&)))r3   Nr4   r9   r3   r)   r   r   L  s8        --
 
 
* * * * *r3   r   c                       e Zd ZdZd Zd ZdS )Spreadz$Wrap a function in a spread context.c                     || _         d S rP   r   r   s     r)   r*   zSpread.__init__q  r   r3   c                      | j         | S )z@Return results from :attr:`func` using array of `args` provided.r   r   s     r)   r2   zSpread.__call__t  s    ty$r3   Nr4   r9   r3   r)   r   r   n  s8        ..           r3   r   c                       e Zd ZdZd Zd ZdS )Throttlez&Wrap a function in a throttle context.c                 p    || _         || _        d | _        t          j                    | j        z
  | _        d S rP   )r&   rv   rx   rZ   ry   r|   )r(   r&   rv   s      r)   r*   zThrottle.__init__|  s3    		!gii$)3r3   c                     t          j                    }|| j        z
  | j        k    r | j        |i || _        || _        | j        S )z
        Execute :attr:`func` if function hasn't been called within last :attr:`wait` milliseconds.

        Return results of last successful call.
        )rZ   ry   r|   rv   r&   rx   r~   s       r)   r2   zThrottle.__call__  sN     '))d))di77(ty$9&99D")Dr3   Nr4   r9   r3   r)   r   r   y  s8        004 4 4         r3   r   c                 "    t          | |          S )a  
    Creates a function that executes `func`, with the arguments of the created function, only after
    being called `n` times.

    Args:
        func (callable): Function to execute.
        n (int): Number of times `func` must be called before it is executed.

    Returns:
        After: Function wrapped in an :class:`After` context.

    Example:

        >>> func = lambda a, b, c: (a, b, c)
        >>> after_func = after(func, 3)
        >>> after_func(1, 2, 3)
        >>> after_func(1, 2, 3)
        >>> after_func(1, 2, 3)
        (1, 2, 3)
        >>> after_func(4, 5, 6)
        (4, 5, 6)

    .. versionadded:: 1.0.0

    .. versionchanged:: 3.0.0
        Reordered arguments to make `func` first.
    )r   r&   r%   s     r)   r   r     s    8 q>>r3   c                 "    t          | |          S )a}  
    Creates a function that accepts up to `n` arguments ignoring any additional arguments. Only
    positional arguments are capped. All keyword arguments are allowed through.

    Args:
        func (callable): Function to cap arguments for.
        n (int): Number of arguments to accept.

    Returns:
        Ary: Function wrapped in an :class:`Ary` context.

    Example:

        >>> func = lambda a, b, c=0, d=5: (a, b, c, d)
        >>> ary_func = ary(func, 2)
        >>> ary_func(1, 2, 3, 4, 5, 6)
        (1, 2, 0, 5)
        >>> ary_func(1, 2, 3, 4, 5, 6, c=10, d=20)
        (1, 2, 10, 20)

    .. versionadded:: 3.0.0
    r;   r   s     r)   r   r     s    . tQ<<r3   c                 "    t          | |          S )a  
    Creates a function that executes `func`, with the arguments of the created function, until it
    has been called `n` times.

    Args:
        func (callable): Function to execute.
        n (int): Number of times `func` may be executed.

    Returns:
        Before: Function wrapped in an :class:`Before` context.

    Example:

        >>> func = lambda a, b, c: (a, b, c)
        >>> before_func = before(func, 3)
        >>> before_func(1, 2, 3)
        (1, 2, 3)
        >>> before_func(1, 2, 3)
        (1, 2, 3)
        >>> before_func(1, 2, 3)
        >>> before_func(1, 2, 3)

    .. versionadded:: 1.1.0

    .. versionchanged:: 3.0.0
        Reordered arguments to make `func` first.
    )r?   r   s     r)   r   r     s    8 $??r3   c                      t          |  S )as  
    Creates a function that composes multiple predicate functions into a single predicate that tests
    whether **all** elements of an object pass each predicate.

    Args:
        *funcs (callable): Function(s) to conjoin.

    Returns:
        Conjoin: Function(s) wrapped in a :class:`Conjoin` context.

    Example:

        >>> conjoiner = conjoin(lambda x: isinstance(x, int), lambda x: x > 3)
        >>> conjoiner([1, 2, 3])
        False
        >>> conjoiner([1.0, 2, 1])
        False
        >>> conjoiner([4.0, 5, 6])
        False
        >>> conjoiner([4, 5, 6])
        True

    .. versionadded:: 2.0.0
    )rN   rQ   s    r)   r   r     s    2 E?r3   c                 "    t          | |          S )a  
    Creates a function that accepts one or more arguments of `func` that when invoked either
    executes `func` returning its result (if all `func` arguments have been provided) or returns a
    function that accepts one or more of the remaining `func` arguments, and so on.

    Args:
        func (callable): Function to curry.
        arity (int, optional): Number of function arguments that can be accepted by curried
            function. Default is to use the number of arguments that are accepted by `func`.

    Returns:
        Curry: Function wrapped in a :class:`Curry` context.

    Example:

        >>> func = lambda a, b, c: (a, b, c)
        >>> currier = curry(func)
        >>> currier = currier(1)
        >>> assert isinstance(currier, Curry)
        >>> currier = currier(2)
        >>> assert isinstance(currier, Curry)
        >>> currier = currier(3)
        >>> currier
        (1, 2, 3)

    .. versionadded:: 1.0.0
    )ra   r&   rd   s     r)   r   r     s    8 ur3   c                 "    t          | |          S )aS  
    This method is like :func:`curry` except that arguments are applied to `func` in the manner of
    :func:`partial_right` instead of :func:`partial`.

    Args:
        func (callable): Function to curry.
        arity (int, optional): Number of function arguments that can be accepted by curried
            function. Default is to use the number of arguments that are accepted by `func`.

    Returns:
        CurryRight: Function wrapped in a :class:`CurryRight` context.

    Example:

        >>> func = lambda a, b, c: (a, b, c)
        >>> currier = curry_right(func)
        >>> currier = currier(1)
        >>> assert isinstance(currier, CurryRight)
        >>> currier = currier(2)
        >>> assert isinstance(currier, CurryRight)
        >>> currier = currier(3)
        >>> currier
        (3, 2, 1)

    .. versionadded:: 1.1.0
    )rq   r   s     r)   r	   r	   %  s    6 dE"""r3   Fc                 &    t          | ||          S )a,  
    Creates a function that will delay the execution of `func` until after `wait` milliseconds have
    elapsed since the last time it was invoked. Subsequent calls to the debounced function will
    return the result of the last `func` call.

    Args:
        func (callable): Function to execute.
        wait (int): Milliseconds to wait before executing `func`.
        max_wait (optional): Maximum time to wait before executing `func`.

    Returns:
        Debounce: Function wrapped in a :class:`Debounce` context.

    .. versionadded:: 1.0.0
    )rw   )rt   )r&   rv   rw   s      r)   r
   r
   C  s      D$2222r3   c                 @    t          j        |dz              | |i |S )a  
    Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to
    `func` when it is invoked.

    Args:
        func (callable): Function to execute.
        wait (int): Milliseconds to wait before executing `func`.
        *args (optional): Arguments to pass to `func`.
        **kwargs (optional): Keyword arguments to pass to `func`.

    Returns:
        mixed: Return from `func`.

    .. versionadded:: 1.0.0
    g     @@)timesleep)r&   rv   r0   r1   s       r)   r   r   V  s-      	Jtf}4    r3   c                      t          |  S )a}  
    Creates a function that composes multiple predicate functions into a single predicate that tests
    whether **any** elements of an object pass each predicate.

    Args:
        *funcs (callable): Function(s) to disjoin.

    Returns:
        Disjoin: Function(s) wrapped in a :class:`Disjoin` context.

    Example:

        >>> disjoiner = disjoin(lambda x: isinstance(x, float),                                lambda x: isinstance(x, int))
        >>> disjoiner([1, '2', '3'])
        True
        >>> disjoiner([1.0, '2', '3'])
        True
        >>> disjoiner(['1', '2', '3'])
        False

    .. versionadded:: 2.0.0
    )r   rQ   s    r)   r   r   j  s    0 E?r3   c                      t          |           S )a  
    Creates a function that invokes the method with arguments reversed.

    Args:
        func (callable): Function to flip arguments for.

    Returns:
        function: Function wrapped in a :class:`Flip` context.

    Example:

        >>> flipped = flip(lambda *args: args)
        >>> flipped(1, 2, 3, 4)
        (4, 3, 2, 1)
        >>> flipped = flip(lambda *args: [i * 2 for i in args])
        >>> flipped(1, 2, 3, 4)
        [8, 6, 4, 2]

    .. versionadded:: 4.0.0
    )r   r   s    r)   r   r         * ::r3   c                      t          | ddiS )a
  
    Creates a function that is the composition of the provided functions, where each successive
    invocation is supplied the return value of the previous. For example, composing the functions
    ``f()``, ``g()``, and ``h()`` produces ``h(g(f()))``.

    Args:
        *funcs (callable): Function(s) to compose.

    Returns:
        Flow: Function(s) wrapped in a :class:`Flow` context.

    Example:

        >>> mult_5 = lambda x: x * 5
        >>> div_10 = lambda x: x / 10.0
        >>> pow_2 = lambda x: x ** 2
        >>> ops = flow(sum, mult_5, div_10, pow_2)
        >>> ops([1, 2, 3, 4])
        25.0

    .. versionadded:: 2.0.0

    .. versionchanged:: 2.3.1
        Added :func:`pipe` as alias.

    .. versionchanged:: 4.0.0
        Removed alias ``pipe``.
    rD   FrB   rQ   s    r)   r   r     s    : )5)))r3   c                      t          | ddiS )ay  
    This function is like :func:`flow` except that it creates a function that invokes the provided
    functions from right to left. For example, composing the functions ``f()``, ``g()``, and ``h()``
    produces ``f(g(h()))``.

    Args:
        *funcs (callable): Function(s) to compose.

    Returns:
        Flow: Function(s) wrapped in a :class:`Flow` context.

    Example:

        >>> mult_5 = lambda x: x * 5
        >>> div_10 = lambda x: x / 10.0
        >>> pow_2 = lambda x: x ** 2
        >>> ops = flow_right(mult_5, div_10, pow_2, sum)
        >>> ops([1, 2, 3, 4])
        50.0

    .. versionadded:: 1.0.0

    .. versionchanged:: 2.0.0
        Added :func:`flow_right` and made :func:`compose` an alias.

    .. versionchanged:: 2.3.1
        Added :func:`pipe_right` as alias.

    .. versionchanged:: 4.0.0
        Removed aliases ``pipe_right`` and ``compose``.
    rD   Tr   rQ   s    r)   r   r     s    @ (4(((r3   c                      t          |           S )a  
    Creates a function that is composed with itself. Each call to the iterated function uses the
    previous function call's result as input. Returned :class:`Iterated` instance can be called with
    ``(initial, n)`` where `initial` is the initial value to seed `func` with and `n` is the number
    of times to call `func`.

    Args:
        func (callable): Function to iterate.

    Returns:
        Iterated: Function wrapped in a :class:`Iterated` context.

    Example:

        >>> doubler = iterated(lambda x: x * 2)
        >>> doubler(4, 5)
        128
        >>> doubler(3, 9)
        1536

    .. versionadded:: 2.0.0
    )r   r   s    r)   r   r     s    . D>>r3   c                      t          |  S )a  
    Creates a function whose return value is a list of the results of calling each `funcs` with the
    supplied arguments.

    Args:
        *funcs (callable): Function(s) to juxtapose.

    Returns:
        Juxtapose: Function wrapped in a :class:`Juxtapose` context.

    Example:

        >>> double = lambda x: x * 2
        >>> triple = lambda x: x * 3
        >>> quadruple = lambda x: x * 4
        >>> juxtapose(double, triple, quadruple)(5)
        [10, 15, 20]


    .. versionadded:: 2.0.0
    )r   rQ   s    r)   r   r     s    , er3   c                      t          |           S )a  
    Creates a function that negates the result of the predicate `func`. The `func` function is
    executed with the arguments of the created function.

    Args:
        func (callable): Function to negate execute.

    Returns:
        Negate: Function wrapped in a :class:`Negate` context.

    Example:

        >>> not_is_number = negate(lambda x: isinstance(x, (int, float)))
        >>> not_is_number(1)
        False
        >>> not_is_number('1')
        True

    .. versionadded:: 1.1.0
    )r   r   s    r)   r   r     s    * $<<r3   c                      t          |           S )a  
    Creates a function that is restricted to execute `func` once. Repeat calls to the function will
    return the value of the first call.

    Args:
        func (callable): Function to execute.

    Returns:
        Once: Function wrapped in a :class:`Once` context.

    Example:

        >>> oncer = once(lambda *args: args[0])
        >>> oncer(5)
        5
        >>> oncer(6)
        5

    .. versionadded:: 1.0.0
    )r   r   s    r)   r   r   +  r   r3   c                     t          | g|R  S )a  
    Creates a function that runs each argument through a corresponding transform function.

    Args:
        func (callable): Function to wrap.
        *transforms (callable): Functions to transform arguments, specified as individual functions
            or lists of functions.

    Returns:
        OverArgs: Function wrapped in a :class:`OverArgs` context.

    Example:

        >>> squared = lambda x: x ** 2
        >>> double = lambda x: x * 2
        >>> modder = over_args(lambda x, y: [x, y], squared, double)
        >>> modder(5, 10)
        [25, 20]

    .. versionadded:: 3.3.0

    .. versionchanged:: 4.0.0
        Renamed from ``mod_args`` to ``over_args``.
    )r   )r&   r   s     r)   r   r   C  s    2 D&:&&&&r3   c                 $    t          | ||          S )a  
    Creates a function that, when called, invokes `func` with any additional partial arguments
    prepended to those provided to the new function.

    Args:
        func (callable): Function to execute.
        *args (optional): Partial arguments to prepend to function call.
        **kwargs (optional): Partial keyword arguments to bind to function call.

    Returns:
        Partial: Function wrapped in a :class:`Partial` context.

    Example:

        >>> dropper = partial(lambda array, n: array[n:], [1, 2, 3, 4])
        >>> dropper(2)
        [3, 4]
        >>> dropper(1)
        [2, 3, 4]
        >>> myrest = partial(lambda array, n: array[n:], n=1)
        >>> myrest([1, 2, 3, 4])
        [2, 3, 4]

    .. versionadded:: 1.0.0
    r   r&   r0   r1   s      r)   r   r   _  s    4 4v&&&r3   c                 (    t          | ||d          S )aE  
    This method is like :func:`partial` except that partial arguments are appended to those provided
    to the new function.

    Args:
        func (callable): Function to execute.
        *args (optional): Partial arguments to append to function call.
        **kwargs (optional): Partial keyword arguments to bind to function call.

    Returns:
        Partial: Function wrapped in a :class:`Partial` context.

    Example:

        >>> myrest = partial_right(lambda array, n: array[n:], 1)
        >>> myrest([1, 2, 3, 4])
        [2, 3, 4]

    .. versionadded:: 1.0.0
    T)rD   r   r   s      r)   r   r   |  s    * 4v$7777r3   c                     t          | g|R  S )a  
    Creates a function that invokes `func` with arguments arranged according to the specified
    indexes where the argument value at the first index is provided as the first argument, the
    argument value at the second index is provided as the second argument, and so on.

    Args:
        func (callable): Function to rearrange arguments for.
        *indexes (int): The arranged argument indexes.

    Returns:
        Rearg: Function wrapped in a :class:`Rearg` context.

    Example:

        >>> jumble = rearg(lambda *args: args, 1, 2, 3)
        >>> jumble(1, 2, 3)
        (2, 3, 1)
        >>> jumble('a', 'b', 'c', 'd', 'e')
        ('b', 'c', 'd', 'a', 'e')

    .. versionadded:: 3.0.0
    )r   )r&   r   s     r)   r   r     s    .      r3   c                      t          |           S )a  
    Creates a function that invokes `func` with the array of arguments provided to the created
    function.

    Args:
        func (callable): Function to spread.

    Returns:
        Spread: Function wrapped in a :class:`Spread` context.

    Example:

        >>> greet = spread(lambda *people: 'Hello ' + ', '.join(people) + '!')
        >>> greet(['Mike', 'Don', 'Leo'])
        'Hello Mike, Don, Leo!'

    .. versionadded:: 3.1.0
    )r   r   s    r)   r   r     s    & $<<r3   c                 "    t          | |          S )a  
    Creates a function that, when executed, will only call the `func` function at most once per
    every `wait` milliseconds. Subsequent calls to the throttled function will return the result of
    the last `func` call.

    Args:
        func (callable): Function to throttle.
        wait (int): Milliseconds to wait before calling `func` again.

    Returns:
        mixed: Results of last `func` call.

    .. versionadded:: 1.0.0
    )r   )r&   rv   s     r)   r   r     s     D$r3   c                 "    t          | d          S )a  
    Creates a function that accepts up to one argument, ignoring any additional arguments.

    Args:
        func (callable): Function to cap arguments for.

    Returns:
        Ary: Function wrapped in an :class:`Ary` context.

    Example:

        >>> func = lambda a, b=1, c=0, d=5: (a, b, c, d)
        >>> unary_func = unary(func)
        >>> unary_func(1, 2, 3, 4, 5, 6)
        (1, 1, 0, 5)
        >>> unary_func(1, 2, 3, 4, 5, 6, b=0, c=10, d=20)
        (1, 0, 10, 20)

    .. versionadded:: 4.0.0
    r-   r   r   s    r)   r   r     s    * tQ<<r3   c                 $    t          || f          S )a1  
    Creates a function that provides value to the wrapper function as its first argument. Additional
    arguments provided to the function are appended to those provided to the wrapper function.

    Args:
        value (mixed): Value provided as first argument to function call.
        func (callable): Function to execute.

    Returns:
        Partial: Function wrapped in a :class:`Partial` context.

    Example:

        >>> wrapper = wrap('hello', lambda *args: args)
        >>> wrapper(1, 2)
        ('hello', 1, 2)

    .. versionadded:: 1.0.0
    r   )r   r&   s     r)   r   r     s    ( 4%"""r3   rP   r   )4r8   inspectr   r   r   pydashrZ   __all__objectr   r;   r?   rB   rN   ra   rq   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r3   r)   <module>r      s    # " " " " "         8. . . . .F . . .** * * * *& * * *2. . . . .U . . .    6   ,( ( ( ( (f ( ( (7 7 7 7 7F 7 7 7>7 7 7 7 7 7 7 7              v         F' ' ' ' 'f ' ' '4 4 4 4 46 4 4 4    v   04 4 4 4 4 4 4 4	  	  	  	  	 v 	  	  	 . . . . .V . . .    6   "* * * * *f * * *2* * * * *F * * *D         V               v      2  >  4  >  8   ># # # #<3 3 3 3&! ! !(  6  0* * *@ )  )  )F  4  2  0  0' ' '8' ' ':8 8 80! ! !4  ,     $  0# # # # #r3   