
    9i                     .    d dl Z defdZd ZddZddZy)	    Nreturnc                 R    | j                         } | dv ry| dv ryt        d|        )z
    Converts a string representation of truth to `True` (1) or `False` (0).

    True values are `y`, `yes`, `t`, `true`, `on`, and `1`; False value are `n`, `no`, `f`, `false`, `off`, and `0`;
    )yyesttrueon1   )nnoffalseoff0r   zinvalid truth value )lower
ValueError)values    f/var/www/html/backtest/airagagent/rag_env/lib/python3.12/site-packages/accelerate/utils/environment.pystr_to_boolr      s:     KKME44	7	7/w788    c                 x    | D ]4  }t        t        j                  j                  |d            }|dk\  s2|c S  |S )zQReturns the first positive env value found in the `env_keys` list or the default.r   )intosenvironget)env_keysdefaultevals       r   get_int_from_envr"   !   s=     "**..B'(!8J Nr   c                 p    t         j                  j                  | t        |            }t	        |      dk(  S )zJReturns truthy value for `key` from the env if available else the default.r   )r   r   r   strr   keyr   r   s      r   parse_flag_from_envr'   *   s*    JJNN3G-Eu""r   c                 X    t         j                  j                  | t        |            }|S )N)r   r   r   r$   r%   s      r   parse_choice_from_envr)   0   s    JJNN3G-ELr   )F)r   )r   r   r   r"   r'   r)    r   r   <module>r+      s%    
9# 9#r   