o
    $i                     @   sT   d dl Z d dlmZ d dlZdedeeef fddZG dd dejZd	d
 Z	dS )    N)Unionstringreturnc                 C   s4   |   dks
| dkrdS |   dks| dkrdS | S )zDCast a string to a boolean if possible, otherwise return the string.true1Tfalse0F)lower)r    r
   `/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/ray/dashboard/modules/job/cli_utils.py	bool_cast   s
   r   c                   @   s   e Zd ZdZdZdd ZdS )BoolOrStringParamz;A click parameter that can be either a boolean or a string.zBOOL | TEXTc                 C   s   t |tr|S t|S N)
isinstanceboolr   )selfvalueparamctxr
   r
   r   convert   s   
zBoolOrStringParam.convertN)__name__
__module____qualname____doc__namer   r
   r
   r
   r   r      s    r   c                    sD   t jdddt ddt jddtddd	t  fd
d}|S )z@Decorator for adding CLI flags shared by all `ray job` commands.z--verifyTzsBoolean indication to verify the server's TLS certificate or a path to a file or directory of trusted certificates.)defaultshow_defaulttypehelpz	--headersFNzpUsed to pass headers through http/s to the Ray Cluster.please follow JSON formatting formatting {"key": "value"})requiredr   r   r   c                     s    | i |S r   r
   )argskwargsfuncr
   r   wrapper    s   z'add_common_job_options.<locals>.wrapper)clickoptionr   str	functoolswraps)r#   r$   r
   r"   r   add_common_job_options   s"   

r*   )
r(   typingr   r%   r'   r   r   	ParamTyper   r*   r
   r
   r
   r   <module>   s    
