ó
    „ñ:i¯  ã                   óŽ   • S SK r S SKrS SKrS SKrS SKJr  S SKJr  S SKJ	r	   " S S\5      r
\S:X  a  \ R                  " 5         gg)é    N©Únjit)ÚTestCase)Úget_func_body_first_linenoc                   ó~   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rSrg)ÚTestFirstLineFinderé   zv
The following methods contains tests that are sensitive to the source
locations w.r.t. the beginning of each method.
c                 óŠ   • [         R                  " 5       n[         R                  " U5      nUS   R                  R                  $ )Né   )ÚinspectÚcurrentframeÚgetouterframesÚframeÚf_code)Úselfr   Úcaller_frames      Úc/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/numba/tests/test_firstlinefinder.pyÚ_get_grandparent_caller_codeÚ0TestFirstLineFinder._get_grandparent_caller_code   s6   € Ü×$Ò$Ó&ˆÜ×-Ò-¨eÓ4ˆØ˜A‰×$Ñ$×+Ñ+Ð+ó    c                 ód   • U R                  5       nUR                  nU R                  XU-   5        g ©N)r   Úco_firstlinenoÚassertEqual)r   ÚexpectedÚoffset_from_callerÚgrandparent_coÚlnos        r   Úassert_line_locationÚ(TestFirstLineFinder.assert_line_location   s/   € Ø×:Ñ:Ó<ˆØ×+Ñ+ˆØ×Ñ˜Ð);Ñ#;Õ<r   c                 óV   • [         S 5       n[        U5      nU R                  US5        g )Nc                  ó   • g©Né   © r%   r   r   ÚfooÚBTestFirstLineFinder.test_decorated_odd_comment_indent.<locals>.foo   s   € ð r   é   ©r   r   r   ©r   r&   Úfirst_def_lines      r   Ú!test_decorated_odd_comment_indentÚ5TestFirstLineFinder.test_decorated_odd_comment_indent   s0   € Ü	ñ	ó 
ð	ô 4°CÓ8ˆØ×!Ñ! .°!Õ4r   c                 óV   • S n[        [        U5      5      nU R                  US5        g )Nc                  ó   • gr#   r%   r%   r   r   r&   ÚDTestFirstLineFinder.test_undecorated_odd_comment_indent.<locals>.foo%   s   € àr   é   )r   r   r   r*   s      r   Ú#test_undecorated_odd_comment_indentÚ7TestFirstLineFinder.test_undecorated_odd_comment_indent$   s'   € ò	ô 4´D¸³IÓ>ˆØ×!Ñ! .°!Õ4r   c                 óT   • S n[        [        U5      5      nU R                  U5        g )Nc                  ó   • gr#   r%   r%   r   r   Ú<lambda>Ú9TestFirstLineFinder.test_unnamed_lambda.<locals>.<lambda>-   s   € �ar   )r   r   ÚassertIsNoner*   s      r   Útest_unnamed_lambdaÚ'TestFirstLineFinder.test_unnamed_lambda,   s#   € ÙˆÜ3´D¸³IÓ>ˆà×Ñ˜.Õ)r   c                 óR   • S nU" 5       n[        U5      nU R                  US5        g )Nc                  ó   • [         S 5       n U $ )Nc                  ó   • gr#   r%   r%   r   r   r&   ÚBTestFirstLineFinder.test_nested_function.<locals>.foo.<locals>.foo4   s   € ð r   r   )r&   s    r   r&   Ú5TestFirstLineFinder.test_nested_function.<locals>.foo3   s   € Üñó ðð ˆJr   é   )r   r   )r   r&   Úinnerr+   s       r   Útest_nested_functionÚ(TestFirstLineFinder.test_nested_function2   s*   € ò	ñ “ˆÜ3°EÓ:ˆØ×!Ñ! .°!Õ4r   c                 óV   • [         S 5       n[        U5      nU R                  US5        g )Nc                  ó   • g r   r%   r%   r   r   r&   Ú4TestFirstLineFinder.test_pass_statement.<locals>.foo@   s   € àr   r1   r)   r*   s      r   Útest_pass_statementÚ'TestFirstLineFinder.test_pass_statement?   s0   € Ü	ñ	ó 
ð	ô 4°CÓ8ˆØ×!Ñ! .°!Õ4r   c                 ód   • Sn0 n[        X5        US   n[        U5      nU R                  U5        g )Nú$def foo():
            pass
        r&   )Úexecr   r8   )r   ÚsourceÚglobalnsr&   r+   s        r   Útest_string_evalÚ$TestFirstLineFinder.test_string_evalG   s9   € ðˆð ˆÜˆVÔØ�u‰oˆä3°CÓ8ˆà×Ñ˜.Õ)r   c                 óÚ   • S n[        U5      XRR                  S5      U4nU[        R                  U'   [	        X!S5      n0 n[        Xx5        Xƒ   n	[        U	5      n
U R                  X¤5        g )NTrK   )ÚlenÚ
splitlinesÚ	linecacheÚcacheÚcompilerK   r   r   )r   ÚfilenamerL   Úfunction_nameÚexpected_first_lineÚ	timestampÚentryÚcoderM   Úfunctionr+   s              r   Ú_test_with_patched_linecacheÚ0TestFirstLineFinder._test_with_patched_linecacheT   so   € ð
 ˆ	Ü�V“˜i×):Ñ):¸4Ó)@À(ÐKˆØ$)Œ	�‰˜Ñ!ô �v¨Ó0ˆàˆÜˆTÔØÑ*ˆô 4°HÓ=ˆØ×Ñ˜Õ=r   c                 ó:   • SnSnSnSnU R                  X!UU5        g )NrJ   z<foo-basic>r&   r   ©r]   ©r   rL   rV   rW   rX   s        r   Ú test_string_eval_linecache_basicÚ4TestFirstLineFinder.test_string_eval_linecache_basicj   s0   € ðˆð !ˆØˆØÐØ×)Ñ)¨(¸MØ*=õ	?r   c                 ó:   • SnSnSnSnU R                  X!UU5        g )Nz„if True:
        # indent designed to test against potential indent error in ast.parse

        def foo():
            pass
        z<foo-indent>r&   r@   r`   ra   s        r   Ú!test_string_eval_linecache_indentÚ5TestFirstLineFinder.test_string_eval_linecache_indentu   s0   € ðˆð "ˆØˆØÐØ×)Ñ)¨(¸MØ*=õ	?r   c                 ób   • [         R                  " S5      nSnSnSnU R                  X!UU5        g )Nz†
        def foo_gen():
            def foo():
                pass
            return foo

        generated_foo = foo_gen()
        z	<foo-gen>Úgenerated_foor(   ©ÚtextwrapÚdedentr]   ra   s        r   Ú"test_string_eval_linecache_closureÚ6TestFirstLineFinder.test_string_eval_linecache_closureƒ   s<   € Ü—’ð "ó ˆð ˆØ'ˆØÐØ×)Ñ)¨(¸MØ*=õ	?r   c                 ób   • [         R                  " S5      nSnSnSnU R                  X!UU5        g )Nzª
        def decorator(function):
            return function

        @decorator
        @decorator
        @decorator
        def decorated():
            pass
        z<foo-stacked-decorator>Ú	decoratedé	   ri   ra   s        r   Ú-test_string_eval_linecache_stacked_decoratorsÚATestFirstLineFinder.test_string_eval_linecache_stacked_decorators“   s<   € Ü—’ð 	"ó 	ˆð -ˆØ#ˆØÐØ×)Ñ)¨(¸MØ*=õ	?r   c                 ó:   • SnSnSnSnU R                  X!UU5        g )Na  if 1:
        def decorator(function):
            return function

        def gen_decorated_foo():
            @decorator
            @decorator
            @decorator
            def _foo():
                pass

            return _foo

        foo_all = gen_decorated_foo()
        z	<foo-all>Úfoo_allé
   r`   ra   s        r   Útest_string_eval_linecache_allÚ2TestFirstLineFinder.test_string_eval_linecache_all¥   s0   € ðˆð  ˆØ!ˆØ ÐØ×)Ñ)¨(¸MØ*=õ	?r   c                 óV   • [         S 5       n[        U5      nU R                  US5        g )Nc                  ó   • g r   r%   r%   r   r   r&   Ú:TestFirstLineFinder.test_single_line_function.<locals>.foo¾   s   € Ør   r   r)   r*   s      r   Útest_single_line_functionÚ-TestFirstLineFinder.test_single_line_function½   s*   € Ü	Ùó 
Øä3°CÓ8ˆØ×!Ñ! .°!Õ4r   c                 óV   • [         S 5       n[        U5      nU R                  US5        g )Nc                  ó   • g©zDocstring
            Nr%   r%   r   r   r&   Ú/TestFirstLineFinder.test_docstring.<locals>.fooÅ   s   € ð r   r@   r)   r*   s      r   Útest_docstringÚ"TestFirstLineFinder.test_docstringÄ   s0   € Ü	ñ	ó 
ð	ô
 4°CÓ8ˆØ×!Ñ! .°!Õ4r   c                 óV   • [         S 5       n[        U5      nU R                  US5        g )Nc                  ó   •  gr   r%   r%   r   r   r&   Ú1TestFirstLineFinder.test_docstring_2.<locals>.fooÏ   s
   € ðàr   r@   r)   r*   s      r   Útest_docstring_2Ú$TestFirstLineFinder.test_docstring_2Î   s0   € Ü	ñ	ó 
ð	ô 4°CÓ8ˆØ×!Ñ! .°!Õ4r   r%   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r,   r2   r9   rB   rG   rN   r]   rb   re   rl   rq   rv   r{   r�   r†   Ú__static_attributes__r%   r   r   r   r      s\   † ñò
,ò
=ò
5ò5ò*ò5ò5ò*ò>ò,	?ò?ò?ò ?ò$?ò05ò5õ5r   r   Ú__main__)ÚunittestrS   r   rj   Únumbar   Únumba.tests.supportr   Únumba.misc.firstlinefinderr   r   rˆ   Úmainr%   r   r   Ú<module>r”      sA   ðÛ Û Û Û å Ý (Ý AôN5˜(ô N5ðb ˆzÓØ‡M‚M…Oð r   