+
    :ih                        R t ^ RIHtH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t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
I H!t!H"t" ^ RI#H$t$ R t% ! R R]R7      t& ! R R]&4      t' ! R R]R7      t( ! R R])4      t* ! R R]*](4      t+ ! R R]*](4      t, ! R R],4      t- ! R R]*](4      t. ! R R](4      t/ ! R  R!]*](4      t0 ! R" R#]R7      t1 ! R$ R%]14      t2 ! R& R']14      t3 ! R( R)])4      t4 ! R* R+]&4      t5 ! R, R-]54      t6]7! R..4      t8R/ t9R# )0z+
Caching mechanism for compiled functions.
)ABCMetaabstractmethodN)floor)AppDirs)Path)NumbaWarning)BaseContext)CodeLibrary)CompileResult)configcompilerdumpsc                 \    \         P                  '       d   W,          p \        V 4       R # R # N)r   DEBUG_CACHEprint)msgargss   &*P/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/core/caching.py
_cache_logr   "   s!    jc
     c                      a  ] tR t^(t o ]]R 4       4       t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       tRtV tR# )	_Cachec                    R# )zG
The base filesystem path of this cache (for example its root folder).
N selfs   &r   
cache_path_Cache.cache_path*       r   c                    R# )z
Load an overload for the given signature using the target context.
The saved object must be returned if successful, None if not found
in the cache.
Nr   r   sigtarget_contexts   &&&r   load_overload_Cache.load_overload1   r    r   c                    R# )z,
Save the overload for the given signature.
Nr   r   r#   datas   &&&r   save_overload_Cache.save_overload9   r    r   c                    R# )z
Enable the cache.
Nr   r   s   &r   enable_Cache.enable?   r    r   c                    R# )z
Disable the cache.
Nr   r   s   &r   disable_Cache.disableE   r    r   c                    R# )z
Flush the cache.
Nr   r   s   &r   flush_Cache.flushK   r    r   r   N)__name__
__module____qualname____firstlineno__propertyr   r   r%   r*   r-   r0   r3   __static_attributes____classdictcell____classdict__s   @r   r   r   (   s       
    
  
  
  r   r   )	metaclassc                   N   a  ] tR t^Rt o ]R 4       tR tR tR tR t	R t
RtV tR# )		NullCachec                    R # r   r   r   s   &r   r   NullCache.cache_pathS   s    r   c                    R # r   r   r"   s   &&&r   r%   NullCache.load_overloadW       r   c                    R # r   r   )r   r#   cress   &&&r   r*   NullCache.save_overloadZ   rE   r   c                    R # r   r   r   s   &r   r-   NullCache.enable]   rE   r   c                    R # r   r   r   s   &r   r0   NullCache.disable`   rE   r   c                    R # r   r   r   s   &r   r3   NullCache.flushc   rE   r   r   N)r5   r6   r7   r8   r9   r   r%   r*   r-   r0   r3   r:   r;   r<   s   @r   r@   r@   R   s5       r   r@   c                   z   a  ] tR t^gt o RtR t]R 4       t]R 4       t]R 4       t	]
R 4       t]
R 4       tRtV tR	# )
_CacheLocatorz4
A filesystem locator for caching a given function.
c                    V P                  4       p\        P                  ! VR R7       \        P                  ! VR7      P                  4        R# )T)exist_ok)dirN)get_cache_pathosmakedirstempfileTemporaryFileclose)r   paths   & r   ensure_cache_path_CacheLocator.ensure_cache_pathl   s5    ""$
D4(4(..0r   c                    R# )z1
Return the directory the function is cached in.
Nr   r   s   &r   rT   _CacheLocator.get_cache_pathr   r    r   c                    R# )zc
Get a timestamp representing the source code's freshness.
Can return any picklable Python object.
Nr   r   s   &r   get_source_stamp_CacheLocator.get_source_stampx   r    r   c                    R# )z
Get a string disambiguator for this locator's function.
It should allow disambiguating different but similarly-named functions.
Nr   r   s   &r   get_disambiguator_CacheLocator.get_disambiguator   r    r   c                    \         h)zM
Create a locator instance for the given function located in the
given file.
)NotImplementedErrorclspy_funcpy_files   &&&r   from_function_CacheLocator.from_function   s
     "!r   c                R   \         P                  P                  V4      p\         P                  P                  V4      p\         P                  P	                  V4      R,          p\
        P                  ! VP                  4       4      P                  4       pRP                  WE.4      # )zGiven the Python file path, compute a suitable path inside the
cache directory.

This will reduce a file path that is too long, which can be a problem
on some operating system (i.e. Windows 7).
_)
rU   rZ   abspathdirnamesplithashlibsha1encode	hexdigestjoin)rh   rj   rZ   subpath	parentdirhasheds   &&    r   get_suitable_cache_subpath(_CacheLocator.get_suitable_cache_subpath   sq     www'''//$'GGMM'*2.	 gnn./99;xx+,,r   r   N)r5   r6   r7   r8   __doc__r[   r   rT   r`   rc   classmethodrk   r{   r:   r;   r<   s   @r   rP   rP   g   ss     1  
     " " - -r   rP   c                   @   a  ] tR t^t o RtR tR t]R 4       tRt	V t
R# )_SourceFileBackedLocatorMixinzZ
A cache locator mixin for functions which are backed by a well-known
Python source file.
c                    \        \        R R4      '       d&   \        P                  ! \        P                  4      pM \        P                  ! V P
                  4      pVP                  VP                  3# )frozenF)getattrsysrU   stat
executable_py_filest_mtimest_sizer   sts   & r   r`   ._SourceFileBackedLocatorMixin.get_source_stamp   sJ    3%(((B'B {{BJJ&&r   c                ,    \        V P                  4      # r   )str_linenor   s   &r   rc   /_SourceFileBackedLocatorMixin.get_disambiguator   s    4<<  r   c                    \         P                  P                  V4      '       g   R # V ! W4      p VP                  4        V#   \         d     R # i ; ir   )rU   rZ   existsr[   OSErrorrh   ri   rj   r   s   &&& r   rk   +_SourceFileBackedLocatorMixin.from_function   sN    ww~~g&&7$	""$   		s   A AAr   N)r5   r6   r7   r8   r}   r`   rc   r~   rk   r:   r;   r<   s   @r   r   r      s(     
'! 
 
r   r   c                   L   a a ] tR t^t oRtR tR t]V 3R l4       tRt	Vt
V ;t# )UserProvidedCacheLocatorzX
A locator that always point to the user provided directory in
`numba.config.CACHE_DIR`
c                    W n         VP                  P                  V n        V P	                  V4      p\
        P                  P                  \        P                  V4      V n
        R # r   )r   __code__co_firstlinenor   r{   rU   rZ   rw   r   	CACHE_DIR_cache_path)r   ri   rj   cache_subpaths   &&& r   __init__!UserProvidedCacheLocator.__init__   sG    ''6677@77<<(8(8-Hr   c                    V P                   # r   r   r   s   &r   rT   'UserProvidedCacheLocator.get_cache_path       r   c                v   < \         P                  '       g   R # \        \        V 4      pVP	                  W4      # r   )r   r   superr   rk   )rh   ri   rj   parent	__class__s   &&& r   rk   &UserProvidedCacheLocator.from_function   s0    /5##G55r   r   r   r   )r5   r6   r7   r8   r}   r   rT   r~   rk   r:   r;   __classcell__r   r=   s   @@r   r   r      s.     I  6 6 6r   r   c                   0   a  ] tR t^t o RtR tR tRtV tR# )InTreeCacheLocatorzb
A locator for functions backed by a regular Python module with a
writable __pycache__ directory.
c                    W n         VP                  P                  V n        \        P
                  P                  \        P
                  P                  V P                   4      R 4      V n        R# )__pycache__N)	r   r   r   r   rU   rZ   rw   rq   r   )r   ri   rj   s   &&&r   r   InTreeCacheLocator.__init__   sB    ''6677<<(FVr   c                    V P                   # r   r   r   s   &r   rT   !InTreeCacheLocator.get_cache_path   r   r   r   N)	r5   r6   r7   r8   r}   r   rT   r:   r;   r<   s   @r   r   r      s     
W
   r   r   c                   6   a a ] tR t^t oRtV 3R ltRtVtV ;t# )InTreeCacheLocatorFsAgnosticz
A locator for functions backed by a regular Python module with a
writable __pycache__ directory. This version is agnostic to filesystem differences,
e.g. timestamp precision with milliseconds.
c                V   < \         SV `  4       p\        V^ ,          4      V^,          3# )    )r   r`   r   )r   r   r   s   & r   r`   -InTreeCacheLocatorFsAgnostic.get_source_stamp   s'    W%'RU|RU""r   r   )	r5   r6   r7   r8   r}   r`   r:   r;   r   r   s   @@r   r   r      s     # #r   r   c                   @   a  ] tR t^t o RtR tR t]R 4       tRt	V t
R# )UserWideCacheLocatorz|
A locator for functions backed by a regular Python module or a
frozen executable, cached into a user-wide cache directory.
c                    W n         VP                  P                  V n        \	        R RR7      pVP
                  pV P                  V4      p\        P                  P                  WE4      V n
        R# numbaF)appname	appauthorN)r   r   r   r   r   user_cache_dirr{   rU   rZ   rw   r   r   ri   rj   appdirs	cache_dirr   s   &&&   r   r   UserWideCacheLocator.__init__   sV    ''66'U;**	77@77<<	Ar   c                    V P                   # r   r   r   s   &r   rT   #UserWideCacheLocator.get_cache_path   r   r   c                    \         P                  P                  V4      '       g   \        \        R R4      '       g   R# V ! W4      p VP                  4        V#   \         d     R# i ; i)r   FN)rU   rZ   r   r   r   r[   r   r   s   &&& r   rk   "UserWideCacheLocator.from_function  s^    w''73%+H+H 7$	""$   		s   A A)(A)r   N)r5   r6   r7   r8   r}   r   rT   r~   rk   r:   r;   r<   s   @r   r   r      s)     
B   r   r   c                   L   a  ] tR tRt o RtR tR tR tR t]	R 4       t
RtV tR	# )
IPythonCacheLocatori  zL
A locator for functions entered at the IPython prompt (notebook or other).
c                    W n         \        P                  ! V4      p\        V\        4      '       d	   W0n        R# VP                  R 4      V n        R# )zutf-8N)r   inspect	getsource
isinstancebytes_bytes_sourceru   )r   ri   rj   sources   &&& r   r   IPythonCacheLocator.__init__  s=     ""7+fe$$!'!'w!7Dr   c                     ^ RI Hp \        P
                  P                  V! 4       R4      #   \         d
    ^ RIHp  L8i ; i)r   )get_ipython_cache_dirnumba_cache)IPython.pathsr   ImportErrorIPython.utils.pathrU   rZ   rw   )r   r   s   & r   rT   "IPythonCacheLocator.get_cache_path   s<    
	A; ww||13]CC  	A@	As   - A Ac                ^    \         P                  ! V P                  4      P                  4       # r   )rs   sha256r   rv   r   s   &r   r`   $IPythonCacheLocator.get_source_stamp,  s     ~~d001;;==r   c                    R P                  V P                  P                  R4      R,          4      p\        P                  ! V4      P                  4       R,          # )r   T:N   N:N
   N)rw   r   
splitlinesrs   r   rv   )r   
firstliness   & r   rc   %IPythonCacheLocator.get_disambiguator/  sE     XXd00;;DA"EF
~~j)335c::r   c                0   VP                  R 4      '       gT   \        P                  P                  \        P                  P	                  V4      4      P                  R4      '       g   R# V ! W4      p VP                  4        V#   \         d     R# i ; i)z	<ipython-
ipykernel_N)
startswithrU   rZ   basenamerq   r[   r   r   s   &&& r   rk   !IPythonCacheLocator.from_function8  s{     {++ww 89DD\RR7$	""$   		s   4B BB)r   r   N)r5   r6   r7   r8   r}   r   rT   r`   rc   r~   rk   r:   r;   r<   s   @r   r   r     s3     8
D>;  r   r   c                   V   a  ] tR tRt o RtR t]R 4       tR tR t	]
R 4       tRtV tR	# )
ZipCacheLocatoriH  zH
A locator for functions backed by Python modules within a zip archive.
c                    W n         VP                  P                  V n        V P	                  V4      w  V n        V n        \        R RR7      pVP                  pV P                  V4      p\        P                  P                  WE4      V n        R# r   )r   r   r   r   _split_zip_path	_zip_path_internal_pathr   r   r{   rU   rZ   rw   r   r   s   &&&   r   r   ZipCacheLocator.__init__M  sr    ''66.2.B.B7.K++ 'U;**	77@77<<	Ar   c           	     :   \        V 4      p\        VP                  4       Fm  w  r#VP                  R 4      '       g   K  \	        \        VP                  RV^,            !  4      p\	        \        VP                  V^,           R !  4      pWE3u # 	  \        R4      h).zipNzNo zip file found in path)r   	enumeratepartsendswithr   
ValueError)rj   rZ   ipartzip_pathinternal_paths   &     r   r   ZipCacheLocator._split_zip_pathY  s    G} ,GA}}V$$tTZZ!a%%89: #D$**QUW*=$> ?..	 -
 455r   c                    V P                   # r   r   r   s   &r   rT   ZipCacheLocator.get_cache_pathc  r   r   c                r    \         P                  ! V P                  4      pVP                  VP                  3# r   )rU   r   r   r   r   r   s   & r   r`    ZipCacheLocator.get_source_stampf  s'    WWT^^${{BJJ&&r   c                $    R V9  d   R# V ! W4      # )r   Nr   rg   s   &&&r   rk   ZipCacheLocator.from_functionj  s     7$$r   )r   r   r   r   r   N)r5   r6   r7   r8   r}   r   staticmethodr   rT   r`   r~   rk   r:   r;   r<   s   @r   r   r   H  sB     
B 6 6 ' % %r   r   c                      a  ] tR tRt o Rt]]]]]	.t
R tR t]R 4       t]R 4       t]R 4       t]R 4       t]R	 4       tR
tV tR# )	CacheImplip  z
Provides the core machinery for caching.
- implement how to serialize and deserialize the data in the cache.
- control the filename of the cache.
- provide the cache locator
c                @   VP                   P                  V n         VP                  p\        P                  '       d   . p\        P                  P                  R 4       F  pVP                  4       pRV9   d8   VP                  R^4      w  rV \        P                  ! V4      p\        Wv4      pM,\!        4       P#                  V4      pVf   \        RV R24      hVP%                  V4       K  	  MV P&                  p\(        P*                  ! V4      p
V F  pVP-                  W4      pVf   K   M	  \        RV: RV
: 24      hWn        \(        P*                  ! V4      p\0        P2                  P5                  \0        P2                  P7                  V4      4      ^ ,          pV: RV: 2p\        \8        RR	4      pV P;                  W4      V n        R#   \         d    TP
                  p ELi ; i  \        \        3 d   p	\        RT R24      T	hRp	?	ii ; i)
,.zFailed to import 'z8' specified via NUMBA_CACHE_LOCATOR_CLASSES env variableNzUnknown cache locator class: 'zcannot cache function z : no locator available for file abiflags )r   r   r   r7   AttributeErrorr5   r   CACHE_LOCATOR_CLASSESrr   striprsplit	importlibimport_moduler   r   RuntimeErrorglobalsgetappend_locator_classesr   getfilerk   _locatorrU   rZ   splitextr   r   get_filename_base_filename_base)r   ri   qualnamelocator_classeslocator_class_pathmodule_path
class_namemodulerh   esource_pathlocatorfilenamemodnamefullnamer  s   &&              r   r   CacheImpl.__init__  s   ''66	(++H
 ''' O&,&B&B&H&H&M"%7%=%=%?",,.@.G.GQ.O+K^!*!8!8!E%f9 ")--(:;C{*-KL^K_ `V ,V W W&&s+# 'N& #33O oog."C''=G" #
 08+ G H H ??7+''""277#3#3H#=>qA%x03
B/"44XHW  	(''H	( (8 ^*-?@R?S TV ,V W\]^^s)   G !G7G43G47HHHc                    VP                  R R4      P                  RR4      pRpWCV P                  P                  4       \        P                  ^ ,          \        P                  ^,          V3,          # )<r  >z%s-%s.py%d%d%s)replacer  rc   r   version_info)r   r"  r  fixed_fullnamefmts   &&&  r   r  CacheImpl.get_filename_base  si     "))#r2::3Cdll&D&D&F&&q)3+;+;A+>J J 	Jr   c                    V P                   # r   )r  r   s   &r   filename_baseCacheImpl.filename_base  s    """r   c                    V P                   # r   )r  r   s   &r   r  CacheImpl.locator  s    }}r   c                    R# )z$Returns the serialized form the dataNr   r   r)   s   &&r   reduceCacheImpl.reduce       	r   c                    R# )z4Returns the de-serialized form of the *reduced_data*Nr   )r   r$   reduced_datas   &&&r   rebuildCacheImpl.rebuild  r5  r   c                    R# )zEReturns True if the given data is cachable; otherwise, returns False.Nr   r2  s   &&r   check_cachableCacheImpl.check_cachable  r5  r   )r  r   r  N)r5   r6   r7   r8   r}   r   r   r   r   r   r  r   r  r9   r-  r  r   r3  r8  r;  r:   r;   r<   s   @r   r  r  p  s      	!0IdJ # #        r   r  c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )CompileResultCacheImpli  z6
Implements the logic to cache CompileResult objects.
c                "    VP                  4       # )z$
Returns a serialized CompileResult
)_reduce)r   rG   s   &&r   r3  CompileResultCacheImpl.reduce  s     ||~r   c                F    \         P                  P                  ! V.VO5!  # )z(
Returns the unserialized CompileResult
)r   r
   _rebuildr   r$   payloads   &&&r   r8  CompileResultCacheImpl.rebuild  s      %%..~HHHr   c                   Rp\         ;QJ d&    R VP                   4       F  '       g   K   RM	  RM! R VP                   4       4      '       d   RpMVP                  P                  '       d   RpV'       dr   RVP                  P
                  P                  R4      R
,          : R	V: 2p\        P                  ! V\        V P                  P                  V P                  4       R# R# )z0
Check cachability of the given compile result.
Nc              3   B   "   T F  qP                   '       * x  K  	  R # 5ir   )	can_cache).0xs   & r   	<genexpr>8CompileResultCacheImpl.check_cachable.<locals>.<genexpr>  s     41;;s   TFzas it uses lifted codezLas it uses dynamic globals (such as ctypes pointers and large global arrays)z Cannot cache compiled function "r  z" ro   )anyliftedlibraryhas_dynamic_globalsfndescr  rr   warningswarn_explicitr   r  r   r   )r   rG   cannot_cacher   s   &&  r   r;  %CompileResultCacheImpl.check_cachable  s     34433344443L\\---PL<kk**005b99<IC""3#'==#9#94<<Ir   r   N)
r5   r6   r7   r8   r}   r3  r8  r;  r:   r;   r<   s   @r   r>  r>    s     I r   r>  c                   L   a a ] tR tRt oRtRtR tR tR tV 3R lt	Rt
VtV ;t# )	CodeLibraryCacheImpli  z4
Implements the logic to cache CodeLibrary objects.
Nc                "    VP                  4       # )z"
Returns a serialized CodeLibrary
)serialize_using_object_coder   codelibs   &&r   r3  CodeLibraryCacheImpl.reduce  s     2244r   c                @    VP                  4       P                  V4      # )z&
Returns the unserialized CodeLibrary
)codegenunserialize_libraryrD  s   &&&r   r8  CodeLibraryCacheImpl.rebuild  s     %%';;GDDr   c                $    VP                   '       * # )z-
Check cachability of the given CodeLibrary.
)rQ  r[  s   &&r   r;  #CodeLibraryCacheImpl.check_cachable	  s     ....r   c                   < \        \        V 4      pVP                  W4      pR P                  V P                  V.4      # )-)r   rX  r  rw   _filename_prefix)r   r"  r  r   resr   s   &&&  r   r  &CodeLibraryCacheImpl.get_filename_base  s:    +T2&&x:xx..455r   r   )r5   r6   r7   r8   r}   rf  r3  r8  r;  r  r:   r;   r   r   s   @@r   rX  rX    s,      5E/6 6r   rX  c                      a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR t]P"                  R 4       tRtV tR# )IndexDataCacheFilei  zH
Implements the logic for the index file and data file used by a cache.
c                    Wn         V: R 2V n        \        P                  P	                  V P                   V P                  4      V n        V: R2V n        W0n        \        P                  V n
        R# )z.nbiz.{number:d}.nbcN)r   _index_namerU   rZ   rw   _index_path_data_name_pattern_source_stampr   __version___version)r   r   r-  source_stamps   &&&&r   r   IndexDataCacheFile.__init__  sT    %'4677<<(8(8$:J:JK9F"H)))r   c                (    V P                  / 4       R # r   )_save_indexr   s   &r   r3   IndexDataCacheFile.flush!  s    r   c                D   V P                  4       p W1,          pT P                  YB4       R#   \         dh    \        TP                  4       4      p\        P
                  ! ^4       F  pT P                  T4      pYE9  g   K   M	  XY1&   T P                  T4        Li ; i)z/
Save a new cache entry with *key* and *data*.
N)	_load_indexKeyErrorsetvalues	itertoolscount
_data_nameru  
_save_data)r   keyr)   	overloads	data_nameexistingr   s   &&&    r   saveIndexDataCacheFile.save$  s     $$&		(!I 		(  	(9++-.H__Q' OOA.	, ( 'INY'	(s   - ABBBc                    V P                  4       pVP                  V4      pVf   R#  V P                  V4      #   \         d     R# i ; i)z 
Load a cache entry with *key*.
N)rx  r  
_load_datar   )r   r  r  r  s   &&  r   loadIndexDataCacheFile.load7  sO     $$&	MM#&		??9-- 		s   : A	A	c                    \        V P                  R4      ;_uu_ 4       p\        P                  ! V4      pVP	                  4       pRRR4       XT P                  8w  d   / # \        P                  ! X4      w  rE\        RT P                  4       Y@P                  8w  d   / # T#   + '       g   i     Le; i  \
         d    / u # i ; i)zd
Load the cache index and return it as a dictionary (possibly
empty if cache is empty or obsolete).
rbNz[cache] index loaded from %r)
openrm  pickler  readFileNotFoundErrorrq  loadsr   ro  )r   fversionr)   stampr  s   &     r   rx  IndexDataCacheFile._load_indexE  s    
	d&&-- ++a.vvx . dmm# I!<<-143C3CD&&& I# .- ! 	I	s.   B7 'B$B7 $B4	/B7 4B7 7CCc                V   V P                   V3pV P                  V4      pV P                  V P                  4      ;_uu_ 4       p\        P
                  ! V P                  VRR7       VP                  V4       RRR4       \        RV P                  4       R#   + '       g   i     L(; i)   )protocolNz[cache] index saved to %rro   )	ro  _dump_open_for_writerm  r  dumprq  writer   )r   r  r)   r  s   &&  r   ru  IndexDataCacheFile._save_index^  sy    !!9,zz$!!$"2"233qKKq26GGDM 4 	.0@0@A 43s   5BB(	c                    V P                  V4      p\        VR 4      ;_uu_ 4       pVP                  4       pRRR4       \        P                  ! X4      p\        RV4       V#   + '       g   i     L4; i)r  Nz[cache] data loaded from %r)
_data_pathr  r  r  r  r   )r   namerZ   r  r)   tups   &&    r   r  IndexDataCacheFile._load_dataf  sV    t$$668D ll4 0$7
	 s   A##A3	c                    V P                  V4      pV P                  V4      pV P                  V4      ;_uu_ 4       pVP                  V4       R R R 4       \	        RV4       R #   + '       g   i     L; i)Nz[cache] data saved to %r)r  r  r  r  r   )r   r  r)   rZ   r  s   &&&  r   r  IndexDataCacheFile._save_datan  sU    zz$t$!!$''1GGDM (-t4 ('s   A$$A4	c                :    V P                   P                  VR 7      # ))number)rn  format)r   r  s   &&r   r~  IndexDataCacheFile._data_nameu  s    &&--V-<<r   c                V    \         P                  P                  V P                  V4      # r   )rU   rZ   rw   r   )r   r  s   &&r   r  IndexDataCacheFile._data_pathx  s    ww||D,,d33r   c                    \        V4      # r   r   )r   objs   &&r   r  IndexDataCacheFile._dump{  s    Szr   c              #  r  "   \         P                  ! 4       P                  R,          pV: RV: 2p \        VR4      ;_uu_ 4       pVx  RRR4       \        P
                  ! W14       R#   + '       g   i     L(; i  \         d+     \        P                  ! T4       h   \         d     h i ; ii ; i5i)z
Open *filepath* for writing in a race condition-free way (hopefully).
uuid4 is used to try and avoid name collisions on a shared filesystem.
:N   Nz.tmp.wbN)	uuiduuid4hexr  rU   r'  	Exceptionunlinkr   )r   filepathuidtmpnamer  s   &&   r   r  "IndexDataCacheFile._open_for_write~  s      jjls#!)3/
	gt$$ %JJw) %$  			'"   		sX   0B7A? A,A? *B7,A<	7A? ?B4B"!B4"B0-B4/B00B44B7)r   rn  rl  rm  ro  rq  N)r5   r6   r7   r8   r}   r   r3   r  r  rx  ru  r  r  r~  r  r  
contextlibcontextmanagerr  r:   r;   r<   s   @r   rj  rj    s\     *)&2B5=4  r   rj  c                      a  ] tR tRt o RtRtR tR t]R 4       t	R t
R tR	 tR
 tR tR tR t]P$                  R 4       tR tRtV tR# )Cachei  a   
A per-function compilation cache.  The cache saves data in separate
data files and maintains information in an index file.

There is one index file per function and Python version
("function_name-<lineno>.pyXY.nbi") which contains a mapping of
signatures and architectures to data files.
It is prefixed by a versioning key and a timestamp of the Python source
file containing the function.

There is one data file ("function_name-<lineno>.pyXY.<number>.nbc")
per function, function signature, target architecture and Python version.

Separate index and data files per Python version avoid pickle
compatibility problems.

Note:
This contains the driver logic only.  The core logic is provided
by a subclass of ``CacheImpl`` specified as *_impl_class* in the subclass.
Nc                ~   \        V4      V n        Wn        V P                  V4      V n        V P                  P
                  P                  4       V n        V P                  P
                  P                  4       pV P                  P                  p\        V P                  VVR 7      V n        V P                  4        R# ))r   r-  rr  N)repr_name_py_func_impl_class_implr  rT   r   r`   r-  rj  _cache_filer-   )r   ri   rr  r-  s   &&  r   r   Cache.__init__  s    ']
%%g.
::--<<>zz))::<

00-9I9I<I;GI 	r   c                T    R V P                   P                  : RV P                  : R2# )r%  z	 py_func=r&  )r   r5   r  r   s   &r   __repr__Cache.__repr__  s    $(NN$;$;TZZHHr   c                    V P                   # r   r   r   s   &r   r   Cache.cache_path  s    r   c                    R V n         R# )TN_enabledr   s   &r   r-   Cache.enable  s	    r   c                    R V n         R# )FNr  r   s   &r   r0   Cache.disable  s	    r   c                :    V P                   P                  4        R # r   )r  r3   r   s   &r   r3   Cache.flush  s     r   c                    VP                  4        V P                  4       ;_uu_ 4        V P                  W4      uuRRR4       #   + '       g   i     R# ; i)zZ
Load and recreate the cached object for the given signature,
using the *target_context*.
N)refresh!_guard_against_spurious_io_errors_load_overloadr"   s   &&&r   r%   Cache.load_overload  s<     	 3355&&s; 6555s   AA	c                    V P                   '       g   R # V P                  WP                  4       4      pV P                  P	                  V4      pVe   V P
                  P                  W$4      pV# r   )r  
_index_keyr_  r  r  r  r8  )r   r#   r$   r  r)   s   &&&  r   r  Cache._load_overload  sZ    }}}ooc#9#9#;<$$S)::%%n;Dr   c                    V P                  4       ;_uu_ 4        V P                  W4       RRR4       R#   + '       g   i     R# ; i)z5
Save the data for the given signature in the cache.
N)r  _save_overloadr(   s   &&&r   r*   Cache.save_overload  s0     3355* 6555s	   5A	c                ^   V P                   '       g   R # V P                  P                  V4      '       g   R # V P                  P                  P	                  4        V P                  WP                  4      pV P                  P                  V4      pV P                  P                  W24       R # r   )
r  r  r;  r  r[   r  r_  r3  r  r  )r   r#   r)   r  s   &&& r   r  Cache._save_overload  sv    }}}zz((..

,,.ooc<<0zz  &c(r   c              #     "   \         P                  R 8X  d    Rx  R# Rx  R#   \         d,   pTP                  \        P                  8w  d   h  Rp?R# Rp?ii ; i5i)ntN)rU   r  r   errnoEACCES)r   r  s   & r   r  'Cache._guard_against_spurious_io_errors  sF     77d?   77ell* +s*   A% AA AAAAc                N   V P                   P                  P                  pV P                   P                  eE   \	        V P                   P                   Uu. uF  qDP
                  NK  	  up4      p\        V4      pMRpR pWP                  4       V! V4      V! V4      33# u upi )z
Compute index key for the given signature and codegen.
It includes a description of the OS, target architecture and hashes of
the bytecode for the function and, if the function has a __closure__,
a hash of the cell_contents.
r   c                 J    \         P                  ! V 4      P                  4       # r   )rs   r   rv   )rK  s   &r   <lambda>"Cache._index_key.<locals>.<lambda>  s    7>>!,668r   )r  r   co_code__closure__tuplecell_contentsr   magic_tuple)r   r#   r_  	codebytesrK  cvars	cvarbyteshashers   &&&     r   r  Cache._index_key  s     MM**22	==$$0DMM4M4MN4Mq??4MNOE eII8((*VI->-3I->-A B 	B Os   B")r  r   r  r  r  r  )r5   r6   r7   r8   r}   r  r   r  r9   r   r-   r0   r3   r%   r  r*   r  r  r  r  r  r:   r;   r<   s   @r   r  r    sy     , KI    !<+)  B Br   r  c                       ] tR tRtRt]tRtR# )FunctionCachei  z>
Implements Cache that saves and loads CompileResult objects.
r   N)r5   r6   r7   r8   r}   r>  r  r:   r   r   r   r  r    s     )Kr   r  r  c                   a a S \         9  g   Q h\         P                  S 4        ! V 3R lR\        4      o ! V3R lR\        4      pV# )z
Create a Cache class for additional compilation features to cache their
result for reuse.  The cache is saved in filename pattern like
in ``FunctionCache`` but with additional *prefix* as specified.
c                      < ] tR tRt Z tRtR# )6make_library_cache.<locals>.CustomCodeLibraryCacheImpli&  r   N)r5   r6   r7   r8   rf  r:   )prefixs   r   CustomCodeLibraryCacheImplr  &  s	    !r   r  c                   "   < ] tR tRtRt Z tRtR# )(make_library_cache.<locals>.LibraryCachei)  zu
Implements Cache that saves and loads CodeLibrary objects for additional
feature for the specified python function.
r   N)r5   r6   r7   r8   r}   r  r:   )r  s   r   LibraryCacher  )  s    	 1r   r  )_lib_cache_prefixesaddrX  r  )r  r  r  s   f @r   make_library_cacher    sC     ,,,,F#"%9 "1u 1 r   ):r}   abcr   r   r  r  rs   r  r   r|  mathr   rU   r  r   rW   r  rS  numba.misc.appdirsr   zipfilepathlibr   r   numba.core.errorsr   numba.core.baser   numba.core.codegenr	   numba.core.compilerr
   
numba.corer   r   numba.core.serializer   r   r   r@   rP   objectr   r   r   r   r   r   r   r  r>  rX  rj  r  r  rz  r  r  r   r   r   <module>r     sK  
 (        	  
    &    * ' * - ' &'w 'T *6-g 6-rF @6<m 6, 6  	##5 	#8- @4- 4n&%3] &%P_' _D!Y !H69 6>{ {|{BF {B|)E ) 2$i r   