
    h                     P   % S SK r S SKJr  S SKJr  S SKJrJr  S SKJ	r	  S SK
JrJr  SrSrS	rS
rSrSrSrSrSr\\S4   \S'   \\-  rSrSr " S S5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rS r  " S S \5      r! " S! S"\5      r" " S# S$\	5      r#g)%    N)contextmanager)Tuple)ErrorFinderErrorFinderConfig)Rule)FlowScope)import_nameimport_from)classdeffuncdefif_stmt
while_stmtfor_stmttry_stmt	with_stmt)termr   power)([{))]})+-~)*r   r   **/z//@)z<<z>>|&^)=%z-><>==z>=z<=z<>!=z+=z-=z*=z@=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=._NEEDS_SPACE)dictorsetmakerargument)	subscriptsubscriptlistsliceopc                   Z    \ rS rSr\" 5       r\" 5       r\" 5       r\" 5       r\" 5       r	Sr
g)IndentationTypes    N)__name__
__module____qualname____firstlineno__objectVERTICAL_BRACKETHANGING_BRACKET	BACKSLASHSUITEIMPLICIT__static_attributes__r4       dC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\parso/python/pep8.pyr2   r2      s&    xhOIHExHr@   r2   c                   B    \ rS rSr\R
                  rSS jrS rS r	Sr
g)IndentationNode%   Nc                 ,    U=U l         U l        X0l        g Nbracket_indentationindentationparent)selfconfigrI   rJ   s       rA   __init__IndentationNode.__init__(   s    6AA 4#3r@   c                 4    SU R                   R                  -  $ )Nz<%s>)	__class__r5   )rK   s    rA   __repr__IndentationNode.__repr__,   s    ////r@   c                 r    U nUb2  UR                   [        R                  :X  a  U$ UR                  nUb  M1  g g rF   )typer2   r=   rJ   )rK   ns     rA   get_latest_suite_node%IndentationNode.get_latest_suite_node/   s4    mvv)///A	 mr@   rG   rF   )r5   r6   r7   r8   r2   r=   rT   rM   rQ   rV   r?   r4   r@   rA   rC   rC   %   s    !!D0r@   rC   c                       \ rS rSrSS jrSrg)BracketNode8   c                    X l         UnUnUR                  [        R                  :X  a  UR                  n [        US5      (       a%  UR                  UR                   R                  :w  a  OCUR                  5       n[        U[        5      (       a  XVR                   :w  a  OUR                  nMy  UR                  nUR                  5       nSUR                  ;   d  SUR                  ;   a=  UUR                  -   U l        XqR                  -   U l
        [        R                  U l        OWUR                   S   n	SUR                  ;   a  S U l
        O
SU	-  U l
        U R                  U l        [        R"                  U l        U(       aj  UR                  [        R$                  :X  aL  U R                  XqR                  -   :X  a0  U =R                  UR                  -  sl
        U R                  U l        X0l        g )Nleaf
   	 )r\   rT   r2   r>   rJ   hasattrlineget_previous_leaf
isinstancerY   rI   get_next_leafprefix#closing_bracket_hanging_indentationrH   r;   end_posr:   r=   )
rK   rL   r\   rJ   in_suite_introducerprevious_leafrU   parent_indentation	next_leafexpected_end_indents
             rA   rM   BracketNode.__init__9   s   	 66%...Aq&!!m&8&8AFFKK&G);;=Ma--&&1HA  ]]&&(	9###ty/?/?'? (:<<(=D$14F4FFD(88DI #',,q/v)))#' #&)<#< '+'7'7D$(99DI6;;2B2H2H#H$$(:=O=O(OO 2 22'+'7'7D$r@   )rH   rI   r\   rJ   rT   NF)r5   r6   r7   r8   rM   r?   r4   r@   rA   rY   rY   8   s    1r@   rY   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ImplicitNodem   z_
Implicit indentation after keyword arguments, default arguments,
annotations and dict values.
c                    > [         TU ]  XU5        [        R                  U l        UR                  5       nUS:X  a8  SUR                  ;  a'  SUR                  ;  a  U =R                  S-  sl        g g g g )N:r]   r^   ra   )superrM   r2   r>   rT   rf   rg   rI   )rK   rL   r\   rJ   rm   rP   s        rA   rM   ImplicitNode.__init__r   sj    v.$--	&&(	3;4y'7'77D	HXHX<X# =Y7;r@   rT   )r5   r6   r7   r8   __doc__rM   r?   __classcell__rP   s   @rA   rr   rr   m   s    $ $r@   rr   c                   6    \ rS rSr\R
                  rSS jrSrg)BackslashNode{   Nc                 `   UR                  S5      nUbp  UR                  S   nSUR                  ;   a  S U l        O\UR                  UR                  :X  a  X!R                  -   U l        O.SUR                  S   S-   -  U l        OX!R                  -   U l        U R                  U l        XPl        g )N	expr_stmtr`   ra   r_   )search_ancestorchildrenrI   ri   	start_posrH   rJ   )rK   rL   rl   containing_leafspacingrJ   r   equalss           rA   rM   BackslashNode.__init__~   s    #33K@	 ''+Fv)))#'  >>W%6%66'9<N<N'ND$ (+fnnQ.?!.C'DD$14F4FFD#'#3#3 r@   rG   rF   )	r5   r6   r7   r8   r2   r<   rT   rM   r?   r4   r@   rA   r}   r}   {   s    %%Dr@   r}   c                 |    U R                   R                  S5      =(       a    U R                   R                  S5      $ )N__)value
startswithendswith)names    rA   _is_magic_namer      s+    ::  &D4::+>+>t+DDr@   c                      ^  \ rS rSrU 4S jr\U 4S j5       r\S 5       rS rS r	SS jr
U 4S jrS	 rS
 rS rS rU 4S jrSrU =r$ )PEP8Normalizer   c                 R  > [         TU ]  " U0 UD6  S U l        S U l        SU l        SU l        S U l        SU l        SU l        SU l	        [        U R                  SS9=U l        U l        SU l        SU R                  R                  ;   a  SU l        SU l        g S	U l        SU l        g )
NTr   F )rI   ra   spacesr`   tabs)rv   rM   _previous_part_previous_leaf_on_newline_newline_count_wanted_newline_count_max_new_lines_in_prefix_new_statement_implicit_indentation_possiblerC   _config_indentation_tos_last_indentation_tos_in_suite_introducerrI   _indentation_type_wrong_indentation_char)rK   argskwargsrP   s      rA   rM   PEP8Normalizer.__init__   s    $)&)""%)"()%".3+ DLLb9	: :$)!$,,***%-D"+/D(%+D"+.D(r@   c              #      >#    [         TU ]  U5         U R                  U5         S v   S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f7frF   )rv   
visit_node_visit_node)rK   noderP   s     rA   r   PEP8Normalizer.visit_node   s@     W%!!$' ( &%'' &%s/   AA;A	A
A		A
AAc              #    
  #    UR                   nUS;   a@  UR                  5       n[        U5      S:  a  US S  H  nU R                  USS5        M     GOUS:X  aX  UR                  nUR                   S:X  a:  [        S UR                  S SS	2    5       5      (       a  U R                  US
S5        GOUS:X  aL  UR                   H:  nUR                   S:X  d  M  UR                  S:X  d  M'  U R                  USS5        M<     GO8US:X  a  UR                   H  nUR                   S;  a  M  [        UR                  5      S	:  a  M0  UR                  S   nUR                  S   nUR                   S:X  d  M`  UR                   S:X  d  Mr  UR                  S:X  d  M  U R                  USS5          O   OUS:X  a  UR                  S   n	U	R                  5       n
U	R                  nUR                  S5      (       dC  UR                  S5      (       d-  U(       d  U
b  U
R                  S;  a  U R                  U	SS5        U[        ;   Ga  UR                  nUR                  nUR                   S:X  a  UR                  R                  U5      nUR                  S U  H  nU/nUR                   S :X  a  UR                  S S nS!nU H  nUR                   S":X  a	  U(       d  M  S#nUR                   S:X  a'  [        S$ UR                  5        5       5      (       a  MU  UR                   [        ;   d  [        U[        5      (       a  M  U R                  US%S&5          O   M    O   U[         ;   nU["        ;   nU(       a  S#U l        OUS':X  a  U R&                  R                   [(        R*                  :X  a  U R&                  R                  U l        [-        U R.                  U R&                  R0                  U R.                  R0                  -   U R&                  S(9U l        OU(       a  S#U l        S v   US':X  aM  U R&                  R                   [(        R4                  :X  d   eU R&                  R                  U l        S U l        g U(       aL  S!U l        U R&                  R                   [(        R8                  :X  a  U R&                  R                  U l        g g U(       a$  S!U l        US);   a  U R;                  5       U l        g g g 7f)*Nr
   r_   i  zMultiple imports on one linelambdefr   c              3   @   #    U  H  nUR                   S :H  v   M     g7f)r   Nrx   .0rU   s     rA   	<genexpr>-PEP8Normalizer._visit_node.<locals>.<genexpr>   s!      5Y>W 67VVv5E>Ws   r      i  z,Do not assign a lambda expression, use a defr   keywordexcepti  z1Do not use bare except, specify exception instead
comparison)	atom_exprr   r   trailerr   rT   i  z'Do not compare types, use 'isinstance()
file_inputr]   r^      r]   r^   
i$  zNo newline at end of filesimple_stmtFstringTc              3   8   #    U  H  n[        U5      v   M     g 7frF   )r   r   s     rA   r   r      s     #U?T!N1$5$5?Ts   i  z&Module level import not at top of filesuiterJ   )r   r   )rT   get_defined_nameslen	add_issuerJ   anyr   r   rd   rg   r   _IMPORT_TYPESindexallre   r   _IMPLICIT_INDENTATION_TYPES_SUITE_INTRODUCERSr   r   r2   r<   rC   r   rI   r   r=   r   r>   _get_wanted_blank_lines_count)rK   r   typnamesr   r   childr   atom	endmarkerprevrg   r   moduler   r   found_docstringcimplicit_indentation_possiblein_introducers                       rA   r   PEP8Normalizer._visit_node   sF    ii-**,E5zA~!"1IDNN4.LM &II ~~, 5Y>G>P>PQVRTUVQV>W5Y 2Y 2YtS*XYJ ::*u{{h/FNN5#/bc	 '
 L ::%;;u~~&*..+~~a(<<9,f1D JJ&0NN4.WX ' L b)I..0D%%FOOD))&//$2G2Gdldjj@T.Ty#/JK-++K ''F{{l*--k:#__Ve4E %wHzz]2#(>>#2#6&+O%66X-o$*.66[0 ##Uq?R?R?T#U U U$66]2jD6I6I$tS2Z[ & !/ 52 ),/J(J%11(,D%G^$$))-=-G-GG(,(=(=(D(D%$3%%11DLL4L4LL,,%D!
 +26D/'>((--1A1G1GGGG$($9$9$@$@D!)-D&*27D/$$))-=-F-FF(,(=(=(D(D% G(-D%---1-O-O-Q* . s&   CS>S>,BS>7S>	S>M#S>c                 z    U R                   UR                  ;   a!  U R                  USSU R                  -   5        gg)Ne   zIndentation contains TF)r   r   r   r   )rK   r   s     rA   _check_tabs_spaces!PEP8Normalizer._check_tabs_spaces  s6    ''7==8NN7C)@4CYCY)YZr@   c                 j    U R                   R                  5       n[        UR                  S L 5      S-   $ )Nr_   )r   rV   intrJ   )rK   
suite_nodes     rA   r   ,PEP8Normalizer._get_wanted_blank_lines_count!  s1    **@@B
:$$,-11r@   c                    [        U R                  U R                  5      U l        U R                  nUb`  U R                  S-
  nXE:  aE  UR                  S:w  a5  U(       d-  US:X  a  SOSnSU< SU< 3nU R                  XU5        S U l        OS U l        U(       Gdd  U R                  5       nU R                  S-
  nUR                  n	U	S:H  =(       a    UR                  R                  S	:H  =(       dw    U	S
:H  =(       dA    U	S:H  =(       a    UR                  5       S:H  =(       d    U	S:H  =(       a    U R                  S:g  =(       a#    UR                  R                  R                  S:g  n
U
(       a  X:  a  UR                  nUR                  nUR                  S:X  a  UR                  nUR                  [        UR                  S:H  5         U:w  a&  US:X  a  SOSnSU< SU< 3nU R                  XU5        SU l        SU l        g )Nr_   r   r   i.  i-  z	expected z blank line, found r!   	decoratorclassasyncdef	decoratedr   r   )maxr   r   r   rT   r   r   r   rJ   rf   r   r   r   )rK   r   r\   
is_commentwantedblank_linescodemessageactualvalneeds_linesfunc_or_clsr   s                rA   _reset_newlinesPEP8Normalizer._reset_newlines%  s   --t/B/BC 	% ++--1K#		[(@!"(A+33D!;0GNN7':15D.-1*779F22Q6F**Cs
>t{{//;> =7N Gg~G$*<*<*>%*GGe|F(;(;w(F= kk((--<  v"kk#**::,!LLE >>#ejjG&;"<=L"(A+33D!6+GNN7':,-D)r@   c                   > [         TU ]  U5        UR                  5        H5  nUR                  S:X  a    O$U R	                  X"R                  5       U5        M7     U R                  U5        U R	                  UWU5        U R                  U l        UR                  S:H  U l	        UR                  S:X  aC  U R                  R                  [        R                  :X  a  U R                  R                  U l        UR                  S:X  a&  UR                  R                  [        ;   a  SU l        OUR                  S:X  a  SU l        U R                  (       d  U R!                  X!5        SU l        Xl        UR                  $ )Nr   newlineru   FelifTr   )rv   
visit_leaf_split_prefixrT   _visit_partcreate_spacing_part_analyse_non_prefixr   r   r   r2   r<   rJ   r   r   r   r   _max_blank_linesr   )rK   r\   partrP   s      rA   r   PEP8Normalizer.visit_leafX  s4   4 &&(DyyI%T#;#;#=tD	 ) 	  &tT* &*%:%:""ii94 99	!%%**.>.H.HH$($9$9$@$@D!::!1!15G!G(-D%ZZ6!(,D%""  ,$%D!"zzr@   c                 H   UR                   nUR                  nUS:X  a  g US:X  a5  UR                  R                  S:X  a  U R                  R                  U l        U R                  nUS:X  a  UR	                  S5      (       a*  UR                  S5      (       a  U R                  USS5        OU R                  (       a\  [        R                  " S	U5      (       d?  US:X  d9  UR	                  S
5      (       a  UR                  S:X  d  U R                  USS5        O/[        R                  " SU5      (       d  U R                  USS5        U R                  X#SS9  OUS:X  a  U R                  U R                  5       :  a!  U R                  USSU R                  -  5        O=US;   a7  UR                  R                  R                  S:X  a  U R                  USS5        U =R                  S-  sl        US:X  a  UR                  [        R                  :w  a  UR                  [        R                   :w  a  U R                  USS5        GO-UR"                  nU R$                  (       a6  UR                  [        R                   :X  a  XpR&                  R"                  -  n[)        U R&                  UUUU R                  S9U l        GOU R                  (       Ga  UR                   nUR                  [        R                  :X  a5  U R*                  R                  S:X  a  U R                  R                  U l        U R-                  U5      (       Gd  UR"                  nUS:X  aV  U R.                  n	 [1        U5      [1        U	R"                  5      :  a  O&U	R"                  nXl        X:X  a  OU	R                  n	MI  U R2                  (       ao  US:X  a  U(       a  U R                  USS 5        GOXx:w  aF  [1        U R&                  R"                  5      < S!U R4                  < 3n
U R                  US"S#U
-   5        GOBUS$;   a  UR6                  nOUR"                  nU R$                  (       aJ  UUR9                  5       R"                  U R&                  R"                  -   :X  a  U R                  US%S&5        GOXx:w  Ga  U R-                  U5      (       Gd  UR                   S';  Ga  US$;   aH  UR                  [        R:                  :X  a  U R                  US(S)5        GOaU R                  US*S+5        GOL[1        U5      [1        U5      :  a  UR                  [        R:                  :X  a  U R                  US,S-5        GOUR                  [        R                  :X  a  U R                  US.S/5        OUR                  [        R<                  :X  a  U R                  US0S15        OU R                  US2S35        OUR                  [        R:                  :X  a  U R                  US4S55        OWUR                  [        R<                  :X  a  U R                  US6S15        O%U R                  US7S85        OU R?                  X5        U RA                  X5        U(       a  US9;   a  US:w  a  UR                  R                  S::w  av  U[B        ;   a0  [E        U R&                  UU R                  U R$                  S;9U l        OUR                  [        R<                  :w  d   eU R                  R                  U l        OdUS<;   a^  U RF                  (       aM  UR                  R                  [H        ;   a/  UR"                  n[K        U R&                  XR                  S9U l        US=;   U l        Xl        X l&        g )>N
error_leaf,r,   commentz###i
  z'Too many leading '#' for block comment.z#:? z#!)r_   r   i	  z$Block comment should start with '# 'z#:? [^ ]i  z%Inline comment should start with '# 'T)r   r   i/  zToo many blank lines (%s))r   r   r   i0  z*Blank lines found after function decoratorr_   	backslashi  z+The backslash is redundant between bracketsr   #  Trailing whitespacera   o   z!Indentation is not a multiple of z])}   z+Line with same indent as next logical blockr   |   z1Closing bracket does not match visual indentationr~   zCLosing bracket does not match indentation of opening bracket's line   z2Continuation line under-indented for visual indentz   z2Continuation line missing indentation or outdented   xxxy   z3Continuation line under-indented for hanging indent   z1Continuation line over-indented for visual indent   ~   z2Continuation line over-indented for hanging indentz()[]{}
error_node)rJ   rj   )r%   ru   )r   r  bom)'r   rT   rJ   r   r   lstripr   r   rematchr   r   r   r   r2   r<   r=   rI   r   r   r}   r   r   r   r   r   r   rH   rV   r:   r>   _check_spacing_check_line_length_OPENING_BRACKETSrY   r   r   rr   _previous_spacing)rK   r   r   r\   r   type_r   rI   should_be_indentationrU   ss              rA   r   PEP8Normalizer._visit_partz  s=   

		L C<DKK,,0@@$($9$9$@$@D!$$I%%<<$$NN4.WX!!xx//!&!1!1$!7!7DNNf<TNN4.TUxxU33NN4.UV  4 @i""T%G%G%IItS*EH[H[*[\))**//;>tS*VW1$Kyy,66699 0 6 66NN4.[\"&"2"2K00TYYBRBXBX5X#||'?'??,9##44-D) !--Kyy,666++00I=(,(=(=(D(D%**733(,(8(8%I%22A{+c!--.@@!01-5629!HH  &&	)& NN7C9NO$='*4<<+C+C'DdF\F\]tS2UXY2YZ~040H0H-040@0@-00[ 668DD"ll66767 tS2_`$=#66w??DJJ 4E5$~#'990@0Q0Q#Q$(NN(,(+([%& %)NN(,(+)P%& $'{#3c:O6P#P'+yy4D4U4U'U(,,0,/,`)*
 *.6F6P6P)P(,,0,/,`)*
 *.6F6O6O)O(,tS%(H(,,0,/,a)* (,yy4D4U4U'U(,,0,/,_)*
 *.6F6O6O)O(,tS%(H(,,0,/,`)* .. Uh&5L+@KK$$4))(3LL$00(,(A(A)% yy$4$=$====(,(=(=(D(D%j T%H%HKK$$(CC**K$0d+@+@%D! !$CC"!(r@   c           	          UR                   S:X  a  UR                  S   S-   nOUR                  S   nX0R                  R                  :  a  UR                  S   U R                  R                  ::  a  SnUR                   S:X  aP  UR
                  SS  R                  5       n[        U5      S:X  a$  UR                  S   [        US   5      -
  S:  a  SnU(       a1  U R                  USS	U< S
U R                  R                  < S35        g g g g )Nr  r_   Tr  r   H   Fi  zLine too long (z > z characters))	rT   r   ri   r   max_charactersr   splitr   r   )rK   r   r   last_columnreportsplitteds         rA   r  !PEP8Normalizer._check_line_length'  s    99#..+a/K,,q/K444%%a(DLL,G,GG FyyI%::ab>//1x=A%!\\!_s8A;/??2E"F $,,"="=?  H 5r@   c                   ^ ^ U U4S jnU U4S jnUR                   mT R                  nUb  UR                  S:X  d  UR                  S:X  a  g UR                  nST;   a  T R                  USS5        g US:X  a8  [	        T5      T R
                  R                  :  a  T R                  USS	5        g g US
:X  a  U" USS5        g [	        T5      S:  a  T R                  USS5        g U[        ;   a  SUR                   -  nU" USU5        g U[        ;   a  SUR                   -  nU" USU5        g US;   d$  US:X  a8  UR                  R                  [        ;  a  SUR                   -  nU" USU5        g US:X  a  UR                  R                  [        ;   a  g US;   a  U" USS5        g US:X  a  g US;   a  UR                  R                  [        ;  d$  US;   a  UR                  R                  [        ;  a  g U[        ;   a  UR                  R                  S:X  a  g US:X  a  UR                  R                  S:X  a  g U[        ;   d
  U[        ;   a  US:X  a  UR                  R                  S;   d   US:X  ap  UR                  R                  S;   aV  US:X  a  UR                  nOUR                  nUR                  S :X  a  UR                  (       a  U" US!S"5        g U" US#S$5        g U[        ;   d
  U[        ;   a  U" US%S&5        g US':X  d  US':X  a  U" US(S)5        g S*n	U" US+U	5        g US,:X  d  UR                  S,:X  a  U" US-S.5        g T R                   n
U["        ;   aY  TU
R                   :w  aI  S/T R$                  R&                  ;  a/  S0T R$                  R&                  ;  a  S1nT R                  US2U5        T(       a=  U["        ;  a2  U["        ;  a'  S*n	U[        ;   a  SUR                   -  nU" US3U5        g g g g g )4Nc                  2   > T(       a  TR                   " U 6 $ g rF   r   r   rK   r   s    rA   add_if_spaces4PEP8Normalizer._check_spacing.<locals>.add_if_spaces?  s    ~~t,, r@   c                  2   > T(       d  TR                   " U 6 $ g rF   r(  r)  s    rA   add_not_spaces5PEP8Normalizer._check_spacing.<locals>.add_not_spacesC  s    ~~t,, r@   r   r`      zUsed tab to separate tokensr  i  z)At least two spaces before inline commentr   r  r  r_      zMultiple spaces usedzWhitespace after '%s'   zWhitespace before '%s'   )r   ;ru      )r   r3  ru      zmissing whitespace after '%s')r   r   factorr!   r   r%   )r-   paramr7     z(Expected spaces around annotation equals   z3Unexpected spaces around keyword / parameter equals   z3Missing whitespace around bitwise or shift operatorr&      z)Missing whitespace around modulo operatorz!Missing whitespace between tokens   r   i  z!Missing whitespace around keywordr]   r^   z>Whitespace before operator doesn't match with whitespace after      )r   r   rT   r   r   r   spaces_before_commentr  _CLOSING_BRACKETSrJ   _POSSIBLE_SLICE_PARENTS_NON_STAR_TYPES_FACTORr+   
annotation_BITWISE_OPERATORr  _ALLOW_SPACEr   rg   )rK   r   r   r*  r-  r   r  r   r7  message_225prev_spacingr   s   `          @rA   r  PEP8Normalizer._check_spacing>  s   	-	- ""		\ 9TYY,=V		6>NN7C)FGi6{T\\???w-XY @i'3(=>[1_NN7C)?@((1DJJ>gsG4**2TZZ?gsG4#ts{((0GG2TZZ?gsG4!1!15L!L(w-LM$)9)9)P{*((?T[[%5%5%A!1!1[!@%)=3;4;;#3#37L#L3;4;;+;+;?T+Ts{ $ $zzW,1A1A&w5_`%#Q
 ..$:K2K"M
 S[DCK"7C1\]"EK"7C=)#tyyI'=w-PQ#55<'Fl6H6H,H (;(;(B(BB (;(;(B(BB^GNN7C9d,64|;S"EK 00":TZZ"G%gsG< 1	 <T66r@   c                    UR                   nUS:X  a  UR                  S;   a  UR                  5       (       a  SnUR                  R                   S:X  a1  UR                  R                  U:X  a  U R                  USUS-  5        g UR                  R                   S:X  a1  UR                  R                  U:X  a  U R                  USUS-  5        g U R                  S	US
-  U5        g g UR                  S:X  a  [        UR                  [        [        45      (       a~  UR                  R                   S:w  ac  UR                  5       nUR                   S:w  aB  UR                  R                   S:X  a  U R                  USS5        g U R                  USS5        g g g g UR                  S:X  aF  UR                  5       R                   S;   a  U R                  USS5        g U R                  USS5        g UR                  S;   a  UR                  nUR                  R                  U5      nUR                  US-
     nUR                  US-      nXx4 Hs  n	U	R                   S:X  d  U	R                   S:X  d  M%  U	R                  S:X  a  SnU R                  USU5          g U	R                  S;   d  M^  S nU R                  US!U5          g    g UR                  S";   ap  UR                  nUR                   S#:X  aS  UR                  R                   S$:X  a8  UR                  S%:X  a  U R                  US&S'5        g U R                  US(S)5        g g g US*:X  ar  [        UR                  R                  5       SS  5       HG  u  p[        R                   " S+U5      R#                  S,5      nUR$                  U
-   ['        U5      4nU  MI     g US-:X  a%  U R(                  S.:  a  U R                  US/S05        g g g )1Nr   )lOIz0Do not define %s named 'l', 'O', or 'I' one liner   i  classesfunction  i  	variablesru   r   r   r   i  z%Multiple statements on one line (def)i  z'Multiple statements on one line (colon)r3  )r   r   i  zStatement ends with a semicoloni  z+Multiple statements on one line (semicolon))r)   r*   r_   r   Nonez/comparison to None should be 'if cond is None:'i  )TrueFalsezCcomparison to False/True should be 'if cond is True:' or 'if cond:'i  )inisr   not_testrU  i  z&test for membership should be 'not in'i  z+test for object identity should be 'is not'r   z[ \t]*r   r   r   i  Blank line at end of file)rT   r   is_definitionrJ   r   r   add_issuadd_issuere   r   r	   rf   r   r   	enumerate
splitlinesr  r  grouprc   r   r   )rK   r\   r   r   rm   r   r   leftrightr   irc   rI   r   s                 rA   r   "PEP8Normalizer._analyse_non_prefix  s[   ii&=TZZ?:!!##L;;##w.4;;3C3Ct3KNN4g	.AB[[%%38H8HD8PNN4g
.BC**3+0EtL $ ZZ3$++e}55$++:J:Ji:W ..0	>>Y.{{''94y#7^_y#7`a	 / ;X5 ZZ3!!#((,DDtS*KLtS*WXZZ<'J''--d3E&&uqy1D''	2E99	)TYY&-@zzV+"StS':'88#EtS': $ ZZ<'J,.:3D3D3I3IZ3W::%NN4.VWNN4.[\	 4X.
 H_$TZZ%:%:%<QR%@A hhy$7==a@ IIM3{+;;		 B
 K""a'tS*EF (  r@   c                   > U R                   b8  U R                   R                  S5      b  g U R                   R                  S:X  a  g UR                  S5      b  g US;   a  [        TU ]  XU5        g [        [
        U ]  XU5        g )Nr  r   )i  i  )r   r   rT   rv   r   r   )rK   r   r   r   rP   s       rA   r   PEP8Normalizer.add_issue  s~    *""22<@L""''<7-9:Gd'2 +t.t7Cr@   )r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   rp   )r5   r6   r7   r8   rM   r   r   r   r   r   r   r   r   r  r  r   r   r?   rz   r{   s   @rA   r   r      sq    /,  
 cR cRJ21 f Dk)Z.]=~8GtD Dr@   r   c                   (    \ rS rSr\r   SS jrSrg)PEP8NormalizerConfigrP  Nc                 Z    Xl         Uc  UnX l        SU l        SU l        X0l        X@l        g )Nr   F)rI   hanging_indentationrh   break_after_binaryr   r?  )rK   rI   rg  r   r?  s        rA   rM   PEP8NormalizerConfig.__init__  s6    &&"-#6 350"',%:"r@   )rh  rh   rg  rI   r   r?  )z    NO   r   )r5   r6   r7   r8   r   normalizer_classrM   r?   r4   r@   rA   re  re    s    % AE:;	;r@   re  c                   "    \ rS rSrSrSrS rSrg)BlankLineAtEndi  i  rX  c                      U R                   S:  $ )Nr   )r   )rK   r\   s     rA   is_issueBlankLineAtEnd.is_issue  s    ""a''r@   r4   N)r5   r6   r7   r8   r   r   ro  r?   r4   r@   rA   rm  rm    s    D)G(r@   rm  )$r  
contextlibr   typingr   parso.python.errorsr   r   parso.normalizerr   parso.python.treer   r	   r   r   rB  r  r@  rC  rF  rE  r+   str__annotations__r   rA  r2   r9   rC   rY   rr   r}   r   r   re  rm  r4   r@   rA   <module>rx     s    	 %  > ! ) /; 2! ! 
2- !eCHo 
 ! !< C  f &2/ 2j$; $O 2EL	D[ L	D^;, ;&(T (r@   