+
    :i?/                        R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t
 ^ RIHtHt ^ RIHt ^ RIHtHt  ! R R]P&                  4      t]! . RO4      tR t ! R	 R
4      t]! ]4      tR tR tR t ! R R]P<                  4      t ! R R]4      t  ! R R]4      t!]R 4       t"]R 4       t#]R 4       t$RR lt%RR lt&]RR l4       t'R R lt(R t)]PT                  '       d
   ])! 4        R# R# ) ag  
The ``numba.core.event`` module provides a simple event system for applications
to register callbacks to listen to specific compiler events.

The following events are built in:

- ``"numba:compile"`` is broadcast when a dispatcher is compiling. Events of
  this kind have ``data`` defined to be a ``dict`` with the following
  key-values:

  - ``"dispatcher"``: the dispatcher object that is compiling.
  - ``"args"``: the argument types.
  - ``"return_type"``: the return type.

- ``"numba:compiler_lock"`` is broadcast when the internal compiler-lock is
  acquired. This is mostly used internally to measure time spent with the lock
  acquired.

- ``"numba:llvm_lock"`` is broadcast when the internal LLVM-lock is acquired.
  This is used internally to measure time spent with the lock acquired.

- ``"numba:run_pass"`` is broadcast when a compiler pass is running.

    - ``"name"``: pass name.
    - ``"qualname"``: qualified name of the function being compiled.
    - ``"module"``: module name of the function being compiled.
    - ``"flags"``: compilation flags.
    - ``"args"``: argument types.
    - ``"return_type"`` return type.

Applications can register callbacks that are listening for specific events using
``register(kind: str, listener: Listener)``, where ``listener`` is an instance
of ``Listener`` that defines custom actions on occurrence of the specific event.
N)default_timer)contextmanager	ExitStack)defaultdict)configutilsc                   ^    ] tR t^2tRt]P                  ! 4       t]P                  ! 4       tRt	R# )EventStatuszStatus of an event.
     N)
__name__
__module____qualname____firstlineno____doc__enumautoSTARTEND__static_attributes__r
       N/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/core/event.pyr	   r	   2   s    IIKE
))+Cr   r	   c                j    V P                  R4      '       d   V \        9  d   V  R2p\        V4      hV # )a  Guard to ensure that an event kind is valid.

All event kinds with a "numba:" prefix must be defined in the pre-defined
``numba.core.event._builtin_kinds``.
Custom event kinds are allowed by not using the above prefix.

Parameters
----------
kind : str

Return
------
res : str
znumba:zG is not a valid event kind, it starts with the reserved prefix 'numba:')
startswith_builtin_kinds
ValueError)kindmsgs   & r   _guard_kindr   B   s:     x  T%? = =oKr   c                      a  ] tR t^Xt o RtRR lt]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       t]R	 4       tR
 t]tRtV tR# )EventzAn event.

Parameters
----------
kind : str
status : EventStatus
data : any; optional
    Additional data for the event.
exc_details : 3-tuple; optional
    Same 3-tuple for ``__exit__``.
Nc                |    \        V4      V n        W n        W0n        Ve   V^ ,          f
   R V n        R # TV n        R # N)r   _kind_status_data_exc_details)selfr   statusdataexc_detailss   &&&&&r   __init__Event.__init__d   s<     &

 + 3{1~7M ""- 	r   c                    V P                   # )z&Event kind

Returns
-------
res : str
)r"   r&   s   &r   r   
Event.kindl        zzr   c                    V P                   # )z0Event status

Returns
-------
res : EventStatus
)r#   r-   s   &r   r'   Event.statusv   s     ||r   c                    V P                   # )z)Event data

Returns
-------
res : object
)r$   r-   s   &r   r(   
Event.data   r/   r   c                <    V P                   \        P                  8H  # )z3Is it a *START* event?

Returns
-------
res : bool
)r#   r	   r   r-   s   &r   is_startEvent.is_start   s     ||{0000r   c                <    V P                   \        P                  8H  # )z2Is it an *END* event?

Returns
-------
res : bool
)r#   r	   r   r-   s   &r   is_endEvent.is_end   s     ||{..r   c                    V P                   RJ # )zIs the event carrying an exception?

This is used for *END* event. This method will never return ``True``
in a *START* event.

Returns
-------
res : bool
N)r%   r-   s   &r   	is_failedEvent.is_failed   s       D((r   c                    V P                   e!   \        V P                   4      P                   MRpRV P                   RV P                   RV R2# )NNonezEvent(z, z, data: ))r(   typer   r"   r#   )r&   r(   s   & r   __str__Event.__str__   sM    99( 		?//0.4 	

|2dll^8D6CCr   )r$   r%   r"   r#   NN)r   r   r   r   r   r*   propertyr   r'   r(   r5   r8   r;   rA   __repr__r   __classdictcell____classdict__s   @r   r   r   X   s     
/       1 1 / / 
) 
)D
 Hr   r   c                    \        V\        4      '       g   Q h\        V 4      p \        V ,          P	                  V4       R# )zbRegister a listener for a given event kind.

Parameters
----------
kind : str
listener : Listener
N)
isinstanceListenerr   _registeredappendr   listeners   &&r   registerrP      s4     h))))tDX&r   c                    \        V\        4      '       g   Q h\        V 4      p \        V ,          pVP	                  V4       R# )zdUnregister a listener for a given event kind.

Parameters
----------
kind : str
listener : Listener
N)rJ   rK   r   rL   remove)r   rO   lsts   && r   
unregisterrT      s7     h))))tD
d
CJJxr   c                d    \         V P                  ,           F  pVP                  V 4       K  	  R# )zUBroadcast an event to all registered listeners.

Parameters
----------
event : Event
N)rL   r   notify)eventrO   s   & r   	broadcastrX      s&      

++ ,r   c                   r   a  ] tR t^t o Rt]P                  R 4       t]P                  R 4       tR t	Rt
V tR# )rK   z(Base class for all event listeners.
    c                    R# )zKCalled when there is a *START* event.

Parameters
----------
event : Event
Nr
   r&   rW   s   &&r   on_startListener.on_start        	r   c                    R# )zICalled when there is a *END* event.

Parameters
----------
event : Event
Nr
   r[   s   &&r   on_endListener.on_end   r^   r   c                    VP                   '       d   V P                  V4       R# VP                  '       d   V P                  V4       R# \	        R4      h)zPNotify this Listener with the given Event.

Parameters
----------
event : Event
unreachableN)r5   r\   r8   r`   AssertionErrorr[   s   &&r   rV   Listener.notify   s9     >>>MM% \\\KK //r   r
   N)r   r   r   r   r   abcabstractmethodr\   r`   rV   r   rF   rG   s   @r   rK   rK      sF       	 0 0r   rK   c                   V   a  ] tR tRt o RtR tR tR t]R 4       t	]R 4       t
RtV tR	# )
TimingListeneri  zxA listener that measures the total time spent between *START* and
*END* events during the time this listener is active.
c                    ^ V n         R#     N)_depthr-   s   &r   r*   TimingListener.__init__  s	    r   c                x    V P                   ^ 8X  d   \        4       V n        V ;P                   ^,          un         R# rk   )rm   timer_tsr[   s   &&r   r\   TimingListener.on_start	  s%    ;;!wDHqr   c                    V ;P                   ^,          un         V P                   ^ 8X  d7   \        V R^ 4      p\        4       V P                  ,
          V,           V n        R# R# )   	_durationN)rm   getattrrp   rq   ru   )r&   rW   lasts   && r   r`   TimingListener.on_end  sF    q;;!4a0D#g0D8DN r   c                    \        V R4      # )zReturns a ``bool`` indicating whether a measurement has been made.

When this returns ``False``, the matching event has never fired.
If and only if this returns ``True``, ``.duration`` can be read without
error.
ru   )hasattrr-   s   &r   doneTimingListener.done  s     t[))r   c                    V P                   # )zReturns the measured duration.

This may raise ``AttributeError``. Users can use ``.done`` to check
that a measurement has been made.
)ru   r-   s   &r   durationTimingListener.duration  s     ~~r   )rm   ru   rq   N)r   r   r   r   r   r*   r\   r`   rD   r{   r~   r   rF   rG   s   @r   ri   ri     sA     
9 * *  r   ri   c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )RecordingListeneri(  zA listener that records all events and stores them in the ``.buffer``
attribute as a list of 2-tuple ``(float, Event)``, where the first element
is the time the event occurred as returned by ``time.time()`` and the second
element is the event.
c                    . V n         R # r!   bufferr-   s   &r   r*   RecordingListener.__init__.  s	    r   c                f    V P                   P                  \        P                  ! 4       V34       R # r!   r   rM   timer[   s   &&r   r\   RecordingListener.on_start1      DIIK/0r   c                f    V P                   P                  \        P                  ! 4       V34       R # r!   r   r[   s   &&r   r`   RecordingListener.on_end4  r   r   r   N)
r   r   r   r   r   r*   r\   r`   r   rF   rG   s   @r   r   r   (  s     
11 1r   r   c              #  d   "   \        W4        Vx  \        W4       R#   \        Y4       i ; i5i)aU  Install a listener for event "kind" temporarily within the duration of
the context.

Returns
-------
res : Listener
    The *listener* provided.

Examples
--------

>>> with install_listener("numba:compile", listener):
>>>     some_code()  # listener will be active here.
>>> other_code()     # listener will be unregistered by this point.

N)rP   rT   rN   s   &&r   install_listenerr   8  s)     $ T#4"
4"s   0  0-0c              #     "   \        4       p\        W4      ;_uu_ 4        Vx  RRR4       VP                  '       d   V! VP                  4       R# R#   + '       g   i     L8; i5i)a  Install a TimingListener temporarily to measure the duration of
an event.

If the context completes successfully, the *callback* function is executed.
The *callback* function is expected to take a float argument for the
duration in seconds.

Returns
-------
res : TimingListener

Examples
--------

This is equivalent to:

>>> with install_listener(kind, TimingListener()) as res:
>>>    ...
N)ri   r   r{   r~   )r   callbacktls   && r   install_timerr   Q  sH     * 
	B	$	#	# 
$ 
www  
$	#s    A(AA(A(A%	 A(c              #     "   \        4       p\        W4      ;_uu_ 4        Vx  RRR4       R#   + '       g   i     R# ; i5i)aB  Install a RecordingListener temporarily to record all events.

Once the context is closed, users can use ``RecordingListener.buffer``
to access the recorded events.

Returns
-------
res : RecordingListener

Examples
--------

This is equivalent to:

>>> with install_listener(kind, RecordingListener()) as res:
>>>    ...
N)r   r   )r   rls   & r   install_recorderr   n  s-     & 
	B	$	#	# 
$	#	#	#s   A/
AA 		Ac                T    \        V \        P                  VR7      p\        V4       R# )zTrigger the start of an event of *kind* with *data*.

Parameters
----------
kind : str
    Event kind.
data : any; optional
    Extra event data.
)r   r'   r(   N)r   r	   r   rX   )r   r(   evts   && r   start_eventr     s     T+"3"3$
?CcNr   c                T    \        V \        P                  WR7      p\        V4       R# )zTrigger the end of an event of *kind*, *exc_details*.

Parameters
----------
kind : str
    Event kind.
data : any; optional
    Extra event data.
exc_details : 3-tuple; optional
    Same 3-tuple for ``__exit__``. Or, ``None`` if no error.
)r   r'   r(   r)   N)r   r	   r   rX   )r   r(   r)   r   s   &&& r   	end_eventr     s"     +//C cNr   c              #     a a"   \        4       ;_uu_ 4       pVP                  VV 3R l4       p\        S SR7       Rx  RRR4       R#   + '       g   i     R# ; i5i)a  A context manager to trigger the start and end events of *kind* with
*data*. The start event is triggered when entering the context.
The end event is triggered when exiting the context.

Parameters
----------
kind : str
    Event kind.
data : any; optional
    Extra event data.
c                  $   < \        SSV R 7       R# ))r(   r)   N)r   )r)   r(   r   s   *r   on_exittrigger_event.<locals>.on_exit  s    d;?r   )r(   N)r   pushr   )r   r(   scoper   s   ff  r   trigger_eventr     sC      
		@ 
	@ 	Dt$ 
s   A(A	
A	A		Ac                $    V ^8  d   QhR\         /# )   rO   )r   )formats   "r   __annotate__r     s      ): r   c                ^   \         P                  ! 4       p\        P                  ! 4       p. pV P                   Fp  w  rEVP
                  p\        VP                  4      pVR,          pVP                  '       d   RMRp	VR,          p
Tp\        WqW(WVR7      pVP                  V4       Kr  	  V# )zGPrepare events in `listener` for serializing as chrome trace data.
    i@B BEname)catpidtidtsphr   args)osgetpid	threadingget_native_idr   r(   strr   r5   dictrM   )rO   r   r   evsr   recr(   r   	ts_scaledr   r   r   evs   &            r   _prepare_chrome_trace_datar     s     ))+C

!
!
#C
C??xx#((mN	LLLScF|#
 	

2 # Jr   c                    aa \        4       o\        RS4       \        P                  o\        P                  VV3R l4       p R# )zTSetup a RecordingListener and an exit handler to write the captured
events to file.
numba:run_passc                     < \        S4      p \        SR 4      ;_uu_ 4       p\        P                  ! W\        P
                  R7       RRR4       R#   + '       g   i     R# ; i)w)clsN)r   openjsondumpr   _LazyJSONEncoder)r   outfilenamerO   s     r   _write_chrome_trace=_setup_chrome_trace_exit_handler.<locals>._write_chrome_trace  sA     )2(C  CIIcE$:$:; !   s   'AA#	N)r   rP   r   CHROME_TRACEatexit)r   r   rO   s    @@r    _setup_chrome_trace_exit_handlerr     s9     !"Hx(""H__< <r   )znumba:compiler_lockznumba:compileznumba:llvm_lockr   r!   rC   )+r   r   r   r   rf   r   r   r   timeitr   rp   
contextlibr   r   collectionsr   
numba.corer   r   Enumr	   	frozensetr   r   r   listrL   rP   rT   rX   ABCrK   ri   r   r   r   r   r   r   r   r   r   r   r
   r   r   <module>r      s#  !F 
   
    ) 0 # $$))    ,X Xv $
'#0sww #0L#X #L1 1  # #0  8  .$  *0<  
$& r   