§
    îyIf81  ã                   óö   — d dl Z d dlmZ d dlmZmZmZmZ d dl	m
Z d dlm
Z d dlm
Z d dlmZmZ  G d„ d¦  «        Z G d„ d	e¦  «        Z
 G d
„ dee¦  «        Z G d„ dee¦  «        Z G d„ dee¦  «        ZdS )é    N)Úmessages)ÚPYPYÚDoctestScopeÚFunctionScopeÚModuleScope)ÚTest)ÚTestCaseÚskipc                   ó(   ‡ — e Zd ZdZd„ Zˆ fd„Zˆ xZS )Ú_DoctestMixinTc                 óX  — g }t          j        |¦  «                             ¦   «         D ]Ö}|                     ¦   «         dk    rn¦|                     d¦  «        s†|                     d¦  «        sq|                     d¦  «        s\|                     d¦  «        sG|                     d¦  «        s2|                     d¦  «        s|r!|d                              d	¦  «        rd
|z  }nd|z  }|                     |¦  «         Œ×t          j        d¦  «        }|d                     |¦  «        z  S )NÚ ú zexcept:zexcept zfinally:zelse:zelif éÿÿÿÿ)z>>> @z... @z... %sz>>> %szo            def doctest_something():
                """
                   %s
                """
            z
       )ÚtextwrapÚdedentÚ
splitlinesÚstripÚ
startswithÚappendÚjoin)ÚselfÚinputÚlinesÚlineÚdoctestificators        úO/var/www/piapp/venv/lib/python3.11/site-packages/pyflakes/test/test_doctests.pyÚ
doctestifyz_DoctestMixin.doctestify   sC  € ØˆÝ”O EÑ*Ô*×5Ò5Ñ7Ô7ð 	ð 	ˆDØ�zŠz‰|Œ|˜rÒ!Ð!ØØ—/’/ #Ñ&Ô&ð 	'Ø—/’/ )Ñ,Ô,ð	'à—/’/ )Ñ,Ô,ð	'ð —/’/ *Ñ-Ô-ð	'ð —/’/ 'Ñ*Ô*ð		'ð
 —/’/ 'Ñ*Ô*ð	'ð ð	'ð # 2œY×1Ò1Ð2DÑEÔEð	'ð   $‘��à $‘�Ø�LŠL˜ÑÔÐÐÝ"œ/ð +ñ ô ˆð  ×!1Ò!1°%Ñ!8Ô!8Ñ8Ð8ó    c                 ód   •—  t          ¦   «         j        |                      |¦  «        g|¢R i |¤ŽS )N)ÚsuperÚflakesr   )r   r   ÚargsÚkwÚ	__class__s       €r   r"   z_DoctestMixin.flakes,   s5   ø€ Ø�u‰wŒwŒ~˜dŸošo¨eÑ4Ô4ÐB°tÐBÐBÐB¸rÐBÐBÐBr   )Ú__name__Ú
__module__Ú__qualname__ÚwithDoctestr   r"   Ú__classcell__)r%   s   @r   r   r      sU   ø€ € € € € à€Kð9ð 9ð 9ð0Cð Cð Cð Cð Cð Cð Cð Cð Cr   r   c                   ó²   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Z ed
¦  «        d„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )r   Tc                 ó  — |                       d¦  «        }|j        }d„ |D ¦   «         }d„ |D ¦   «         }d„ |D ¦   «         }|                      t          |¦  «        d¦  «         |                      t          |¦  «        d¦  «         |d         }|d         }|                      |t
          ¦  «         |                      |t          ¦  «         |                      |t          ¦  «         |                      |t
          ¦  «         |  	                    d|¦  «         |  	                    d|¦  «         |  	                    d	|¦  «         |                      t          |¦  «        d¦  «         |  	                    d
|d         ¦  «         dS )z-Check that a doctest is given a DoctestScope.z§
        m = None

        def doctest_stuff():
            '''
                >>> d = doctest_stuff()
            '''
            f = m
            return f
        c                 ó.   — g | ]}|j         t          u ¯|‘ŒS © ©r%   r   ©Ú.0Úscopes     r   ú
<listcomp>z)Test.test_scope_class.<locals>.<listcomp>B   ó.   € ð Ið Ið IØ¨¬½KÐ)GÐ)GˆEÐ)GÐ)GÐ)Gr   c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   ©r%   r   r0   s     r   r3   z)Test.test_scope_class.<locals>.<listcomp>D   ó.   € ð Jð Jð JØ¨¬½LÐ)HÐ)HˆEÐ)HÐ)HÐ)Hr   c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   ©r%   r   r0   s     r   r3   z)Test.test_scope_class.<locals>.<listcomp>F   ó.   € ð Kð Kð KØ¨¬½MÐ)IÐ)IˆEÐ)IÐ)IÐ)Ir   é   r   ÚmÚdoctest_stuffÚdÚfN)
r"   Ú
deadScopesÚassertEqualÚlenÚassertIsInstancer   r   ÚassertNotIsInstancer   ÚassertIn©r   ÚcheckerÚscopesÚmodule_scopesÚdoctest_scopesÚfunction_scopesÚmodule_scopeÚdoctest_scopes           r   Útest_scope_classzTest.test_scope_class4   s°  € à—+’+ð 	ñ 	ô 	ˆð Ô#ˆðIð IØ%ðIñ Iô IˆðJð JØ%ðJñ Jô JˆðKð KØ%ðKñ Kô Kˆð 	×Ò�˜]Ñ+Ô+¨QÑ/Ô/Ð/Ø×Ò�˜^Ñ,Ô,¨aÑ0Ô0Ð0à$ QÔ'ˆØ& qÔ)ˆà×Ò˜m­\Ñ:Ô:Ð:Ø×Ò˜m­[Ñ9Ô9Ð9Ø× Ò  µÑ>Ô>Ð>Ø× Ò  ­|Ñ<Ô<Ð<à�Š�c˜<Ñ(Ô(Ð(Ø�Š�o |Ñ4Ô4Ð4à�Š�c˜=Ñ)Ô)Ð)à×Ò�˜_Ñ-Ô-¨qÑ1Ô1Ð1Ø�Š�c˜?¨1Ô-Ñ.Ô.Ð.Ð.Ð.r   c                 ól  — |                       d¦  «        }|j        }d„ |D ¦   «         }d„ |D ¦   «         }d„ |D ¦   «         }|                      t          |¦  «        d¦  «         |                      t          |¦  «        d¦  «         |d         }|d         }|                      d|¦  «         |                      d|¦  «         |                      d	|¦  «         |                      t          |¦  «        d
¦  «         |                      d|d         ¦  «         |                      d|d         ¦  «         dS )z'Check that nested doctests are ignored.a˜  
        m = None

        def doctest_stuff():
            '''
                >>> def function_in_doctest():
                ...     """
                ...     >>> ignored_undefined_name
                ...     """
                ...     df = m
                ...     return df
                ...
                >>> function_in_doctest()
            '''
            f = m
            return f
        c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   r/   r0   s     r   r3   z4Test.test_nested_doctest_ignored.<locals>.<listcomp>q   r4   r   c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   r6   r0   s     r   r3   z4Test.test_nested_doctest_ignored.<locals>.<listcomp>s   r7   r   c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   r9   r0   s     r   r3   z4Test.test_nested_doctest_ignored.<locals>.<listcomp>u   r:   r   r;   r   r<   r=   Úfunction_in_doctesté   r?   ÚdfN)r"   r@   rA   rB   rE   rF   s           r   Útest_nested_doctest_ignoredz Test.test_nested_doctest_ignored\   sr  € à—+’+ð ñ ô ˆð$ Ô#ˆðIð IØ%ðIñ Iô IˆðJð JØ%ðJñ Jô JˆðKð KØ%ðKñ Kô Kˆð 	×Ò�˜]Ñ+Ô+¨QÑ/Ô/Ð/Ø×Ò�˜^Ñ,Ô,¨aÑ0Ô0Ð0à$ QÔ'ˆØ& qÔ)ˆà�Š�c˜<Ñ(Ô(Ð(Ø�Š�o |Ñ4Ô4Ð4Ø�ŠÐ+¨]Ñ;Ô;Ð;à×Ò�˜_Ñ-Ô-¨qÑ1Ô1Ð1à�Š�c˜?¨1Ô-Ñ.Ô.Ð.Ø�Š�d˜O¨AÔ.Ñ/Ô/Ð/Ð/Ð/r   c                 ó¤  — |                       d¦  «        }|j        }d„ |D ¦   «         }d„ |D ¦   «         }d„ |D ¦   «         }|                      t          |¦  «        d¦  «         |                      t          |¦  «        d¦  «         |d         }|d         }|                      d|¦  «         |                      d|¦  «         |                      t          |¦  «        d	¦  «         |                      d
|d         ¦  «         |                      d|d         ¦  «         |                      d|d         ¦  «         |                      d|¦  «         dS )z;Check that global in doctest does not pollute module scope.a[  
        def doctest_stuff():
            '''
                >>> def function_in_doctest():
                ...     global m
                ...     m = 50
                ...     df = 10
                ...     m = df
                ...
                >>> function_in_doctest()
            '''
            f = 10
            return f

        c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   r/   r0   s     r   r3   z;Test.test_global_module_scope_pollution.<locals>.<listcomp>š   r4   r   c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   r6   r0   s     r   r3   z;Test.test_global_module_scope_pollution.<locals>.<listcomp>œ   r7   r   c                 ó.   — g | ]}|j         t          u ¯|‘ŒS r.   r9   r0   s     r   r3   z;Test.test_global_module_scope_pollution.<locals>.<listcomp>ž   r:   r   r;   r   r=   rS   rT   r?   rU   r<   N)r"   r@   rA   rB   rE   ÚassertNotInrF   s           r   Ú"test_global_module_scope_pollutionz'Test.test_global_module_scope_pollution‡   s�  € à—+’+ð ñ ô ˆð  Ô#ˆðIð IØ%ðIñ Iô IˆðJð JØ%ðJñ Jô JˆðKð KØ%ðKñ Kô Kˆð 	×Ò�˜]Ñ+Ô+¨QÑ/Ô/Ð/Ø×Ò�˜^Ñ,Ô,¨aÑ0Ô0Ð0à$ QÔ'ˆØ& qÔ)ˆà�Š�o |Ñ4Ô4Ð4Ø�ŠÐ+¨]Ñ;Ô;Ð;à×Ò�˜_Ñ-Ô-¨qÑ1Ô1Ð1à�Š�c˜?¨1Ô-Ñ.Ô.Ð.Ø�Š�d˜O¨AÔ.Ñ/Ô/Ð/Ø�Š�c˜?¨1Ô-Ñ.Ô.Ð.à×Ò˜˜lÑ+Ô+Ð+Ð+Ð+r   c                 óF   — |                       dt          j        ¦  «         d S )Nzn
        global m

        def doctest_stuff():
            '''
                >>> m
            '''
        ©r"   r<   ÚUndefinedName©r   s    r   Útest_global_undefinedzTest.test_global_undefined²   s.   € Ø�Šð õ Œ_ñ	ô 	ð 	ð 	ð 	r   c                 ó\   — |                       dt          j        t          j        ¦  «         dS )z*Doctest within nested class are processed.a  
        class C:
            class D:
                '''
                    >>> m
                '''
                def doctest_stuff(self):
                    '''
                        >>> m
                    '''
                    return 1
        Nr^   r`   s    r   Útest_nested_classzTest.test_nested_class¼   s2   € à�Šð õ Œ_�aœoñ	/ô 	/ð 	/ð 	/ð 	/r   c                 ó0   — |                       d¦  «         dS )z<Doctest module does not process doctest in nested functions.a=  
        def doctest_stuff():
            def inner_function():
                '''
                    >>> syntax error
                    >>> inner_function()
                    1
                    >>> m
                '''
                return 1
            m = inner_function()
            return m
        N©r"   r`   s    r   Útest_ignore_nested_functionz Test.test_ignore_nested_functionË   s)   € ð 	�Šð ñ 	ô 	ð 	ð 	ð 	r   c                 óF   — |                       dt          j        ¦  «         dS )z#Doctest may not access class scope.z¬
        class C:
            def doctest_stuff(self):
                '''
                    >>> m
                '''
                return 1
            m = 1
        Nr^   r`   s    r   Útest_inaccessible_scope_classz"Test.test_inaccessible_scope_classà   s.   € à�Šð õ Œ_ñ	ô 	ð 	ð 	ð 	r   c                 ó0   — |                       d¦  «         d S )Nzr
        import foo

        def doctest_stuff():
            '''
                >>> foo
            '''
        re   r`   s    r   Útest_importBeforeDoctestzTest.test_importBeforeDoctestì   s'   € Ø�Šð ñ 	ô 	ð 	ð 	ð 	r   Útodoc                 óF   — |                       dt          j        ¦  «         d S )Nzž
        import foo

        def doctest_stuff():
            """
                >>> import foo
                >>> foo
            """

        foo
        )r"   r<   ÚRedefinedWhileUnusedr`   s    r   Útest_importBeforeAndInDoctestz"Test.test_importBeforeAndInDoctestö   s/   € à�Šð 
õ Ô#ñ
	%ô 
	%ð 
	%ð 
	%ð 
	%r   c                 ó0   — |                       d¦  «         d S )NzŸ
        def doctest_stuff():
            """
                >>> import foo
                >>> foo
            """

        import foo
        foo()
        re   r`   s    r   Útest_importInDoctestAndAfterz!Test.test_importInDoctestAndAfter  ó'   € Ø�Šð 	ñ 		ô 		ð 		ð 		ð 		r   c                 óÈ   — |                       dt          j        ¦  «        j        d         }|                      |j        d¦  «         |                      |j        d¦  «         d S )Nzg

        def doctest_stuff():
            """
                >>> x # line 5
            """

        r   é   é   ©r"   r<   r_   r   rA   ÚlinenoÚcol©r   Úexcs     r   Útest_offsetInDoctestszTest.test_offsetInDoctests  óe   € Ø�kŠkð õ Œ_ñô ô ' qô*ˆð 	×Ò˜œ QÑ'Ô'Ð'Ø×Ò˜œ "Ñ%Ô%Ð%Ð%Ð%r   c                 óÈ   — |                       dt          j        ¦  «        j        d         }|                      |j        d¦  «         |                      |j        d¦  «         d S )Nzo

        def doctest_stuff():
            """
                >>> lambda: x # line 5
            """

        r   rs   é   ru   rx   s     r   Útest_offsetInLambdasInDoctestsz#Test.test_offsetInLambdasInDoctests  r{   r   c                 óÈ   — |                       dt          j        ¦  «        j        d         }|                      |j        d¦  «         |                      |j        d¦  «         d S )Nzm

        def doctest_stuff():
            """
                >>> x = 5
            """

        x

        r   é   ru   rx   s     r   Útest_offsetAfterDoctestszTest.test_offsetAfterDoctests(  se   € Ø�kŠkð 	õ Œ_ñ	ô 	ô ' qô	*ˆð 	×Ò˜œ QÑ'Ô'Ð'Ø×Ò˜œ !Ñ$Ô$Ð$Ð$Ð$r   c                 ó|  — |                       dt          j        t          j        t          j        ¦  «        j        }|d         }|                      |j        d¦  «         t          s|                      |j        d¦  «         n|                      |j        d¦  «         |d         }|                      |j        d¦  «         t          r|                      |j        d¦  «         n|                      |j        d	¦  «         |d
         }|                      |j        d¦  «         |                      |j        d¦  «         d S )NzÐ
            def doctest_stuff():
                """
                    >>> from # line 4
                    >>>     fortytwo = 42
                    >>> except Exception:
                """
            r   é   é   é   r;   rs   é   é   rT   é   )r"   r<   ÚDoctestSyntaxErrorr   rA   rv   r   rw   ©r   Ú
exceptionsry   s      r   Útest_syntaxErrorInDoctestzTest.test_syntaxErrorInDoctest6  s1  € Ø—[’[ðõ Ô ÝÔ ÝÔ ñ"ô "ô #+ð 	ð ˜ŒmˆØ×Ò˜œ QÑ'Ô'Ð'Ýð 	*Ø×Ò˜SœW bÑ)Ô)Ð)Ð)à×Ò˜SœW bÑ)Ô)Ð)ð
 ˜ŒmˆØ×Ò˜œ QÑ'Ô'Ð'Ýð 	*Ø×Ò˜SœW bÑ)Ô)Ð)Ð)à×Ò˜SœW bÑ)Ô)Ð)Ø˜ŒmˆØ×Ò˜œ QÑ'Ô'Ð'Ø×Ò˜œ "Ñ%Ô%Ð%Ð%Ð%r   c                 óÈ   — |                       dt          j        ¦  «        j        d         }|                      |j        d¦  «         |                      |j        d¦  «         d S )Nz|
        def doctest_stuff():
            """
                >>> if True:
                ... pass
            """
        r   rs   r†   )r"   r<   r‰   r   rA   rv   rw   rx   s     r   Útest_indentationErrorInDoctestz#Test.test_indentationErrorInDoctestW  sf   € Ø�kŠkð õ Ô!ñ#ô #ô $,¨Aô/ˆð 	×Ò˜œ QÑ'Ô'Ð'Ø×Ò˜œ "Ñ%Ô%Ð%Ð%Ð%r   c                 óD  — |                       dt          j        t          j        ¦  «        j        \  }}|                      |j        d¦  «         |                      |j        d¦  «         |                      |j        d¦  «         |                      |j        d¦  «         d S )NzÞ
            def doctest_stuff(arg1,
                              arg2,
                              arg3):
                """
                    >>> assert
                    >>> this
                """
            rˆ   é   é   rt   )r"   r<   r‰   r_   r   rA   rv   rw   )r   Úexc1Úexc2s      r   Útest_offsetWithMultiLineArgsz!Test.test_offsetWithMultiLineArgsb  s›   € Ø—{’{ðõ Ô ÝŒOñô ô &ñ 	ˆˆtð 	×Ò˜œ aÑ(Ô(Ð(Ø×Ò˜œ 2Ñ&Ô&Ð&Ø×Ò˜œ aÑ(Ô(Ð(Ø×Ò˜œ 2Ñ&Ô&Ð&Ð&Ð&r   c                 ó0   — |                       d¦  «         d S )NzT
        def foo():
            '''
                >>> foo
            '''
        re   r`   s    r   Útest_doctestCanReferToFunctionz#Test.test_doctestCanReferToFunctiont  s'   € Ø�Šð ñ 	ô 	ð 	ð 	ð 	r   c                 ó0   — |                       d¦  «         d S )Nzµ
        class Foo():
            '''
                >>> Foo
            '''
            def bar(self):
                '''
                    >>> Foo
                '''
        re   r`   s    r   Útest_doctestCanReferToClassz Test.test_doctestCanReferToClass|  rq   r   c                 óò   — |                       dt          j        t          j        ¦  «        j        }|d         }|                      |j        d¦  «         |d         }|                      |j        d¦  «         d S )NaF  
            def buildurl(base, *args, **kwargs):
                """
                >>> buildurl('/blah.php', ('a', '&'), ('b', '=')
                '/blah.php?a=%26&b=%3D'
                >>> buildurl('/blah.php', a='&', 'b'='=')
                '/blah.php?b=%3D&a=%26'
                """
                pass
            r   rƒ   r;   rˆ   )r"   r<   r‰   r   rA   rv   rŠ   s      r   Ú!test_noOffsetSyntaxErrorInDoctestz&Test.test_noOffsetSyntaxErrorInDoctestˆ  sz   € Ø—[’[ð	õ Ô ÝÔ ñ"ô "ô #+ð 	ð ˜ŒmˆØ×Ò˜œ QÑ'Ô'Ð'Ø˜ŒmˆØ×Ò˜œ QÑ'Ô'Ð'Ð'Ð'r   c                 ó0   — |                       d¦  «         d S )Nz£
        def func():
            """A docstring

            >>> func()
            1
            >>> _
            1
            """
            return 1
        re   r`   s    r   Útest_singleUnderscoreInDoctestz#Test.test_singleUnderscoreInDoctest›  s'   € Ø�Šð 
ñ 
	ô 
	ð 
	ð 
	ð 
	r   c                 óF   — |                       dt          j        ¦  «         d S )NzŠ
        from gettext import ugettext as _

        def doctest_stuff():
            '''
                >>> pass
            '''
        )r"   r<   ÚUnusedImportr`   s    r   Útest_globalUnderscoreInDoctestz#Test.test_globalUnderscoreInDoctest¨  s.   € Ø�Šð õ Œ^ñ	ô 	ð 	ð 	ð 	r   N)r&   r'   r(   r)   rN   rV   r\   ra   rc   rf   rh   rj   r
   rn   rp   rz   r~   r�   rŒ   rŽ   r”   r–   r˜   rš   rœ   rŸ   r.   r   r   r   r   0   sl  € € € € € à€Kð&/ð &/ð &/ðP)0ð )0ð )0ðV),ð ),ð ),ðVð ð ð/ð /ð /ðð ð ð*
ð 
ð 
ðð ð ð 
€Tˆ&�\„\ð%ð %ñ „\ð%ð
ð 
ð 
ð
&ð 
&ð 
&ð
&ð 
&ð 
&ð%ð %ð %ð&ð &ð &ðB	&ð 	&ð 	&ð'ð 'ð 'ð$ð ð ð
ð 
ð 
ð(ð (ð (ð&ð ð ðð ð ð ð r   r   c                   ó   — e Zd ZdZdS )Ú	TestOtherz2Run TestOther with each test wrapped in a doctest.N©r&   r'   r(   Ú__doc__r.   r   r   r¡   r¡   ³  s   € € € € € Ø<Ð<Ð<Ð<r   r¡   c                   ó   — e Zd ZdZdS )ÚTestImportsz4Run TestImports with each test wrapped in a doctest.Nr¢   r.   r   r   r¥   r¥   ·  s   € € € € € Ø>Ð>Ð>Ð>r   r¥   c                   ó   — e Zd ZdZdS )ÚTestUndefinedNamesz;Run TestUndefinedNames with each test wrapped in a doctest.Nr¢   r.   r   r   r§   r§   »  s   € € € € € ØEÐEÐEÐEr   r§   )r   Úpyflakesr   r<   Úpyflakes.checkerr   r   r   r   Úpyflakes.test.test_otherr   r¡   Úpyflakes.test.test_importsr¥   Ú"pyflakes.test.test_undefined_namesr§   Úpyflakes.test.harnessr	   r
   r   r.   r   r   ú<module>r®      s©  ðØ €€€à "Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð ð ð ð ð 7Ð 6Ð 6Ð 6Ð 6Ð 6Ø :Ð :Ð :Ð :Ð :Ð :Ø IÐ IÐ IÐ IÐ IÐ IØ 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0ðCð Cð Cð Cð Cñ Cô Cð Cð@@ð @ð @ð @ð @ˆ8ñ @ô @ð @ðF=ð =ð =ð =ð =�˜yñ =ô =ð =ð?ð ?ð ?ð ?ð ?�- ñ ?ô ?ð ?ðFð Fð Fð Fð F˜Ð(:ñ Fô Fð Fð Fð Fr   