o
    2g                     @  s8   d Z ddlmZ ddlmZmZmZ dddddZdS )zf
This is a module for various lookup functions:
functions that will find a semantic node by its name.
    )annotations)MypyFileSymbolTableNodeTypeInfoF)raise_on_missingnamestrmodulesdict[str, MypyFile]r   boolreturnSymbolTableNode | Nonec                C  s   | }g }	 d|vr|rd|v sJ d|  dS |j ddd\}}|| ||}|dur0nq|j}|sD|rB|sBJ d|  ddS 	 | }||vr_|r]||v s]J d	|d
| dS || }	|sg|	S |	j}
t|
ts||rz|
szJ d|  dS |
j}qE)aW  Find a symbol using it fully qualified name.

    The algorithm has two steps: first we try splitting the name on '.' to find
    the module, then iteratively look for each next chunk after a '.' (e.g. for
    nested classes).

    This function should *not* be used to find a module. Those should be looked
    in the modules dictionary.
    T.zCannot find module for N   )maxsplitzCannot find z, got a module symbolzCannot find component z for )rsplitappendgetnamespopnode
isinstancer   )r   r	   r   headresttailmodr   keystnoder    r   C/home/garg/my-data/venv/lib/python3.10/site-packages/mypy/lookup.pylookup_fully_qualified   sD   



r    N)r   r   r	   r
   r   r   r   r   )__doc__
__future__r   
mypy.nodesr   r   r   r    r   r   r   r   <module>   s
    