U
    kuf3                     @  s   d Z ddlmZ dd ZdS )zZ
A simple utility to import something by its string name.

Vendored form ipython_genutils
    )annotationsc                 C  sp   |  dd}t|dkrd|\}}t||gd}zt||}W n" tk
r^   td| dY nX |S t|d S )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)namepartspackageobjmoduleZpak r   5/tmp/pip-unpacked-wheel-zj9qk9v2/nbformat/_imports.pyimport_item   s    r   N)__doc__
__future__r   r   r   r   r   r   <module>   s   