+
     h  c                   s    ^ RI t ^ RIt^ RIt^ RIHtHt ^ RIt^ RIHtH	t	 R R lt
R tR tR tR	 tR
 tRR ltR tR tR tR tR# )    N)ListTuple)KeysTKeyTc                sl    V ^8  d   QhR\         R\        \        R3,          R\        \        ,          /# )i   keysargs.Zreturn)r   r   r   r   )Zformats   ";/usr/lib/python3.14/site-packages/redis/commands/helpers.py__annotate__r   
   s.      u E$)$4 d     c                 s     \        V 4       \        V \        \        34      '       d   V .p M\	        V 4      p  V'       d   V P                  V4       V #   \
         d    T .p  L+i ; iN)Ziter
isinstancebytesstrlist	TypeErrorZextend)r   r   s   &&r   list_or_argsr   
   s_    	T
 dUCL))6D:D DK	  vs   *A A A%$A%c                sl    \        V \        4      '       d   V P                  RR4      MT pVR8X  d   R# V# )zAReturn the decoded binary string, or a string, depending on type.utf-8replacenullN)r   r   decode)xZr   & r   	nativestrr      s/    (21e(<(<)$!AF{Hr	   c                sN    V f   V # V  Uu. uF  p\        V4      NK  	  up# u upi )z9Given a list of binaries, return the stringified version.)r   )r   objr   r   delistr   #   s(    y&'(asIcNa(((s   "c                sN   . pV f   V# V  F  p VP                  \        V4      4       K   	  V#   \         dM     TP                  \        T4      4        KM    \         d     TP                  \	        T4      4         Kv  i ; i\
         d    TP                  R4        K  i ; i)z,Optimistically parse the response to a list.N)appendZint
ValueErrorfloatr   r   )responseresZitem   &  r   parse_to_listr    *   s    
C
	JJs4y!  J  	,,

5;' ,

9T?++, 	JJt	s2   /B$A%B=B$BB$B$#B$c                 s   / p\        ^ \        V 4      ^4       EF   p\        W,          \        4      '       d~   VR,          P	                  \        W,          4      4        \        W^,           ,          \        4      '       d1   VR,          P	                  \        W^,           ,          4      4       K  K  \        W^,           ,          \        4      '       d   \        W^,           ,          4      .VR&   K   \        W^,           ,          4      WV,          &   EK  	  V#   \         d     EK  i ; i  \        \        3 d    Y^,           ,          YT,          &    EKG  i ; i)r    zChild iterators)
rangelenr   r   r   parse_list_to_dict
IndexErrorr   r   r   )r   r   Zir   r   r#   r#   >   s   
C1c(mQ'hk4((!"))*<X[*IJh1uot44)*112DXRSe_2UV 5 Q..&8a%&I%JC!"3#(a%#9QK  ( J   z* 3#+E?QK 3s%   !AD 8!D3 D0/D03)E! E!c                 s   V f   / # / pV  F  p\        V\        4      '       d	   V'       g   K#  \        V4      ^8X  d   RW^ ,          &   K@  \        V^,          \        4      '       d   \        V^,          4      W^ ,          &   Kz    \	        V^,          4      W^ ,          &   K  	  V#   \
        \        3 d    T^,          Y^ ,          &    K  i ; i  \         d     K  i ; i)NT)r   r   r"   r#   r   r   r   r$   )r   r   Zdetr   r   parse_to_dictr%   R   s    	
C#t$$Cs8q=CAKA%%,SV4CAK)"'A-CAK  J	 ":. )"%a&CAK) s*   B((#CCCCC! C!c                sD    RP                  R \        V 4       4       4      # )z+
Returns a random N character long string.
Z c              3   sj   "   T F)  p\         P                  ! \        P                  4      x  K+  	  R # 5ir
   )randomZchoicestringZascii_lowercase).0r   r   r   	<genexpr>Z random_string.<locals>.<genexpr>m   s%      7D!f,,--}s   13)joinr!   )Zlength   &r   random_stringr,   i   s&     77 7<V}  r	   c                s    \        V \        4      '       d   V P                  4       p M\        V \        4      '       g   V # \	        V 4      ^ 8X  d   R# V P                  RR4      p V P                  RR4      p RV  R2# )za
RedisGraph strings must be quoted,
quote_string wraps given v with quotes incase
v is a string.
z""Z\z\\Z"z\")r   r   r   r   r"   r   )vr+   r   quote_stringr.   r   si     !UHHJ3
1v{			$A			#uAqc8Or	   c                s    \         P                   ! V 4      pV P                  4        FE  p\        V\        4      '       g   K  W,          WP	                  R4      &   VP                  V4       KG  	  V# )z3Decode the keys of the given dictionary with utf-8.r   )copyr   r   r   r   Zpop)r   Znewobjkr   r   decode_dict_keysr1      sQ    YYs^FXXZa(.	F88G$%JJqM  Mr	   c                sd   \        V \        4      '       d   \        V 4      # V f   R# \        V \        \        34      '       d$   RRP                  \        \        V 4      4       R2# \        V \        4      '       d+   RRP                  R V P                  4        4       4       R2# \        V 4      # )a}  
Turn a parameter value into a string suitable for the params header of
a Cypher command.
You may pass any value that would be accepted by `json.dumps()`.

Ways in which output differs from that of `str()`:
    * Strings are quoted.
    * None --> "null".
    * In dictionaries, keys are _not_ quoted.

:param value: The parameter value to be turned into a string.
:return: string
r   Z[Z,Z]Z{c              3   sF   "   T F  w  rV R \        V4       2x  K  	  R# 5i)Z:N)stringify_param_value)r(   r0   r-   r   r   r)   Z(stringify_param_value.<locals>.<genexpr>   s$     Y=41s!$9!$<#=>=s   !Z})
r   r   r.   r   Ztupler*   Zmapr2   ZdictZitems)Zvaluer+   r   r2   r2      s     %E""		ED%=	)	)388C 5u=>?qAA	E4	 	 CHHY5;;=YYZZ\]]5zr	   c                 s   \        V \        P                  4      '       g+   \        V \        P                  P                  4      '       d&   V P                  P
                  P                  R 4      # \        V \        P                  P                  4      '       d&   V P                  P
                  P                  R 4      # R# )ZprotocolN)
r   redisZRedisZasyncioZconnection_poolZconnection_kwargsZgetZclusterZAbstractRedisClusterZnodes_manager)Zclientr+   r   get_protocol_versionr4      s    &%++&&*VU]]=P=P*Q*Q%%77;;JGG	FEMM>>	?	?##5599*EE 
@r	   )i
   )r/   r&   r'   Ztypingr   r   r3   Zredis.typingr   r   r   r   r   r    r#   r%   r,   r.   r1   r2   r4   ) r	   r   <module>r5      sO         $")((.(6Fr	   