o
    Ri                     @   sv  d 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mZ ddl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/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKZdLZdMZdNZdOZdPZdQZdRZdSZdTZdUZdVdW ZG dXdY dYejZdZS )[z8
Fixer for standard library imports renamed in Python 3
    )
fixer_base)Nameis_probably_builtinNewlinedoes_tree_import)python_symbols)token)NodeLeaftouch_import_topreprlibreprwinreg_winregconfigparserConfigParsercopyregcopy_regzmultiprocessing.SimpleQueuez"multiprocessing.queues.SimpleQueuequeueQueuesocketserverSocketServer_markupbase
markupbaseztest.supportztest.test_supportzdbm.bsddbhashzdbm.ndbmdbmzdbm.dumbdumbdbmzdbm.gnugdbmzhtml.parser
HTMLParserzhtml.entitieshtmlentitydefszhttp.clienthttplibzhttp.cookiesCookiezhttp.cookiejar	cookielibztkinter.dialogDialogztkinter._fixFixTkztkinter.scrolledtextScrolledTextztkinter.tixTixztkinter.constantsTkconstantsztkinter.dndTkdndztkinter.__init__Tkinterztkinter.colorchoosertkColorChooserztkinter.commondialogtkCommonDialogztkinter.fonttkFontztkinter.ttkttkztkinter.messageboxtkMessageBoxztkinter.turtleturtlezurllib.robotparserrobotparserzxmlrpc.client	xmlrpclibbuiltins__builtin__z	name='%s'z	attr='%s'z$dotted_name=dotted_name< %s '.' %s >z%sz"power< %s trailer< '.' %s > any* >zpower< %s any* >z:from_import=import_from< 'from' %s 'import' imported=any >zfrom_import_submod=import_from< 'from' %s 'import' (%s | import_as_name< %s 'as' renamed=any > | import_as_names< any* (%s | import_as_name< %s 'as' renamed=any >) any* > ) >zrname_import=import_name< 'import' %s > | name_import=import_name< 'import' dotted_as_name< %s 'as' renamed=any > >zAname_import=import_name< 'import' dotted_as_names< names=any* > >c           
      C   s   d| v rA|  dd\} }t|  }t| }t||f }t| }t|||||f }t||f }t||f }t| }	d	|||||	fS t|  }t||f }t| }t
| }d	|||fS )z
    Accepts a string and returns a pattern of possible patterns involving that name
    Called by simple_mapping_to_pattern for each name in the mapping it receives.
    .    | 
)splitsimple_name_matchsubname_matchdotted_name_matchfrom_import_matchfrom_import_submod_matchname_import_matchpower_twoname_matchpower_subname_matchjoinpower_onename_match)
nameattrsimple_namesimple_attrdotted_namei_fromi_from_submodi_nameu_name	u_subname rM   V/home/air/SG/back/venv/lib/python3.10/site-packages/libpasteurize/fixes/fix_imports.pyall_patternsP   s    rO   c                   @   s6   e Zd Zddd eD ZdeefZdd ZdS )
FixImportsr7   c                 C   s   g | ]}t |qS rM   )rO   ).0rC   rM   rM   rN   
<listcomp>m   s    zFixImports.<listcomp>c                 C   s   t dd| d S )Nfuturestandard_libraryr   )selfnoderesultsrM   rM   rN   	transformp   s   zFixImports.transformN)__name__
__module____qualname__rA   MAPPINGPATTERNmultiple_name_import_matchrX   rM   rM   rM   rN   rP   k   s    rP   N) __doc__lib2to3r   lib2to3.fixer_utilr   r   r   r   lib2to3.pygramr   symslib2to3.pgen2r   lib2to3.pytreer	   r
   libfuturize.fixer_utilr   r\   r9   r:   r;   rB   r?   r@   r<   r=   r>   r^   rO   BaseFixrP   rM   rM   rM   rN   <module>   s    	
 !"-