a
     ³ŠaW	  ã                   @   s@   d Z ddlZddlmZ ddlmZ g d¢Zdd„ Zdd	„ ZdS )
z(
Module completion auxiliary functions.
é    N)ÚPickleShareDB)Úget_conf_path)-ZnumpyZscipyZsympyZpandasZnetworkxZstatsmodelsZ
matplotlibZsklearnZskimageZmpmathÚosZpillowZOpenGLZarrayZaudioopZbinasciiZcPickleZ	cStringIOZcmathÚcollectionsZdatetimeÚerrnoÚ
exceptionsÚgcÚ	importlibÚ	itertoolsZmathZmmapZmsvcrtÚntÚoperatorÚastÚsignalÚsysZ	threadingÚtimeZwxÚ	zipimportÚzlibZpytestZPyQt4ZPyQt5ZPySideZPySide2zos.pathc                 C   sx   dd„ }zDt | ƒ}| g}t |j|jd |¡}|D ]}|d }| |¡ q2W n& tyb   g  Y S    | g Y S 0 |S )z$Get all submodules of a given modulec                 S   s   d S )N© )Úmoduler   r   úKlib/python3.9/site-packages/spyder/utils/introspection/module_completion.pyÚcatch_exceptions$   s    z(get_submodules.<locals>.catch_exceptionsÚ.é   )Ú
__import__ÚpkgutilÚwalk_packagesÚ__path__Ú__name__ÚappendÚImportError)Úmodr   ÚmÚ
submodulesÚsubmodsZsmZsm_namer   r   r   Úget_submodules"   s    ÿr$   c                  C   sJ   t dƒ} t| ƒ}d|v r |d S g }tD ]}t|ƒ}||7 }q(||d< |S )zZ
    Get all submodules of the main scientific modules and others of our
    interest
    Zdbr"   )r   r   ÚPREFERRED_MODULESr$   )Zmodules_pathZ
modules_dbr"   r!   r#   r   r   r   Úget_preferred_submodules6   s    
r&   )	Ú__doc__r   Zpicklesharer   Zspyder.config.baser   r%   r$   r&   r   r   r   r   Ú<module>
   s   