
    Mh<                        S SK J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r\(       a  S SK	J
r
  S SKJr  \R                  S	S j5       rS
S jr\R                   S         SS jj5       rg)    )annotationsN)TYPE_CHECKING)	Generator)	FrameTypec              #    #     Sv   g! [          at  nUR                  (       d  e [        UR                  S   5      nUR                  X5      nU4n[	        UR                  5      S:  a  XBR                  SS -   nXBl        e SnAff = f7f)z&
Rewrite the message of an exception.
Nr      )	Exceptionargsstrreplacelen)old_namenew_nameerrmsgr
   s        I/var/www/html/env/lib/python3.13/site-packages/pandas/util/_exceptions.pyrewrite_exceptionr      sw     
 	xx#((1+kk(-!$sxx=1((12,&D	s%   B
	 B

BA/BBB
c                    SSK n [        R                  R                  U R                  5      n[        R                  R                  US5      n[        R                  " 5       n SnU(       a^  [        R                  " U5      nUR                  U5      (       a(  UR                  U5      (       d  UR                  nUS-  nOO	U(       a  M^  AU$ ! Af = f)zV
Find the first place in the stack that is not inside pandas
(tests notwithstanding).
r   Ntestsr   )pandasospathdirname__file__joininspectcurrentframegetfile
startswithf_back)pdpkg_dirtest_dirframenfilenames         r   find_stack_levelr'   "   s     ggoobkk*Gww||GW-H &224Eu-H""7++H4G4G4Q4QQ e H s   $A%C Cc              #    #    Uc  Un[         R                  " SS9 nSv   SSS5        [        W5      S:  a  [        R                  " U 5      nU H  nUR
                  UL a4  [        R                  " U[        UR                  5      5      (       a  UnUnOUR
                  UR                  p[         R                  " UUUR                  UR                  S9  M     gg! , (       d  f       N= f7f)aP  
Rewrite the message of a warning.

Parameters
----------
target_message : str
    Warning message to match.
target_category : Warning
    Warning type to match.
new_message : str
    New warning message to emit.
new_category : Warning or None, default None
    New warning type to emit. When None, will be the same as target_category.
NT)recordr   )messagecategoryr&   lineno)warningscatch_warningsr   recompiler+   searchr   r*   warn_explicitr&   r,   )	target_messagetarget_categorynew_messagenew_categoryr)   matchwarningr+   r*   s	            r   rewrite_warningr9   ?   s     * &		 	 	- 
.
6{Q

>*G?2ryys7??+8 8 ()4$+$4$4goo'""! ))~~	   
.	-s   C/CB=C/
C,(C/)r   r   r   r   returnGenerator[None, None, None])r:   int)N)
r3   r   r4   ztype[Warning]r5   r   r6   ztype[Warning] | Noner:   r;   )
__future__r   
contextlibr   r   r/   typingr   r-   collections.abcr   typesr   contextmanagerr   r'   r9        r   <module>rE      s    "   	 	   )  $: 
 *.	''"' ' '	'
 !' 'rD   