o
     JAfv                     @   s  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Zd dlZd dlZd dlZddlmZmZ ddlmZ ddlmZ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 d
lmZ d dlm Z  d dlm!Z! d dl"m#Z#m$Z$m%Z%m&Z& g dZ'G dd de(Z)G dd dZ*G dd de+ddZ,G dd de-Z.G dd de.Z/G dd dZ0G dd de0e1Z2G dd  d ej3Z4G d!d" d"Z5G d#d$ d$Z6G d%d& d&e Z7G d'd( d(Z8G d)d* d*Z9G d+d, d,Z:G d-d. d.e7Z;G d/d0 d0e6Z<d1d2 Z=d3d4 Z>d5ejfd6d7Z?d8d9 Z@d5e&e/e2f fd:d;ZAd<d= ZBd>d? ZCd5e$eDe#eD f fd@dAZEdS )B    N   )	_adapters_meta)PackageMetadata)FreezableDefaultDictPair)method_cache)unique_everseen)r   
SimplePath)suppress)import_module)MetaPathFinder)starmap)ListMappingOptionalUnion)DistributionDistributionFinderr   PackageNotFoundErrordistributiondistributionsentry_pointsfilesmetadatapackages_distributionsrequiresversionc                   @   s"   e Zd Z	 dd Zedd ZdS )r   c                 C   s   d| j  S )Nz"No package metadata was found for nameself r"   2/usr/lib/python3.10/importlib/metadata/__init__.py__str__2      zPackageNotFoundError.__str__c                 C   s   | j \}|S N)argsr!   r   r"   r"   r#   r   5   s   zPackageNotFoundError.nameN)__name__
__module____qualname__r$   propertyr   r"   r"   r"   r#   r   /   s
    r   c                   @   sB   e Zd Z	 ed Zedd Ze	d	ddZ
e	dd ZdS )
	Sectionedzm
        [sec1]
        # comments ignored
        a = 1
        b = 2

        [sec2]
        a = 2
        c                 C   s   dd | j || jdD S )Nc                 s   s.    | ]}|j d ur|jt|jdV  qd S )N)value)r   _replacer   parser.   ).0sectionr"   r"   r#   	<genexpr>f   s    
z*Sectioned.section_pairs.<locals>.<genexpr>)filter_)readvalidclstextr"   r"   r#   section_pairsd   s   zSectioned.section_pairsNc                 c   sZ    t |ttj|  }d }|D ]}|do|d}|r$|d}qt||V  qd S )N[]z[])filtermapstrstrip
splitlines
startswithendswithr   )r9   r4   linesr   r.   Zsection_matchr"   r"   r#   r5   l   s   
zSectioned.readc                 C   s   | o|  d S )N#)rB   )liner"   r"   r#   r6   w      zSectioned.validr&   )r)   r*   r+   textwrapdedentlstripZ_sampleclassmethodr:   staticmethodr5   r6   r"   r"   r"   r#   r-   ;   s    


r-   c                   @   sx   e Zd ZU 	 edZ	 dZed ed< dd Z	e
dd Ze
d	d
 Ze
dd Zdd Zdd Zdd Zdd ZdS )
EntryPointzH(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$Nr   distc                 C   sF   	 | j | j}t|d}td |dpdd}tt	||S )Nmoduleattr .)
patternmatchr.   r   groupr=   split	functoolsreducegetattr)r!   rT   rO   attrsr"   r"   r#   load   s
   zEntryPoint.loadc                 C      | j | j}|dS )NrO   rS   rT   r.   rU   r!   rT   r"   r"   r#   rO         
zEntryPoint.modulec                 C   r\   )NrP   r]   r^   r"   r"   r#   rP      r_   zEntryPoint.attrc                 C   s$   | j | j}td|dpdS )Nz\w+extrasrQ   )rS   rT   r.   refindallrU   r^   r"   r"   r#   r`      s   zEntryPoint.extrasc                 C   s
   || _ | S r&   rN   )r!   rN   r"   r"   r#   _for   s   zEntryPoint._forc                 C   s    	 d}t |t t| j| fS )NzJConstruction of dict of EntryPoints is deprecated in favor of EntryPoints.)warningswarnDeprecationWarningiterr   )r!   msgr"   r"   r#   __iter__   s
   zEntryPoint.__iter__c                 C   s   | j | j| j| jffS r&   )	__class__r   r.   rU   r    r"   r"   r#   
__reduce__   s   zEntryPoint.__reduce__c                    s*   	  fdd|D }t ttj| |S )Nc                 3   s    | ]}t  |V  qd S r&   rY   )r1   Zparamr    r"   r#   r3          z%EntryPoint.matches.<locals>.<genexpr>)allr>   operatoreqvalues)r!   paramsrZ   r"   r    r#   matches   s   zEntryPoint.matches)r)   r*   r+   ra   compilerS   rN   r   __annotations__r[   r,   rO   rP   r`   rd   rj   rl   rt   r"   r"   r"   r#   rM   |   s$   
 



rM   ZEntryPointBasezname value groupc                       s   e Zd Z	 dZejejdeddZ	 fddZ
 fddZ fd	d
Z fddZ fddZ fddZ fddZ fddZdd Z fddZ fddZdd Z  ZS )DeprecatedListr"   zAEntryPoints list interface is deprecated. Cast to list if needed.   
stacklevelc                       |    t j|i |S r&   )_warnsuper__setitem__r!   r'   kwargsrk   r"   r#   r~        zDeprecatedList.__setitem__c                    r{   r&   )r|   r}   __delitem__r   r   r"   r#   r     r   zDeprecatedList.__delitem__c                    r{   r&   )r|   r}   appendr   r   r"   r#   r     r   zDeprecatedList.appendc                    r{   r&   )r|   r}   reverser   r   r"   r#   r      r   zDeprecatedList.reversec                    r{   r&   )r|   r}   extendr   r   r"   r#   r   $  r   zDeprecatedList.extendc                    r{   r&   )r|   r}   popr   r   r"   r#   r   (  r   zDeprecatedList.popc                    r{   r&   )r|   r}   remover   r   r"   r#   r   ,  r   zDeprecatedList.removec                    r{   r&   )r|   r}   __iadd__r   r   r"   r#   r   0  r   zDeprecatedList.__iadd__c                 C   s,   t |ts|   t|}| t| | S r&   )
isinstancetupler|   rk   r!   otherr"   r"   r#   __add__4  s   
zDeprecatedList.__add__c                    r{   r&   )r|   r}   insertr   r   r"   r#   r   :  r   zDeprecatedList.insertc                    r{   r&   )r|   r}   sortr   r   r"   r#   r   >  r   zDeprecatedList.sortc                 C   s(   t |ts|   t|}t| |S r&   )r   r   r|   __eq__r   r"   r"   r#   r   B  s   
zDeprecatedList.__eq__)r)   r*   r+   	__slots__rW   partialre   rf   rg   r|   r~   r   r   r   r   r   r   r   r   r   r   r   __classcell__r"   r"   r   r#   rw      s*    rw   c                       sf   e Zd Z	 dZ fddZdd Zedd Zedd	 Ze	d
d Z
e	dd Zedd Z  ZS )EntryPointsr"   c                    sV   	 t |trtjdtdd t |S ztt| j	|dW S  t
y*   t|w )NzGAccessing entry points by index is deprecated. Cast to tuple if needed.rx   ry   r   )r   intre   rf   rg   r}   __getitem__nextrh   selectStopIterationKeyErrorr(   r   r"   r#   r   Q  s   
zEntryPoints.__getitem__c                    s   	 t  fdd| D S )Nc                 3   s$    | ]}|j di  r|V  qd S Nr"   )rt   r1   Zeprs   r"   r#   r3   g  s   " z%EntryPoints.select.<locals>.<genexpr>r   r!   rs   r"   r   r#   r   b  s   zEntryPoints.selectc                 C      	 t dd | D S )Nc                 s       | ]}|j V  qd S r&   r   r   r"   r"   r#   r3   n      z$EntryPoints.names.<locals>.<genexpr>setr    r"   r"   r#   namesi  s   zEntryPoints.namesc                 C   r   )Nc                 s   r   r&   )rU   r   r"   r"   r#   r3   y  r   z%EntryPoints.groups.<locals>.<genexpr>r   r    r"   r"   r#   groupsp     zEntryPoints.groupsc                    s   |  fdd|  |D S )Nc                 3       | ]}|  V  qd S r&   )rd   r   rc   r"   r#   r3   }  rn   z-EntryPoints._from_text_for.<locals>.<genexpr>)
_from_text)r8   r9   rN   r"   rc   r#   _from_text_for{  s   zEntryPoints._from_text_forc                 C   s   t t| |pdS )NrQ   )	itertoolsr   rM   _parse_groupsr7   r"   r"   r#   r     s   zEntryPoints._from_textc                 C   s   dd t | D S )Nc                 s   s$    | ]}|j j|j j |jfV  qd S r&   r.   r   )r1   itemr"   r"   r#   r3     s
    
z,EntryPoints._parse_groups.<locals>.<genexpr>)r-   r:   )r9   r"   r"   r#   r     s   zEntryPoints._parse_groups)r)   r*   r+   r   r   r   r,   r   r   rK   r   r   rL   r   r   r"   r"   r   r#   r   J  s    




r   c                       sp   e Zd Z	 ejejdeddZ fddZ	d fdd	Z
 fd	d
Z fddZ fddZ fddZ  ZS )
Deprecatedz:SelectableGroups dict interface is deprecated. Use select.rx   ry   c                    s   |    t |S r&   )r|   r}   r   r(   r   r"   r#   r        zDeprecated.__getitem__Nc                    s   |    t ||S r&   )r|   r}   get)r!   r   defaultr   r"   r#   r     s   zDeprecated.getc                       |    t  S r&   )r|   r}   rj   r    r   r"   r#   rj        
zDeprecated.__iter__c                    s   |    t j| S r&   )r|   r}   __contains__)r!   r'   r   r"   r#   r     r   zDeprecated.__contains__c                    r   r&   )r|   r}   keysr    r   r"   r#   r     r   zDeprecated.keysc                    r   r&   )r|   r}   rr   r    r   r"   r#   rr     r   zDeprecated.valuesr&   )r)   r*   r+   rW   r   re   rf   rg   r|   r   r   rj   r   r   rr   r   r"   r"   r   r#   r     s    r   c                       sN   e Zd Z	 edd Ze fddZedd Zedd Zd	d
 Z	  Z
S )SelectableGroupsc                 C   s4   t d}t||d}t||}| dd |D S )NrU   keyc                 s   s     | ]\}}|t |fV  qd S r&   r   )r1   rU   epsr"   r"   r#   r3     s    z(SelectableGroups.load.<locals>.<genexpr>)rp   
attrgettersortedr   groupby)r8   r   Zby_groupZorderedZgroupedr"   r"   r#   r[     s   
zSelectableGroups.loadc                    s    	 t t|  }ttj|S r&   )r}   r   rr   r   r   chainfrom_iterable)r!   r   r   r"   r#   _all  s   zSelectableGroups._allc                 C   s   | j jS r&   )r   r   r    r"   r"   r#   r        zSelectableGroups.groupsc                 C   s
   	 | j jS r&   )r   r   r    r"   r"   r#   r     s   zSelectableGroups.namesc                 K   s   |s| S | j jdi |S r   )r   r   r   r"   r"   r#   r     s   zSelectableGroups.select)r)   r*   r+   rK   r[   r,   r   r   r   r   r   r"   r"   r   r#   r     s    


r   c                   @   s(   e Zd Z	 d	ddZdd Zdd ZdS )
PackagePathutf-8c                 C   s<   |   j|d}| W  d    S 1 sw   Y  d S )Nencodinglocateopenr5   )r!   r   streamr"   r"   r#   	read_text  s   $zPackagePath.read_textc                 C   s:   |   d}| W  d    S 1 sw   Y  d S )Nrbr   )r!   r   r"   r"   r#   read_binary  s   $zPackagePath.read_binaryc                 C   s   	 | j | S r&   )rN   locate_filer    r"   r"   r#   r     s   zPackagePath.locateN)r   )r)   r*   r+   r   r   r   r"   r"   r"   r#   r     s
    
r   c                   @   s   e Zd Zdd Zdd ZdS )FileHashc                 C   s   | d\| _}| _d S )N=)	partitionmoder.   )r!   spec_r"   r"   r#   __init__  s   zFileHash.__init__c                 C   s   d| j  d| j dS )Nz<FileHash mode: z value: >)r   r.   r    r"   r"   r#   __repr__  s   zFileHash.__repr__N)r)   r*   r+   r   r   r"   r"   r"   r#   r     s    r   c                   @   s   e Zd Z	 ejdd Zejdd Zedd Zedd Z	e
d	d
 Ze
dd Zed,ddZedejfddZedd Zedd Zedd Zedd Zedd Zdd Zdd  Zed!d" Zd#d$ Zd%d& Zed'd( Ze
d)d* Zd+S )-r   c                 C      d S r&   r"   r!   filenamer"   r"   r#   r        zDistribution.read_textc                 C   r   r&   r"   r!   pathr"   r"   r#   r     r   zDistribution.locate_filec                 C   sF   	 |   D ]}|tj|d}tt|d }|d ur|  S qt|)Nr   )_discover_resolversr   Contextr   rh   r   )r8   r   resolverZdistsrN   r"   r"   r#   	from_name  s   zDistribution.from_namec                    sP   	 | dd   r|rtd ptjdi | tj fdd|  D S )Ncontextz cannot accept context and kwargsc                 3   s    | ]}| V  qd S r&   r"   )r1   r   r   r"   r#   r3   4  s    
z(Distribution.discover.<locals>.<genexpr>r"   )r   
ValueErrorr   r   r   r   r   r   )r8   r   r"   r   r#   discover&  s   zDistribution.discoverc                 C   s   	 t t| S r&   )PathDistributionpathlibPath)r   r"   r"   r#   at8  s   zDistribution.atc                  C   s   	 dd t jD } td | S )Nc                 s   s    | ]	}t |d dV  qdS )find_distributionsNrm   )r1   finderr"   r"   r#   r3   D  s    
z3Distribution._discover_resolvers.<locals>.<genexpr>)sys	meta_pathr=   )Zdeclaredr"   r"   r#   r   A  s
   
z Distribution._discover_resolversrR   c                 C   s@   ddl m}m} ||}tj|j||d}tt|	|S )Nr   )buildmeta)Z
source_dirsystem)
Zpep517r   r   Zcompat_systemrW   r   r   zipfiler   Zbuild_as_zip)r8   rootr   r   r   Zbuilderr"   r"   r#   _localI  s   
zDistribution._localreturnc                 C   s0   	 |  dp|  dp|  d}tt|S )NZMETADATAzPKG-INFOrQ   )r   r   ZMessageemailZmessage_from_stringr!   r9   r"   r"   r#   r   U  s   
zDistribution.metadatac                 C      	 | j d S )NNamer   r    r"   r"   r#   r   f     
zDistribution.namec                 C   s   	 t | jS r&   )Prepared	normalizer   r    r"   r"   r#   _normalized_namek  s   zDistribution._normalized_namec                 C   r   )NZVersionr   r    r"   r"   r#   r   p  r   zDistribution.versionc                 C   s   t | d| S )Nzentry_points.txt)r   r   r   r    r"   r"   r#   r   u  s   zDistribution.entry_pointsc                    s8   	    p  }d fdd	}|ott|t|S )Nc                    s6   t | }|r
t|nd |_|rt|nd |_ |_|S r&   )r   r   hashr   sizerN   )r   r   Zsize_strresultr    r"   r#   	make_file  s
   z%Distribution.files.<locals>.make_file)NN)_read_files_distinfo_read_files_egginfolistr   csvreader)r!   Z
file_linesr  r"   r    r#   r   y  s   	zDistribution.filesc                 C   s   	 |  d}|o| S )NZRECORD)r   rA   r   r"   r"   r#   r    s   
z!Distribution._read_files_distinfoc                 C   s    	 |  d}|otdj| S )NzSOURCES.txtz"{}")r   r>   formatrA   r   r"   r"   r#   r    s   
z Distribution._read_files_egginfoc                 C   s   	 |   p|  }|ot|S r&   )_read_dist_info_reqs_read_egg_info_reqsr  )r!   Zreqsr"   r"   r#   r     s   zDistribution.requiresc                 C   s   | j dS )NzRequires-Dist)r   Zget_allr    r"   r"   r#   r    r%   z!Distribution._read_dist_info_reqsc                 C   s    |  d}|d u rd S | |S )Nzrequires.txt)r   _deps_from_requires_text)r!   sourcer"   r"   r#   r	    s   
z Distribution._read_egg_info_reqsc                 C   s   |  t|S r&   )%_convert_egg_info_reqs_to_simple_reqsr-   r5   )r8   r  r"   r"   r#   r
    rG   z%Distribution._deps_from_requires_textc                 #   sN    	 dd   fdd}dd }| D ]}||j }|j | ||j V  qd S )Nc                 S   s   | od|  dS )Nz
extra == ""r"   r   r"   r"   r#   make_condition  s   zJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditionc                    sX   | pd} |  d\}}}|r|rd| d}ttd | |g}|r*dd| S dS )NrQ   :()z; z and )r   r  r=   join)r2   extrasepZmarkersZ
conditionsr  r"   r#   quoted_marker  s   zIDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.quoted_markerc                 S   s   	 dd| v  S )N @r"   )Zreqr"   r"   r#   url_req_space     zIDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.url_req_spacer   )Zsectionsr  r  r2   spacer"   r  r#   r    s   

z2Distribution._convert_egg_info_reqs_to_simple_reqsN)rR   )r)   r*   r+   abcabstractmethodr   r   rK   r   r   rL   r   r   r   r,   r   r   r   r   r   r   r   r   r  r  r   r  r	  r
  r  r"   r"   r"   r#   r     sL    












r   c                   @   s0   e Zd Z	 G dd dZeje fddZdS )r   c                   @   s(   e Zd Z	 dZ	 dd Zedd ZdS )zDistributionFinder.ContextNc                 K   s   t | | d S r&   )varsupdate)r!   r   r"   r"   r#   r        z#DistributionFinder.Context.__init__c                 C   s   	 t | dtjS )Nr   )r  r   r   r   r    r"   r"   r#   r     r   zDistributionFinder.Context.path)r)   r*   r+   r   r   r,   r   r"   r"   r"   r#   r     s    r   c                 C   r   r&   r"   )r!   r   r"   r"   r#   r     r   z%DistributionFinder.find_distributionsN)r)   r*   r+   r   r  r  r   r"   r"   r"   r#   r     s
     r   c                       sf   e Zd Z	 e  fddZdd Zdd Zdd Zd	d
 Z	dd Z
edd Zedd Z  ZS )FastPathc                    s   t  | S r&   )r}   __new__)r8   r   r   r"   r#   r"  	  s   zFastPath.__new__c                 C   s
   || _ d S r&   )r   )r!   r   r"   r"   r#   r        
zFastPath.__init__c                 C   s   t | j|S r&   )r   r   r   )r!   childr"   r"   r#   joinpath     zFastPath.joinpathc                 C   sl   t t t| jpdW  d    S 1 sw   Y  t t |  W  d    S 1 s/w   Y  g S )NrR   )r   	Exceptionoslistdirr   zip_childrenr    r"   r"   r#   children  s   
 
 zFastPath.childrenc                 C   s2   t | j}|j }|j| _tdd |D S )Nc                 s   s"    | ]}| tjd d V  qdS )r   r   N)rV   	posixpathr  )r1   r$  r"   r"   r#   r3     s     z(FastPath.zip_children.<locals>.<genexpr>)r   r   r   Znamelistr%  dictfromkeys)r!   Zzip_pathr   r"   r"   r#   r*    s   
zFastPath.zip_childrenc                 C   s   |  | j|S r&   )lookupmtimesearchr(   r"   r"   r#   r1  !  r   zFastPath.searchc                 C   sD   t t t| jjW  d    S 1 sw   Y  | j  d S r&   )r   OSErrorr(  statr   st_mtimer/  cache_clearr    r"   r"   r#   r0  $  s   
 zFastPath.mtimec                 C   s   t | S r&   )Lookup)r!   r0  r"   r"   r#   r/  *  r   zFastPath.lookup)r)   r*   r+   rW   	lru_cacher"  r   r%  r+  r*  r1  r,   r0  r   r/  r   r"   r"   r   r#   r!    s    
r!  c                   @   s"   e Zd ZdefddZdd ZdS )r6  r   c           	      C   s   t j|j }|d}tt| _tt| _	|
 D ]J}| }|drD|dd dd }t|}| j| || q|rf|dkrf|dd dd }t|}| j	| || q| j  | j	  d S )Nz.eggz
.dist-infoz	.egg-inforR   r   -zegg-info)r(  r   basenamer   lowerrC   r   r  infoseggsr+  
rpartitionr   r   r   r   r%  legacy_normalizeZfreeze)	r!   r   baseZbase_is_eggr$  lowr   
normalizedlegacy_normalizedr"   r"   r#   r   0  s"   






zLookup.__init__c                 C   sP   |r| j |j ntj| j  }|r| j|j ntj| j }t||S r&   )r<  rB  r   r   r   rr   r=  rC  )r!   preparedr<  r=  r"   r"   r#   r1  E  s   zLookup.searchN)r)   r*   r+   r!  r   r1  r"   r"   r"   r#   r6  /  s    r6  c                   @   s>   e Zd Z	 dZdZdd Zedd Zedd Zdd	 Z	dS )
r   Nc                 C   s.   || _ |d u r	d S | || _| || _d S r&   )r   r   rB  r?  rC  r(   r"   r"   r#   r   [  s
   zPrepared.__init__c                 C   s   	 t dd|  ddS )Nz[-_.]+r9  r   )ra   subr;  replacer   r"   r"   r#   r   b  s   zPrepared.normalizec                 C   s   	 |   ddS )Nr9  r   )r;  rF  r   r"   r"   r#   r?  i  s   zPrepared.legacy_normalizec                 C   s
   t | jS r&   )boolr   r    r"   r"   r#   __bool__q  r#  zPrepared.__bool__)
r)   r*   r+   rB  rC  r   rL   r   r?  rH  r"   r"   r"   r#   r   S  s    

r   c                   @   s4   e Zd Zee fddZedd Zdd ZdS )MetadataPathFinderc                 C   s   	 |  |j|j}tt|S r&   )_search_pathsr   r   r>   r   )r8   r   foundr"   r"   r#   r   v  s   
z%MetadataPathFinder.find_distributionsc                    s*   	 t | tj fddtt|D S )Nc                 3   r   r&   )r1  )r1   r   rD  r"   r#   r3     s    

z3MetadataPathFinder._search_paths.<locals>.<genexpr>)r   r   r   r   r>   r!  )r8   r   pathsr"   rL  r#   rJ    s
   z MetadataPathFinder._search_pathsc                 C   s   t j  d S r&   )r!  r"  r5  )r8   r"   r"   r#   invalidate_caches  r&  z$MetadataPathFinder.invalidate_cachesN)	r)   r*   r+   rK   r   r   r   rJ  rN  r"   r"   r"   r#   rI  u  s    
rI  c                       sP   e Zd ZdefddZdd Zejje_dd Ze	 fdd	Z
d
d Z  ZS )r   r   c                 C   s   	 || _ d S r&   )_pathr   r"   r"   r#   r     s   
zPathDistribution.__init__c                 C   sH   t ttttt | j|jddW  d    S 1 sw   Y  d S )Nr   r   )	r   FileNotFoundErrorIsADirectoryErrorr   NotADirectoryErrorPermissionErrorrO  r%  r   r   r"   r"   r#   r     s   $zPathDistribution.read_textc                 C   s   | j j| S r&   )rO  parentr   r"   r"   r#   r     r%   zPathDistribution.locate_filec                    s&   	 t jt| j}| |pt jS r&   )r(  r   r:  r?   rO  _name_from_stemr}   r   )r!   stemr   r"   r#   r     s   z!PathDistribution._normalized_namec                 C   s0   t j|\}}|dvrd S |d\}}}|S )Nr8  r9  )r(  r   splitextr   )r!   rV  r   extr  restr"   r"   r#   rU    s
   z PathDistribution._name_from_stem)r)   r*   r+   r
   r   r   r   __doc__r   r,   r   rU  r   r"   r"   r   r#   r     s    

r   c                 C   s   	 t | S r&   )r   r   Zdistribution_namer"   r"   r#   r        
r   c                  K   s   	 t jdi | S r   )r   r   )r   r"   r"   r#   r     s   r   r   c                 C   s   	 t | jS r&   )r   r   r   r[  r"   r"   r#   r     r  r   c                 C      	 t | jS r&   )r   r   r[  r"   r"   r#   r        
r   c                  K   sL   	 t d}tjt|d}tjdd |t D }t	
|jdi | S )Nr   r   c                 s   r   r&   )r   )r1   rN   r"   r"   r#   r3     s    
zentry_points.<locals>.<genexpr>r"   )rp   r   rW   r   r	   r   r   r   r   r   r[   r   )rs   Z	norm_nameuniquer   r"   r"   r#   r     s   
r   c                 C   r]  r&   )r   r   r[  r"   r"   r#   r     r\  r   c                 C   r]  r&   )r   r   r[  r"   r"   r#   r     r^  r   c                  C   sL   	 t t} t D ]}|dpd D ]}| | |jd  qq	t| S )Nztop_level.txtrQ   r   )	collectionsdefaultdictr  r   r   rV   r   r   r-  )Zpkg_to_distrN   Zpkgr"   r"   r#   r     s   
	
r   )Fr(  ra   r  r  r   r   r   r   rp   rH   re   rW   r   r,  r`  rQ   r   r   r   _collectionsr   r   
_functoolsr   
_itertoolsr	   r
   
contextlibr   	importlibr   Zimportlib.abcr   r   typingr   r   r   r   __all__ModuleNotFoundErrorr   r-   
namedtuplerM   r  rw   r   r   r-  r   PurePosixPathr   r   r   r   r!  r6  r   rI  r   r   r   r   r   r   r   r   r?   r   r"   r"   r"   r#   <module>   sl    
A
o_A7( R0,$"(		
	
