
    h                        S r SSKrSSKrSSKJrJrJrJrJrJrJ	r	J
r
  SSKJr  SSKJrJrJrJr  \R                  \R                  \R                  \R
                  \R                  S.r\R                  rS rS	\4S
 jrS	\R,                  4S jrSS jrSS jrSS\\   S	\R,                  4S jjrS	\4S jrS\S	S4S jrS rS rS r S r!SS jr"SS jr#\" 5         g)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            	         [         R                  " SS5      n U (       a^  U [        ;   a	  [        U    $ [        R                  " 5       R                  SU  SSR                  [        R                  5       5       35        [        $ )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    P/home/james-whalen/.local/lib/python3.13/site-packages/datasets/utils/logging.py_get_default_logging_levelr"   1   sr    
 II2D9MJ&m,,''4]OCWX\XaXablbqbqbsXtWuv     returnc                  2    [         R                  S5      S   $ )N.r   )__name__split r#   r!   _get_library_namer*   A   s    >>#q!!r#   c                  >    [         R                  " [        5       5      $ N)r   r   r*   r)   r#   r!   _get_library_root_loggerr-   E   s    .011r#   c                      [        5       n U R                  [        R                  " 5       5        U R	                  [        5       5        g r,   )r-   
addHandlerr   StreamHandlersetLevelr"   library_root_loggers    r!   _configure_library_root_loggerr4   I   s4    24""7#8#8#:;  !;!=>r#   c                  V    [        5       n U R                  [        R                  5        g r,   )r-   r1   r   r   r2   s    r!   _reset_library_root_loggerr6   P   s    24  0r#   namec                 H    U c
  [        5       n [        R                  " U 5      $ )zXReturn 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                  2    [        5       R                  5       $ )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9r#   	verbosityc                 6    [        5       R                  U 5        g)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     ''	2r#   c                       [        [        5      $ )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                       [        [        5      $ )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                       [        [        5      $ )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                       [        [        5      $ )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                  "    S[        5       l        g)zbDisable 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                  "    S[        5       l        g)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      s      		 	 	   ]]LL]]  
 __  "3 "2'.. 2?1
#Xc] #gnn #:s : 3S 3T 3"  10   r#   