+
    :i}                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RI	t	^ RI
H
t
 ^ RI t  ^ RIHt R t ! R
 R]4      tR#   ] d    ^ RIHt R	 t Li ; i)    )TestCase)utils)convert)readsN)copy)Emptyc                 "    \        V \        4      # N)
isinstancestrss   &T/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/testing/notebook.pyisstrr      s    !S!!    c                 "    \        V \        4      # r
   )r   
basestringr   s   &r   r   r      s    !Z((r   c                   h   a  ] tR t^t o Rt. ROt. ROt^tR tR t	R t
R tR tR tR tR	 tR
tV tR# )NotebookTestaF  Validate a notebook. All code cells are executed in order. The output is either checked
for errors (if no reference output is present), or is compared against expected output.


Useful references:
http://nbformat.readthedocs.org/en/latest/format_description.html
http://jupyter-client.readthedocs.org/en/latest/messaging.html
c                   \        V4      ;_uu_ 4       p\        \        VP                  4       4      V P                  4      pR R R 4       \
        P                  ! 4       w  rV\        XP                   Uu. uF  qwP                  R8X  g   K  VNK  	  up4       F'  w  rV P                  V P                  V4      WV4       K)  	  R #   + '       g   i     L; iu upi )Ncode)openr   r   readNBFORMAT_VERSIONr   start_new_kernel	enumeratecells	cell_type_test_notebook_cellsanitize_cell)	selfnotebooktestfnb_kernelcis	   &&&      r   _test_notebookNotebookTest._test_notebook(   s    (^^qqvvx$*?*?@B **,	"((L(QkkV6Kqq(LMDA$$T%7%7%:AtL N ^ Ms   .C4CCC	c                R  a  \        VR 4      '       d   VP                  pMVP                  pVP                  pVP	                  V4       . pRpRp	Rp
RpS P                  V4      '       d    VP                  R^R7      pTR,          S P                  9  g   KE  TR,          R8X  d?   RTR,          R	,          ,           R
,           TR,          R,          ,           pRp	T
R8X  d   Tp
\        T4      pT\        TP                  4      8  ;'       d    TP                  T,          ;'       g    . pS P                  Y4      pTP                  T4       K  VR8X  d   S P                  V	RW3,          4       R# V 3R lpV! V4      pV! VP                  4      pR#   \         d     EKQ  i ; i)sourceNT )blocktimeoutmsg_typeerrorz  contentenamez
  evalueFcheck_errorz*Executing cell %d resulted in an error:
%sc                 V   < SP                  \        SP                  V 4      4      4      # r
   )dump_canonicallistscrub_outputs)xr!   s   &r   <lambda>2NotebookTest._test_notebook_cell.<locals>.<lambda>S   s     d11$t7I7I!7L2MNr   )hasattrr-   inputiopub_channelexecuteshould_continueget_msgr   IGNORE_TYPESlenoutputstransform_messageappend
assertTrue)r!   cellr)   r'   r#   r   iopubrG   msgno_errorfirst_error	error_msgexpectedoscrubscrubbeds   f&&&&           r   r    NotebookTest._test_notebook_cell0   sv   4"";;D::D$$t	""3''mm$m: :d&7&77z?g- $s9~g'> > G#i.YaJb bI$H"b(&'Ls4<<00DDT\\!_JJ**39q!M!OOH&SU`Tl&lm
 OEW~HT\\*H+  s   ,F F&%F&c                4    \         P                  ! V^RR7      # )   T)indent	sort_keys)jsondumps)r!   objs   &&r   r8   NotebookTest.dump_canonicalZ   s    zz#a488r   c              #  r  aa"   V F  p\        V4      pR F  w  ooVV3R lpRV9   d   V! VR,          4      VR&   RV9   g   K/  \        VR,          \        4      '       d5   VR,          P                  4        F  w  rVV! V4      VR,          V&   K  	  K  V! VR,          4      VR&   K  	  Vx  K  	  R# 5i)z-
remove all scrubs from output data and text
c                    < \        V 4      '       d   \        P                  ! SSV 4      # V  Uu. uF  p\        P                  ! SSV4      NK  	  up# u upi r
   )r   resub)lineslinerS   ra   s   & r   _scrubLines/NotebookTest.scrub_outputs.<locals>._scrubLinese   sD    U||!vveS%88EJKUTuc4 8UKKKs   !AtextdataN )r   r   dictitems)	r!   rG   outputoutrd   mimerg   rS   ra   s	   &&     @@r   r:   NotebookTest.scrub_outputs]   s      Fv,C 
sL S="-c&k":CKS=!#f+t44*-f+*;*;*=JD0;D0ACK- +> '2#f+&>F !  I' s   =B7A1B7c                P    V P                    F  pVP                  VR4       K  	  V# )z5
remove keys from STRIP_KEYS to ensure comparability
N)
STRIP_KEYSpop)r!   dkeys   && r   
strip_keysNotebookTest.strip_keysv   s%     ??CEE#t #r   c                N    VP                    F  pV P                  V4       K  	  V# )z 
remove non-reproducible things
)rG   rt   )r!   rK   rk   s   && r   r    NotebookTest.sanitize_cell~   s#     llFOOF# #r   c                :   RRRRR//pRVR,          /pVP                  VR,          4       V P                  V4      pVP                  4        F-  w  rVWT9   g   K  WE,          V9   g   K  WdV,          ,          WE&   K/  	  RV9   d   RV9  d   VR,          VR	&   VR V# )
z6
transform a message into something like the notebook
output_typepyoutexecute_resultpyerrr2   r1   r3   rg   rf   )updatert   rj   )r!   rM   rQ   	SWAP_KEYSrk   rs   swapss   &&&    r   rH   NotebookTest.transform_message   s    
 )
	 C
O
 	c)n%(#//+JC}!5#3K0 , Vh 6#F^F6Nvr   c                f    Vf   R# VR,          R8H  ;'       d    VR,          R,          R8H  '       * # )zA
determine whether the current message is the last for this cell
Tr1   statusr3   execution_stateidlerh   )r!   rM   s   &&r   rC   NotebookTest.should_continue   sB     ;
Ox/ @ @	N#45?A 	Ar   rh   N)execute_requestexecute_inputr   pyin)execution_count	tracebackprompt_numberr-   )__name__
__module____qualname____firstlineno____doc__rE   rp   r   r*   r   r8   r:   rt   r    rH   rC   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sN      JLLJM%+T926A Ar   r   )unittestr   ipykernel.testsr   nbformat.converterr   nbformat.readerr   r`   rZ   r   queuer   r   ImportErrorQueuer   rh   r   r   <module>r      sS     ! & ! 	   )"PA8 PA  ))	)s   	A AA