o
    g                     @   s  d Z ddlmZ ddlmZmZ ddlmZ erddlm	Z	 edddgZ
e
d	d
Ze
ddZe
ddZe
ddZeeeegZG dd dZdddeeef defddZG dd deZG dd deZG dd deZG dd deZG d d! d!eZd"Zd#S )$zInterfaces for Pylint objects    )
namedtuple)TYPE_CHECKINGTuple)nodes)Section
ConfidencenamedescriptionHIGHzNo false positive possible.	INFERENCEz"Warning based on inference result.INFERENCE_FAILUREz)Warning based on inference with failures.	UNDEFINEDz0Warning without any associated confidence level.c                   @   s   e Zd ZdZedd ZdS )	InterfacezBase class for interfaces.c                 C   s
   t || S )N)
implements)clsinstance r   O/home/ubuntu/cloudmapper/venv/lib/python3.10/site-packages/pylint/interfaces.pyis_implemented_by+   s   
zInterface.is_implemented_byN)__name__
__module____qualname____doc__classmethodr   r   r   r   r   r   (   s    r   obj	interfacereturnc                 C   s>   t | dd}t|ttfs|f}|D ]
}t||r dS qdS )z^Return true if the give object (maybe an instance or class) implements
    the interface.
    __implements__r   TF)getattr
isinstancelisttuple
issubclass)r   r   kimplementsimplementedinterfacer   r   r   r   0   s   
r   c                   @   s    e Zd ZdZdd Zdd ZdS )ICheckerzhThis is a base interface, not designed to be used elsewhere than for
    sub interfaces definition.
    c                 C      dS )z3called before visiting project (i.e set of modules)Nr   selfr   r   r   openB       zIChecker.openc                 C   r&   )z2called after visiting project (i.e set of modules)Nr   r'   r   r   r   closeE   r*   zIChecker.closeN)r   r   r   r   r)   r+   r   r   r   r   r%   =   s    r%   c                   @   s$   e Zd ZdZdejddfddZdS )IRawCheckerz6interface for checker which need to parse the raw filenoder   Nc                 C   r&   )zXprocess a module

        the module's content is accessible via astroid.stream
        Nr   )r(   r-   r   r   r   process_moduleL   r*   zIRawChecker.process_module)r   r   r   r   r   Moduler.   r   r   r   r   r,   I   s    r,   c                   @   s   e Zd ZdZdd ZdS )ITokenCheckerz:Interface for checkers that need access to the token list.c                 C   r&   )z[Process a module.

        tokens is a list of all source code tokens in the file.
        Nr   )r(   tokensr   r   r   process_tokensV   r*   zITokenChecker.process_tokensN)r   r   r   r   r2   r   r   r   r   r0   S   s    r0   c                   @   s   e Zd ZdZdS )IAstroidCheckerzWinterface for checker which prefers receive events according to
    statement type
    N)r   r   r   r   r   r   r   r   r3   ]   s    r3   c                   @   s$   e Zd ZdZd
ddZddd	ZdS )	IReporterzFreporter collect messages and display results encapsulated in a layoutr   Nc                 C   r&   )z Handle the given message object.Nr   )r(   msgr   r   r   handle_messagef   r*   zIReporter.handle_messagelayoutr   c                 C   r&   )z/display results encapsulated in the layout treeNr   )r(   r7   r   r   r   display_reportsi   r*   zIReporter.display_reports)r   N)r7   r   r   N)r   r   r   r   r6   r8   r   r   r   r   r4   c   s    
r4   )r,   r3   r0   r4   r%   N)r   collectionsr   typingr   r   astroidr   pylint.reporters.ureports.nodesr   r   r
   r   r   r   CONFIDENCE_LEVELSr   typeboolr   r%   r,   r0   r3   r4   __all__r   r   r   r   <module>   s,   





