
    ;;i:                     $    d Z ddlmZ dedefdZy)z:
A simple utility to import something by its string name.
    )Anynamereturnc                     | j                  dd      }t        |      dk(  r"|\  }}t        ||g      }	 t        ||      }|S t        |d         S # t        $ r}t        d|z        |d}~ww xY w)a  Import and return ``bar`` given the string ``foo.bar``.

    Calling ``bar = import_item("foo.bar")`` is the functional equivalent of
    executing the code ``from foo import bar``.

    Parameters
    ----------
    name : string
        The fully qualified name of the module/package being imported.

    Returns
    -------
    mod : module object
        The module that was imported.
    .      )fromlistzNo module named %sNr   )rsplitlen
__import__getattrAttributeErrorImportError)r   partspackageobjmodulepakes          W/home/rose/Desktop/poly/venv/lib/python3.12/site-packages/IPython/utils/importstring.pyimport_itemr      s    " KKQE
5zQGse4	A&#&C 
 %(##  	A2S89q@	As   A 	A.A))A.N)__doc__typingr   strr        r   <module>r      s"    $c $c $r   