Format: application/x-python-code
⬇ Download File (1.0 KB)
   1  o
   2  
   3  ��h�@sdZdd�ZdS)z:
   4  A simple utility to import something by its string name.
   5  c
   6  Csr|�dd�}t|�dkr3|\}}t||gd�}zt||�}W|Sty2}ztd|�|�d}~wwt|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���rN)�__doc__rrrrr�<module>s