Format: application/x-python-code
1 o
2
3 ��h � @ s d Z dd� ZdS )z:
4 A simple utility to import something by its string name.
5 c
6 C sr | � dd�}t|�dkr3|\}}t||gd�}zt||�}W |S ty2 } ztd| �|�d}~ww t|d �S )a� Import and return ``bar`` given the string ``foo.bar``.
7
8 Calling ``bar = import_item("foo.bar")`` is the functional equivalent of
9 executing the code ``from foo import bar``.
10
11 Parameters
12 ----------
13 name : string
14 The fully qualified name of the module/package being imported.
15
16 Returns
17 -------
18 mod : module object
19 The module that was imported.
20 �.� � )�fromlistzNo module named %sN� )�rsplit�len�
21 __import__�getattr�AttributeError�ImportError)�name�parts�package�obj�moduleZpak�e� r �Pc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/importstring.py�import_item
22 s ���r N)�__doc__r r r r r �<module> s