
    )Jf                     0    d Z ddlmZ d Zd	dZd Zd ZdS )
z
Common validation functions
    )
basestringc                 X    t          | t                    st          |d|           dS )z<Require that value is a string

    :raises: TypeError

    z' must be a str or unicode str, but got N)
isinstancer   	TypeError)value
value_names     R/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/pika/validators.pyrequire_stringr
      sC     eZ(( JJE
   	     callbackc                 N    t          |           st          d|d|           dS )zORequire that callback is callable and is not None

    :raises: TypeError

    z	callback z must be callable, but got Ncallabler   )r   callback_names     r	   require_callbackr      sC     H iMMH
   	 r   c                 J    | dS t          |           rdS t          d          )z~Verify callback is callable if not None

    :returns: boolean indicating nowait
    :rtype: bool
    :raises: TypeError

    NTFz0completion callback must be callable if not Noner   r   s    r	   rpc_completion_callbackr   "   s6      t LuJKKKr   c                 v    t          |          dk     r%d                    | |          }t          |          dS )zuVerify that value is zero or greater. If not, 'name'
    will be used in error message

    :raises: ValueError

    r   z{} must be >= 0, but got {}N)intformat
ValueError)namer   errmsgs      r	   zero_or_greaterr   6   s=     5zzA~~.55dEBB    ~r   Nr   )__doc__pika.compatr   r
   r   r   r    r   r	   <module>r      sq     # " " " " "
 
 

 
 
 
L L L(	! 	! 	! 	! 	!r   