
    Pi                     n   d Z ddlZddlZddlmZmZmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZmZmZmZ ej        ej        ej
        ej        ej        dZej
        Zd Zd	efd
Zd	ej        fdZddZddZddee         d	ej        fdZd	efdZded	dfdZd Zd Zd Z d Z!ddZ"ddZ# e             dS )zLogging utilities.    N)CRITICALDEBUGERRORFATALINFONOTSETWARNWARNING)Optional   )disable_progress_barenable_progress_baris_progress_bar_enabledtqdm)debuginfowarningerrorcriticalc            	         t          j        dd          } | rl| t          v rt          |          S t          j                                        d|  dd                    t                                                                t          S )z
    If DATASETS_VERBOSITY env var is set to one of the valid choices return that as the new default level.
    If it is not - fall back to ``_default_log_level``
    DATASETS_VERBOSITYNz"Unknown option DATASETS_VERBOSITY=z, has to be one of: z, )	osgetenv
log_levelslogging	getLoggerr   joinkeys_default_log_level)env_level_strs    j/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/datasets/utils/logging.py_get_default_logging_levelr"   1   s    
 I2D99M J&&m,,''v]vvX\XaXablbqbqbsbsXtXtvv       returnc                  B    t                               d          d         S )N.r   )__name__split r#   r!   _get_library_namer*   A   s    >>#q!!r#   c                  B    t          j        t                                S N)r   r   r*   r)   r#   r!   _get_library_root_loggerr-   E   s    .00111r#   c                      t                      } |                     t          j                               |                     t                                 d S r,   )r-   
addHandlerr   StreamHandlersetLevelr"   library_root_loggers    r!   _configure_library_root_loggerr4   I   sL    244""7#8#:#:;;;  !;!=!=>>>>>r#   c                  `    t                      } |                     t          j                   d S r,   )r-   r1   r   r   r2   s    r!   _reset_library_root_loggerr6   P   s*    244  00000r#   namec                 J    | t                      } t          j        |           S )z`Return a logger with the specified name.
    This function can be used in dataset builders.
    )r*   r   r   )r7   s    r!   
get_loggerr9   U   s%     | ""T"""r#   c                  B    t                                                      S )a  Return the current level for the HuggingFace datasets library's root logger.
    Returns:
        Logging level, e.g., `datasets.logging.DEBUG` and `datasets.logging.INFO`.

    > [!TIP]
    > HuggingFace datasets library has following logging levels:
    >     - `datasets.logging.CRITICAL`, `datasets.logging.FATAL`
    >     - `datasets.logging.ERROR`
    >     - `datasets.logging.WARNING`, `datasets.logging.WARN`
    >     - `datasets.logging.INFO`
    >     - `datasets.logging.DEBUG`
    )r-   getEffectiveLevelr)   r#   r!   get_verbosityr<   ^   s     $%%77999r#   	verbosityc                 H    t                                          |            dS )zSet the level for the Hugging Face Datasets library's root logger.
    Args:
        verbosity:
            Logging level, e.g., `datasets.logging.DEBUG` and `datasets.logging.INFO`.
    N)r-   r1   )r=   s    r!   set_verbosityr?   n   s$     ''	22222r#   c                  *    t          t                    S )zSet the level for the Hugging Face datasets library's root logger to `INFO`.

    This will display most of the logging information and tqdm bars.

    Shortcut to `datasets.logging.set_verbosity(datasets.logging.INFO)`.
    )r?   r   r)   r#   r!   set_verbosity_inforA   w   s     r#   c                  *    t          t                    S )zSet the level for the Hugging Face datasets library's root logger to `WARNING`.

    This will display only the warning and errors logging information and tqdm bars.

    Shortcut to `datasets.logging.set_verbosity(datasets.logging.WARNING)`.
    )r?   r
   r)   r#   r!   set_verbosity_warningrC      s     !!!r#   c                  *    t          t                    S )zSet the level for the Hugging Face datasets library's root logger to `DEBUG`.

    This will display all the logging information and tqdm bars.

    Shortcut to `datasets.logging.set_verbosity(datasets.logging.DEBUG)`.
    )r?   r   r)   r#   r!   set_verbosity_debugrE           r#   c                  *    t          t                    S )zSet the level for the Hugging Face datasets library's root logger to `ERROR`.

    This will display only the errors logging information and tqdm bars.

    Shortcut to `datasets.logging.set_verbosity(datasets.logging.ERROR)`.
    )r?   r   r)   r#   r!   set_verbosity_errorrH      rF   r#   c                  ,    dt                      _        dS )zjDisable propagation of the library log outputs.
    Note that log propagation is disabled by default.
    FNr-   	propagater)   r#   r!   disable_propagationrL      s     ,1(((r#   c                  ,    dt                      _        dS )zEnable propagation of the library log outputs.
    Please disable the Hugging Face datasets library's default handler to prevent double logging if the root logger has
    been configured.
    TNrJ   r)   r#   r!   enable_propagationrN      s    
 ,0(((r#   )r$   Nr,   )$__doc__r   r   r   r   r   r   r   r   r	   r
   typingr   r   r   r   r   r   r   r"   strr*   Loggerr-   r4   r6   r9   intr<   r?   rA   rC   rE   rH   rL   rN   r)   r#   r!   <module>rT      sY      					 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                  ]L]  
 _    "3 " " " "2'. 2 2 2 2? ? ? ?1 1 1 1
# #Xc] #gn # # # #:s : : : : 3S 3T 3 3 3 3  " " "          1 1 1 10 0 0 0            r#   