
    f                     .    d Z ddlmZ d ZddZd Zd Zy)	z
Common validation functions
    )
basestringc                 D    t        | t              st        |d|       y)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     J/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/pika/validators.pyrequire_stringr
      s+     eZ(
  	 )    c                 <    t        |       st        d|d|       y)zORequire that callback is callable and is not None

    :raises: TypeError

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

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

    TFz0completion callback must be callable if not Noner   r   s    r	   rpc_completion_callbackr   "   s&      JKKr   c                 Z    t        |      dk  rdj                  | |      }t        |      y)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   s1     5zA~.55dEB   r   Nr   )__doc__pika.compatr   r
   r   r   r    r   r	   <module>r      s$    #

L(	!r   