o
    j                     @  s   d dl mZ d dlmZ d dlZd dlZd dlmZmZ d dlZ	d dl
Z
d dlZd dlmZ ejr7d dlmZ edZe
jdg d	d$ddZd%ddZdd Zd%ddZd%ddZd%ddZd%ddZd%d d!Zd%d"d#ZdS )&    )annotations)CallableN)AnyTypeVar)_api)SelfTztarget,shape_repr,test_shape))Nz(N,))      )Nr   (N, 3))r
   )r   r   )r
      ))r
      z(1, 5))r
   	   ))Nr   Nz	(M, 2, N))r
   r   r
   targettuple[int | None, ...]
shape_reprstr
test_shapetuple[int, ...]returnNonec              	   C  sp   dt dt|  d| d|  }t|}tjt|d tj	| |d W d    d S 1 s1w   Y  d S )N^z'aardvark' must be zD with shape z, but your input has shape match)Zaardvark)
reescapelennpZzerospytestraises
ValueErrorr   Zcheck_shape)r   r   r   Zerror_patterndata r$   Z/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/matplotlib/tests/test_api.pytest_check_shape   s   

"r&   c                  C  s~   G dd d} t tj | j W d    n1 sw   Y  t tj |  }|j W d    d S 1 s8w   Y  d S )Nc                   @  s&   e Zd Zedejd	ddZdS )
z)test_classproperty_deprecation.<locals>.Az0.0.0clsr   r   r   c                 S     d S r	   r$   )r'   r$   r$   r%   f)   s   z+test_classproperty_deprecation.<locals>.A.fN)r'   r   r   r   )__name__
__module____qualname__r   
deprecatedZclasspropertyr)   r$   r$   r$   r%   A(   s    r.   )r    warnsmplMatplotlibDeprecationWarningr)   )r.   ar$   r$   r%   test_classproperty_deprecation'   s   "r3   c                
   C  sL  t jtjdd tjddd W d    n1 sw   Y  t jtjdd tjdddd W d    n1 s:w   Y  t jtjd	d tjddd
d W d    n1 sZw   Y  t jtjdd tjdddd W d    n1 szw   Y  t jtjdd tjdddd W d    n1 sw   Y  t jtjdd tjdddd W d    n1 sw   Y  t jtdd tjdddd W d    n1 sw   Y  t jtdd tjddddd W d    n1 sw   Y  t jtjdd tjdddd
dddd W d    d S 1 sw   Y  d S )NzEfoo was deprecated in Matplotlib 3\.10 and will be removed in 3\.12\.r   z3.10foo)namezOThe foo class was deprecated in Matplotlib 3\.10 and will be removed in 3\.12\.class)r5   obj_typezWfoo was deprecated in Matplotlib 3\.10 and will be removed in 3\.12\. Use bar instead\.bar)r5   alternativezXfoo was deprecated in Matplotlib 3\.10 and will be removed in 3\.12\. More information\.zMore information.)r5   addendumzDfoo was deprecated in Matplotlib 3\.10 and will be removed in 4\.0\.z4.0)r5   removalz(foo was deprecated in Matplotlib 3\.10\.Fz*foo will be deprecated in a future versionT)r5   pendingzcannot have a scheduled removalz3.12)r5   r<   r;   zComplete replacement)messager5   r9   r:   r7   r;   )	r    r/   r0   r1   r   Zwarn_deprecatedPendingDeprecationWarningr!   r"   r$   r$   r$   r%   test_warn_deprecated4   sX   
$r?   c                  C  s   G dd d} |  }t tj |jdksJ W d    n1 s"w   Y  t tj d|_W d    n1 s;w   Y  t tj |jdksNJ W d    n1 sXw   Y  t tj |ddksmJ W d    d S 1 sxw   Y  d S )Nc                   @  sF   e Zd ZU dddZdddZed	Zd
ed< ed	Z	ded< dS )z-test_deprecate_privatize_attribute.<locals>.Cr   r   c                 S  s
   d| _ d S )Nr
   )Z_attr)selfr$   r$   r%   __init__Y   s   
 z6test_deprecate_privatize_attribute.<locals>.C.__init__argr   c                 S  s   |S r	   r$   )r@   rB   r$   r$   r%   _methZ   s    z3test_deprecate_privatize_attribute.<locals>.C._methz0.0intattrr   methNr   r   )rB   r   r   r   )
r*   r+   r,   rA   rC   r   Zdeprecate_privatize_attributerE   __annotations__rF   r$   r$   r$   r%   CX   s
   
 

rI   r
   r   *   )r    r/   r0   r1   rE   rF   )rI   cr$   r$   r%   "test_deprecate_privatize_attributeW   s   "rL   c               	     s   t dddddd t dddd	d
}  | fD ] }|  ttj |dd W d    n1 s6w   Y  qt jjfd fdd}|  ttj |dd W d    d S 1 saw   Y  d S )N3.0r4   r   r   r   c                 S  r(   r	   r$   r4   r$   r$   r%   func1j      z$test_delete_parameter.<locals>.func1kwargsc                  [  r(   r	   r$   )rQ   r$   r$   r%   func2n   rP   z$test_delete_parameter.<locals>.func2r8   rN   c                   s    |  d S r	   r$   rN   rO   r$   r%   pyplot_wrapperw   s   z-test_delete_parameter.<locals>.pyplot_wrapperr	   )r4   r   r   r   )rQ   r   r   r   )r   Zdelete_parameterr    r/   r0   r1   deprecationZ_deprecated_parameter)rR   funcrT   r$   rS   r%   test_delete_parameteri   s   

"rW   c                  C  s   t dddddd	} | d
dd ttj | d
d W d    n1 s(w   Y  ttj | d
dd W d    d S 1 sEw   Y  d S )NrM   rB   prer   postr   r   c                 S  r(   r	   r$   )rX   rB   rY   r$   r$   r%   rV      rP   z$test_make_keyword_only.<locals>.funcr
   r   )rB   r   r	   )rX   r   rB   r   rY   r   r   r   )r   Zmake_keyword_onlyr    r/   r0   r1   )rV   r$   r$   r%   test_make_keyword_only   s   
"rZ   c                  C  sB   d} t jd| dd	dd}|jd u rtd | |jv sJ d S )
Nz)`.f1`, `f2`, `f3(x) <.f3>` or `f4(x)<f4>`1)r9   r   r   c                   S  r(   r	   r$   r$   r$   r$   r%   r)      rP   z'test_deprecation_alternative.<locals>.fzDocumentation is disabledrG   )r   r-   __doc__r    skip)r9   r)   r$   r$   r%   test_deprecation_alternative   s   

r^   c                   C  s@   t jtdd tdg W d    d S 1 sw   Y  d S )NzNo argument to check!r   r2   )r    r!   	TypeErrorr   check_in_listr$   r$   r$   r%   test_empty_check_in_list   s   "ra   c                   C  sL   t jtdd tjddgtdd W d    d S 1 sw   Y  d S )Nzarray\(5\) is not a valid valuer   r2   br   )value)r    r!   r"   r   r`   r   arrayr$   r$   r$   r%   test_check_in_list_numpy   s   "re   )r   r   r   r   r   r   r   r   rG   )
__future__r   collections.abcr   r   typingr   r   numpyr   r    Z
matplotlibr0   r   TYPE_CHECKINGZtyping_extensionsr   r   markZparametrizer&   r3   r?   rL   rW   rZ   r^   ra   re   r$   r$   r$   r%   <module>   s0    

#




