<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

Re$                 @   s  d  d l  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 m Z d d l m Z m Z m Z m Z e j e  Z d a Gd d   d e  Z Gd d	   d	 e  Z Gd
 d   d e  Z Gd d   d e  Z Gd d   d e  Z Gd d   d e  Z i e e d  6e e
 j 6Z y* d  d l  Z  e e e  j! <e e e  j" <Wn e# e$ f k
 rYn Xd d   Z% i  Z& d d   Z' e	 j( e) d   Z* d d   Z+ d S)    )unicode_literalsN   )DistlibException)cached_propertyget_cache_basepath_to_cache_dirCachec                   s=   e  Z d  Z d   f d d  Z d d   Z d d   Z   S)ResourceCacheNc                sG   | d  k r- t  j j t   t d   } n  t t |   j |  d  S)Nzresource-cache)ospathjoinr   strsuperr	   __init__)selfbase)	__class__ 8/tmp/pip-ztkk0jow-build/pip/_vendor/distlib/resources.pyr      s    !zResourceCache.__init__c             C   s   d S)z
        Is the cache stale for the given resource?

        :param resource: The :class:`Resource` being cached.
        :param path: The path of the resource in the cache.
        :return: True if the cache is stale.
        Tr   )r   resourcer   r   r   r   is_stale#   s    	zResourceCache.is_stalec          	   C   s   | j  j |  \ } } | d k r- | } n t j j |  j |  j |  |  } t j j |  } t j j |  s t j	 |  n  t j j
 |  s d } n |  j | |  } | r t | d   } | j | j  Wd QXn  | S)z
        Get a resource into the cache,

        :param resource: A :class:`Resource` instance.
        :return: The pathname of the resource in the cache.
        NTwb)finderget_cache_infor
   r   r   r   prefix_to_dirdirnameisdirmakedirsexistsr   openwritebytes)r   r   prefixr   resultr   stalefr   r   r   get.   s    	$	zResourceCache.get)__name__
__module____qualname__r   r   r&   r   r   )r   r   r	      s   r	   c               @   s   e  Z d  Z d d   Z d S)ResourceBasec             C   s   | |  _  | |  _ d  S)N)r   name)r   r   r+   r   r   r   r   I   s    	zResourceBase.__init__N)r'   r(   r)   r   r   r   r   r   r*   H   s   r*   c               @   s^   e  Z d  Z d Z d Z d d   Z e d d    Z e d d    Z e d	 d
    Z	 d S)Resourcez
    A class representing an in-package resource, such as a data file. This is
    not normally instantiated by user code, but rather by a
    :class:`ResourceFinder` which manages the resource.
    Fc             C   s   |  j  j |   S)z
        Get the resource as a stream.

        This is not a property to make it obvious that it returns a new stream
        each time.
        )r   
get_stream)r   r   r   r   	as_streamV   s    zResource.as_streamc             C   s%   t  d  k r t   a  n  t  j |   S)N)cacher	   r&   )r   r   r   r   	file_path_   s    zResource.file_pathc             C   s   |  j  j |   S)N)r   	get_bytes)r   r   r   r   r!   f   s    zResource.bytesc             C   s   |  j  j |   S)N)r   get_size)r   r   r   r   sizej   s    zResource.sizeN)
r'   r(   r)   __doc__is_containerr.   r   r0   r!   r3   r   r   r   r   r,   N   s   	r,   c               @   s(   e  Z d  Z d Z e d d    Z d S)ResourceContainerTc             C   s   |  j  j |   S)N)r   get_resources)r   r   r   r   	resourcesr   s    zResourceContainer.resourcesN)r'   r(   r)   r5   r   r8   r   r   r   r   r6   o   s   r6   c               @   s   e  Z d  Z d Z d d   Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z	 d d   Z
 d d   Z d d   Z d d   Z d d   Z e e j j  Z d S)ResourceFinderz4
    Resource finder for file system resources.
    c             C   sC   | |  _  t | d d   |  _ t j j t | d d   |  _ d  S)N
__loader____file__ )modulegetattrloaderr
   r   r   r   )r   r=   r   r   r   r   {   s    	zResourceFinder.__init__c             C   s   t  j j |  S)N)r
   r   realpath)r   r   r   r   r   _adjust_path   s    zResourceFinder._adjust_pathc             C   sA   | j  d  } | j d |  j  t j j |   } |  j |  S)N/r   )splitinsertr   r
   r   r   rA   )r   resource_namepartsr#   r   r   r   
_make_path   s    zResourceFinder._make_pathc             C   s   t  j j |  S)N)r
   r   r   )r   r   r   r   r   _find   s    zResourceFinder._findc             C   s   d  | j  f S)N)r   )r   r   r   r   r   r      s    zResourceFinder.get_cache_infoc             C   sd   |  j  |  } |  j |  s' d  } n9 |  j |  rH t |  |  } n t |  |  } | | _ | S)N)rG   rH   _is_directoryr6   r,   r   )r   rE   r   r#   r   r   r   find   s    		zResourceFinder.findc             C   s   t  | j d  S)Nrb)r   r   )r   r   r   r   r   r-      s    zResourceFinder.get_streamc             C   s)   t  | j d   } | j   SWd  QXd  S)NrK   )r   r   read)r   r   r%   r   r   r   r1      s    zResourceFinder.get_bytesc             C   s   t  j j | j  S)N)r
   r   getsize)r   r   r   r   r   r2      s    zResourceFinder.get_sizec                s5   d d     t    f d d   t j | j  D  S)Nc             S   s   |  d k o |  j  d  S)N__pycache__.pyc.pyo)rO   rP   )endswith)r%   r   r   r   allowed   s    z-ResourceFinder.get_resources.<locals>.allowedc                s"   g  |  ] }   |  r |  q Sr   r   ).0r%   )rR   r   r   
<listcomp>   s   	 z0ResourceFinder.get_resources.<locals>.<listcomp>)setr
   listdirr   )r   r   r   )rR   r   r7      s    zResourceFinder.get_resourcesc             C   s   |  j  | j  S)N)rI   r   )r   r   r   r   r   r5      s    zResourceFinder.is_containerN)r'   r(   r)   r4   r   rA   rG   rH   r   rJ   r-   r1   r2   r7   r5   staticmethodr
   r   r   rI   r   r   r   r   r9   w   s   r9   c                   s   e  Z d  Z d Z   f d d   Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z	 d d   Z
 d d   Z d d   Z   S)ZipResourceFinderz6
    Resource finder for resources in .zip files.
    c                s   t  t |   j |  |  j j } d t |  |  _ t |  j d  rY |  j j |  _ n t	 j
 | |  _ t |  j  |  _ d  S)Nr   _files)r   rX   r   r?   archivelen
prefix_lenhasattrrY   	zipimport_zip_directory_cachesortedindex)r   r=   rZ   )r   r   r   r      s    zZipResourceFinder.__init__c             C   s   | S)Nr   )r   r   r   r   r   rA      s    zZipResourceFinder._adjust_pathc             C   s   | |  j  d   } | |  j k r+ d } ns | rT | d t j k rT | t j } n  t j |  j |  } y |  j | j |  } Wn t k
 r d } Yn X| s t j	 d | |  j
 j  n t j	 d | |  j
 j  | S)NTr   Fz_find failed: %r %rz_find worked: %r %r)r\   rY   r
   sepbisectra   
startswith
IndexErrorloggerdebugr?   r"   )r   r   r#   ir   r   r   rH      s    	zZipResourceFinder._findc             C   s3   |  j  j } | j d t |  d   } | | f S)Nr   )r?   rZ   r   r[   )r   r   r"   r   r   r   r   r      s    z ZipResourceFinder.get_cache_infoc             C   s   |  j  j | j  S)N)r?   get_datar   )r   r   r   r   r   r1      s    zZipResourceFinder.get_bytesc             C   s   t  j |  j |   S)N)ioBytesIOr1   )r   r   r   r   r   r-      s    zZipResourceFinder.get_streamc             C   s%   | j  |  j d   } |  j | d S)N   )r   r\   rY   )r   r   r   r   r   r   r2      s    zZipResourceFinder.get_sizec             C   s   | j  |  j d   } | r? | d t j k r? | t j 7} n  t |  } t   } t j |  j |  } xt | t |  j  k  r |  j | j |  s Pn  |  j | | d   } | j	 | j
 t j d  d  | d 7} ql W| S)Nr   r   rb   )r   r\   r
   rc   r[   rU   rd   ra   re   addrC   )r   r   r   plenr#   ri   sr   r   r   r7      s    	 zZipResourceFinder.get_resourcesc             C   s   | |  j  d   } | r< | d t j k r< | t j 7} n  t j |  j |  } y |  j | j |  } Wn t k
 r d } Yn X| S)Nr   Frb   )r\   r
   rc   rd   ra   re   rf   )r   r   ri   r#   r   r   r   rI      s    zZipResourceFinder._is_directory)r'   r(   r)   r4   r   rA   rH   r   r1   r-   r2   r7   rI   r   r   )r   r   rX      s   rX   c             C   s   | t  t |   <d  S)N)_finder_registrytype)r?   finder_makerr   r   r   register_finder
  s    rt   c             C   s   |  t  k r t  |  } n |  t j k r5 t |   n  t j |  } t | d d  } | d k ro t d   n  t | d d  } t j t |   } | d k r t d |    n  | |  } | t  |  <| S)z
    Return a resource finder for a package.
    :param package: The name of the package.
    :return: A :class:`ResourceFinder` instance for the package.
    __path__Nz8You cannot get a finder for a module, only for a packager:   zUnable to locate finder for %r)	_finder_cachesysmodules
__import__r>   r   rq   r&   rr   )packager#   r=   r   r?   rs   r   r   r   r     s    
r   	__dummy__c             C   sz   d } t  j |   t j j |   } t j t |   } | rv t } t j	 j
 |  d  | _ | | _ | |  } n  | S)z
    Return a resource finder for a path, which should represent a container.

    :param path: The path.
    :return: A :class:`ResourceFinder` instance for the path.
    Nr<   )pkgutilget_importerrw   path_importer_cacher&   rq   rr   _dummy_moduler
   r   r   r;   r:   )r   r#   r?   r   r=   r   r   r   finder_for_path,  s    	r   ),
__future__r   rd   rk   loggingr
   r|   shutilrw   typesr^   r<   r   utilr   r   r   r   	getLoggerr'   rg   r/   r	   objectr*   r,   r6   r9   rX   rr   zipimporterrq   _frozen_importlibSourceFileLoader
FileFinderImportErrorAttributeErrorrt   rv   r   
ModuleTyper   r   r   r   r   r   r   <module>   sB   ",!9M