
    &g              	      H   S r SSKJr  SSKJrJr   SSKrSrSSKr\R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                   \R"                  4	rS	S
S jjrg! \ a    Sr S	     S
S jjr gf = f)z&An implementation of RFC4013 SASLprep.    )annotations)AnyOptionalNTc                  ^ [        U [        5      (       d  U $ U(       a  / [        Q[        R                  P7nO[        n[        R
                  n[        R                  nSR                  U  Vs/ s H"  oT" U5      (       a  M  U" U5      (       a  SOUPM$     sn5      n [        R                  R                  SU 5      n [        R                  nU" U S   5      (       a1  U" U S   5      (       d  [        S5      e/ UQ[        R                  P7nO/ UQUP7nU  H(  m[        U4S jU 5       5      (       d  M  [        S5      e   U $ s  snf )	a  An implementation of RFC4013 SASLprep.

:param data: The string to SASLprep. Unicode strings
    (:class:`str`) are supported. Byte strings
    (:class:`bytes`) are ignored.
:param prohibit_unassigned_code_points: True / False. RFC 3454
    and RFCs for various SASL mechanisms distinguish between
    `queries` (unassigned code points allowed) and
    `stored strings` (unassigned code points prohibited). Defaults
    to ``True`` (unassigned code points are prohibited).

:return: The SASLprep'ed version of `data`.
  NFKCr   z$SASLprep: failed bidirectional checkc              3  2   >#    U  H  o" T5      v   M     g 7f)N ).0in_tablechars     UC:\Suresh\moveshuttle\MDcreated\moveengine\venv\Lib\site-packages\pymongo/saslprep.py	<genexpr>saslprep.<locals>.<genexpr>q   s     =*h8D>>*s   z+SASLprep: failed prohibited character check)
isinstancestr_PROHIBITED
stringprepin_table_a1in_table_c12in_table_b1joinunicodedata	ucd_3_2_0	normalizein_table_d1
ValueErrorin_table_d2any)dataprohibit_unassigned_code_points
prohibitedr   r   eltr   r   s          @r   saslprepr&   9   s5     $$$K*?;?
(>(>?J$J ".. ,,ww?C\t;WZK[3c**X3t\
 $$..vt< ,,tAwtBx(( !!GHH ?:>z'='=>J
 4:3{3J D=*=== !NOO  9 ]s   /EEFc                F    [        U [        5      (       a  [        S5      eU $ )zSASLprep dummyz[The stringprep module is not available. Usernames and passwords must be instances of bytes.)r   r   	TypeError)r"   r#   s     r   r&   r&      s*    
 dC  8      )T)r"   r   r#   zOptional[bool]returnr   )__doc__
__future__r   typingr   r   r   HAVE_STRINGPREPr   r   in_table_c21_c22in_table_c3in_table_c4in_table_c5in_table_c6in_table_c7in_table_c8in_table_c9r   r&   ImportErrorr   r)   r   <module>r8      s    - "  `" O 	##K;G  O ;?

)7
 

s   B	 	B! B!