
    E#iKP                        S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJ	r	J
r
JrJr  SSKr0 r\" GS0 SS /_SS	 /_S
S S /_SS /_SS S S /_SS /_SS /_SGSS j/_SS S S /_SS S GS S  j/_S!S" /_S#S$ /_S%S& /_S'S( /_S)S* /_S+GS!S, j/_S-S. /_S/S0 S1 /_S2S3 S4 /_S5S6 /_S7SGS"S8 j4/_S9S: S; S< /_S=S> S? S@ /_SASGS#SB j4/_SCSD /_SEGS$SF j/_SGSH SI /_SJSK SL /_SMSN SO /_SPSQ /_SRSS /_STSU /_SVSW /_SXSY /_SZS[ S\ /_S]GS"S^ jSGS%S_ j4/_S`Sa /_SbSc /_SdSe /_SfSg Sh /_SiSj /_SkSl Sm /_SnSo /_SpGS"Sq jSGS%Sr j4/_SsSt /_SuSSv 4/_SwSx Sy /_SzS{ /_S|S} /_S~S /_SS S /_SGS&S j/_SS S S /_SS S /_SS S /_SS /_SS /_SS /_SSGS"S j4/_SS S /_SS /_SS S S /_SS /_SS S /_SS S /_SS S /_SS S /_SS /_SS GS'S j/_SS S /_SS S S /_SS /_SSS S4/_SS GS&S j4/_6\\'   S S S /\\   S'   \\   R!                  S /S S GS S j/S GS(S j4/SS S4SS S4/SS S4SS S4/S GS)S j4/SS S4/GS*S j/S9  SS S4/\\   S'   \" SS 4/S /S /S S /S9\\'   \" GS0 SSGS+S j4/_SS /_SSS 4/_SSS 4/_SSS 4/_SGS,S j/_SS /_SS /_SS /_SSGS+S j4/_SS /_SS /_SS /_SS S S /_SS /_SSGS  GS4/_GSGS /_GSSGS"GS j4/_GSSGS GS4/_GS	SGS"GS
 j4/_GSGS /_GSGS /_GSGS GS /_GSSGS GS4/_6\\'   \" GS0 GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GS GS! /_GS"GS# /_GS$GS% /_GS&GS' /_GS(GS) /_GS*GS+ /_GS,GS- /_GS.GS/ /_GS0GS1 /_GS2GS3 /_GS4GS5 /_GS6GS7 /_GS8GS9 /_GS:GS; /_GS<GS= /_GS>GS? /_GS@GSA /_GSBGSC /_GSDGSE /_GSFGSG /_GSHGSI /_GSJGSK /_GSLGSM /_GSNGSO /_GSPGSQ /_GSRGSS /_GSTGSU /_GSVGSW /_GSXGSY /_GSZGS[ /_GS\GS] /_GS^GS_ /_GS`GSa /_GSbGSc /_GSdGSe /_GSfGSg /_GShGSi /_GSjGSk /_GSlGSm /_GSnGSo /_GSpGSq /_GSrGSs /_GStGSu /_GSvGSw /_GSxGSy /_GSzGS{ /_GS|GS} /_GS~GS /_SGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS GS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_SGS /_GS	GS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GSGS /_GS GS /_6\\'   \" SGS 4/SGS+GS j4/SGS-GS j4/SGS 4/SGS-GS j4/GS9\GS'   \" SGS	 4/S GS.GS
 j4/GS9\GS'   GS rGS rGS rGS r0 r\\4GS jrGS rGS rGS rGS rGS rGS rGS rGS rGS rGS r GS r!GS r"g(/  a  Internal module for better introspection of builtins.

The main functions are ``is_builtin_valid_args``, ``is_builtin_partial_args``,
and ``has_unknown_args``.  Other functions in this module support these three.

Notably, we create a ``signatures`` registry to enable introspection of
builtin functions in any Python version.  This includes builtins that
have more than one valid signature.  Currently, the registry includes
builtins from ``builtins``, ``functools``, ``itertools``, and ``operator``
modules.  More can be added as requested.  We don't guarantee full coverage.

Everything in this module should be regarded as implementation details.
Users should try to not use this module directly.
    N)import_module   )is_partial_argsis_arityhas_varargshas_keywordsnum_required_argsabsc                     g N xs    d/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/static_dependencies/toolz/_signatures.py<lambda>r   -       $    allc                     g r   r   iterables    r   r   r   /       r   anextc                     g r   r   )	aiterators    r   r   r   1       $r   c                     g r   r   )r   defaults     r   r   r   2       4r   anyc                     g r   r   r   s    r   r   r   4   r   r   applyc                     g r   r   objects    r   r   r   6       tr   c                     g r   r   )r%   argss     r   r   r   7       Tr   c                     g r   r   )r%   r(   kwargss      r   r   r   8       Tr   asciic                     g r   r   objs    r   r   r   :       Dr   binc                     g r   r   numbers    r   r   r   <   r&   r   boolc                     g r   r   r   s    r   r   r   >       r   bufferc                     g r   r   r$   s    r   r   r   @   r&   r   c                     g r   r   )r%   offsets     r   r   r   A       tr   c                     g r   r   )r%   r<   sizes      r   r   r   B   r,   r   	bytearrayc                      g r   r   r   r   r   r   r   D       r   c                     g r   r   ints    r   r   r   E   r1   r   c                     g r   r   stringencodingerrorss      r   r   r   F       r   callablec                     g r   r   r/   s    r   r   r   H   r1   r   chrc                     g r   r   is    r   r   r   J   r   r   classmethodc                     g r   r   functions    r   r   r   L   r   r   cmpc                     g r   r   r   ys     r   r   r   N       Tr   coercec                     g r   r   rX   s     r   r   r   P   rZ   r   complexc                     g r   r   )realimags     r   r   r   R   r=   r   delattrc                     g r   r   r0   names     r   r   r   T   r   r   dictc                      g r   r   )r+   s    r   r   r   V   r   r   c                     g r   r   )mappingr+   s     r   r   r   W       $r   dirc                      g r   r   r   r   r   r   r   Y   rB   r   c                     g r   r   r$   s    r   r   r   Z   r&   r   divmodc                     g r   r   rX   s     r   r   r   \   rZ   r   	enumeratec                     g r   r   r   starts     r   r   r   ^       dr   evalc                     g r   r   sources    r   r   r   `   r&   r   c                     g r   r   rw   globalss     r   r   r   a       r   c                     g r   r   rw   rz   localss      r   r   r   b       r   execfilec                     g r   r   )filenames    r   r   r   d   r   r   c                     g r   r   )r   rz   s     r   r   r   e   ri   r   c                     g r   r   )r   rz   r~   s      r   r   r   f   s    $r   filec                     g r   r   )rd   mode	bufferings      r   r   r   h   s    r   filterc                     g r   r   )rU   r   s     r   r   r   j   r   r   floatc                     g r   r   r   s    r   r   r   l       dr   formatc                     g r   r   )values    r   r   r   n   r   r   c                     g r   r   )r   format_specs     r   r   r   o   r   r   	frozensetc                      g r   r   r   r   r   r   r   q   rB   r   c                     g r   r   r   s    r   r   r   r   r   r   getattrc                     g r   r   )r%   rd   s     r   r   r   t   r)   r   c                     g r   r   )r%   rd   r   s      r   r   r   u   rs   r   rz   c                      g r   r   r   r   r   r   r   w   rB   r   hasattrc                     g r   r   rc   s     r   r   r   y   r   r   hashc                     g r   r   r/   s    r   r   r   {   r1   r   hexc                     g r   r   r4   s    r   r   r   }   r&   r   idc                     g r   r   r/   s    r   r   r      r1   r   inputc                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   prompts    r   r   r      r&   r   rE   c                     g r   r   r   s    r   r   r      r1   r   c                     g r   r   r   bases     r   r   r      r=   r   internc                     g r   r   )rH   s    r   r   r      r&   r   
isinstancec                     g r   r   )r0   class_or_tuples     r   r   r          Dr   
issubclassc                     g r   r   )clsr   s     r   r   r      r   r   iterc                     g r   r   r   s    r   r   r      r   r   c                     g r   r   )rL   sentinels     r   r   r      r   r   lenc                     g r   r   r/   s    r   r   r      r1   r   listc                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   r   s    r   r   r      r   r   r~   c                      g r   r   r   r   r   r   r      rB   r   longc                     g r   r   r   s    r   r   r      r1   r   c                     g r   r   r   s     r   r   r      r=   r   mapc                     g r   r   funcsequence	iterabless      r   r   r          4r   
memoryviewc                     g r   r   r$   s    r   r   r          4r   nextc                     g r   r   )iterators    r   r   r      r   r   c                     g r   r   )r   r   s     r   r   r      ri   r   r%   c                      g r   r   r   r   r   r   r      rB   r   octc                     g r   r   r4   s    r   r   r      r&   r   ordc                     g r   r   )cs    r   r   r      r   r   powc                     g r   r   rX   s     r   r   r      rZ   r   c                     g r   r   )r   rY   zs      r   r   r      r8   r   propertyc                     g r   r   )fgetfsetfdeldocs       r   r   r      s    $r   rangec                     g r   r   stops    r   r   r      rZ   r   c                     g r   r   rr   r   s     r   r   r          Dr   c                     g r   r   rr   r   steps      r   r   r      ri   r   	raw_inputc                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   r   s    r   r   r      r&   r   reducec                     g r   r   rU   r   s     r   r   r      r   r   c                     g r   r   rU   r   initials      r   r   r          Dr   reloadc                     g r   r   )modules    r   r   r      r&   r   reprc                     g r   r   r/   s    r   r   r      r1   r   reversedc                     g r   r   )r   s    r   r   r      r   r   roundc                     g r   r   )r5   ndigitss     r   r   r      rs   r   setc                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   r   s    r   r   r      r   r   setattrc                     g r   r   )r0   rd   r   s      r   r   r      s    r   slicec                     g r   r   r   s    r   r   r      rZ   r   c                     g r   r   r   s     r   r   r      r   r   c                     g r   r   r   s      r   r   r      ri   r   staticmethodc                     g r   r   rT   s    r   r   r      r   r   sumc                     g r   r   r   s    r   r   r      r   r   c                     g r   r   rq   s     r   r   r      r{   r   superc                     g r   r   )types    r   r   r      rZ   r   c                     g r   r   )r  r0   s     r   r   r      r   r   tuplec                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   r   s    r   r   r      r   r   r  c                     g r   r   r$   s    r   r   r      r&   r   c                     g r   r   )rd   basesre   s      r   r   r      ri   r   unichrc                     g r   r   rP   s    r   r   r      r   r   unicodec                     g r   r   r$   s    r   r   r      r&   r   c                     g r   r   rG   s      r   r   r      s    Dr   varsc                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   r$   s    r   r   r      r&   r   xrangec                     g r   r   r   s    r   r   r      rZ   r   c                     g r   r   r   s     r   r   r      r   r   c                     g r   r   r   s      r   r   r      ri   r   zipc                      g r   r   r   s    r   r   r      r   r   __build_class__   c                     g r   r   )r   rd   r  kwdss       r   r   r      s    tr   )	metaclass
__import__c                     g r   r   )rd   rz   r~   fromlistlevels        r   r   r      s    r   c                     g r   r   rv   s    r   r   r      s    4r   c                     g r   r   ry   s     r   r   r      r   r   c                     g r   r   r}   s      r   r   r      r   r   execc                      g r   r   )r(   kwss     r   r   r      r)   r   c                      g r   r   r   r   r   r   r      rB   r   c                     g r   r   rD   s    r   r   r      r1   r   c                     g r   r   rG   s      r   r   r      rK   r   c                     g r   r   )rw   r   r   flagsdont_inheritoptimizes         r   r   r      s    -1r   c                     g r   r   r   s    r   r   r      r)   r   )r   keyc                     g r   r   arg1arg2r(   s      r   r   r      rs   r   )r;  c                     g r   r   r   s    r   r   r      r)   r   c                     g r   r   r=  s      r   r   r      rs   r   c                     g r   r   )r   r   r   rI   rJ   newlineclosefdopeners           r   r   r      s    BFr   c                     g r   r   r   s    r   r   r     r)   r   )r;  reversec                     g r   r   )r%   rI   rJ   s      r   r   r     s    4r   )
breakpointbytescompilemaxminopensortedstrc                      g r   r   )r(   s    r   r   r     r   r   )sependr   flushprintc                     g r   r   )mycmps    r   r   r     r   r   c                     g r   r   r   r(   r+   s      r   r   r     rs   r   c                     g r   r   rY  s      r   r   r     rs   r   c                     g r   r   r   s     r   r   r     r   r   c                     g r   r   r   s      r   r   r     r   r   )
cmp_to_keypartialpartialmethodr   
accumulatec                     g r   r   )r   r   s     r   r   r     r   r   chainc                      g r   r   r#  s    r   r   r     r   r   combinationsc                     g r   r   r   rs     r   r   r     r{   r   combinations_with_replacementc                     g r   r   rf  s     r   r   r     r{   r   compressc                     g r   r   )data	selectorss     r   r   r     r   r   countc                     g r   r   )rr   r   s     r   r   r   !  r{   r   cyclec                     g r   r   r   s    r   r   r   #  r   r   	dropwhilec                     g r   r   	predicater   s     r   r   r   %  r   r   filterfalsec                     g r   r   r   s     r   r   r   '  r   r   groupbyc                     g r   r   )r   r;  s     r   r   r   )  s    tr   ifilterc                     g r   r   r   s     r   r   r   +  r   r   ifilterfalsec                     g r   r   r   s     r   r   r   -  r   r   imapc                     g r   r   r   s      r   r   r   /  r   r   islicec                     g r   r   )r   r   s     r   r   r   1  r=   r   c                     g r   r   )r   rr   r   s      r   r   r   2  rs   r   c                     g r   r   )r   rr   r   r   s       r   r   r   3  r   r   izipc                      g r   r   r#  s    r   r   r   5  r   r   izip_longestc                      g r   r   r#  s    r   r   r   7  r=   r   )	fillvaluepairwisec                     g r   r   r   s    r   r   r   9  r   r   permutationsc                     g r   r   rf  s     r   r   r   ;  ri   r   productc                      g r   r   r#  s    r   r   r   =  r=   r   )repeatr  c                     g r   r   )r%   timess     r   r   r   ?  r   r   starmapc                     g r   r   r   s     r   r   r   A  r   r   	takewhilec                     g r   r   rt  s     r   r   r   C  r   r   teec                     g r   r   r   s    r   r   r   E  r   r   c                     g r   r   )r   ns     r   r   r   F  r   r   zip_longestc                      g r   r   r#  s    r   r   r   H  r=   r   __abs__c                     g r   r   as    r   r   r   N  r   r   __add__c                     g r   r   r  bs     r   r   r   P  rZ   r   __and__c                     g r   r   r  s     r   r   r   R  rZ   r   
__concat__c                     g r   r   r  s     r   r   r   T  rZ   r   __contains__c                     g r   r   r  s     r   r   r   V  rZ   r   __delitem__c                     g r   r   r  s     r   r   r   X  rZ   r   __delslice__c                     g r   r   r  r  r   s      r   r   r   Z  r8   r   __div__c                     g r   r   r  s     r   r   r   \  rZ   r   __eq__c                     g r   r   r  s     r   r   r   ^  rZ   r   __floordiv__c                     g r   r   r  s     r   r   r   `  rZ   r   __ge__c                     g r   r   r  s     r   r   r   b  rZ   r   __getitem__c                     g r   r   r  s     r   r   r   d  rZ   r   __getslice__c                     g r   r   r  s      r   r   r   f  r8   r   __gt__c                     g r   r   r  s     r   r   r   h  rZ   r   __iadd__c                     g r   r   r  s     r   r   r   j  rZ   r   __iand__c                     g r   r   r  s     r   r   r   l  rZ   r   __iconcat__c                     g r   r   r  s     r   r   r   n  rZ   r   __idiv__c                     g r   r   r  s     r   r   r   p  rZ   r   __ifloordiv__c                     g r   r   r  s     r   r   r   r  rZ   r   __ilshift__c                     g r   r   r  s     r   r   r   t  rZ   r   __imatmul__c                     g r   r   r  s     r   r   r   v  rZ   r   __imod__c                     g r   r   r  s     r   r   r   x  rZ   r   __imul__c                     g r   r   r  s     r   r   r   z  rZ   r   	__index__c                     g r   r   r  s    r   r   r   |  r   r   __inv__c                     g r   r   r  s    r   r   r   ~  r   r   
__invert__c                     g r   r   r  s    r   r   r     r   r   __ior__c                     g r   r   r  s     r   r   r     rZ   r   __ipow__c                     g r   r   r  s     r   r   r     rZ   r   __irepeat__c                     g r   r   r  s     r   r   r     rZ   r   __irshift__c                     g r   r   r  s     r   r   r     rZ   r   __isub__c                     g r   r   r  s     r   r   r     rZ   r   __itruediv__c                     g r   r   r  s     r   r   r     rZ   r   __ixor__c                     g r   r   r  s     r   r   r     rZ   r   __le__c                     g r   r   r  s     r   r   r     rZ   r   
__lshift__c                     g r   r   r  s     r   r   r     rZ   r   __lt__c                     g r   r   r  s     r   r   r     rZ   r   
__matmul__c                     g r   r   r  s     r   r   r     rZ   r   __mod__c                     g r   r   r  s     r   r   r     rZ   r   __mul__c                     g r   r   r  s     r   r   r     rZ   r   __ne__c                     g r   r   r  s     r   r   r     rZ   r   __neg__c                     g r   r   r  s    r   r   r     r   r   __not__c                     g r   r   r  s    r   r   r     r   r   __or__c                     g r   r   r  s     r   r   r     rZ   r   __pos__c                     g r   r   r  s    r   r   r     r   r   __pow__c                     g r   r   r  s     r   r   r     rZ   r   
__repeat__c                     g r   r   r  s     r   r   r     rZ   r   
__rshift__c                     g r   r   r  s     r   r   r     rZ   r   __setitem__c                     g r   r   r  s      r   r   r     r8   r   __setslice__c                     g r   r   r  r  r   ds       r   r   r     r   r   __sub__c                     g r   r   r  s     r   r   r     rZ   r   __truediv__c                     g r   r   r  s     r   r   r     rZ   r   __xor__c                     g r   r   r  s     r   r   r     rZ   r   _absc                     g r   r   r   s    r   r   r     r   r   _compare_digestc                     g r   r   r  s     r   r   r     rZ   r   c                     g r   r   r  s    r   r   r     r   r   addc                     g r   r   r  s     r   r   r     rZ   r   and_c                     g r   r   r  s     r   r   r     rZ   r   
attrgetterc                     g r   r   )attrr(   s     r   r   r     r   r   concatc                     g r   r   r  s     r   r   r     rZ   r   containsc                     g r   r   r  s     r   r   r     rZ   r   countOfc                     g r   r   r  s     r   r   r     rZ   r   delitemc                     g r   r   r  s     r   r   r     rZ   r   delslicec                     g r   r   r  s      r   r   r     r8   r   divc                     g r   r   r  s     r   r   r     rZ   r   eqc                     g r   r   r  s     r   r   r     rZ   r   floordivc                     g r   r   r  s     r   r   r     rZ   r   gec                     g r   r   r  s     r   r   r     rZ   r   getitemc                     g r   r   r  s     r   r   r     rZ   r   getslicec                     g r   r   r  s      r   r   r     r8   r   gtc                     g r   r   r  s     r   r   r     rZ   r   iaddc                     g r   r   r  s     r   r   r     rZ   r   iandc                     g r   r   r  s     r   r   r     rZ   r   iconcatc                     g r   r   r  s     r   r   r     rZ   r   idivc                     g r   r   r  s     r   r   r     rZ   r   	ifloordivc                     g r   r   r  s     r   r   r     rZ   r   ilshiftc                     g r   r   r  s     r   r   r     rZ   r   imatmulc                     g r   r   r  s     r   r   r     rZ   r   imodc                     g r   r   r  s     r   r   r     rZ   r   imulc                     g r   r   r  s     r   r   r     rZ   r   indexc                     g r   r   r  s    r   r   r     r   r   indexOfc                     g r   r   r  s     r   r   r     rZ   r   invc                     g r   r   r  s    r   r   r     r   r   invertc                     g r   r   r  s    r   r   r     r   r   iorc                     g r   r   r  s     r   r   r     rZ   r   ipowc                     g r   r   r  s     r   r   r     rZ   r   irepeatc                     g r   r   r  s     r   r   r     rZ   r   irshiftc                     g r   r   r  s     r   r   r     rZ   r   is_c                     g r   r   r  s     r   r   r     rZ   r   is_notc                     g r   r   r  s     r   r   r     rZ   r   
isCallablec                     g r   r   r  s    r   r   r      r   r   isMappingTypec                     g r   r   r  s    r   r   r     r   r   isNumberTypec                     g r   r   r  s    r   r   r     r   r   isSequenceTypec                     g r   r   r  s    r   r   r     r   r   isubc                     g r   r   r  s     r   r   r     rZ   r   
itemgetterc                     g r   r   )itemr(   s     r   r   r   
  r   r   itruedivc                     g r   r   r  s     r   r   r     rZ   r   ixorc                     g r   r   r  s     r   r   r     rZ   r   lec                     g r   r   r  s     r   r   r     rZ   r   length_hintc                     g r   r   r/   s    r   r   r     r1   r   c                     g r   r   )r0   r   s     r   r   r     r)   r   lshiftc                     g r   r   r  s     r   r   r     rZ   r   ltc                     g r   r   r  s     r   r   r     rZ   r   matmulc                     g r   r   r  s     r   r   r     rZ   r   methodcallerc                     g r   r   )rd   r(   r+   s      r   r   r     rs   r   modc                     g r   r   r  s     r   r   r     rZ   r   mulc                     g r   r   r  s     r   r   r     rZ   r   nec                     g r   r   r  s     r   r   r   !  rZ   r   negc                     g r   r   r  s    r   r   r   #  r   r   not_c                     g r   r   r  s    r   r   r   %  r   r   or_c                     g r   r   r  s     r   r   r   '  rZ   r   posc                     g r   r   r  s    r   r   r   )  r   r   c                     g r   r   r  s     r   r   r   +  rZ   r   c                     g r   r   r  s     r   r   r   -  rZ   r   rshiftc                     g r   r   r  s     r   r   r   /  rZ   r   sequenceIncludesc                     g r   r   r  s     r   r   r   1  rZ   r   setitemc                     g r   r   r  s      r   r   r   3  r8   r   setslicec                     g r   r   r  s       r   r   r   5  r   r   subc                     g r   r   r  s     r   r   r   7  rZ   r   truedivc                     g r   r   r  s     r   r   r   9  rZ   r   truthc                     g r   r   r  s    r   r   r   ;  r   r   xorc                     g r   r   r  s     r   r   r   =  rZ   r   c                      g r   r   )r(   r+   s     r   r   r   B  r   r   c                     g r   r   )excr   handlers      r   r   r   D  r   r   c                     g r   r   )r   r  r  s      r   r   r   F  s    dr   c                      g r   r   funcss    r   r   r   H  r   r   c                     g r   r   )r   cacher;  s      r   r   r   J  s    Dr   )curryexceptsflipjuxtmemoizetoolzc                     g r   r   r  s    r   r   r   O  r   r   c                     g r   r   )r   r   r   r   classvals        r   r   r   Q  s    r   )ComposeInstancePropertyztoolz.functoolzc                 V    [        S U R                  R                  5        5       5      $ )z?Return the number of positional arguments.  ``f(x, y=1)`` has 1c              3      #    U  H>  nUR                   UR                  :X  d  M  UR                  UR                  L d  M:  S v   M@     g7f)r   N)kindPOSITIONAL_OR_KEYWORDr   empty.0r   s     r   	<genexpr>num_pos_args.<locals>.<genexpr>X  s@      )5Q&&A333 99' q5s   AA	A)r  
parametersvalues)sigspecs    r   num_pos_argsr  V  s*     )',,335 ) ) )r   c                     U S:X  a  g[        S UR                  R                  5        5       5      nU(       d  g[        UR                  R                  5       5      SU  n[	        S U 5       5      $ )z@Return the names of position-only arguments if func has **kwargsr   r   c              3   T   #    U  H  nUR                   UR                  :H  v   M      g 7fr   )r  VAR_KEYWORDr  s     r   r  'get_exclude_keywords.<locals>.<genexpr>a  s$      ;9 VVq}},9s   &(Nc              3   8   #    U  H  oR                   v   M     g 7fr   )rd   r  s     r   r  r  f  s     *A   )r    r  r  r   r  )num_pos_onlyr  
has_kwargspos_argss       r   get_exclude_keywordsr  ]  sj    q ;%00779; ;JG&&--/0,?H****r   c                 \     [         R                  " U 5      $ ! [        [        4 a     g f = fr   )inspect	signature
ValueError	TypeError)r   s    r   signature_or_specr  i  s/      &&	" s    ++c                    [        U [        5      (       aA  [        U 5      S:X  a   U u  pn[        U S   [        5      (       d   eOU u  pSn[        U5      nOU n[        U5      n[	        U5      nSn[        X5      nXX5-   U4$ )a  Convert the signature spec in ``module_info`` to add to ``signatures``

The input signature spec is one of:
    - ``lambda_func``
    - ``(num_position_args, lambda_func)``
    - ``(num_position_args, lambda_func, keyword_only_args)``

The output signature spec is:
    ``(num_position_args, lambda_func, keyword_exclude, sigspec)``

where ``keyword_exclude`` includes keyword only arguments and, if variadic
keywords is present, the names of position-only argument.  The latter is
included to support builtins such as ``partial(func, *args, **kwargs)``,
which allows ``func=`` to be used as a keyword even though it's the name
of a positional argument.
   r   )r   r  r   r  r  r  )sigr  r   keyword_onlyr  keyword_excludes         r   
expand_sigr  p  s    " #us8q=/2,Lc"gu----!$LL#D)#D)#G,*<AO|=wFFr   c                 
   U R                  5        Ho  u  p#[        U[        5      (       a  [        U5      nUR                  5        H6  u  pE[	        X$5      (       d  M  [        S U 5       5      nXa[        X$5      '   M8     Mq     g )Nc              3   8   #    U  H  n[        U5      v   M     g 7fr   )r  )r  r  s     r   r  ,create_signature_registry.<locals>.<genexpr>  s      ADSCDr  )itemsr   rP  r   r   r  r   )module_info
signaturesr   inford   sigsnew_sigss          r   create_signature_registryr    sh    #))+fc"""6*F**,JDv$$  AD AA4<7601 ' ,r   c                     U u  p4pV[        U5      U:  a  gU(       a&  [        U5      nU H  nUR                  US5        M      U" U0 UD6  g! [         a     gf = f)z3Like ``is_valid_args`` for the given signature specFNT)r   re   popr  )r  r(   r+   r  r   r  r  ra  s           r   check_validr    sf    360L
4y<f#DJJtT" $df s   A 
AAc                 Z   ^^ U [         ;  a  g[         U    n[        UU4S jU 5       5      $ )zBLike ``is_valid_args`` for builtins in our ``signatures`` registryNc              3   >   >#    U  H  n[        UTT5      v   M     g 7fr   )r  r  r  r(   r+   s     r   r  !_is_valid_args.<locals>.<genexpr>  s     >#{3f--   r  r    r   r(   r+   r  s    `` r   _is_valid_argsr    s)    :dD>>>>r   c                     U u  p4pV[        U5      U:  a  SU[        U5      -
  -  nX-   nU(       a&  [        U5      nU H  nUR                  US5        M     [        XAX&5      $ )z5Like ``is_partial_args`` for the given signature specr   N)r   re   r  r   )	r  r(   r+   r  r   r  r  padra  s	            r   check_partialr    sc    360L
4y<D	12zf#DJJtT" $4v77r   c                 Z   ^^ U [         ;  a  g[         U    n[        UU4S jU 5       5      $ )zDLike ``is_partial_args`` for builtins in our ``signatures`` registryNc              3   >   >#    U  H  n[        UTT5      v   M     g 7fr   )r  r  s     r   r  #_is_partial_args.<locals>.<genexpr>  s     @4C}S$//4r  r  r  s    `` r   _is_partial_argsr    s)    :dD@4@@@r   c                 >    Uu  p#pEU(       d  X :  a  g[        XU5      $ )NF)r   )r  r  r  r   r  r  s         r   check_arityr    s$    360L,*AW%%r   c                     U[         ;  a  g [         U   nU Vs/ s H  n[        X5      PM     nn[        U5      (       a  g[        U5      (       a  g gs  snf NTF)r  r  r   r    )r  r   r  r  checkss        r   	_is_arityr    sP    :dD-12Tck!!TF2
6{{	V 3   Ac                 "    U u  pp4[        X$5      $ r   )r   r  r  r   r  r  s        r   check_varargsr    s    360Lt%%r   c                     U [         ;  a  g [         U    nU Vs/ s H  n[        U5      PM     nn[        U5      (       a  g[        U5      (       a  g gs  snf r  )r  r  r   r    r   r  r  r  s       r   _has_varargsr    sP    :dD,01DSmC DF1
6{{	V 2r  c                 2    U u  pp4U(       a  g[        X$5      $ )NT)r   r  s        r   check_keywordsr    s    360L&&r   c                     U [         ;  a  g [         U    nU Vs/ s H  n[        U5      PM     nn[        U5      (       a  g[        U5      (       a  g gs  snf r  )r  r  r   r    r  s       r   _has_keywordsr    sP    :dD-12TcnS!TF2
6{{	V 3r  c                 "    U u  pp4[        X$5      $ r   )r	   r  s        r   check_required_argsr    s    360LT++r   c                    ^ U [         ;  a  g [         U    nU Vs/ s H  n[        U5      PM     nnUS   m[        U4S jU 5       5      (       a  T$ g s  snf )Nr   c              3   ,   >#    U  H	  oT:H  v   M     g 7fr   r   )r  r   vals     r   r  %_num_required_args.<locals>.<genexpr>  s     
"T8Ts   )r  r  r   )r   r  r  valsr  s       @r   _num_required_argsr     sY    :dD045$D5
q'C

"T
"""
	 6s   Ar   )F)utf8strict)r   r   )r   )rg  r  )g        )
   )NNNN) r  r  )r   Fr  )rg  r  NNNTN)r  utfr  r   )r   r   )NNN)NNNNN)#__doc__	functoolsr  	itertoolsoperator	importlibr   	functoolzr   r   r   r   r	   builtinsr  re   updater  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   <module>r     sz       #9 9 "  |	| 		| 	')| 		| 	!)+| 	|" 		!|& 	
%|* 	#)+)|2 	=?1|: 	9|> 		=|B 	A|F 		E|J 	I|N 	$%M|R 	 Q|V 	&
(U|\ 		[|b 	a|f 
*+-e|j 	$,
.i|r 	&.0q|z 
56
8y|~ 	()}|B 	A|F 	')E|L 	K|R 	"*,Q|X 	W|\ 	 [|` 	
_|d 		c|h 	g|l 	k|r 		
#$	&q|x 	w|| 	)*{|@ 	)*|D 	'
)C|J 		I|N 	
M|T 	S|X 		
#$
&W|^ 	0	1]|b 
 "a|f 	&
(e|l 	k|p 		o|t 		s|x 		w|~ 	?@}|B 	 &(A|J 	I|P 	(02O|V 	U|Z 	
Y|^ 	]|b 
*+-a|f 		e|l 	&'k|p 	 &(o|x 	w|| 	$	&{|B 	 A|H 	G|N 	&
(M|T 	S|X 	@BW|^ 	
]|d 	 &(c|l 	 	!k|p 
3^DFo|t 
 	s|H |  (!*H f 
 H   !# 	=?
 
)+2 	34 
!#67	
*H5	7 
!#67	
*H5	7 
<@G 	H
I 
!#568 	@	A+  2 <="?H g  	
! 	+, 	+, 	(02
I   4	
,-/4 	 !4 
$%'4 
$%#'4 
()+4 	%&4 	4  	)*4$ 	()#4( 
+,.'4, 	()+40 	()/44 	0
1348 	$*0274@ 	 
!?4D 
#^46C4H 	G4L 
&')K4P 
#[13O4T 
()+S4X 	()W4\ 	)*[4` 	 	"_4f 
#^46e4I n  rr 	r 	r 	r 	r 	r 	r  	r$ 	#r( 	'r, 	+r0 	/r4 	3r8 	7r< 	;r@ 	?rD 	CrH 	GrL 	KrP 	OrT 	SrX 	Wr\ 	[r` 	_rd 	crh 	grl 	krp 	ort 	srx 	wr| 	{r@ 	rD 	CrH 	GrL 	KrP 	OrT 	SrX 	Wr\ 	[r` 	_rd 	crh 	grl 	krp 	ort 	srx 	wr| 	{r@ 	rD 	 !CrH 	GrL 	KrP 	OrT 	
SrX 	Wr\ 		[r` 		_rd 	
crh 	!"grl 	krp 	ort 	srx 	wr| 	{r@ 		rD 	CrH 	GrL 	KrP 	OrT 	SrX 	Wr\ 	
[r` 	
_rd 	crh 	
grl 	krp 	ort 	srx 	
wr| 	
{r@ 	rD 	CrH 		GrL 	KrP 		OrT 	
SrX 	Wr\ 	[r` 		_rd 	crh 	grl 	krp 	ort 	srx 	
wr| 	!"{r@ 	rD 	
CrH 	GrL 	!#KrR 	QrV 	UrZ 	Yr^ 	+,]rb 		arf 		erj 	irn 		mrr 	
qrv 		urz 		yr~ 		}rB 	ArF 	ErJ 	IrN 	MrR 	 !QrV 		UrZ 	Yr^ 	]rb 		arH h 	
()+ 
013 
23
5 
 
" 
89;G  "&	
! 
  	!"" )	+GD 
 +6* = ?
8A&	&
	'	,
r   