a
    ø£Be*  ã                   @   s   d Z dd„ ZdS )zZ
A simple utility to import something by its string name.

Vendored form ipython_genutils
c                 C   sr   |   dd¡}t|ƒdkrb|\}}t||gd�}zt||ƒ}W n  ty\   td| ƒd‚Y n0 |S t|d ƒS 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 %sNé    )ÚrsplitÚlenÚ
__import__ÚgetattrÚAttributeErrorÚImportError)ÚnameÚpartsÚpackageÚobjÚmoduleZpak© r   úT/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/nbformat/_imports.pyÚimport_item   s    r   N)Ú__doc__r   r   r   r   r   Ú<module>   s   
