o
    ˷e{                     @   s(   d dl mZ d dlmZmZ dd ZdS )    )Path)TYPESHED_PATHcreate_stub_modulec           
      C   s   |j }t|}|jdksJ z|t}W n	 ty   Y nw |d}|jdd }|jdkr6|dd }|durQ| j	|dd}t
| |||||}	|	| j|< |	S dS )	z\
    This function is given a random .pyi file and should return the proper
    module.
    z.pyi    N__init__F)prefer_stubs)pathr   suffixrelative_tor   
ValueErrorwith_suffixpartsnameimport_moduler   stub_module_cache)
inference_stategrammarfile_ioimport_namesmodule_noder
   relative_pathrestactual_value_setstub r   S/var/www/ideatree/venv/lib/python3.10/site-packages/jedi/inference/gradual/utils.pyload_proper_stub_module   s*   


r   N)pathlibr   jedi.inference.gradual.typeshedr   r   r   r   r   r   r   <module>   s    