
    ^h                        S r SSKJr  SSKJr   " S S\5      rS r             SS jr     SS	 jrSS
 jr	SS jr
SS jr      SS jrSS jrg)a  The basic dict based notebook format.

The Python representation of a notebook is a nested structure of
dictionary subclasses that support attribute access.
The functions in this module are merely
helpers to build the structs in the right form.

Authors:

* Brian Granger
    )annotations)Structc                      \ rS rSrSrSrg)NotebookNode    zA notebook node object. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       L/home/james-whalen/.local/lib/python3.13/site-packages/nbformat/v2/nbbase.pyr   r       s    !r   r   c                   [        U [        5      (       a2  [        5       nU R                  5        H  u  p#[	        U5      X'   M     U$ [        U [
        [        45      (       a  U  Vs/ s H  n[	        U5      PM     sn$ U $ s  snf )z%Create notebook node(s) from a value.)
isinstancedictr   items	from_dicttuplelist)dnewdkvis        r   r   r   $   sl    !T~GGIDAlDG !eT]##&'(a	!a((H )s   'BNc                j   [        5       nU b  [        U 5      Ul        U S:w  a  Ub  [        U5      Ul        Ub  [	        U5      Ul        Ub  [	        U5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul	        Ub  [        U5      Ul
        Ub  [        U5      Ul        U S:X  a  U	b  [        U	5      Ul        U S:X  aS  U
b  [        U
5      Ul        Ub  [        U5      Ul        Ub*  [!        U5       Vs/ s H  n[        U5      PM     snUl        U$ s  snf ),Create a new code cell with input and outputpyerrpyout)r   stroutput_typetextbytespngjpeghtmlsvglatexjson
javascriptintprompt_numberetypeevaluer   	traceback)r"   output_text
output_pngoutput_html
output_svgoutput_latexoutput_jsonoutput_javascriptoutput_jpegr-   r.   r/   r0   outputframes                  r   
new_outputr;   0   s+     ^F -g"k*FK!z*FJ",FK"k*FK!ZFJ#|,FL"k*FK( #$5 6Fg-";"=1gu:FLKFM 8<YHuE
HFM  Is   D0c                    [        5       nSUl        Ub  [        U5      Ul        U b  [        U 5      Ul        Ub  [        U5      Ul        Uc  / Ul        OX%l        Ub  [        U5      Ul	        U$ )r   code)
r   	cell_typer!   languageinputr,   r-   outputsbool	collapsed)r@   r-   rA   r?   rC   cells         r   new_code_cellrE   d   sn     >DDNHZ
  /iKr   c                r    [        5       nUb  [        U5      Ul        Ub  [        U5      Ul        Xl        U$ )zCreate a new text cell.)r   r!   sourcerenderedr>   )r>   rG   rH   rD   s       r   new_text_cellrI   ~   s5    >D&kHNKr   c                x    [        5       nU b  [        U 5      Ul        Uc	  / Ul        U$ [	        U5      Ul        U$ )z5Create a worksheet by name with with a list of cells.)r   r!   namecellsr   )rK   rL   wss      r   new_worksheetrN      s?    	Bd)} I ;Ir   c                    [        5       nSUl        Uc  / Ul        O[        U5      Ul        U c  [	        5       Ul        U$ [        U 5      Ul        U$ )z7Create a notebook by name, id and a list of worksheets.   )r   nbformat
worksheetsr   new_metadatametadata)rT   rR   nbs      r   new_notebookrV      sR    	BBKZ("n I #8,Ir   c                    [        5       nU b  [        U 5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        U$ )zCreate a new metadata node.)	r   r!   rK   r   authorscreatedmodifiedlicensegistid)rK   rX   r[   rY   rZ   r\   rT   s          r   rS   rS      sz     ~HD	=w<Mw<f+Or   c                    [        5       nU b  [        U 5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        Ub  [        U5      Ul        U$ )zCreate a new author.)r   r!   rK   emailaffiliationurl)rK   r^   r_   r`   authors        r   
new_authorrb      sS    ^F$i5z -
X
Mr   )NNNNNNNNNNNNN)NNNpythonF)NN)NNNNNN)NNNN)r   
__future__r   nbformat._structr   r   r   r;   rE   rI   rN   rV   rS   rb   r   r   r   <module>rf      s   
, # #"6 "	 
1j 4	  
2r   