+
    iK                        ^ RI HtHtHt ^ RIHtHtHtHtH	t	 ^ RI
H
t
 ^ RIt^ RIt^ RIt^ RIHt ^ RIHt R]/t]! ]! ]! ]4      ^ ,          ]]4      4      t]! ]4      '       g   Q h]! ]! ]]4      4      t]! ]R4      t]! ]R	4      tR
tRtRtRtRtRtRtRtRt Rt!Rt"Rt#Rt$Rt%]PL                  ! R4      t']PL                  ! R4      t(]PL                  ! R4      t)]PL                  ! R4      t*]PL                  ! R4      t+]PL                  ! R4      t,]PL                  ! R4      t-]PL                  ! R4      t.R  t/R! t0]1! 4       R"3R# lt2]1! 4       R3R$ lt3 ! R% R&]Ph                  4      t5]5! 4       t6R' t7R( t8R) t9R* t:R+ t;R, t<R- t=R. t>R/ t?R# )0    )walkseppardir)splitjoinabspathexistsisfile)globN)raises_test_this_file_encodingr   binexamplesz/File contains trailing whitespace: %s, line %s.z.File contains an implicit import: %s, line %s.z2File contains tabs instead of spaces: %s, line %s.z:File contains carriage returns at end of line: %s, line %sz+File contains string exception: %s, line %sz,File contains generic exception: %s, line %sz:File contains old-style raise statement: %s, line %s, "%s"z-File does not end with a newline: %s, line %sz/File ends with more than 1 newline: %s, line %sz6Function should start with 'test_' or '_': %s, line %sz.This is a duplicate test function: %s, line %sz3File contains assignments to self/cls: %s, line %s.z&File contains '.func is': %s, line %s.z+File contains bare expression: %s, line %s.z(^\s*(>>> )?(\.\.\. )?from .* import .*\*z9^\s*(>>> )?(\.\.\. )?raise(\s+(\'|\")|\s*(\(\s*)+(\'|\"))z=^\s*(>>> )?(\.\.\. )?raise(\s+Exception|\s*(\(\s*)+Exception)z1^\s*(>>> )?(\.\.\. )?raise((\s*\(\s*)|\s+)\w+\s*,z$^def\s+(?!(_|test))[^(]*\(\s*\)\s*:$z^def\s+test_.*:$z.*[/\\]test_.*\.py$z\.\s*func\s+isc                *   \        V 4      \        V P                  4       4      ,
          pWV^,            R9   g   V RV pMAW^,           R pV RV VR\        V4      \        VP                  4       4      ,
           ,           pVP                  4       V8X  * # )zwReturns True if there are tabs in the leading whitespace of a line,
including the whitespace of docstring code samples.N)z...z>>>)lenlstrip
expandtabs)snchecksmores   &   c/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/testing/tests/test_code_quality.pytab_in_leadingr   7   s     	AQXXZ Aq1u:'"1a%&	"1?s5zC,??@@  "e,,    c                  a \         P                  ! V 4      P                   Uu. uF'  p\        V\         P                  4      '       g   K%  VNK)  	  pp. pV EF  pVP                   EF  p\        V\         P
                  4      '       g   K&  \        ;QJ d&    R VP                   4       F  '       g   K   RM	  RM! R VP                   4       4      '       d   Kv  VP                  R8X  d   K  VP                  P                  '       g   K  VP                  P                  ^ ,          P                  o\         P                  ! V4       EF  p\        V\         P                  4      '       g   K&  VP                   F  p\        V\         P                  4      '       d%   VP                  S8X  d   VP!                  V4       KG  \        V\         P"                  4      '       g   Ki  \        ;QJ d)    V3R lVP$                   4       F  '       g   K   RM	  RM! V3R lVP$                   4       4      '       g   K  VP!                  V4       K  	  EK	  	  EK  	  EK  	  V# u upi )zReturns a list of "bad" assignments: if there are instances
of assigning to the first argument of the class method (except
for staticmethod's).
c              3      "   T F6  p\        V\        P                  4      '       g   K%  VP                  R 8H  x  K8  	  R# 5i)staticmethodN
isinstanceastNameid).0ds   & r   	<genexpr>(find_self_assignments.<locals>.<genexpr>O   s0      I,q
1chh0G *144>),s
   "A A TF__new__c              3      <"   T F6  p\        V\        P                  4      '       g   K%  VP                  S8H  x  K8  	  R # 5iNr   )r$   q	first_args   & r   r&   r'   ^   s/      ">V%/388%< #4!$$)"3Vs
   "AA)r!   parsebodyr    ClassDefFunctionDefanydecorator_listnameargsargr   Assigntargetsr"   r#   appendTupleelts)r   r   tbadcmar,   s   &      @r   find_self_assignmentsr@   C   s   
 IIaL%%E%qAs||)D%AE
CAa11s I,,Isss I,,I I Ivv"66;;;A**IXXa[a,,YY%a22qtty7HJJqM(CII66!c ">QVV ">ccc ">QVV "> > >JJqM ' !  . J5 	Fs   "I"I"z*.pyc           	         V '       g   R# \        V 4       F$  w  rEp\        \        \        WC4      4      W4       K&  	  R# )z
Checks all files in the directory tree (with base_path as starting point)
with the file_check function provided, skipping files that contain
any of the strings in the set provided by exclusions.
N)r   check_filesr   r   )	base_path
file_check
exclusionspatternrootdirsfiless   &&&&   r   check_directory_treerJ   e   s1     !)_EDd,-zF -r   c                P  a V '       g   R# V  F  o\        S4      '       d   \        S4      '       g   K'  \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   Ki  Ve    \        P                  ! VS4      '       g   K  V! S4       K  	  R# )z
Checks all files with the file_check function provided, skipping files
that contain any of the strings in the set provided by exclusions.
Nc              3   ,   <"   T F	  qS9   x  K  	  R # 5ir*    )r$   exfnames   & r   r&   check_files.<locals>.<genexpr>{   s     0ZrU{Zs   TF)r	   r
   r1   rematch)rI   rD   rE   rF   rO   s   &&&&@r   rB   rB   q   sj    
 e}}F5MM30Z03330Z000?bhhw66u r   c                   0   a  ] tR t^t o RtR tR tRtV tR# )_Visita=  return the line number corresponding to the
line on which a bare expression appears if it is a binary op
or a comparison that is not in a with block.

EXAMPLES
========

>>> import ast
>>> class _Visit(ast.NodeVisitor):
...     def visit_Expr(self, node):
...         if isinstance(node.value, (ast.BinOp, ast.Compare)):
...             print(node.lineno)
...     def visit_With(self, node):
...         pass  # no checking there
...
>>> code='''x = 1    # line 1
... for i in range(3):
...     x == 2       # <-- 3
... if x == 2:
...     x == 3       # <-- 5
...     x + 1        # <-- 6
...     x = 1
...     if x == 1:
...         print(1)
... while x != 1:
...     x == 1       # <-- 11
... with raises(TypeError):
...     c == 1
...     raise TypeError
... assert x == 1
... '''
>>> _Visit().visit(ast.parse(code))
3
5
6
11
c                    \        VP                  \        P                  \        P                  34      '       d   Q \
        RTP                  3,          4       hR # )N )r    valuer!   BinOpComparemessage_bare_exprlinenoselfnodes   &&r   
visit_Expr_Visit.visit_Expr   s>    djj399ckk":;;>*b$++->>>4 <r   c                    R # r*   rM   r\   s   &&r   
visit_With_Visit.visit_With   s    r   rM   N)	__name__
__module____qualname____firstlineno____doc__r_   rb   __static_attributes____classdictcell__)__classdict__s   @r   rT   rT      s     $J? r   rT   c                   \         P                  ! V 4      p \        P                  V4       R#   \         d   pTP
                  '       g   Q hTP
                  ^ ,          pTP                  \        P                  R^4      ^ ,          4      '       g   Q h\        TP                  R^4      ^,          P                  R4      4      u Rp?# Rp?ii ; i)zUreturn None or else 0-based line number of code on which
a bare expression appeared.
: .N)r!   r-   BareExprvisitAssertionErrorr4   
startswithrZ   r   intrsplitrstrip)codetreemsgs   &  r   line_with_bare_exprrz      s     99T?D6t 6xxxxhhqk~~/55c1=a@AAAA3::c1%a(//455	6s!   / CAC2CCCc                 0  aa V3R lp V3R loR Uu. uF  p\        \        V4      NK  	  ppR\        ,          R\        ,          R\        ,          R\        ,          R\        ,          0pR\        ,          R	\        ,          R
\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          R\        ,          0o\        W 4       \	        \
        V 0 RmR4       \	        \        W4       \	        \        W4       R# u upi )aL  
This test tests all files in SymPy and checks that:
  o no lines contains a trailing whitespace
  o no lines end with 

  o no line uses tabs instead of spaces
  o that the file ends with a single newline
  o there are no general or string exceptions
  o there are no old style raise statements
  o name of arg-less test suite functions start with _ or test_
  o no duplicate function names that start with test_
  o no assignments to self variable in class methods
  o no lines contain ".func is" except in the test suite
  o there is no do-nothing expression like `a == b` or `x + 1`
c                    < \        V R R7      ;_uu_ 4       pS! W4       RRR4       \        V R R7      ;_uu_ 4       p\        W4       RRR4       R#   + '       g   i     L;; i  + '       g   i     R# ; i)utf8)encodingN)openr   )rO   	test_filetest_this_files   & r   testtest_files.<locals>.test   sQ    %&))Y5, *%&))Y$U6 *) *))))s   	AA&A#	&A7	c                   <a  R pVP                  4       pVP                  ^ 4       \        S 9  d   S MS P                  \        ^4      R,          pVP	                  R4      '       d   \        V4      pVe   Q \        S T^,           3,          4       hR p^ p\        4       p\        V4       EF  w  r%\        P                  S 4      '       d   \        P                  V4      '       d   Q \        S T^,           3,          4       h\        P                  V4      '       dq   V^,          pVP                  VR,          P                  R4      ^ ,          P!                  4       4       \#        V4      V8w  d   Q \$        S T^,           3,          4       hVP'                  R4      '       d   Q \(        S T^,           3,          4       hVP'                  R4      '       d   Q \*        S T^,           3,          4       h\-        V4      '       d   Q \.        S T^,           3,          4       h\0        P3                  V4      '       d   Q \4        S T^,           3,          4       h\6        P3                  V4      '       d   Q \8        S T^,           3,          4       h\:        P3                  V4      '       d;   \=        \?        V 3R lS	4      4      '       g   Q \@        S T^,           3,          4       h\B        P3                  V4      '       d7   \        P3                  S 4      '       g   Q \D        S T^,           3,          4       h\F        P3                  V4      pVf   EK  Q \H        S T^,           TPK                  ^4      3,          4       h	  Ve^   VR8X  d#   V^ 8  d   Q \L        S T^,           3,          4       hVP'                  R4      '       g   Q \N        S T^,           3,          4       hR # R # )	Ntest_   NN(z
c                    < V S9   # r*   rM   )rN   rO   s   &r   <lambda>4test_files.<locals>.test_this_file.<locals>.<lambda>   s	    rU{r   
)z 
z	
)(readseekr   ru   rs   rz   rZ   set	enumeratetest_file_rerR   test_suite_def_remessage_test_suite_deftest_ok_def_readdr   stripr   message_duplicate_testendswithmessage_spacemessage_carriager   message_tabsstr_raise_researchmessage_str_raisegen_raise_remessage_gen_raiseimplicit_test_relistfiltermessage_implicit
func_is_remessage_func_isold_raise_remessage_old_raisegroupmessage_multi_eofmessage_eof)
rO   r   idxrw   pylineteststest_setresultimport_excludes
   f&       r   r   "test_files.<locals>.test_this_file   s   ~~q&UELLa,@,D==!!%d+C?>+ucAg.>>>55"9-IC!!%(($**400K"8E37;K"KK5!''--QJELLb!4Q!7!=!=!?@8}-O&<sQw?O&OOu}}_-->mucAg.>>>u}}V$$A.%q1AAAud##=leS1W-===u""4((B/5#'2BBBu""4((B/5#'2BBBu ''--V$:NKLLA.%q1AAAu  &&|/B/B5/I/I@oa0@@@u!((.F!5/37FLLO35 5 5u9 .> t|aB/5#'2BBBu]]4((<kUC!G,<<<u ) r   zL%(sep)ssympy%(sep)sparsing%(sep)sautolev%(sep)s_antlr%(sep)sautolevparser.pyzK%(sep)ssympy%(sep)sparsing%(sep)sautolev%(sep)s_antlr%(sep)sautolevlexer.pyzN%(sep)ssympy%(sep)sparsing%(sep)sautolev%(sep)s_antlr%(sep)sautolevlistener.pyzH%(sep)ssympy%(sep)sparsing%(sep)slatex%(sep)s_antlr%(sep)slatexparser.pyzG%(sep)ssympy%(sep)sparsing%(sep)slatex%(sep)s_antlr%(sep)slatexlexer.pyz%(sep)ssympy%(sep)s__init__.pyz%(sep)svector%(sep)s__init__.pyz"%(sep)smechanics%(sep)s__init__.pyz %(sep)squantum%(sep)s__init__.pyz%(sep)spolys%(sep)s__init__.pyz,%(sep)spolys%(sep)sdomains%(sep)s__init__.pyz#%(sep)sinteractive%(sep)ssession.pyz%(sep)sisympy.pyz%(sep)sbin%(sep)ssympy_time.pyz$%(sep)sbin%(sep)ssympy_time_cache.pyz&%(sep)sparsing%(sep)ssympy_tokenize.pyz'%(sep)splotting%(sep)spygletplot%(sep)sz)%(sep)sbin%(sep)stest_external_imports.pyz*%(sep)sbin%(sep)stest_submodule_imports.pyz"%(sep)sutilities%(sep)sruntests.pyz %(sep)sutilities%(sep)spytest.pyz"%(sep)sutilities%(sep)srandtest.pyz"%(sep)sutilities%(sep)stmpfiles.pyz)%(sep)sutilities%(sep)squality_unicode.py*N)z	isympy.pyzbuild.pyzsetup.py>   ~.sh.pyc)r   TOP_PATHsepdrB   rJ   BIN_PATH
SYMPY_PATHEXAMPLES_PATH)r   filetop_level_filesexcluder   r   s       @@r   
test_filesr      sB    71=j9  9tHd+ 9O  	WY]]UX\\X[__RUYYQTXXG 	)4/ 	*D0,t3*T1(4/6=-4T!(4/.50471D83d:4t;,t3*T1,t3,t33d:;N> &4)=sCT36as   Fc                 L    \         P                  ! ^ ^
4      R,          V ,           # )r   rn   )randomrandint)r=   s   &r   _with_spacer   =  s    >>!R $q((r   c                  B   . ROp . ROp. ROp. ROpV  Fx  p\         P                  \        V4      4      e   Q V4       h\        P                  \        V4      4      e   Q V4       h\        P                  \        V4      4      f   Ks  Q V4       h	  V F*  p\         P                  \        V4      4      e   K%  Q V4       h	  V F*  p\        P                  \        V4      4      e   K%  Q V4       h	  V F*  p\        P                  \        V4      4      e   K%  Q V4       h	  R# )#some text # raise Exception, 'text'N)r   z2raise ValueError('text') # raise Exception, 'text'raise ValueError('text')zraise ValueErrorr   zraise ValueError('text') #,zB'"""This function will raise ValueError, except when it doesn't"""zraise (ValueError('text'))zraise 'exception'zraise 'Exception'zraise "exception"zraise "Exception"zraise 'ValueError')z1raise Exception('text') # raise Exception, 'text'raise Exception('text')zraise Exceptionr   zraise Exception('text') #,raise Exception, 'text'1raise Exception, 'text' # raise Exception('text')1raise Exception, 'text' # raise Exception, 'text'>>> raise Exception, 'text'5>>> raise Exception, 'text' # raise Exception('text')5>>> raise Exception, 'text' # raise Exception, 'text')r   r   r   r   r   r   zraise ValueError, 'text'z2raise ValueError, 'text' # raise Exception('text')z2raise ValueError, 'text' # raise Exception, 'text'z>>> raise ValueError, 'text'z6>>> raise ValueError, 'text' # raise Exception('text')z6>>> raise ValueError, 'text' # raise Exception, 'text'zraise(ValueError,zraise (ValueError,zraise( ValueError,zraise ( ValueError,zraise(ValueError ,zraise (ValueError ,zraise( ValueError ,zraise ( ValueError ,)r   r   r   r   r   )candidates_okstr_candidates_failgen_candidates_failold_candidates_failr=   s        r   'test_raise_statement_regular_expressionr   B  s   
M. "";q>2:=A=:"";q>2:=A=:"";q>2:=A=:  !"";q>2>AA> ! "";q>2>AA> ! "";q>2>AA> !r   c                      . ROp . ROpV  F*  p\         P                  \        V4      4      f   K%  Q V4       h	  V F*  p\         P                  \        V4      4      e   K%  Q V4       h	  R# )from sympy import somethingN)r   z>>> from sympy import somethingz%from sympy.somewhere import somethingz)>>> from sympy.somewhere import somethingzimport sympyz>>> import sympyz import sympy.something.somethingz... import sympyz$... import sympy.something.somethingz... from sympy import somethingz)... from sympy.somewhere import somethingz>> from sympy import *z# from sympy import *zsome text # from sympy import *)zfrom sympy import *z>>> from sympy import *zfrom sympy.somewhere import *z!>>> from sympy.somewhere import *z... from sympy import *z!... from sympy.somewhere import *)r   r   r   r   candidates_failr=   s      r   (test_implicit_imports_regular_expressionr     sf    M O &&{1~6>AA> &&{1~6BEAEB r   c                      . ROp . ROpV  F!  p\         P                  V4      f   K  Q V4       h	  V F!  p\         P                  V4      e   K  Q V4       h	  R# )    def foo():
N)r   zdef foo(arg):
zdef _foo():
zdef test_foo():
)zdef foo():
zdef foo() :
zdef foo( ):
zdef  foo():
)r   r   r   s      r   test_test_suite_defsr     s^    MO  ''*25A52  ''*6996 r   c                      . ROp RR.pRpR pV  F  pV! V4      V8X  d   K  Q h	  V F  pV! V4      V8w  d   K  Q h	  R# )def foo():
def foo():
zdef test_():
def test_ ():
zdef test_1():
def  test_1():
Nc                 z   ^ p\        4       p\        V P                  4       4       F  w  r4\        P	                  V4      '       g   K"  V^,          pVP                  VR,          P                  R4      ^ ,          P                  4       4       \        V4      V8w  g   Ky  R\        RV^,           3,          3u # 	  R# )r   r   r   Fr   Nr   )
r   r   
splitlinesr   rR   r   r   r   r   r   )r   r   r   r   r   s   &    r   r   'test_test_duplicate_defs.<locals>.check  s    5"4??#45IC##D))
T"X^^C0399;<x=E) "8GS1W;M"MMM 6 r   )r   zdef test():
def test_():
zdef test_():
def test__():
r   rM   )r   r   okr   r=   s        r   test_test_duplicate_defsr     sZ    M 	()O 
B	 Qx2~~ Qx2~~ r   c                      . ROp . ROpV  F  p\        V4      . 8X  d   K  Q h	  V F  p\        V4      . 8w  d   K  Q h	  R# )4class A(object):
    def foo(self, arg): arg = self
N)r   z9class A(object):
    def foo(self, arg): self.prop = arg
z?class A(object):
    def foo(self, arg): obj, obj2 = arg, self
zCclass A(object):
    @classmethod
    def bar(cls, arg): arg = cls
z2class A(object):
    def foo(var, arg): arg = var
)z4class A(object):
    def foo(self, arg): self = arg
z>class A(object):
    def foo(self, arg): obj, self = arg, arg
zCclass A(object):
    def foo(self, arg):
        if arg: self = argzCclass A(object):
    @classmethod
    def foo(cls, arg): cls = arg
z2class A(object):
    def foo(var, arg): var = arg
)r@   r   s      r   test_find_self_assignmentsr     sL    MO $Q'2--- $Q'2--- r   c                     a aaa R .oR.oRo R.o\        \        V VVV3R l4       Ro R.o\        S SSS4       R o R.o\        \        V VVV3R l4       Ro R.o\        S SSS4       R# )foobarabcu   αc                      < \        S SSS4      # r*   r   rO   r   unicode_strict_whitelistunicode_whitelists   r   r   ,test_test_unicode_encoding.<locals>.<lambda>      #;y+-E$Gr   c                      < \        S SSS4      # r*   r   r   s   r   r   r     r   r   N)r   rr   r   r   s   @@@@r   test_test_unicode_encodingr     s     %wEI
> G H EIy+-EG EI
> G H EIy+-EGr   )@osr   r   r   os.pathr   r   r   r	   r
   r   rQ   r   r!   sympy.testing.pytestr   sympy.testing.quality_unicoder   r   __file__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   message_self_assignmentsr   rZ   compiler   r   r   r   r   r   r   r   r   r@   r   rJ   rB   NodeVisitorrT   rp   rz   r   r   r   r   r   r   r   r   rM   r   r   <module>r      s       8 8  	  
 ' B 	s| T%/!,ff=>
j 4
F+,% Xz* BC CO A B R =E Q I P :A ::IJ zz@BzzDFzzNOJJFG /0zz01ZZ)*
	-D <?5& 	G /2eT  *S__ *Z 86{7|)
@BFF>:&6.,Gr   