o
    hh                     @  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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)aardvark)
reescapelennpzerospytestraises
ValueErrorr   check_shape)r   r   r   error_patterndata r(   m/var/www/html/construction_image-detection-poc/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   
deprecatedclasspropertyr-   r(   r(   r(   r)   A(   s    r3   )r"   warnsmplMatplotlibDeprecationWarningr-   )r3   ar(   r(   r)   test_classproperty_deprecation'   s   "r8   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)r:   obj_typezWfoo was deprecated in Matplotlib 3\.10 and will be removed in 3\.12\. Use bar instead\.bar)r:   alternativezXfoo was deprecated in Matplotlib 3\.10 and will be removed in 3\.12\. More information\.zMore information.)r:   addendumzDfoo was deprecated in Matplotlib 3\.10 and will be removed in 4\.0\.z4.0)r:   removalz(foo was deprecated in Matplotlib 3\.10\.Fz*foo will be deprecated in a future versionT)r:   pendingzcannot have a scheduled removalz3.12)r:   rA   r@   zComplete replacement)messager:   r>   r?   r<   r@   )	r"   r4   r5   r6   r   warn_deprecatedPendingDeprecationWarningr#   r$   r(   r(   r(   r)   test_warn_deprecated4   sX   
$rE   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
   )_attr)selfr(   r(   r)   __init__Y   s   
 z6test_deprecate_privatize_attribute.<locals>.C.__init__argr   c                 S  s   |S r	   r(   )rG   rI   r(   r(   r)   _methZ   s    z3test_deprecate_privatize_attribute.<locals>.C._methz0.0intattrr   methNr   r   )rI   r   r   r   )
r.   r/   r0   rH   rJ   r   deprecate_privatize_attributerL   __annotations__rM   r(   r(   r(   r)   CX   s
   
 

rQ   r
   r   *   )r"   r4   r5   r6   rL   rM   )rQ   cr(   r(   r)   "test_deprecate_privatize_attributeW   s   "rT   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.0r9   r   r   r   c                 S  r,   r	   r(   r9   r(   r(   r)   func1j      z$test_delete_parameter.<locals>.func1kwargsc                  [  r,   r	   r(   )rY   r(   r(   r)   func2n   rX   z$test_delete_parameter.<locals>.func2r=   rV   c                   s    |  d S r	   r(   rV   rW   r(   r)   pyplot_wrapperw   s   z-test_delete_parameter.<locals>.pyplot_wrapperr	   )r9   r   r   r   )rY   r   r   r   )r   delete_parameterr"   r4   r5   r6   deprecation_deprecated_parameter)rZ   funcr\   r(   r[   r)   test_delete_parameteri   s   

"ra   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 )NrU   rI   prer   postr   r   c                 S  r,   r	   r(   )rb   rI   rc   r(   r(   r)   r`      rX   z$test_make_keyword_only.<locals>.funcr
   r   )rI   r   r	   )rb   r   rI   r   rc   r   r   r   )r   make_keyword_onlyr"   r4   r5   r6   )r`   r(   r(   r)   test_make_keyword_only   s   
"re   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)r>   r   r   c                   S  r,   r	   r(   r(   r(   r(   r)   r-      rX   z'test_deprecation_alternative.<locals>.fzDocumentation is disabledrN   )r   r1   __doc__r"   skip)r>   r-   r(   r(   r)   test_deprecation_alternative   s   

ri   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   r7   )r"   r#   	TypeErrorr   check_in_listr(   r(   r(   r)   test_empty_check_in_list   s   "rl   )r   r   r   r   r   r   r   r   rN   )
__future__r   collections.abcr   r   typingr   r   numpyr    r"   
matplotlibr5   r   TYPE_CHECKINGtyping_extensionsr   r   markparametrizer*   r8   rE   rT   ra   re   ri   rl   r(   r(   r(   r)   <module>   s.    

#



