
    xKg[                     2   d Z ddlmZmZmZ ddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlZddlZddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZ d Z  G d de      Z! G d de!      Z" G d de      Z# G d de$      Z% G d de%e#      Z& G d de%e#      Z' G d de%e#      Z( G d de#      Z) G d de      Z* G d d e*      Z+ G d! d"e*      Z, G d# d$e$      Z- G d% d&e!      Z. G d' d(e.      Z/ e0d)g      Z1d* Z2y)+z+
Caching mechanism for compiled functions.
    )ABCMetaabstractmethodabstractpropertyN)AppDirs)NumbaWarning)BaseContext)CodeLibrary)CompileResult)configcompilerdumpsc                 F    t         j                  r| |z  } t        |        y y N)r   DEBUG_CACHEprint)msgargss     V/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/core/caching.py
_cache_logr      s     Djc
     c                   l    e Zd Zed        Zed        Zed        Zed        Zed        Z	ed        Z
y)_Cachec                      y)zW
        The base filesystem path of this cache (for example its root folder).
        N selfs    r   
cache_pathz_Cache.cache_path&       r   c                      y)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_overloadz_Cache.load_overload,   r   r   c                      y)z<
        Save the overload for the given signature.
        Nr   r   r"   datas      r   save_overloadz_Cache.save_overload4   r   r   c                      y)z#
        Enable the cache.
        Nr   r   s    r   enablez_Cache.enable:   r   r   c                      y)z$
        Disable the cache.
        Nr   r   s    r   disablez_Cache.disable@   r   r   c                      y)z"
        Flush the cache.
        Nr   r   s    r   flushz_Cache.flushF   r   r   N)__name__
__module____qualname__r   r   r   r$   r(   r*   r,   r.   r   r   r   r   r   $   sx     
    
  
  
  r   r   )	metaclassc                   :    e Zd Zed        Zd Zd Zd Zd Zd Z	y)	NullCachec                      y r   r   r   s    r   r   zNullCache.cache_pathN   s    r   c                      y r   r   r!   s      r   r$   zNullCache.load_overloadR       r   c                      y r   r   )r   r"   cress      r   r(   zNullCache.save_overloadU   r7   r   c                      y r   r   r   s    r   r*   zNullCache.enableX   r7   r   c                      y r   r   r   s    r   r,   zNullCache.disable[   r7   r   c                      y r   r   r   s    r   r.   zNullCache.flush^   r7   r   N)
r/   r0   r1   propertyr   r$   r(   r*   r,   r.   r   r   r   r4   r4   M   s-     r   r4   c                   f    e Zd ZdZd Zed        Zed        Zed        Ze	d        Z
e	d        Zy)	_CacheLocatorz<
    A filesystem locator for caching a given function.
    c                     | j                         }t        j                  |d       t        j                  |      j                          y )NT)exist_ok)dir)get_cache_pathosmakedirstempfileTemporaryFileclose)r   paths     r   ensure_cache_pathz_CacheLocator.ensure_cache_pathg   s5    ""$
D4(4(..0r   c                      y)zA
        Return the directory the function is cached in.
        Nr   r   s    r   rC   z_CacheLocator.get_cache_pathm   r   r   c                      y)z{
        Get a timestamp representing the source code's freshness.
        Can return any picklable Python object.
        Nr   r   s    r   get_source_stampz_CacheLocator.get_source_stamps   r   r   c                      y)z
        Get a string disambiguator for this locator's function.
        It should allow disambiguating different but similarly-named functions.
        Nr   r   s    r   get_disambiguatorz_CacheLocator.get_disambiguatorz   r   r   c                     t         )ze
        Create a locator instance for the given function located in the
        given file.
        )NotImplementedError)clspy_funcpy_files      r   from_functionz_CacheLocator.from_function   s
     "!r   c                 J   t         j                  j                  |      }t         j                  j                  |      }t         j                  j	                  |      d   }t        j                  |j                               j                         }dj                  ||g      S )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).
        _)
rD   rI   abspathdirnamesplithashlibsha1encode	hexdigestjoin)rR   rT   rI   subpath	parentdirhasheds         r   get_suitable_cache_subpathz(_CacheLocator.get_suitable_cache_subpath   ss     www'''//$'GGMM'*2.	 gnn./99;xxF+,,r   N)r/   r0   r1   __doc__rJ   r   rC   rM   rO   classmethodrU   rd   r   r   r   r?   r?   b   sp    1  
     " " - -r   r?   c                   ,    e Zd ZdZd Zd Zed        Zy)_SourceFileBackedLocatorMixinzf
    A cache locator mixin for functions which are backed by a well-known
    Python source file.
    c                     t        t        dd      r$t        j                  t        j                        }nt        j                  | j
                        }|j                  |j                  fS NfrozenF)getattrsysrD   stat
executable_py_filest_mtimest_size)r   sts     r   rM   z._SourceFileBackedLocatorMixin.get_source_stamp   sG    3%((B'B {{BJJ&&r   c                 ,    t        | j                        S r   )str_linenor   s    r   rO   z/_SourceFileBackedLocatorMixin.get_disambiguator   s    4<<  r   c                     t         j                  j                  |      sy  | ||      }	 |j                          |S # t        $ r Y y w xY wr   )rD   rI   existsrJ   OSErrorrR   rS   rT   r   s       r   rU   z+_SourceFileBackedLocatorMixin.from_function   sM    ww~~g&7G$	""$   		s   = 	A	A	N)r/   r0   r1   re   rM   rO   rf   rU   r   r   r   rh   rh      s%    
'! 
 
r   rh   c                   8     e Zd ZdZd Zd Ze fd       Z xZS )_UserProvidedCacheLocatorzd
    A locator that always point to the user provided directory in
    `numba.config.CACHE_DIR`
    c                     || _         |j                  j                  | _        | j	                  |      }t
        j                  j                  t        j                  |      | _
        y r   )rp   __code__co_firstlinenorv   rd   rD   rI   r`   r   	CACHE_DIR_cache_path)r   rS   rT   cache_subpaths       r   __init__z"_UserProvidedCacheLocator.__init__   sI    ''6677@77<<(8(8-Hr   c                     | j                   S r   r   r   s    r   rC   z(_UserProvidedCacheLocator.get_cache_path       r   c                 j    t         j                  sy t        t        |       }|j	                  ||      S r   )r   r   superr|   rU   )rR   rS   rT   parent	__class__s       r   rU   z'_UserProvidedCacheLocator.from_function   s/    0#6##GW55r   )	r/   r0   r1   re   r   rC   rf   rU   __classcell__r   s   @r   r|   r|      s'    I  6 6r   r|   c                       e Zd ZdZd Zd Zy)_InTreeCacheLocatorzn
    A locator for functions backed by a regular Python module with a
    writable __pycache__ directory.
    c                     || _         |j                  j                  | _        t        j
                  j                  t        j
                  j                  | j                         d      | _        y )N__pycache__)	rp   r~   r   rv   rD   rI   r`   rZ   r   )r   rS   rT   s      r   r   z_InTreeCacheLocator.__init__   sD    ''6677<<(FVr   c                     | j                   S r   r   r   s    r   rC   z"_InTreeCacheLocator.get_cache_path   r   r   N)r/   r0   r1   re   r   rC   r   r   r   r   r      s    
W
 r   r   c                   ,    e Zd ZdZd Zd Zed        Zy)_UserWideCacheLocatorz
    A locator for functions backed by a regular Python module or a
    frozen executable, cached into a user-wide cache directory.
    c                     || _         |j                  j                  | _        t	        dd      }|j
                  }| j                  |      }t        j                  j                  ||      | _
        y )NnumbaF)appname	appauthor)rp   r~   r   rv   r   user_cache_dirrd   rD   rI   r`   r   )r   rS   rT   appdirs	cache_dirr   s         r   r   z_UserWideCacheLocator.__init__   sZ    ''66'U;**	77@77<<	=Ar   c                     | j                   S r   r   r   s    r   rC   z$_UserWideCacheLocator.get_cache_path   r   r   c                     t         j                  j                  |      st        t        dd      sy  | ||      }	 |j                          |S # t        $ r Y y w xY wrj   )rD   rI   rx   rl   rm   rJ   ry   rz   s       r   rU   z#_UserWideCacheLocator.from_function   sZ    w'73%+H 7G$	""$   		s   A 	AAN)r/   r0   r1   re   r   rC   rf   rU   r   r   r   r   r      s&    
B   r   r   c                   8    e Zd ZdZd Zd Zd Zd Zed        Z	y)_IPythonCacheLocatorzT
    A locator for functions entered at the IPython prompt (notebook or other).
    c                     || _         t        j                  |      }t        |t              r|| _        y |j                  d      | _        y )Nzutf-8)rp   inspect	getsource
isinstancebytes_bytes_sourcer^   )r   rS   rT   sources       r   r   z_IPythonCacheLocator.__init__  s>     ""7+fe$!'D!'w!7Dr   c                     	 ddl m} t        j
                  j                   |       d      S # t        $ r	 ddlm} Y 6w xY w)Nr   )get_ipython_cache_dirnumba_cache)IPython.pathsr   ImportErrorIPython.utils.pathrD   rI   r`   )r   r   s     r   rC   z#_IPythonCacheLocator.get_cache_path  s<    
	A; ww||13]CC  	A@	As   - ??c                 \    t        j                  | j                        j                         S r   )r\   sha256r   r_   r   s    r   rM   z%_IPythonCacheLocator.get_source_stamp  s     ~~d001;;==r   c                     dj                  | j                  j                  d      d d       }t        j                  |      j                         d d S )Nr   T   
   )r`   r   
splitlinesr\   r   r_   )r   
firstliness     r   rO   z&_IPythonCacheLocator.get_disambiguator  sI     XXd00;;DA"1EF
~~j)335cr::r   c                    |j                  d      sLt        j                  j                  t        j                  j	                  |            j                  d      sy  | ||      }	 |j                          |S # t        $ r Y y w xY w)Nz	<ipython-
ipykernel_)
startswithrD   rI   basenamerZ   rJ   ry   rz   s       r   rU   z"_IPythonCacheLocator.from_function'  sw     {+ww 89DD\R7G$	""$   		s   (A: :	BBN)
r/   r0   r1   re   r   rC   rM   rO   rf   rU   r   r   r   r   r      s0    8
D>;  r   r   c                   x    e Zd ZdZeeeegZd Z	d Z
ed        Zed        Zed        Zed        Zed        Zy	)
	CacheImplz
    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                 8   |j                   j                  | _        	 |j                  }t        j                  |      }| j                  D ]  }|j                  ||      }| n t        d|d|      || _        t        j                  |      }t        j                  j                  t        j                  j                  |            d   }|d|}t!        t"        dd      }	| j%                  ||	      | _        y # t        $ r |j
                  }Y w xY w)Nzcannot cache function z : no locator available for file r   .abiflags )r~   r   rv   r1   AttributeErrorr/   r   getfile_locator_classesrU   RuntimeError_locatorrD   rI   splitextr   rl   rm   get_filename_base_filename_base)
r   rS   qualnamesource_pathrR   locatorfilenamemodnamefullnamer   s
             r   r   zCacheImpl.__init__C  s   ''66	(++H oog.((C''=G" )
 08+ G H H ??7+''""277#3#3H#=>qA%x03
B/"44XxH%  	(''H	(s   D DDc                     |j                  dd      j                  dd      }d}||| j                  j                         t        j                  d   t        j                  d   |fz  S )N<r   >z%s-%s.py%d%d%sr      )replacer   rO   rm   version_info)r   r   r   fixed_fullnamefmts        r   r   zCacheImpl.get_filename_base\  sk     "))#r2::3Cndll&D&D&F&&q)3+;+;A+>J J 	Jr   c                     | j                   S r   )r   r   s    r   filename_basezCacheImpl.filename_based  s    """r   c                     | j                   S r   )r   r   s    r   r   zCacheImpl.locatorh  s    }}r   c                      y)z$Returns the serialized form the dataNr   r   r'   s     r   reducezCacheImpl.reducel       	r   c                      y)z4Returns the de-serialized form of the *reduced_data*Nr   )r   r#   reduced_datas      r   rebuildzCacheImpl.rebuildq  r   r   c                      y)zEReturns True if the given data is cachable; otherwise, returns False.Nr   r   s     r   check_cachablezCacheImpl.check_cachablev  r   r   N)r/   r0   r1   re   r|   r   r   r   r   r   r   r=   r   r   r   r   r   r   r   r   r   r   r   7  s     2+-,.
I2J # #        r   r   c                   "    e Zd ZdZd Zd Zd Zy)CompileResultCacheImplz>
    Implements the logic to cache CompileResult objects.
    c                 "    |j                         S )z4
        Returns a serialized CompileResult
        )_reduce)r   r9   s     r   r   zCompileResultCacheImpl.reduce  s     ||~r   c                 B    t        j                  j                  |g| S )z8
        Returns the unserialized CompileResult
        )r   r
   _rebuildr   r#   payloads      r   r   zCompileResultCacheImpl.rebuild  s      %%..~HHHr   c                 L   d}t        d |j                  D              rd}n|j                  j                  rd}|rid|j                  j
                  j                  d      d   d|}t        j                  |t        | j                  j                  | j                         y	y
)z@
        Check cachability of the given compile result.
        Nc              3   6   K   | ]  }|j                      y wr   )	can_cache).0xs     r   	<genexpr>z8CompileResultCacheImpl.check_cachable.<locals>.<genexpr>  s     411;;s   zas it uses lifted codezLas it uses dynamic globals (such as ctypes pointers and large global arrays)z Cannot cache compiled function "r   rW   z" FT)anyliftedlibraryhas_dynamic_globalsfndescr   r[   warningswarn_explicitr   r   rp   rv   )r   r9   cannot_cacher   s       r   r   z%CompileResultCacheImpl.check_cachable  s     4443L\\--PLkk**005b9<IC""3#'==#9#94<<Ir   N)r/   r0   r1   re   r   r   r   r   r   r   r   r   |  s    Ir   r   c                   8     e Zd ZdZdZd Zd Zd Z fdZ xZ	S )CodeLibraryCacheImplz<
    Implements the logic to cache CodeLibrary objects.
    Nc                 "    |j                         S )z2
        Returns a serialized CodeLibrary
        )serialize_using_object_coder   codelibs     r   r   zCodeLibraryCacheImpl.reduce  s     2244r   c                 @    |j                         j                  |      S )z6
        Returns the unserialized CodeLibrary
        )codegenunserialize_libraryr   s      r   r   zCodeLibraryCacheImpl.rebuild  s     %%';;GDDr   c                     |j                    S )z=
        Check cachability of the given CodeLibrary.
        )r   r   s     r   r   z#CodeLibraryCacheImpl.check_cachable  s     ....r   c                     t        t        |       }|j                  ||      }dj                  | j                  |g      S )N-)r   r   r   r`   _filename_prefix)r   r   r   r   resr   s        r   r   z&CodeLibraryCacheImpl.get_filename_base  s<    +T2&&x:xx..455r   )
r/   r0   r1   re   r  r   r   r   r   r   r   s   @r   r   r     s*     5E/6 6r   r   c                   v    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zej                   d        Zy)IndexDataCacheFilezP
    Implements the logic for the index file and data file used by a cache.
    c                     || _         |d| _        t        j                  j	                  | j                   | j                        | _        |d| _        || _        t        j                  | _
        y )Nz.nbiz.{number:d}.nbc)r   _index_namerD   rI   r`   _index_path_data_name_pattern_source_stampr   __version___version)r   r   r   source_stamps       r   r   zIndexDataCacheFile.__init__  sX    %'4677<<(8(8$:J:JK9F"H)))r   c                 &    | j                  i        y r   )_save_indexr   s    r   r.   zIndexDataCacheFile.flush  s    r   c                 2   | j                         }	 ||   }| j                  ||       y# t        $ rc t        |j                               }t	        j
                  d      D ]  }| j                  |      }||vs n ||<   | j                  |       Y ~w xY w)z?
        Save a new cache entry with *key* and *data*.
        r   N)	_load_indexKeyErrorsetvalues	itertoolscount
_data_namer  
_save_data)r   keyr'   	overloads	data_nameexistingis          r   savezIndexDataCacheFile.save  s     $$&		(!#I 		4(  	(9++-.H__Q' OOA.	H, ( 'IcNY'	(s   * AB:BBc                     | j                         }|j                  |      }|y	 | j                  |      S # t        $ r Y yw xY w)z0
        Load a cache entry with *key*.
        N)r  get
_load_datary   )r   r  r  r  s       r   loadzIndexDataCacheFile.load  sO     $$&	MM#&		??9-- 		s   7 	AAc                 j   	 t        | j                  d      5 }t        j                  |      }|j	                         }ddd       | j                  k7  ri S t        j                        \  }}t        d| j                         || j                  k7  ri S |S # 1 sw Y   [xY w# t
        $ r i cY S w xY w)z|
        Load the cache index and return it as a dictionary (possibly
        empty if cache is empty or obsolete).
        rbNz[cache] index loaded from %r)
openr  pickler!  readFileNotFoundErrorr  loadsr   r	  )r   fversionr'   stampr  s         r   r  zIndexDataCacheFile._load_index  s    
	d&&- ++a.vvx . dmm# I!<<-y143C3CDD&&& I# .- ! 	I	s'   B$ &BB$ B!B$ $B21B2c                 4   | j                   |f}| j                  |      }| j                  | j                        5 }t	        j
                  | j                  |d       |j                  |       d d d        t        d| j                         y # 1 sw Y    xY w)NrW   )protocolz[cache] index saved to %r)	r	  _dump_open_for_writer  r%  dumpr  writer   )r   r  r'   r)  s       r   r  zIndexDataCacheFile._save_index  sv    !!9,zz$!!$"2"23qKKq26GGDM 4 	.0@0@A 43s   4BBc                     | j                  |      }t        |d      5 }|j                         }d d d        t        j                        }t        d|       |S # 1 sw Y   ,xY w)Nr#  z[cache] data loaded from %r)
_data_pathr$  r&  r%  r(  r   )r   namerI   r)  r'   tups         r   r   zIndexDataCacheFile._load_data  sS    t$$668D ll4 0$7
	 s   AA#c                     | j                  |      }| j                  |      }| j                  |      5 }|j                  |       d d d        t	        d|       y # 1 sw Y   xY w)Nz[cache] data saved to %r)r.  r3  r/  r1  r   )r   r4  r'   rI   r)  s        r   r  zIndexDataCacheFile._save_data  sR    zz$t$!!$'1GGDM (-t4 ('s   AA$c                 :    | j                   j                  |      S )N)number)r  format)r   r8  s     r   r  zIndexDataCacheFile._data_name  s    &&--V-<<r   c                 V    t         j                  j                  | j                  |      S r   )rD   rI   r`   r   )r   r4  s     r   r3  zIndexDataCacheFile._data_path"  s    ww||D,,d33r   c                     t        |      S r   r   )r   objs     r   r.  zIndexDataCacheFile._dump%  s    Szr   c              #   :  K   t        j                         j                  dd }|d|}	 t        |d      5 }| ddd       t	        j
                  ||       y# 1 sw Y    xY w# t        $ r' 	 t	        j                  |        # t        $ r Y  w xY ww xY ww)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   z.tmp.wb)	uuiduuid4hexr$  rD   r   	Exceptionunlinkry   )r   filepathuidtmpnamer)  s        r   r/  z"IndexDataCacheFile._open_for_write(  s      jjls#!)3/
	gt$ %JJw) %$  			'"   		sV   )BA( AA( BA%!A( (	B2BB	BBBBBN)r/   r0   r1   re   r   r.   r  r!  r  r  r   r  r  r3  r.  
contextlibcontextmanagerr/  r   r   r   r  r    sY    *)&2B5=4  r   r  c                       e Zd ZdZdZd Zd Zed        Zd Z	d Z
d Zd	 Zd
 Zd Zd Zej"                  d        Zd Zy)Cachea<  
    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                 ~   t        |      | _        || _        | j                  |      | _        | j                  j
                  j                         | _        | j                  j
                  j                         }| j                  j                  }t        | j                  ||      | _        | j                          y )N)r   r   r  )repr_name_py_func_impl_class_implr   rC   r   rM   r   r  _cache_filer*   )r   rS   r  r   s       r   r   zCache.__init__V  s    ']
%%g.
::--<<>zz))::<

00-9I9I<I;GI 	r   c                 P    d| j                   j                  d| j                  dS )Nr   z	 py_func=r   )r   r/   rN  r   s    r   __repr__zCache.__repr__c  s    $(NN$;$;TZZHHr   c                     | j                   S r   r   r   s    r   r   zCache.cache_pathf  s    r   c                     d| _         y )NT_enabledr   s    r   r*   zCache.enablej  s	    r   c                     d| _         y )NFrW  r   s    r   r,   zCache.disablem  s	    r   c                 8    | j                   j                          y r   )rR  r.   r   s    r   r.   zCache.flushp  s     r   c                     |j                          | j                         5  | j                  ||      cddd       S # 1 sw Y   yxY w)zr
        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$   zCache.load_overloads  s8     	 335&&sN; 655s	   =Ac                     | j                   sy | j                  ||j                               }| j                  j	                  |      }|| j
                  j                  ||      }|S r   )rX  
_index_keyr   rR  r!  rQ  r   )r   r"   r#   r  r'   s        r   r^  zCache._load_overload~  s\    }}ooc>#9#9#;<$$S)::%%nd;Dr   c                 r    | j                         5  | j                  ||       ddd       y# 1 sw Y   yxY w)zE
        Save the data for the given signature in the cache.
        N)r]  _save_overloadr&   s      r   r(   zCache.save_overload  s,     335T* 655s   -6c                 D   | j                   sy | j                  j                  |      sy | j                  j                  j	                          | j                  ||j                        }| j                  j                  |      }| j                  j                  ||       y r   )
rX  rQ  r   r   rJ   r`  r   r   rR  r  )r   r"   r'   r  s       r   rb  zCache._save_overload  su    }}zz((.

,,.ooc4<<0zz  &c4(r   c              #      K   t         j                  dk(  r	 d  y d  y # t        $ r(}|j                  t        j                  k7  r Y d }~y d }~ww xY ww)Nnt)rD   r4  ry   errnoEACCES)r   es     r   r]  z'Cache._guard_against_spurious_io_errors  sG     77d?   77ell* +s*   A! A	AAAAAc                 J   | j                   j                  j                  }| j                   j                  Ct	        | j                   j                  D cg c]  }|j
                   c}      }t        |      }nd}d }||j                          ||       ||      ffS c c}w )a
  
        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                 H    t        j                  |       j                         S r   )r\   r   r_   )r   s    r   <lambda>z"Cache._index_key.<locals>.<lambda>  s    7>>!,668r   )rO  r~   co_code__closure__tuplecell_contentsr   magic_tuple)r   r"   r   	codebytesr   cvars	cvarbyteshashers           r   r`  zCache._index_key  s     MM**22	==$$0DMM4M4MN4Mq1??4MNOE eII8W((*VI->-3I->-A B 	B Os   B )r/   r0   r1   re   rP  r   rT  r=   r   r*   r,   r.   r$   r^  r(   rb  rH  rI  r]  r`  r   r   r   rK  rK  =  sp    , KI    !<+)  Br   rK  c                       e Zd ZdZeZy)FunctionCachezF
    Implements Cache that saves and loads CompileResult objects.
    N)r/   r0   r1   re   r   rP  r   r   r   rv  rv    s     )Kr   rv  r   c                       t         vsJ t         j                           G  fddt               G fddt              }|S )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                       e Zd ZW  Zy)6make_library_cache.<locals>.CustomCodeLibraryCacheImplN)r/   r0   r1   r  )prefixs   r   CustomCodeLibraryCacheImplry    s	    !r   r{  c                       e Zd ZdZW  Zy)(make_library_cache.<locals>.LibraryCachez
        Implements Cache that saves and loads CodeLibrary objects for additional
        feature for the specified python function.
        N)r/   r0   r1   re   rP  )r{  s   r   LibraryCacher}    s    	 1r   r~  )_lib_cache_prefixesaddr   rK  )rz  r~  r{  s   ` @r   make_library_cacher    sC     ,,,,F#"%9 "1u 1 r   )3re   abcr   r   r   rH  rf  r\   r   r  rD   r%  rm   rF   r@  r   numba.misc.appdirsr   r   numba.core.errorsr   numba.core.baser   numba.core.codegenr	   numba.core.compilerr
   
numba.corer   r   numba.core.serializer   r   r   r4   r?   objectrh   r|   r   r   r   r   r   r   r  rK  rv  r  r  r  r   r   r   <module>r     s%  
 : 9      	  
    &  * ' * - ' &&w &R *6-g 6-rF @6 =} 6, 7  9= @4= 4nB' BJ!Y !H69 6>{ {|{BF {B|)E ) 2$i r   