o
    Zh{                     @   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)Zprefer_stubs)pathr   suffixrelative_tor   
ValueErrorwith_suffixpartsnameimport_moduler   Zstub_module_cache)
Zinference_stateZgrammarZfile_ioZimport_namesZmodule_noder	   Zrelative_pathrestZactual_value_setZstub r   S/var/www/html/lang_env/lib/python3.10/site-packages/jedi/inference/gradual/utils.pyload_proper_stub_module   s*   


r   N)pathlibr   Zjedi.inference.gradual.typeshedr   r   r   r   r   r   r   <module>   s    