
    Ri	                     B   S SK Jr  S SKJr  S SKJrJrJrJr   S SK	r	\	R                  R                  S5      (       + r S SKrSrS r\S	 5       rS
\\\4   S\4S jrS rS\\\4   S\\\4   4S jrS rS rSS jrSS jrg! \ a    Sr NQf = f! \ a    Sr NXf = f)    )contextmanagerwraps)AnyDictMappingUnionNz0.FTc                 4    SSK Jn  UR                  " U 40 UD6$ )z
Returns an active Redis client generated from the given database URL.

Will attempt to extract the database id from the path url fragment, if
none is provided.
r   )Redis)redis.clientr   from_url)urlkwargsr   s      ]/var/www/html/backend/Backoffice_Marketplace/venv/lib/python3.13/site-packages/redis/utils.pyr   r      s     #>>#(((    c              #   T   #    U R                  5       nUv   UR                  5         g 7fN)pipelineexecute)	redis_objps     r   r   r   !   s!     A
GIIKs   &(valuereturnc                 P    [        U [        5      (       a  U R                  SSS9$ U $ )Nzutf-8replace)errors)
isinstancebytesdecoder   s    r   str_if_bytesr!   (   s+    3=eU3K3KWY/QVr   c                 *    [        [        U 5      5      $ r   )strr!   r    s    r   safe_strr$   .   s    |E"##r   dictsc                  >    0 nU  H  nUR                  U5        M     U$ )zQ
Merge all provided dicts into 1 dict.
*dicts : `dict`
    dictionaries to merge
)update)r%   mergedds      r   
dict_merger*   2   s&     Fa  Mr   c                 ,    [         R                  X5      $ r   )dictfromkeys)key_listcallbacks     r   list_keys_to_dictr0   @   s    ==,,r   c                     [        5       nUR                  5        H  nU H  nUR                  U5        M     M     [        U5      $ )z
Merge all items in `res` into a list.

This command is used when sending a command to multiple nodes
and the result from each node should be merged into a single list.

res : 'dict'
)setvaluesaddlist)commandresresultvr   s        r   merge_resultr:   D   s=     UFZZ\EJJu   <r   c                     SS K nSU  S3nU(       a	  USU S3-  nU(       a	  USU S3-  nUR                  U[        US9  g )Nr   zCall to deprecated .z ()z -- Deprecated since version )category
stacklevel)warningswarnDeprecationWarning)namereasonversionr?   r@   msgs         r   warn_deprecatedrG   V   sR    vQ
'CF81~.wiq99MM# 2zMJr   c                    ^ ^^ UU U4S jnU$ )z-
Decorator to mark a function as deprecated.
c                 8   >^  [        T 5      U UUU4S j5       nU$ )Nc                  R   > [        T=(       d    TR                  TTSS9  T" U 0 UD6$ )N   )r?   )rG   __name__)argsr   funcrC   rD   rE   s     r   wrapper7deprecated_function.<locals>.decorator.<locals>.wrapperg   s*    D1DMM67qQ(((r   r   )rN   rO   rC   rD   rE   s   ` r   	decorator&deprecated_function.<locals>.decoratorf   s     	t	) 
	) r    )rD   rE   rC   rQ   s   ``` r   deprecated_functionrT   a   s    
 r   ) rU      )rU   rU   N)
contextlibr   	functoolsr   typingr   r   r   r	   hiredis__version__
startswithHIREDIS_AVAILABLEImportErrorcryptographyCRYPTOGRAPHY_AVAILABLEr   r   r#   r   r!   r$   r*   r0   r:   rG   rT   rS   r   r   <module>ra      s    %  , , $//::4@@#!
	)  c5j) c $wsCx( T#s(^ -$Ko    #"#s"   $B B BBBB