
    *#h                     v    d dl Z d dlZd dlmZmZmZ d dlmZ d dlm	Z	m
Z
mZmZ ddlmZ e G d d             Zy)	    N)InitVar	dataclassfield)Path)AnyDictOptionalUnion   )configc                       e Zd ZU dZdZeeeef      e	d<   dZ
ee	d<   dZee	d<   dZee	d<   dZee   e	d<   dZee   e	d	<   dZee	d
<   dZee	d<   dZee	d<   dZee	d<   dZee   e	d<   dZee	d<   dZeeeef      e	d<   dZeeeeef         e	d<   dZee	d<    ee      Zeeef   e	d<   dZ ee   e	d<   d Z!ddZ" fdZ# xZ$S )DownloadConfiga
  Configuration for our cached path manager.

    Attributes:
        cache_dir (`str` or `Path`, *optional*):
            Specify a cache directory to save the file to (overwrite the
            default cache dir).
        force_download (`bool`, defaults to `False`):
            If `True`, re-dowload the file even if it's already cached in
            the cache dir.
        resume_download (`bool`, defaults to `False`):
            If `True`, resume the download if an incompletely received file is
            found.
        proxies (`dict`, *optional*):
        user_agent (`str`, *optional*):
            Optional string or dict that will be appended to the user-agent on remote
            requests.
        extract_compressed_file (`bool`, defaults to `False`):
            If `True` and the path point to a zip or tar file,
            extract the compressed file in a folder along the archive.
        force_extract (`bool`, defaults to `False`):
            If `True` when `extract_compressed_file` is `True` and the archive
            was already extracted, re-extract the archive and override the folder where it was extracted.
        delete_extracted (`bool`, defaults to `False`):
            Whether to delete (or keep) the extracted files.
        use_etag (`bool`, defaults to `True`):
            Whether to use the ETag HTTP response header to validate the cached files.
        num_proc (`int`, *optional*):
            The number of processes to launch to download the files in parallel.
        max_retries (`int`, default to `1`):
            The number of times to retry an HTTP request if it fails.
        token (`str` or `bool`, *optional*):
            Optional string or boolean to use as Bearer token
            for remote files on the Datasets Hub. If `True`, or not specified, will get token from `~/.huggingface`.
        use_auth_token (`str` or `bool`, *optional*):
            Optional string or boolean to use as Bearer token
            for remote files on the Datasets Hub. If `True`, or not specified, will get token from `~/.huggingface`.

            <Deprecated version="2.14.0">

            `use_auth_token` was deprecated in favor of `token` in version 2.14.0 and will be removed in 3.0.0.

            </Deprecated>

        ignore_url_params (`bool`, defaults to `False`):
            Whether to strip all query parameters and fragments from
            the download URL before using it for caching the file.
        storage_options (`dict`, *optional*):
            Key/value pairs to be passed on to the dataset file-system backend, if any.
        download_desc (`str`, *optional*):
            A description to be displayed alongside with the progress bar while downloading the files.
    N	cache_dirFforce_downloadresume_downloadlocal_files_onlyproxies
user_agentextract_compressed_fileforce_extractdelete_extractedTuse_etagnum_proc   max_retriestoken
deprecateduse_auth_tokenignore_url_params)default_factorystorage_optionsdownload_descc                     |dk7  r%t        j                  d| dt               || _        d| j                  vr+| j                  t
        j                  d| j                  d<   y y )Nr   z'use_auth_token' was deprecated in favor of 'token' in version 2.14.0 and will be removed in 3.0.0.
You can remove this warning by passing 'token=z
' instead.hfr   endpoint)warningswarnFutureWarningr   r!   r   HF_ENDPOINT)selfr   s     ^/var/www/html/sandstorm/venv/lib/python3.12/site-packages/datasets/download/download_config.py__post_init__zDownloadConfig.__post_init__R   si    \)MMAAO@PPZ\
 (DJt+++37::6K]K])^D  & ,    c                      | j                   di | j                  j                         D ci c]  \  }}|t        j                  |       c}}S c c}}w )N )	__class____dict__itemscopydeepcopy)r+   kvs      r,   r4   zDownloadConfig.copy]   sC    t~~XATATAV WADMM!$4!4 WXX Ws    Ac                     |dk(  rht        | dd       [d| j                  vr!|t        j                  d| j                  d<   n,t        | j                  d   dd       || j                  d   d<   t        |   ||       y )Nr   r!   r$   r%   )getattrr!   r   r*   super__setattr__)r+   namevaluer1   s      r,   r;   zDownloadConfig.__setattr__`   s    7?wt->EQ4///7<&J\J\-]$$T*--d3WdCK6;$$T*73D%(r.   )returnr   )%__name__
__module____qualname____doc__r   r	   r
   strr   __annotations__r   boolr   r   r   r   r   r   r   r   r   r   intr   r   r   r   r   r   dictr!   r   r"   r-   r4   r;   __classcell__)r1   s   @r,   r   r   
   s   2h -1Ixc4i()0 ND !OT!"d""GXd^" $J$$)T)M4"d"Hd"Hhsm"K(,E8E#t)$%,:FNGHU39%567F#t#&+D&AOT#s(^A#'M8C='	_Y) )r.   r   )r4   r'   dataclassesr   r   r   pathlibr   typingr   r   r	   r
    r   r   r0   r.   r,   <module>rM      s9      1 1  - -  [) [) [)r.   