
    Ehv                    H    S r SSKJr  SSKJr  SSKJr   " S S\5      rS rg	)
z/NotebookNode - adding attribute access to dicts    )annotations)Mapping   )Structc                  2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )NotebookNode
   z&A dict-like node with attribute-accessc                   > [        U[        5      (       a   [        U[        5      (       d  [        U5      n[        TU ]  X5        g)zSet an item on the notebook.N)
isinstancer   r   	from_dictsuper__setitem__)selfkeyvalue	__class__s      hC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\nbformat/notebooknode.pyr   NotebookNode.__setitem__   s3    eW%%j.M.Me$EC'    c                L   [        U5      S:  a  [        S[        U5      -  5      eU(       aZ  US   n[        U[        5      (       a  U H	  nX4   X'   M     O0[	        US5      (       a  U H	  nX4   X'   M     OU H	  u  pEXPU'   M     UR                  5        H	  u  pEXPU'   M     g)zN
A dict-like update method based on CPython's MutableMapping `update`
method.
r   z+update expected at most 1 arguments, got %dr   keysN)len	TypeErrorr   r   hasattritems)r   argskwargsotherr   r   s         r   updateNotebookNode.update   s    
 t9q=ICPTIUVVGE%)) C %
DI !'' C %
DI ! #(JC %I #( ,,.JCI )r    )	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classcell__)r   s   @r   r   r   
   s    0( r   r   c           
     $   [        U [        5      (       a8  [        U R                  5        VVs0 s H  u  pU[	        U5      _M     snn5      $ [        U [
        [        45      (       a  U  Vs/ s H  n[	        U5      PM     sn$ U $ s  snnf s  snf )zConvert dict to dict-like NotebookNode

Recursively converts any dict in the container to a NotebookNode.
This does not check that the contents of the dictionary make a valid
notebook or part of a notebook.
)r   dictr   r   r   tuplelist)dkvis       r   r   r   )   ss     !TCQ	!_CDD!eT]##&'(a	!a((H D(s   B
-BN)	r&   
__future__r   collections.abcr   _structr   r   r   r!   r   r   <module>r4      s"    5 " # 6 >r   