Ë
    :vžjy  ã                  ór   — d Z ddlmZ ddlmZ ddlmZ ddlm	Z	 e
eeee ed«      efZ G d„ d	e	«      Zd
„ Zy)z/NotebookNode - adding attribute access to dictsé    )Úannotations)ÚMapping)Údeepcopyé   )ÚStructNc                  ó.   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zˆ xZS )ÚNotebookNodez&A dict-like node with attribute-accessc                ó|   •— t        |t        «      rt        |t        «      st        |«      }t        ‰| �  ||«       y)zSet an item on the notebook.N)Ú
isinstancer   r	   Ú	from_dictÚsuperÚ__setitem__)ÚselfÚkeyÚvalueÚ	__class__s      €úf/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/nbformat/notebooknode.pyr   zNotebookNode.__setitem__   s/   ø€ ä�eœWÔ%¬j¸ÄÔ.MÜ˜eÓ$ˆEÜ‰Ñ˜C Õ'ó    c                óÖ  — | j                  «       }||t        | «      <   | j                  «       D ]w  \  }}t        |«      }|t        v rt
        j                  |||«       Œ1|t        u r0t
        j                  |||D �cg c]  }t        ||«      ‘Œ c}«       Œit        ||«      ||<   Œy | j                  r/|j                  j                  t        | j                  |«      «       |S c c}w )ar  Deep-copy the node without going through `copy._reconstruct`.

        `copy.deepcopy` only takes its fast path for exact `dict`s, so a `dict`
        subclass falls back to the generic `__reduce_ex__` machinery once per
        node. Notebooks get deep-copied on every `isvalid`, `normalize` and
        `writes` call, which makes that fallback worth avoiding.
        )r   ÚidÚitemsÚtypeÚ_ATOMIC_TYPESÚdictr   ÚlistÚ	_deepcopyÚ__dict__Úupdate)r   ÚmemoÚnewr   r   Ú
value_typeÚitems          r   Ú__deepcopy__zNotebookNode.__deepcopy__   sÉ   € ð �n‰nÓˆØˆŒR�‹X‰ØŸ*™*ž,‰JˆC�Ü˜e›ˆJØœ]Ñ*Ü× Ñ   c¨5Õ1ØœtÑ#ô × Ñ   cÉeÓ+TÉeÀd¬I°d¸DÕ,AÈeÑ+TÕUô % U¨DÓ1��C’ð 'ð �=Š=Ø�L‰L×Ñ¤	¨$¯-©-¸Ó >Ô?Øˆ
ùò ,Us   Á=C&c                ó,  — t        |«      dkD  rt        dt        |«      z  «      ‚|rP|d   }t        |t        «      r|D ]
  }||   | |<   Œ n+t	        |d«      r|D ]
  }||   | |<   Œ n|D ]
  \  }}|| |<   Œ |j                  «       D ]
  \  }}|| |<   Œ y)zf
        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   Úhasattrr   )r   ÚargsÚkwargsÚotherr   r   s         r   r   zNotebookNode.update3   s©   € ô
 ˆt‹9�qŠ=ÜÐIÌCÐPTËIÑUÓVÐVÙØ˜‘GˆEÜ˜%¤Ô)Û �CØ % c¡
�D˜’Iñ !ä˜ Ô'Û �CØ % c¡
�D˜’Iñ !ó #(‘J�C˜Ø %�D˜’Ið #(à Ÿ,™,ž.‰JˆC�ØˆD�ŠIñ )r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r#   r   Ú__classcell__)r   s   @r   r	   r	      s   ø„ Ù0ô(òö8r   r	   c           
     ó  — t        | t        «      r6t        | j                  «       D ��ci c]  \  }}|t	        |«      “Œ c}}«      S t        | t
        t        f«      r| D �cg c]  }t	        |«      ‘Œ c}S | S c c}}w c c}w )zßConvert 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   r   r	   r   r   Útupler   )ÚdÚkÚvÚis       r   r   r   I   so   € ô �!”TÔÜ¸¿¹¼ÔC¹±°°A˜Q¤	¨!£™_¸ÒCÓDÐDÜ�!”eœT�]Ô#Ù&'Ó(¡a ”	˜!• aÑ(Ð(Ø€Hùó Dùâ(s   ©A8
Á!A>)r/   Ú
__future__r   Úcollections.abcr   Úcopyr   r   Ú_structr   ÚstrÚintÚfloatÚboolÚbytesr   Úcomplexr   r	   r   © r   r   Ú<module>rB      s@   ðÙ 5å "å #Ý &å ð �c˜5 $¨©t°D«z¸7ÐC€ô8�6ô 8óvr   