o
    Mh`                     @   s   d dl Z dddZdS )    N c                    sR   dd |D dd |D fdd}t t    fdd} ||fS )a  
    Helper function to import submodules lazily in Python 3.7+

    Parameters
    ----------
    rel_modules: list of str
        list of submodules to import, of the form .submodule
    rel_classes: list of str
        list of submodule classes/variables to import, of the form ._submodule.Foo

    Returns
    -------
    tuple
        Tuple that should be assigned to __all__, __getattr__ in the caller
    c                 S      i | ]
}| d d |qS .split).0
rel_moduler   r   X/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/_plotly_utils/importers.py
<dictcomp>       z#relative_import.<locals>.<dictcomp>c                 S   r   r   r   )r	   rel_pathr   r   r   r      r   c                    sp   | v r|  }t |S |  v r/ |  d}d|d d }| }t |}t||S tdj| d)Nr   r   z-module {__name__!r} has no attribute {name!r})name__name__)	importlibimport_moduler   joingetattrAttributeErrorformat)import_name
rel_importrel_path_partsr
   
class_nameclass_module)class_namesmodule_namesparent_namer   r   __getattr__   s   
z$relative_import.<locals>.__getattr__c                      s    S )Nr   r   )__all__r   r   __dir__/   s   z relative_import.<locals>.__dir__)list)r   rel_modulesrel_classesr   r!   r   )r    r   r   r   r   relative_import   s   
r%   )r   r   )r   r%   r   r   r   r   <module>   s    