Format: application/x-python-code
1 o
2
3 ��h � @ s d Z ddlZddlZdd� ZdS )z[Utility functions for finding modules
4
5 Utility functions for finding modules on sys.path.
6
7 � Nc C sN t j�| �}|j}|du r|jtjv r|jS dS |�d�}|d dv r%|S dS )a�
8 Find module `module_name` on sys.path, and return the path to module `module_name`.
9
10 * If `module_name` refers to a module directory, then return path to `__init__` file.
11 * If `module_name` is a directory without an __init__file, return None.
12
13 * If module is missing or does not have a `.py` or `.pyw` extension, return None.
14 * Note that we are not interested in running bytecode.
15
16 * Otherwise, return the fill path of the module.
17
18 Parameters
19 ----------
20 module_name : str
21
22 Returns
23 -------
24 module_path : str
25 Path to module `module_name`, its __init__.py, or None,
26 depending on above conditions.
27 N�.�����)�py�pyw)� importlib�util� find_spec�origin�loader�sys� meta_path�split)�module_name�spec�module_pathZ
28 split_path� r �Pc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/module_paths.py�find_mod'