
    ZQd4                     R   d Z ddlmZ ddlmZmZ i ddddddd	d
dddddddddddddddddddddddd d!d"i d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdDdEdFdGdHdIdJdJdJdKdLdLdMdNdOZdP ZefdQZ G dR dSej	                  Z
dTS )Uz/Fix incompatible imports and module references.   )
fixer_base)Name
attr_chainStringIOio	cStringIOcPicklepickle__builtin__builtinscopy_regcopyregQueuequeueSocketServersocketserverConfigParserconfigparserreprreprlib
FileDialogztkinter.filedialogtkFileDialogSimpleDialogztkinter.simpledialogtkSimpleDialogtkColorChooserztkinter.colorchoosertkCommonDialogztkinter.commondialogDialogztkinter.dialogTkdndztkinter.dndtkFontztkinter.fonttkMessageBoxztkinter.messageboxScrolledTextztkinter.scrolledtextTkconstantsztkinter.constantsTixztkinter.tixttkztkinter.ttkTkintertkinter
markupbase_markupbase_winregwinregthread_threaddummy_thread_dummy_threaddbhashzdbm.bsddumbdbmzdbm.dumbdbmzdbm.ndbmgdbmzdbm.gnu	xmlrpclibzxmlrpc.clientDocXMLRPCServerzxmlrpc.serverzhttp.clientzhtml.entitieszhtml.parserzhttp.cookieszhttp.cookiejarzhttp.server
subprocesscollectionszurllib.parsezurllib.robotparser)SimpleXMLRPCServerhttplibhtmlentitydefs
HTMLParserCookie	cookielibBaseHTTPServerSimpleHTTPServerCGIHTTPServercommands
UserStringUserListurlparserobotparserc                 ^    dd                     t          t          |                     z   dz   S )N(|))joinmapr   )memberss    0/usr/lib/python3.11/lib2to3/fixes/fix_imports.py
alternatesrM   =   s(    #dG,,---33    c              #      K   d                     d | D                       }t          |                                           }d|d|dV  d|z  V  d|d|d	V  d
|z  V  d S )Nz | c                     g | ]}d |z  S )zmodule_name='%s' ).0keys     rL   
<listcomp>z!build_pattern.<locals>.<listcomp>B   s    GGG-3GGGrN   z$name_import=import_name< 'import' ((z;) |
               multiple_imports=dotted_as_names< any* (z) any* >) >
          zimport_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          z(import_name< 'import' (dotted_as_name< (zg) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (z!) 'as' any > any* >) >
          z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rI   rM   keys)mappingmod_list
bare_namess      rL   build_patternrY   A   s      zzGGwGGGHHHGLLNN++JJ 888% % % %      888% % % % @*
LLLLLLrN   c                   N     e Zd ZdZdZeZdZd Z fdZ	 fdZ
 fdZd Z xZS )
FixImportsT   c                 P    d                     t          | j                            S )NrG   )rI   rY   rV   )selfs    rL   rY   zFixImports.build_pattern`   s    xxdl33444rN   c                     |                                  | _        t          t          |                                            d S N)rY   PATTERNsuperr[   compile_pattern)r^   	__class__s    rL   rc   zFixImports.compile_patternc   s:     ))++j$//11111rN   c                     t          t          |           j         |          }|r1d|vr+t          fdt	          |d          D                       rdS |S dS )Nbare_with_attrc              3   .   K   | ]} |          V  d S r`   rQ   )rR   objmatchs     rL   	<genexpr>z#FixImports.match.<locals>.<genexpr>q   s+      IIsc

IIIIIIrN   parentF)rb   r[   ri   anyr   )r^   noderesultsri   rd   s      @rL   ri   zFixImports.matchj   sv    j$''-%++ 	  w..IIIIjx.H.HIIIII /uNurN   c                 h    t          t          |                               ||           i | _        d S r`   )rb   r[   
start_treereplace)r^   treefilenamerd   s      rL   rp   zFixImports.start_treev   s.    j$**4:::rN   c                    |                     d          }|r|j        }| j        |         }|                    t	          ||j                             d|v r
|| j        |<   d|v r/|                     |          }|r|                     ||           d S d S d S |d         d         }| j                             |j                  }|r+|                    t	          ||j                             d S d S )Nmodule_name)prefixname_importmultiple_importsrf       )getvaluerV   rq   r   rv   ri   	transform)r^   rm   rn   
import_modmod_namenew_name	bare_names          rL   r|   zFixImports.transformz   s'   [[//
 	K!'H|H-HtHZ5FGGGHHH'' *2X&!W,,
 **T** 2NN411111 -,2 2   01!4I|''	88H K!!$x	8H"I"I"IJJJJJK KrN   )__name__
__module____qualname__BM_compatiblekeep_line_orderMAPPINGrV   	run_orderrY   rc   ri   rp   r|   __classcell__)rd   s   @rL   r[   r[   U   s        MOG I5 5 52 2 2 2 2
 
 
 
 
    K K K K K K KrN   r[   N)__doc__ r   
fixer_utilr   r   r   rM   rY   BaseFixr[   rQ   rN   rL   <module>r      s   5 5       ) ) ) ) ) ) ) )2: 22h2 :2 y	2
 G2 >2 >2 92 -2 /2 12 32 32 32 %2  M!2 2" ^#2$ /%2& 1'2( -)2* -+2, --2. i/20 122 h324 Y526 ?72: Y;2< j=2> *?2@ 9A2B C2D oE2 2F "1#-'#(*,)#'%&/c2 2 2j4 4 4 " M M M M(<K <K <K <K <K# <K <K <K <K <KrN   