
    Id<                     $    d  Z ddZd Zd Zd Zy)c                     | |kD  | |k  z
  S )z
    Replacement for built-in function cmp that was removed in Python 3

    Compare the two objects x and y and return an integer according to
    the outcome. The return value is negative if x < y, zero if x == y
    and strictly positive if x > y.
     )xys     ./usr/lib/python3/dist-packages/samba/common.pycmpr      s     Ea!e    c                     |rt        d| z         ydddddd}d}|rd|d<   d|d<   d}	 t        | d	|z  z         }|j                         }||v r||   S t        d
|z         9)z|confirm an action with the user

    :param msg: A string to print to the user
    :param forced: Are the answer forced
    z%s [YES]TF)YYES NNOz[y/N]ALLNONEz[y/N/all/none]z %s zUnknown response '%s')printinputupper)msgforced	allow_allmappingpromptvs         r   confirmr   !   s     j3 G F !
#'(GGI<1:%)* r   c                 ~    t        |       dz  r%t        |       dkD  rt        t        |       dz
        S t        |       S )z)normalise a ldap integer to signed 32 bitl            l        )intstr)ivalues    r   normalise_int32r    B   s6    
6{ZCK!O3v;,--v;r   c                     | }t        | t              r| j                  d      }|S t        | t              st	        dt        |       d|       |S Nutf8zExpected bytes or string for :)
isinstancer   encodebytes
ValueErrortypebytesorstringtmps     r   	get_bytesr-   W   sO    
C-%""6* J u-mATVcdeeJr   c                     | }t        | t              r| j                  d      }|S t        | t              st	        dt        |       d|       |S r"   )r%   r'   decoder   r(   r)   r*   s     r   
get_stringr0   e   sO    
C-'""6* J s+mATVcdeeJr   N)FF)r   r   r    r-   r0   r   r   r   <module>r1      s   *	+B*r   