
    wi	                     T    d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d d	          Z	d
S )zAContain helper class to retrieve/store token from/to local cache.    )Path)Optional   )	constants   	get_tokenc                   n    e Zd Zededdfd            Zedee         fd            Zedd            ZdS )HfFoldertokenreturnNc                     t          t          j                  }|j                            dd           |                    |           dS )a  
        Save token, creating folder as needed.

        Token is saved in the huggingface home folder. You can configure it by setting
        the `HF_HOME` environment variable.

        Args:
            token (`str`):
                The token to save to the [`HfFolder`]
        T)parentsexist_okN)r   r   HF_TOKEN_PATHparentmkdir
write_text)clsr   
path_tokens      x/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/huggingface_hub/utils/_hf_folder.py
save_tokenzHfFolder.save_token   sJ     )122
t<<<e$$$$$    c                     t                      S )aB  
        Get token or None if not existent.

        This method is deprecated in favor of [`huggingface_hub.get_token`] but is kept for backward compatibility.
        Its behavior is the same as [`huggingface_hub.get_token`].

        Returns:
            `str` or `None`: The token, `None` if it doesn't exist.
        r   r   s    r   r	   zHfFolder.get_token-   s     {{r   c                     	 t          t          j                                                   dS # t          $ r Y dS w xY w)zX
        Deletes the token from storage. Does not fail if token does not exist.
        N)r   r   r   unlinkFileNotFoundErrorr   s    r   delete_tokenzHfFolder.delete_token<   sL    
	())0022222  	 	 	DD	s   +/ 
==)r   N)	__name__
__module____qualname__classmethodstrr   r   r	   r    r   r   r   r      s         %s %t % % % [%" 
(3- 
 
 
 [
    [  r   r   N)
__doc__pathlibr   typingr    r   _authr	   r   r%   r   r   <module>r+      s    H G                        , , , , , , , , , ,r   