
    _j
                        S SK Jr  S SKrS SKrS SKJrJr  SS jr\" 5       S.       S	S jjr	\" 5       S.       S
S jjr
g)    )annotationsN)AnyCallablec                J    [         R                  " U 5      nXR                  ;   $ )zBReturns whether or not the given function has a specific parameter)inspect	signature
parameters)funcarg_namesigs      Q/home/rurouni/.local/lib/python3.13/site-packages/anthropic/_utils/_reflection.pyfunction_has_argumentr      s    


D
!C~~%%    )exclude_paramsc               >   [         R                  " U5      n[         R                  " U 5      n/ nUR                  R                  5        H  u  pgXb;   a  M  UR                  R	                  U5      nU(       d  UR                  SU S35        ME  UR                  UR                  :w  d  Ma  UR                  SU S[        UR                  5       S[        UR                  5       35        M     U(       a)  [        [        U5       S3SR                  U5      -   5      eg)	zCEnsure that the signature of the second function matches the first.zthe `` param is missingztypes for the `z!` param are do not match; source=z
 checking=z0 errors encountered when comparing signatures:



N)r   r   r	   itemsgetappend
annotationreprAssertionErrorlenjoin)	source_func
check_funcr   	check_sig
source_sigerrorsnamesource_paramcustom_params	            r   assert_signatures_in_syncr$      s!    !!*-I"";/JF(3399;! ++//5MME$'9:;""l&=&==MM!$'HlNeNeIfHggqrv  xD  xO  xO  sP  rQ  R  < F},^_bhbmbmntbuuvv r   c                  [         R                  " U 5      n[        R                  " U5      nU(       d  [	        SU< 35      e/ n[        U5       H  u  pg[         R                  " U5      nUR                  R                  5        H  u  pX;   a  M  UR                  R                  U	5      nU(       d  UR                  SU SU	 S35        MH  UR                  U
R                  :w  d  Md  UR                  SU SU	 S[        U
R                  5       S[        UR                  5       35        M     M     U(       a)  [	        [        U5       S3S	R                  U5      -   5      eg
)zTEnsure that every @overload of overloaded_func contains all params from source_func.z#No @overload definitions found for z	overload z: `r   z: types for `z` do not match; source=z
 overload=z9 errors encountered when comparing overload signatures:

r   N)r   r   typing_extensionsget_overloadsr   	enumerater	   r   r   r   r   r   r   r   )r   overloaded_funcr   r   	overloadsr    ioverload_fnoverload_sigr!   r"   overload_params               r   assert_overloads_in_syncr/   .   sg    "";/J!//@IB?BUVWWF#I.((5","7"7"="="?D%)4488>N!	!Cv5GHI((L,C,CCs-v5LTR^RiRiMjLkkuvz  |J  |U  |U  wV  vW  X #@ /  6{mVWZ`ZeZeflZmm
 	
 r   )r
   Callable[..., Any]r   strreturnbool)r   r0   r   r0   r   set[str]r2   None)r   r0   r)   r0   r   r4   r2   r5   )
__future__r   r   r&   typingr   r   r   setr$   r/    r   r   <module>r:      s|    "    &  #u	w#w"w 	w
 
wH  #u	"
#"
'"
 	"

 
"
r   