
    Mh                    *    d Z ddlmZ ddlmZ d
dZd	S )z:
A simple utility to import something by its string name.
    )annotations)Anynamestrreturnr   c                   t          | t                    st          dt          |           z            |                     dd          }t          |          dk    rP|\  }}t          ||g          }	 t          ||          }n%# t          $ r}t          d|z            |d}~ww xY w|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.
    z&import_item accepts strings, not '%s'..      )fromlistzNo module named %sNr   )

isinstancer   	TypeErrortypersplitlen
__import__getattrAttributeErrorImportError)r   partspackageobjmodulepakes          \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/traitlets/utils/importstring.pyimport_itemr      s      dC   O@4::MNNNKKQE
5zzQGse444	A&#&&CC 	A 	A 	A2S899q@	A
 %(###s   6B 
B)B$$B)N)r   r   r   r   )__doc__
__future__r   typingr   r        r   <module>r#      sS    
 # " " " " "      $ $ $ $ $ $r"   