1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
U
®ý°du
ã@sˆddlmZddlZddlZddlZddlZddlmZddlZej    ddddœdd„ƒZ
d    d
œd d „Z ej    ddd ddddœdd„ƒZ dS)é)Ú annotationsN)Ú    GeneratorÚstrzGenerator[(None, None, None)])Úold_nameÚnew_nameÚreturnc
cs‚z
dVWnrtk
r|}zT|js$‚t|jdƒ}| ||¡}|f}t|jƒdkrd||jdd…}||_‚W5d}~XYnXdS)z.
    Rewrite the message of an exception.
    Nré)Ú    ExceptionÚargsrÚreplaceÚlen)rrÚerrÚmsgr
©rúNd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/util/_exceptions.pyÚrewrite_exception s
 rÚint)rcCsjddl}tj |j¡}tj |d¡}t ¡}d}|rft |¡}|     |¡rf|     |¡sf|j
}|d7}q0qfq0|S)zb
    Find the first place in the stack that is not inside pandas
    (tests notwithstanding).
    rNÚtestsr) ZpandasÚosÚpathÚdirnameÚ__file__ÚjoinÚinspectÚ currentframeÚgetfileÚ
startswithÚf_back)ÚpdZpkg_dirZtest_dirÚframeÚnÚfnamerrrÚfind_stack_levels
 
r"z type[Warning]ztype[Warning] | None)Útarget_messageÚtarget_categoryÚ new_messageÚ new_categoryrc        cs˜|dkr |}tjdd }dVW5QRXt|ƒdkr”t |¡}|D]N}|j|krnt |t|jƒ¡rn|}|}n|j|j}}tj    |||j
|j dqDdS)a€
    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ÚcategoryÚfilenameÚlineno) ÚwarningsÚcatch_warningsr ÚreÚcompiler)Úsearchrr(Ú warn_explicitr*r+)    r#r$r%r&r'ÚmatchÚwarningr)r(rrrÚrewrite_warning6s( 
ÿür4)N) Ú
__future__rÚ
contextlibrrr.Útypingrr,Úcontextmanagerrr"r4rrrrÚ<module>s  ü