o
    viS                     @  s   U d dl mZ d dl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	iZd
ed< i Zded< dZG dd dZG dd dZdd ZdS )    )annotationsN)
ModuleSpec
PathFinder)all_suffixes)spec_from_file_location)chain)Pathspeechtokenizerz,/home/ubuntu/SpeechTokenizer/speechtokenizerzdict[str, str]MAPPINGzdict[str, list[str]]
NAMESPACESz7__editable__.speechtokenizer-1.0.0.finder.__path_hook__c                   @  s*   e Zd ZeddddZedd
dZdS )_EditableFinderNfullnamestrreturnModuleSpec | Nonec                 C  sT   |t v rt | }| |t|S |d\}}}|r(|t v r(tj|t | gdS d S )N.)path)r
   
_find_specr   
rpartitionr   	find_spec)clsr   r   targetpkg_pathparent_child r   ]/home/ubuntu/.local/lib/python3.10/site-packages/__editable___speechtokenizer_1_0_0_finder.pyr      s   z_EditableFinder.find_speccandidate_pathr   c                   sH    d } fddt  D }t|g|D ]}| r!t||  S qd S )Nz__init__.pyc                 3  s    | ]}  |V  qd S N)with_suffix).0xr   r   r   	<genexpr>$       z-_EditableFinder._find_spec.<locals>.<genexpr>)module_suffixesr   existsr   )r   r   r   init
candidates	candidater   r#   r   r   !   s   z_EditableFinder._find_spec)NNr   r   r   r   )r   r   r   r   r   r   )__name__
__module____qualname__classmethodr   r   r   r   r   r   r      s
    r   c                   @  sF   e Zd ZedddZeddd	ZeddddZedddZd
S )_EditableNamespaceFinderr   type[_EditableNamespaceFinder]c                 C  s   |t kr| S tr   )PATH_PLACEHOLDERImportError)r   r   r   r   r   
_path_hook,   s   z#_EditableNamespaceFinder._path_hookr   r   	list[str]c                 C  s*   t | }|s|tv rt| g}g |tS r   )r   r
   r2   )r   r   pathsr   r   r   _paths2   s   
z_EditableNamespaceFinder._pathsNr   c                 C  s*   |t v rt|d dd}| ||_|S d S )NT)
is_package)r   r   r7   submodule_search_locations)r   r   r   specr   r   r   r   =   s
   z"_EditableNamespaceFinder.find_specNonec                 C  s   d S r   r   )r   	_fullnamer   r   r   find_moduleE   s   z$_EditableNamespaceFinder.find_module)r   r1   )r   r   r   r5   r   r+   )r   r;   )r,   r-   r.   r/   r4   r7   r   r=   r   r   r   r   r0   +   s    
r0   c                   C  sh   t dd tjD stjt tsd S t dd tjD s%tjtj t	tj
vr2tj
t	 d S d S )Nc                 s  s    | ]}|t kV  qd S r   )r   )r!   finderr   r   r   r$   K   s    zinstall.<locals>.<genexpr>c                 s  s    | ]}|t jkV  qd S r   )r0   r4   )r!   hookr   r   r   r$   Q   r%   )anysys	meta_pathappendr   r   
path_hooksr0   r4   r2   r   r   r   r   r   installJ   s   
rE   )
__future__r   rA   importlib.machineryr   r   r   r&   importlib.utilr   	itertoolsr   pathlibr   r
   __annotations__r   r2   r   r0   rE   r   r   r   r   <module>   s    