
    5 f                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZ ddlmZ dZd	Zd
 ZefdefdZdZd Zd ZdefdZd ZdefdZd ZdeddfdZdS )zAstroid hooks for six module.    )dedent)nodes)register_module_extender)AstroidBuilder)AstroidBuildingErrorAttributeInferenceErrorInferenceError)AstroidManagerzsix.add_metaclasszsix.with_metaclassc                 *    |                                  S )N)strip)lines    M/var/www/equiseq/venv/lib/python3.11/site-packages/astroid/brain/brain_six.pydefault_predicater      s    ::<<    returnc                 P      fd}d                      |                      S )aF  Adds 'prefix' to the beginning of selected lines in 'text'.

    If 'predicate' is provided, 'prefix' will only be added to the lines
    where 'predicate(line)' is True. If 'predicate' is not provided,
    it will default to adding 'prefix' to all non-empty lines that do not
    consist solely of whitespace characters.
    c               3   d   K                        d          D ]}  |           r| z   n| V  d S )NT)
splitlines)r   	predicateprefixtexts    r   prefixed_linesz_indent.<locals>.prefixed_lines$   sP      OOD)) 	= 	=D#,9T??<&4--<<<<	= 	=r    )join)r   r   r   r   s   ``` r   _indentr      sD    = = = = = = = 77>>##$$$r   a  
import _io
cStringIO = _io.StringIO
filter = filter
from itertools import filterfalse
input = input
from sys import intern
map = map
range = range
from importlib import reload
reload_module = lambda module: reload(module)
from functools import reduce
from shlex import quote as shlex_quote
from io import StringIO
from collections import UserDict, UserList, UserString
xrange = range
zip = zip
from itertools import zip_longest
import builtins
import configparser
import copyreg
import _dummy_thread
import http.cookiejar as http_cookiejar
import http.cookies as http_cookies
import html.entities as html_entities
import html.parser as html_parser
import http.client as http_client
import http.server as http_server
BaseHTTPServer = CGIHTTPServer = SimpleHTTPServer = http.server
import pickle as cPickle
import queue
import reprlib
import socketserver
import _thread
import winreg
import xmlrpc.server as xmlrpc_server
import xmlrpc.client as xmlrpc_client
import urllib.robotparser as urllib_robotparser
import email.mime.multipart as email_mime_multipart
import email.mime.nonmultipart as email_mime_nonmultipart
import email.mime.text as email_mime_text
import email.mime.base as email_mime_base
import urllib.parse as urllib_parse
import urllib.error as urllib_error
import tkinter
import tkinter.dialog as tkinter_dialog
import tkinter.filedialog as tkinter_filedialog
import tkinter.scrolledtext as tkinter_scrolledtext
import tkinter.simpledialog as tkinder_simpledialog
import tkinter.tix as tkinter_tix
import tkinter.ttk as tkinter_ttk
import tkinter.constants as tkinter_constants
import tkinter.dnd as tkinter_dnd
import tkinter.colorchooser as tkinter_colorchooser
import tkinter.commondialog as tkinter_commondialog
import tkinter.filedialog as tkinter_tkfiledialog
import tkinter.font as tkinter_font
import tkinter.messagebox as tkinter_messagebox
import urllib
import urllib.request as urllib_request
import urllib.robotparser as urllib_robotparser
import urllib.parse as urllib_parse
import urllib.error as urllib_error
c                      t          d                              t          t          d                    } t	          t                                                    |           }d|_        |S )Nz9
    class Moves(object):
    {}
    moves = Moves()
    z    	six.moves)r   formatr   _IMPORTSr   r
   string_buildname)codemodules     r   six_moves_transformr$   m   sa    	  fWXv&&'' 	 N,,--::4@@FFKMr   c                    | dk    o|                      d          }| dk    r|st          |           t          t                                                    t
                    }d|_        |rt          |j                  }| |d                             d          	                    dd          }	 |
                    |          d         }n## t          $ r}t          |           |d}~ww xY wt          |t          j                  r4t                                          |j        d         d                   }|S |S )a  Fix six.moves imports due to the dynamic nature of this
    class.

    Construct a pseudo-module which contains all the necessary imports
    for six

    :param modname: Name of failed module
    :type modname: str

    :return: An astroid module
    :rtype: nodes.Module
    r   )modnameN._r   )
startswithr   r   r
   r    r   r!   lenlstripreplacegetattrr   
isinstancer   Importast_from_module_namenames)r&   attribute_ofr#   start_index	attributeimport_attrexc	submodules           r   _six_fail_hookr8   z   sJ    k)Mg.@.@.M.ML+l"73333N,,--::8DDFFK 
&+&&KLL)0055==c3GG		A ..33A6KK& 	A 	A 	A&w777S@	Ak5<00 	&((==k>OPQ>RST>UVVI Ms   6C 
C2C--C2c                     | j         sdS | j         j        D ]B}t          |t          j                  s|j                                        t          k    r dS CdS )NFT)
decoratorsr   r.   Callfunc	as_stringSIX_ADD_METACLASS)node	decorators     r   ,_looks_like_decorated_with_six_add_metaclassrA      sg    ? u_*  	)UZ00 	>##%%):::44 ;5r   c                 b   | j         sdS | j         j        D ]}t          |t          j                  s	 t	          |j                                                  }n# t          t          f$ r Y Xw xY w|	                                t          k    r|j        r|j        d         }|| _        | c S dS )zCheck if the given class node is decorated with *six.add_metaclass*.

    If so, inject its argument as the metaclass of the underlying class.
    Nr   )r:   r   r.   r;   nextr<   inferr	   StopIterationqnamer>   args
_metaclass)r?   r@   r<   	metaclasss       r   transform_six_add_metaclassrJ      s    
 ? _*  	)UZ00 			,,..//DD. 	 	 	H	::<<,,,,!q)I'DOKKK
Fs   &AA/.A/c                    t          | j                  dk    rdS | j        d         }t          |t          j                  sdS 	 t          |j        d          r%|j        j        j        }|j        j	        }| d| }n5|j
        j
        }|j        d         d         }|j         d|j        j         }n# t          t          t          f$ r Y dS w xY w|t           k    S )N   Fr   exprr'   with_metaclass)r*   basesr.   r   r;   hasattrr<   rM   r!   attrnameparentlocalsr&   AttributeErrorKeyError
IndexErrorSIX_WITH_METACLASS)r?   basemodr<   import_froms        r   *_looks_like_nested_from_six_with_metaclassr[      s    
4:!u:a=DdEJ'' u49f%% 
	=).%C9%D??D??DD +$C*%56q9K!)<<DIN<<DHj1   uu%%%s   A/B5 5CCc                 D    | j         d         }|j        d         | _        | S )zCheck if the given class node is defined with *six.with_metaclass*.

    If so, inject its argument as the metaclass of the underlying class.
    r   )rO   rG   rH   )r?   calls     r   transform_six_with_metaclassr^      s!    
 :a=DilDOKr   managerNc                 >   t          | dt                     t          | dt                     |                     t                     |                     t
          j        t          t                     |                     t
          j        t          t                     d S )Nsixz&requests.packages.urllib3.packages.six)r   r$   register_failed_import_hookr8   register_transformr   ClassDefrJ   rA   r^   r[   )r_   s    r   registerre      s    We-@AAA9;N   ''777#4  
 $2    r   )__doc__textwrapr   astroidr   astroid.brain.helpersr   astroid.builderr   astroid.exceptionsr   r   r	   astroid.managerr
   r>   rW   r   strr   r   r$   r8   boolrA   rJ   r[   r^   re    r   r   <module>rp      s  
 $ #             : : : : : : * * * * * *         
 + * * * * *' )    %6 % %# % % % % ?D
 
 
     F	$ 	 	 	 	  .& & & & &.  n       r   