
    ph9                       S SK r S SKrS SKrS SKJr  S SKJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJr  S SKJrJrJrJr  S SKJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.  S SK/J0r0J1r1  SSK2J3r3  \(       a  S SK4r5S SK6r5 " S	 S
\ 5      r7\7r8 " S S\ 5      r9 " S S\95      r: " S S5      r; " S S\ 5      r< " S S\<5      r= " S S\ 5      r>\>r? " S S\ 5      r@ " S S\@5      rA " S S\ 5      rB\BrC " S S\ 5      rD\DrE " S S \ 5      rF\FrG " S! S"\ 5      rH\HrI " S# S$\5      rJ " S% S&\ 5      rK\KrL " S' S(5      rM " S) S*5      rN " S+ S,\ 5      rO\OrP " S- S.\ 5      rQ " S/ S0\Q5      rR " S1 S2\ 5      rS\SrT " S3 S4\ 5      rU " S5 S6\U5      rV " S7 S8\ 5      rW\WrX " S9 S:5      rY\YrZ " S; S<\<\H\K\S\>\@\B\D\F5      r[ " S= S>\=\I\L\T\?\A\C\E\G5      r\ " S? S@\7\W\[\9\U\O\Q\Y5
      r] " SA SB\8\X\\\:\V\P\R\Z5
      r^g)C    N)Enum)TYPE_CHECKINGAnyAsyncIterator	AwaitableCallableDictIterableIteratorListLiteralMappingOptionalSequenceSetTupleUnion)ConnectionError	DataErrorNoScriptError
RedisError)
AbsExpiryTAnyKeyTBitfieldOffsetTChannelTCommandsProtocol	ConsumerT
EncodableTExpiryTFieldTGroupTKeysTKeyTNumberPatternT	ResponseTScriptTextT	StreamIdTTimeoutSecTZScoreBoundT)deprecated_functionextract_expire_flags   )list_or_argsc                      \ rS rSrSrS%S\\   S\4S jjrS r	S\S\4S	 jr
S%S
\\   S\4S jjrS\S\4S jrS\4S jrS\4S jrS%S\\   S\4S jjrS\4S jrS\4S jrS\4S jr             S&S\S\S\S\\\\\   4      S\\\\\   4      S\\\      S\\\      S\\\      S\\\      S\\\\\4         S\S\S\S \S\4S! jjrS\4S" jrS\4S# jrS$rg)'ACLCommands<   zL
Redis Access Control List (ACL) commands.
see: https://redis.io/topics/acl
Ncategoryreturnc                 F    U(       a  U/O/ nU R                   " S/UQ70 UD6$ )a  
Returns a list of categories or commands within a category.

If ``category`` is not supplied, returns a list of all categories.
If ``category`` is supplied, returns a list of all commands within
that category.

For more information, see https://redis.io/commands/acl-cat
zACL CATexecute_command)selfr2   kwargspiecess       M/home/james-whalen/.local/lib/python3.13/site-packages/redis/commands/core.pyacl_catACLCommands.acl_catB   s*     2:H:r##IAA&AA    c                 0    U R                   " SU/UQ70 UD6$ )z
Simulate the execution of a given command by a given ``username``.

For more information, see https://redis.io/commands/acl-dryrun
z
ACL DRYRUNr5   )r7   usernameargsr8   s       r:   
acl_dryrunACLCommands.acl_dryrunO   s!     ##L(LTLVLLr=   r?   c                 .    U R                   " S/UQ70 UD6$ )zr
Delete the ACL for the specified ``username``\s

For more information, see https://redis.io/commands/acl-deluser
zACL DELUSERr5   r7   r?   r8   s      r:   acl_deluserACLCommands.acl_deluserW   s     ##MGHGGGr=   bitsc                     / nUb/   [        U5      nUS:  d  US:  a  [        eUR                  U5        U R                  " S/UQ70 UD6$ ! [         a    [        S5      ef = f)zGenerate a random password value.
If ``bits`` is supplied then use this number of bits, rounded to
the next multiple of 4.
See: https://redis.io/commands/acl-genpass
r   i   z?genpass optionally accepts a bits argument, between 0 and 4096.zACL GENPASS)int
ValueErrorappendr   r6   )r7   rG   r8   r9   bs        r:   acl_genpassACLCommands.acl_genpass_   sz     Iq5AH$$a 
 ##MEFEfEE	  U s   .A A!c                 *    U R                   " SU40 UD6$ )z
Get the ACL details for the specified ``username``.

If ``username`` does not exist, return None

For more information, see https://redis.io/commands/acl-getuser
zACL GETUSERr5   rD   s      r:   acl_getuserACLCommands.acl_getuserr   s     ##M8FvFFr=   c                 &    U R                   " S0 UD6$ )zThe ACL HELP command returns helpful text describing
the different subcommands.

For more information, see https://redis.io/commands/acl-help
)zACL HELPr5   r7   r8   s     r:   acl_helpACLCommands.acl_help|        ##9&99r=   c                 &    U R                   " S0 UD6$ )zg
Return a list of all ACLs on the server

For more information, see https://redis.io/commands/acl-list
)zACL LISTr5   rS   s     r:   acl_listACLCommands.acl_list   rV   r=   countc                     / nUb1  [        U[        5      (       d  [        S5      eUR                  U5        U R                  " S/UQ70 UD6$ )z
Get ACL logs as a list.
:param int count: Get logs[0:count].
:rtype: List.

For more information, see https://redis.io/commands/acl-log
z ACL LOG count must be an integerACL LOG)
isinstancerI   r   rK   r6   )r7   rZ   r8   r@   s       r:   acl_logACLCommands.acl_log   sO     eS)) BCCKK##I????r=   c                 4    S/nU R                   " S/UQ70 UD6$ )z_
Reset ACL logs.
:rtype: Boolean.

For more information, see https://redis.io/commands/acl-log
s   RESETr\   r5   )r7   r8   r@   s      r:   acl_log_resetACLCommands.acl_log_reset   s&     z##I????r=   c                 &    U R                   " S0 UD6$ )z
Load ACL rules from the configured ``aclfile``.

Note that the server must be configured with the ``aclfile``
directive to be able to load ACL rules from an aclfile.

For more information, see https://redis.io/commands/acl-load
)zACL LOADr5   rS   s     r:   acl_loadACLCommands.acl_load        ##9&99r=   c                 &    U R                   " S0 UD6$ )z
Save ACL rules to the configured ``aclfile``.

Note that the server must be configured with the ``aclfile``
directive to be able to save ACL rules to an aclfile.

For more information, see https://redis.io/commands/acl-save
)zACL SAVEr5   rS   s     r:   acl_saveACLCommands.acl_save   rf   r=   enablednopass	passwordshashed_passwords
categoriescommandskeyschannels	selectorsreset
reset_keysreset_channelsreset_passwordsc           	      	   U R                  5       nU/nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        OUR                  S5        U(       d  U(       a  U(       a  [        S5      eU(       a  [        U/ 5      n[	        U5       H  u  nnUR                  U5      nUR                  S5      (       a  UR                  S	US
S -  5        MF  UR                  S5      (       a  UR                  SUS
S -  5        Mu  [        SU S35      e   U(       a  [        U/ 5      n[	        U5       H  u  nnUR                  U5      nUR                  S5      (       a  UR                  SUS
S -  5        MF  UR                  S5      (       a  UR                  SUS
S -  5        Mu  [        SU S35      e   U(       a  UR                  S5        U(       a  U H  nUR                  U5      nUR                  S5      (       a  UR                  U5        M=  UR                  S5      (       a  UR                  SUS
S -  5        Ml  UR                  S5      (       a  UR                  U5        M  UR                  S5      (       a  UR                  SUS
S -  5        M  [        SUR                  USS9 S35      e   U(       at  U Hn  nUR                  U5      nUR                  S5      (       d3  UR                  S5      (       d  [        SUR                  USS9 S35      eUR                  U5        Mp     U(       a\  U HV  nUR                  U5      nUR                  S5      (       d  UR                  S5      (       d  SU-  nUR                  U5        MX     U	(       a.  U	 H(  nUR                  U5      nUR                  S U-  5        M*     U
(       a  U
 H  u  nnUR                  U5      nUR                  S5      (       d3  UR                  S5      (       d  [        SUR                  USS9 S35      eUR                  U5      nUR                  S5      (       d  UR                  S5      (       d  SU-  nUR                  S!UU4-  5        M     U R                  " S"/UQ70 UD6$ )#a  
Create or update an ACL user.

Create or update the ACL for `username`. If the user already exists,
the existing ACL is completely overwritten and replaced with the
specified values.

For more information, see https://redis.io/commands/acl-setuser

Args:
    username: The name of the user whose ACL is to be created or updated.
    enabled: Indicates whether the user should be allowed to authenticate.
             Defaults to `False`.
    nopass: Indicates whether the user can authenticate without a password.
            This cannot be `True` if `passwords` are also specified.
    passwords: A list of plain text passwords to add to or remove from the user.
               Each password must be prefixed with a '+' to add or a '-' to
               remove. For convenience, a single prefixed string can be used
               when adding or removing a single password.
    hashed_passwords: A list of SHA-256 hashed passwords to add to or remove
                      from the user. Each hashed password must be prefixed with
                      a '+' to add or a '-' to remove. For convenience, a single
                      prefixed string can be used when adding or removing a
                      single password.
    categories: A list of strings representing category permissions. Each string
                must be prefixed with either a '+' to add the category
                permission or a '-' to remove the category permission.
    commands: A list of strings representing command permissions. Each string
              must be prefixed with either a '+' to add the command permission
              or a '-' to remove the command permission.
    keys: A list of key patterns to grant the user access to. Key patterns allow
          ``'*'`` to support wildcard matching. For example, ``'*'`` grants
          access to all keys while ``'cache:*'`` grants access to all keys that
          are prefixed with ``cache:``.
          `keys` should not be prefixed with a ``'~'``.
    reset: Indicates whether the user should be fully reset prior to applying
           the new ACL. Setting this to `True` will remove all existing
           passwords, flags, and privileges from the user and then apply the
           specified rules. If `False`, the user's existing passwords, flags,
           and privileges will be kept and any new specified rules will be
           applied on top.
    reset_keys: Indicates whether the user's key permissions should be reset
                prior to applying any new key permissions specified in `keys`.
                If `False`, the user's existing key permissions will be kept and
                any new specified key permissions will be applied on top.
    reset_channels: Indicates whether the user's channel permissions should be
                    reset prior to applying any new channel permissions
                    specified in `channels`. If `False`, the user's existing
                    channel permissions will be kept and any new specified
                    channel permissions will be applied on top.
    reset_passwords: Indicates whether to remove all existing passwords and the
                     `nopass` flag from the user prior to applying any new
                     passwords specified in `passwords` or `hashed_passwords`.
                     If `False`, the user's existing passwords and `nopass`
                     status will be kept and any new specified passwords or
                     hashed passwords will be applied on top.
s   resets	   resetkeyss   resetchannelss	   resetpasss   ons   offz@Cannot set 'nopass' and supply 'passwords' or 'hashed_passwords'   +s   >%sr-   N   -s   <%sz	Password z6 must be prefixed with a "+" to add or a "-" to removes   #%ss   !%szHashed password s   nopasss   +@s   +@%ss   -@s   -@%sz
Category "T)forcez"" must be prefixed with "+" or "-"z	Command "   %   ~s   ~%ss   &%ss   (%s %s)zACL SETUSER)	get_encoderrK   r   r.   	enumerateencode
startswithdecoder6   )r7   r?   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   r8   encoderr9   ipasswordhashed_passwordr2   cmdkeychannels                            r:   acl_setuserACLCommands.acl_setuser   s}   V ""$$,:MM(#MM,'MM*+MM,'MM% MM&!)vR   %Y3I(38">>(3&&t,,MM&8AB<"78((..MM&8AB<"78##A3 '8 9   4   ,,<bA&/0@&A"?").."A"--d33MM&?12+>">?$//55MM&?12+>">?#*1# .8 9  'B MM)$&">>(3&&u--MM(+((..MM'HQRL"89((//MM(+((..MM'HQRL"89#$W^^HD^%I$J K; ;  '  nnS)~~d++CNN44H4H##GNN3dN$C#D E; ;  c"   nnS)~~d++CNN44H4H 3,Cc"	  #!..1fw./ $ %SnnS)~~d++CNN44H4H##GNN3dN$C#D E; ; 
 nnS)~~d++CNN44H4H 3,CjC:56 & ##MEFEfEEr=   c                 &    U R                   " S0 UD6$ )zuReturns a list of all registered users on the server.

For more information, see https://redis.io/commands/acl-users
)z	ACL USERSr5   rS   s     r:   	acl_usersACLCommands.acl_users{  s    
 ##:6::r=   c                 &    U R                   " S0 UD6$ )zlGet the username for the current connection

For more information, see https://redis.io/commands/acl-whoami
)z
ACL WHOAMIr5   rS   s     r:   
acl_whoamiACLCommands.acl_whoami  s    
 ##;F;;r=    N)FFNNNNNNNFFFF)__name__
__module____qualname____firstlineno____doc__r   strr&   r;   rA   rE   rI   rM   rP   rT   rX   r^   ra   rd   rh   boolr   r
   r#   r   r   r   r   r   __static_attributes__r   r=   r:   r0   r0   <   s   
B B9 BMHS Hy HF F9 F&GC Gi G:I ::I :@Xc] @	 @ @ @	:I 	:	:I 	: 9=@D.2,0)-15:> $ %}F}F }F 	}F
 E#x}"456}F #5hsm);#<=}F Xc]+}F 8C=)}F x~&}F 8H-.}F HU39%567}F }F }F }F }F" 
#}F~;Y ;<i <r=   r0   c                      \ rS rSrSrSS\S\\   4S jjrS rSS	\	S
\
4S jjrS
\
4S jrS\S
\
4S jr       SS\\   S\\   S\\   S\\	   S\\	   S\\   S\\   S
\
4S jjrS
\
4S jrS/ 4S\\   S\\   S
\
4S jjrS
\
4S jrS
\
4S jrS\\S   \S   \S   4   S
\
4S  jrS
\
4S! jrS/ S"S"S"S"4S#\\   S$\\   S%\	S&\	S'\	S(\	S
\
4S) jjrS/ S"S"S"S"4S#\\   S$\\   S%\	S&\	S'\	S(\	S
\
4S* jjrSS/ S"S"S"S"4S+\	S#\\   S$\\   S%\	S&\	S'\	S(\	S
\
4S, jjrS
\
4S- jrS.\S
\
4S/ jr S0\S1\S
\
4S2 jr! SS\S3\	S
\
4S4 jjr"SS5\S6\	S
\
4S7 jjr#S
\
4S8 jr$S9\S
\\%\   \4   4S: jr&S9\S
\\%\   \4   4S; jr'S< r(SS= jr)S
\
4S> jr*   SS?\\   S@\\   SA\\   S
\
4SB jjr+SC\S
\\\\\   4      4SD jr,SE r- SSA\.SC\.S
\
4SF jjr/S.\S1\SC\\\4   S
\
4SG jr0S
\
4SH jr1S
\
4SI jr2S
\
4SJ jr3SK\S
\
4SL jr4SSM jr5S1\S
\
4SN jr6SSO\	S
\
4SP jjr7SSO\	S
\
4SQ jjr8S
\
4SR jr9SS\ST\4SU jr:SV\SW\S
\
4SX jr;SY\S
\
4SZ jr<SS[\\   SC\S
\
4S\ jjr=S
\
4S] jr>S^ r?S_ r@S`\\\A4   S
\
4Sa jrBS
\
4Sb jrC   SSc\Sd\Se\DSf\S5\Sg\	Sh\	Si\\   S
\
4Sj jjrESk\SK\S
\
4Sl jrFSSm jrGSSn jrHS
\
4So jrIS
\
4Sp jrJ SSK\Sq\\   S
\
4Sr jjrKS
\
4Ss jrLSt rMSu\S
\
4Sv jrNS
\
4Sw jrOSx\S
\
4Sy jrPS
\\%\	   \	4   4Sz jrQS
\
4S{ jrRS
\
4S| jrSS
\
4S} jrT     SS~\	S\	S\	S\	S\	S
S4S jjrU SSc\\   Sd\\   S
\
4S jjrVSS\\   S
\
4S jjrWS
\
4S jrXS
\
4S jrYS
\
4S jrZS\S5\S
\
4S jr[S\S\S5\S
\
4S jr\S r]S r^Sr_g)ManagementCommandsi  z
Redis management commands
Nr   r?   c                 |    / nUb  UR                  U5        UR                  U5        U R                  " S/UQ70 UD6$ )z
Authenticates the user. If you do not pass username, Redis will try to
authenticate for the "default" user. If you do pass username, it will
authenticate for the given user.
For more information, see https://redis.io/commands/auth
AUTHrK   r6   )r7   r   r?   r8   r9   s        r:   authManagementCommands.auth  sB     MM(#h##F>V>v>>r=   c                 &    U R                   " S0 UD6$ )zTell the Redis server to rewrite the AOF file from data in memory.

For more information, see https://redis.io/commands/bgrewriteaof
)BGREWRITEAOFr5   rS   s     r:   bgrewriteaofManagementCommands.bgrewriteaof  s    
 ##=f==r=   Tscheduler3   c                 b    / nU(       a  UR                  S5        U R                  " S/UQ70 UD6$ )z
Tell the Redis server to save its data to disk.  Unlike save(),
this method is asynchronous and returns immediately.

For more information, see https://redis.io/commands/bgsave
SCHEDULEBGSAVEr   )r7   r   r8   r9   s       r:   bgsaveManagementCommands.bgsave  s3     MM*%##H@v@@@r=   c                 $    U R                  S5      $ )z
Provide information on the role of a Redis instance in
the context of replication, by returning if the instance
is currently a master, slave, or sentinel.

For more information, see https://redis.io/commands/role
ROLEr5   r7   s    r:   roleManagementCommands.role  s     ##F++r=   addressc                 *    U R                   " SU40 UD6$ )zqDisconnects the client at ``address`` (ip:port)

For more information, see https://redis.io/commands/client-kill
CLIENT KILLr5   )r7   r   r8   s      r:   client_killManagementCommands.client_kill  s    
 ##M7EfEEr=   _id_typeaddrskipmeladdrusermaxagec                 T   / n	UbA  Sn
[        U5      R                  5       U
;  a  [        SU
< 35      eU	R                  SU45        UbJ  [	        U[
        5      (       d  [        S5      eU(       a  U	R                  S5        OU	R                  S5        Ub  U	R                  SU45        Ub  U	R                  SU45        Ub  U	R                  S	U45        Ub  U	R                  S
U45        Ub  U	R                  SU45        U	(       d  [        S5      eU R                  " S/U	Q70 UD6$ )a  
Disconnects client(s) using a variety of filter options
:param _id: Kills a client by its unique ID field
:param _type: Kills a client by type where type is one of 'normal',
'master', 'slave' or 'pubsub'
:param addr: Kills a client by its 'address:port'
:param skipme: If True, then the client calling the command
will not get killed even if it is identified by one of the filter
options. If skipme is not provided, the server defaults to skipme=True
:param laddr: Kills a client by its 'local (bind) address:port'
:param user: Kills a client for a specific user name
:param maxage: Kills clients that are older than the specified age in seconds
)normalmasterslavepubsubz CLIENT KILL type must be one of    TYPEz!CLIENT KILL skipme must be a bool)   SKIPMEs   YES)r      NO   IDs   ADDRs   LADDRs   USERs   MAXAGEzVCLIENT KILL <filter> <value> ... ... <filter> <value> must specify at least one filterr   )r   lowerr   extendr]   r   r6   )r7   r   r   r   r   r   r   r   r8   r@   client_typess              r:   client_kill_filter%ManagementCommands.client_kill_filter  s+   0 BL5z!5"B<BR STTKK%()fd++ CDD/0./?KK%KK$(KK5)*KK$(KKF+,;  ##MCDCFCCr=   c                 &    U R                   " S0 UD6$ )z
Returns information and statistics about the current
client connection.

For more information, see https://redis.io/commands/client-info
)zCLIENT INFOr5   rS   s     r:   client_infoManagementCommands.client_info  s     ##<V<<r=   	client_idc                 P   / nUbP  Sn[        U5      R                  5       U;  a  [        SU< 35      eUR                  S5        UR                  U5        [	        U[
        5      (       d  [        S5      eU(       a  UR                  S5        XB-  nU R                  " S/UQ70 UD6$ )a4  
Returns a list of currently connected clients.
If type of client specified, only that type will be returned.

:param _type: optional. one of the client types (normal, master,
 replica, pubsub)
:param client_id: optional. a list of client ids

For more information, see https://redis.io/commands/client-list
)r   r   replicar   z!CLIENT LIST _type must be one of r   zclient_id must be a listr   zCLIENT LIST)r   r   r   rK   r]   listr6   )r7   r   r   r8   r@   r   s         r:   client_listManagementCommands.client_list  s     DL5z!5"CLCS TUUKK KK)T**677KKD##MCDCFCCr=   c                 &    U R                   " S0 UD6$ )zi
Returns the current connection name

For more information, see https://redis.io/commands/client-getname
)zCLIENT GETNAMEr5   rS   s     r:   client_getname!ManagementCommands.client_getname       ##???r=   c                 &    U R                   " S0 UD6$ )z
Returns the ID (an integer) of the client to whom we are
redirecting tracking notifications.

see: https://redis.io/commands/client-getredir
)zCLIENT GETREDIRr5   rS   s     r:   client_getredir"ManagementCommands.client_getredir%  s     ##@@@r=   replyONOFFSKIPc                 Z    / SQnX;  a  [        SU< 35      eU R                  " SU40 UD6$ )a  
Enable and disable redis server replies.

``reply`` Must be ON OFF or SKIP,
ON - The default most with server replies to commands
OFF - Disable server responses to commands
SKIP - Skip the response of the immediately following command.

Note: When setting OFF or SKIP replies, you will need a client object
with a timeout specified in seconds, and will need to catch the
TimeoutError.
The test_client_reply unit test illustrates this, and
conftest.py has a client with a timeout.

See https://redis.io/commands/client-reply
)r   r   r   zCLIENT REPLY must be one of zCLIENT REPLYr   r6   )r7   r   r8   repliess       r:   client_replyManagementCommands.client_reply.  s:    & (:7+FGG##NEDVDDr=   c                 &    U R                   " S0 UD6$ )zb
Returns the current connection id

For more information, see https://redis.io/commands/client-id
)z	CLIENT IDr5   rS   s     r:   r   ManagementCommands.client_idF       ##:6::r=   Fclientidprefixbcastoptinoptoutnoloopc           	      *    U R                  SXX4XV5      $ )z
Turn on the tracking mode.
For more information, about the options look at client_tracking func.

See https://redis.io/commands/client-tracking
Tclient_trackingr7   r   r   r   r   r   r   s          r:   client_tracking_on%ManagementCommands.client_tracking_onN  s      ##(E&
 	
r=   c           	      *    U R                  SXX4XV5      $ )z
Turn off the tracking mode.
For more information, about the options look at client_tracking func.

See https://redis.io/commands/client-tracking
Fr   r   s          r:   client_tracking_off&ManagementCommands.client_tracking_offa  s      ##8U6
 	
r=   onc                    [        U5      S:w  a  USL a  [        S5      eU(       a  S/OS/n	Ub  U	R                  SU/5        U H  n
U	R                  SU
/5        M     U(       a  U	R                  S5        U(       a  U	R                  S	5        U(       a  U	R                  S
5        U(       a  U	R                  S5        U R                  " S/U	Q76 $ )a  
Enables the tracking feature of the Redis server, that is used
for server assisted client side caching.

``on`` indicate for tracking on or tracking off. The default is on.

``clientid`` send invalidation messages to the connection with
the specified ID.

``bcast`` enable tracking in broadcasting mode. In this mode
invalidation messages are reported for all the prefixes
specified, regardless of the keys requested by the connection.

``optin``  when broadcasting is NOT active, normally don't track
keys in read only commands, unless they are called immediately
after a CLIENT CACHING yes command.

``optout`` when broadcasting is NOT active, normally track keys in
read only commands, unless they are called immediately after a
CLIENT CACHING no command.

``noloop`` don't send notifications about keys modified by this
connection itself.

``prefix``  for broadcasting, register a given key prefix, so that
notifications will be provided only for keys starting with this string.

See https://redis.io/commands/client-tracking
r   Fz"Prefix can only be used with bcastr   r   REDIRECTPREFIXBCASTOPTINOPTOUTNOLOOPzCLIENT TRACKING)lenr   r   rK   r6   )r7   r   r   r   r   r   r   r   r8   r9   ps              r:   r   "ManagementCommands.client_trackingt  s    R v;!@AA$E7MM:x01AMM8Q-( MM'"MM'"MM(#MM(###$5???r=   c                 &    U R                   " S0 UD6$ )z
Returns the information about the current client connection's
use of the server assisted client side cache.

See https://redis.io/commands/client-trackinginfo
)zCLIENT TRACKINGINFOr5   rS   s     r:   client_trackinginfo&ManagementCommands.client_trackinginfo  s     ##DVDDr=   namec                 *    U R                   " SU40 UD6$ )a0  
Sets the current connection name

For more information, see https://redis.io/commands/client-setname

.. note::
   This method sets client name only for **current** connection.

   If you want to set a common name for all connections managed
   by this client, use ``client_name`` constructor argument.
zCLIENT SETNAMEr5   )r7   r  r8   s      r:   client_setname!ManagementCommands.client_setname  s     ##$4dEfEEr=   attrvaluec                 *    U R                   " SX40 UD6$ )zv
Sets the current connection library name or version
For mor information see https://redis.io/commands/client-setinfo
zCLIENT SETINFOr5   )r7   r  r	  r8   s       r:   client_setinfo!ManagementCommands.client_setinfo  s    
 ##$4dLVLLr=   errorc                 p    S[        U5      /nU(       a  UR                  S5        U R                  " U0 UD6$ )a  
Unblocks a connection by its client id.
If ``error`` is True, unblocks the client with a special error message.
If ``error`` is False (default), the client is unblocked using the
regular timeout mechanism.

For more information, see https://redis.io/commands/client-unblock
zCLIENT UNBLOCKs   ERROR)rI   rK   r6   )r7   r   r  r8   r@   s        r:   client_unblock!ManagementCommands.client_unblock  s7     !#i.1KK!##T4V44r=   timeoutallc                     S[        U5      /n[        U[        5      (       d  [        S5      eU(       d  UR	                  S5        U R
                  " U0 UD6$ )aP  
Suspend all the Redis clients for the specified amount of time.


For more information, see https://redis.io/commands/client-pause

Args:
    timeout: milliseconds to pause clients
    all: If true (default) all client commands are blocked.
         otherwise, clients are only blocked if they attempt to execute
         a write command.

For the WRITE mode, some commands have special behavior:

* EVAL/EVALSHA: Will block client for all scripts.
* PUBLISH: Will block client.
* PFCOUNT: Will block client.
* WAIT: Acknowledgments will be delayed, so this command will
    appear blocked.
zCLIENT PAUSEz'CLIENT PAUSE timeout must be an integerWRITE)r   r]   rI   r   rK   r6   )r7   r  r  r8   r@   s        r:   client_pauseManagementCommands.client_pause  sP    * G-'3''EFFKK ##T4V44r=   c                 &    U R                   " S0 UD6$ )z_
Unpause all redis clients

For more information, see https://redis.io/commands/client-unpause
)zCLIENT UNPAUSEr5   rS   s     r:   client_unpause!ManagementCommands.client_unpause  r   r=   modec                 &    U R                  SU5      $ )z
Sets the client eviction mode for the current connection.

For more information, see https://redis.io/commands/client-no-evict
zCLIENT NO-EVICTr5   r7   r  s     r:   client_no_evict"ManagementCommands.client_no_evict  s     ##$5t<<r=   c                 &    U R                  SU5      $ )a  
# The command controls whether commands sent by the client will alter
# the LRU/LFU of the keys they access.
# When turned on, the current client will not change LFU/LRU stats,
# unless it sends the TOUCH command.

For more information, see https://redis.io/commands/client-no-touch
zCLIENT NO-TOUCHr5   r  s     r:   client_no_touch"ManagementCommands.client_no_touch
  s     ##$5t<<r=   c                 &    U R                   " S0 UD6$ )zv
Returns dict reply of details about all Redis commands.

For more information, see https://redis.io/commands/command
)COMMANDr5   rS   s     r:   commandManagementCommands.command  s     ##888r=   c                     [        S5      eNz<COMMAND INFO is intentionally not implemented in the client.NotImplementedErrorrS   s     r:   command_infoManagementCommands.command_info      !J
 	
r=   c                 &    U R                   " S0 UD6$ )N)COMMAND COUNTr5   rS   s     r:   command_count ManagementCommands.command_count"  s    ##>v>>r=   moduler2   patternc                     / nUb  UR                  SU/5        Ub  UR                  SU/5        Ub  UR                  SU/5        U(       a  UR                  SS5        U R                  " S/UQ76 $ )aB  
Return an array of the server's command names.
You can use one of the following filters:
``module``: get the commands that belong to the module
``category``: get the commands in the ACL category
``pattern``: get the commands that match the given pattern

For more information, see https://redis.io/commands/command-list/
MODULEACLCATPATTERNr   FILTERBYzCOMMAND LIST)r   insertr6   )r7   r1  r2   r2  r9   s        r:   command_listManagementCommands.command_list%  su     MM8V,-MM8X./MM9g./MM!Z(##N<V<<r=   r@   c                 (    U R                   " S/UQ76 $ )z
Returns array of keys from a full Redis command and their usage flags.

For more information, see https://redis.io/commands/command-getkeysandflags
zCOMMAND GETKEYSANDFLAGSr5   r7   r@   s     r:   command_getkeysandflags*ManagementCommands.command_getkeysandflagsA  s     ##$=EEEr=   c                     [        S5      e)U
This function throws a NotImplementedError since it is intentionally
not supported.
z<COMMAND DOCS is intentionally not implemented in the client.r(  r<  s     r:   command_docsManagementCommands.command_docsI  s    
 "J
 	
r=   c                 0    U R                   " SU/UQ70 UD6$ )z
Return a dictionary of configuration based on the ``pattern``

For more information, see https://redis.io/commands/config-get
z
CONFIG GETr5   )r7   r2  r@   r8   s       r:   
config_getManagementCommands.config_getR  s!     ##L'KDKFKKr=   c                 0    U R                   " SX/UQ70 UD6$ )zhSet config item ``name`` with ``value``

For more information, see https://redis.io/commands/config-set
z
CONFIG SETr5   )r7   r  r	  r@   r8   s        r:   
config_setManagementCommands.config_set\  s!     ##L$OOOOr=   c                 &    U R                   " S0 UD6$ )z`
Reset runtime statistics

For more information, see https://redis.io/commands/config-resetstat
)zCONFIG RESETSTATr5   rS   s     r:   config_resetstat#ManagementCommands.config_resetstati  s     ##A&AAr=   c                 &    U R                   " S0 UD6$ )z
Rewrite config file with the minimal change to reflect running config.

For more information, see https://redis.io/commands/config-rewrite
)zCONFIG REWRITEr5   rS   s     r:   config_rewrite!ManagementCommands.config_rewriteq  r   r=   c                 &    U R                   " S0 UD6$ )zp
Returns the number of keys in the current database

For more information, see https://redis.io/commands/dbsize
)DBSIZEr5   rS   s     r:   dbsizeManagementCommands.dbsizey  s     ##777r=   r   c                 *    U R                   " SU40 UD6$ )z
Returns version specific meta information about a given key

For more information, see https://redis.io/commands/debug-object
zDEBUG OBJECTr5   )r7   r   r8   s      r:   debug_objectManagementCommands.debug_object  s     ##NCB6BBr=   c                     [        S5      e)Nz
            DEBUG SEGFAULT is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/debug-segfault
            r(  rS   s     r:   debug_segfault!ManagementCommands.debug_segfault      !
 	
r=   c                 *    U R                   " SU40 UD6$ )z`
Echo the string back from the server

For more information, see https://redis.io/commands/echo
ECHOr5   )r7   r	  r8   s      r:   echoManagementCommands.echo  s     ##FE<V<<r=   asynchronousc                 b    / nU(       a  UR                  S5        U R                  " S/UQ70 UD6$ )z
Delete all keys in all databases on the current host.

``asynchronous`` indicates whether the operation is
executed asynchronously by the server.

For more information, see https://redis.io/commands/flushall
   ASYNCFLUSHALLr   r7   r^  r8   r@   s       r:   flushallManagementCommands.flushall  s3     KK!##J@@@@r=   c                 b    / nU(       a  UR                  S5        U R                  " S/UQ70 UD6$ )z
Delete all keys in the current database.

``asynchronous`` indicates whether the operation is
executed asynchronously by the server.

For more information, see https://redis.io/commands/flushdb
r`  FLUSHDBr   rb  s       r:   flushdbManagementCommands.flushdb  s3     KK!##I????r=   c                 >    SSK Jn  0 n/ X!'   U R                  " S0 UD6$ )zk
Initiates a replication stream from the master.

For more information, see https://redis.io/commands/sync
r   NEVER_DECODESYNCredis.clientrk  r6   r7   rk  optionss      r:   syncManagementCommands.sync  s(     	. "##6g66r=   replicationidoffsetc                 B    SSK Jn  0 n/ XC'   U R                  " SX40 UD6$ )z
Initiates a replication stream from the master.
Newer version for `sync`.

For more information, see https://redis.io/commands/sync
r   rj  PSYNCrn  )r7   rt  ru  rk  rq  s        r:   psyncManagementCommands.psync  s,     	. "##G]NgNNr=   firstsecondc                 *    U R                   " SX40 UD6$ )zP
Swap two databases

For more information, see https://redis.io/commands/swapdb
SWAPDBr5   )r7   rz  r{  r8   s       r:   swapdbManagementCommands.swapdb  s     ##HeFvFFr=   indexc                 *    U R                   " SU40 UD6$ )zSSelect the Redis logical database at index.

See: https://redis.io/commands/select
SELECTr5   )r7   r  r8   s      r:   selectManagementCommands.select  s    
 ##He>v>>r=   sectionc                 Z    Uc  U R                   " S0 UD6$ U R                   " SU/UQ70 UD6$ )a6  
Returns a dictionary containing information about the Redis server

The ``section`` option can be used to select a specific section
of information

The section option is not supported by older versions of Redis Server,
and will generate ResponseError

For more information, see https://redis.io/commands/info
INFO)r  r5   )r7   r  r@   r8   s       r:   infoManagementCommands.info  s:     ?''9&99''I$I&IIr=   c                 &    U R                   " S0 UD6$ )z
Return a Python datetime object representing the last time the
Redis database was saved to disk

For more information, see https://redis.io/commands/lastsave
)LASTSAVEr5   rS   s     r:   lastsaveManagementCommands.lastsave  s     ##9&99r=   c                     [        S5      e)zRaise a NotImplementedError, as the client will not support LATENCY DOCTOR.
This function is best used within the redis-cli.

For more information, see https://redis.io/commands/latency-doctor
z
            LATENCY DOCTOR is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/latency-doctor
            r(  r   s    r:   latency_doctor!ManagementCommands.latency_doctor       "
 	
r=   c                     [        S5      e)zRaise a NotImplementedError, as the client will not support LATENCY GRAPH.
This function is best used within the redis-cli.

For more information, see https://redis.io/commands/latency-graph.
z
            LATENCY GRAPH is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/latency-graph
            r(  r   s    r:   latency_graph ManagementCommands.latency_graph  r  r=   version_numbersc                 `    U(       a  U R                   " S/UQ70 UD6$ U R                   " S0 UD6$ )ze
Get the Redis version and a piece of generative computer art

See: https://redis.io/commands/lolwut
zLOLWUT VERSION)LOLWUTr5   )r7   r  r8   s      r:   lolwutManagementCommands.lolwut  s7     ''(8U?UfUU'';F;;r=   c                 $    U R                  S5      $ )zdPerform a full reset on the connection's server-side context.

See: https://redis.io/commands/reset
RESETr5   r   s    r:   rs   ManagementCommands.reset  s    
 ##G,,r=   hostportrp   destination_dbcopyreplacer   c	                 j   [        U/ 5      nU(       d  [        S5      e/ n
U(       a  U
R                  S5        U(       a  U
R                  S5        U(       a"  U
R                  S5        U
R                  U5        U
R                  S5        U
R                  U5        U R                  " SXSXE/U
Q70 U	D6$ )a  
Migrate 1 or more keys from the current Redis server to a different
server specified by the ``host``, ``port`` and ``destination_db``.

The ``timeout``, specified in milliseconds, indicates the maximum
time the connection between the two servers can be idle before the
command is interrupted.

If ``copy`` is True, the specified ``keys`` are NOT deleted from
the source server.

If ``replace`` is True, this operation will overwrite the keys
on the destination server if they exist.

If ``auth`` is specified, authenticate to the destination server with
the password provided.

For more information, see https://redis.io/commands/migrate
z!MIGRATE requires at least one keys   COPYs   REPLACEs   AUTHs   KEYSMIGRATE )r.   r   rK   r   r6   )r7   r  r  rp   r  r  r  r  r   r8   r9   s              r:   migrateManagementCommands.migrate&  s    > D"%?@@MM'"MM*%MM'"MM$gd##t2~
AG
KQ
 	
r=   infotypec                 .    U R                   " SX4SU0UD6$ )z:
Return the encoding, idletime, or refcount about the key
OBJECTr  r5   )r7   r  r   r8   s       r:   objectManagementCommands.objectV  s,     ##h
.6
:@
 	
r=   c                     [        S5      e)Nz
            MEMORY DOCTOR is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/memory-doctor
            r(  rS   s     r:   memory_doctor ManagementCommands.memory_doctor^  rY  r=   c                     [        S5      e)Nz
            MEMORY HELP is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/memory-help
            r(  rS   s     r:   memory_helpManagementCommands.memory_helpg  rY  r=   c                 &    U R                   " S0 UD6$ )zg
Return a dictionary of memory stats

For more information, see https://redis.io/commands/memory-stats
)zMEMORY STATSr5   rS   s     r:   memory_statsManagementCommands.memory_statsp       ##=f==r=   c                 &    U R                   " S0 UD6$ )zu
Return an internal statistics report from the memory allocator.

See: https://redis.io/commands/memory-malloc-stats
)zMEMORY MALLOC-STATSr5   rS   s     r:   memory_malloc_stats&ManagementCommands.memory_malloc_statsx  s     ##DVDDr=   samplesc                     / n[        U[        5      (       a  UR                  SU/5        U R                  " SU/UQ70 UD6$ )a9  
Return the total memory usage for key, its value and associated
administrative overheads.

For nested data structures, ``samples`` is the number of elements to
sample. If left unspecified, the server's default is 5. Use 0 to sample
all elements.

For more information, see https://redis.io/commands/memory-usage
s   SAMPLESzMEMORY USAGE)r]   rI   r   r6   )r7   r   r  r8   r@   s        r:   memory_usageManagementCommands.memory_usage  sD     gs##KKW-.##NCI$I&IIr=   c                 &    U R                   " S0 UD6$ )z~
Attempts to purge dirty pages for reclamation by allocator

For more information, see https://redis.io/commands/memory-purge
)zMEMORY PURGEr5   rS   s     r:   memory_purgeManagementCommands.memory_purge  r  r=   c                     [        S5      e)r@  zALATENCY HISTOGRAM is intentionally not implemented in the client.r(  r<  s     r:   latency_histogram$ManagementCommands.latency_histogram  s    
 "O
 	
r=   eventc                 &    U R                  SU5      $ )z
Returns the raw data of the ``event``'s latency spikes time series.

For more information, see https://redis.io/commands/latency-history
zLATENCY HISTORYr5   )r7   r  s     r:   latency_history"ManagementCommands.latency_history  s     ##$5u==r=   c                 $    U R                  S5      $ )zo
Reports the latest latency events logged.

For more information, see https://redis.io/commands/latency-latest
zLATENCY LATESTr5   r   s    r:   latency_latest!ManagementCommands.latency_latest  s     ##$455r=   eventsc                 (    U R                   " S/UQ76 $ )z
Resets the latency spikes time series of all, or only some, events.

For more information, see https://redis.io/commands/latency-reset
zLATENCY RESETr5   )r7   r  s     r:   latency_reset ManagementCommands.latency_reset  s     ##O=f==r=   c                 &    U R                   " S0 UD6$ )a^  
Ping the Redis server to test connectivity.

Sends a PING command to the Redis server and returns True if the server
responds with "PONG".

This command is useful for:
- Testing whether a connection is still alive
- Verifying the server's ability to serve data

For more information on the underlying ping command see https://redis.io/commands/ping
)PINGr5   rS   s     r:   pingManagementCommands.ping  s     ##5f55r=   c                 &    U R                   " S0 UD6$ )zc
Ask the server to close the connection.

For more information, see https://redis.io/commands/quit
)QUITr5   rS   s     r:   quitManagementCommands.quit  s     ##5f55r=   c                 .    U R                   " S/UQ70 UD6$ )z
Update the replication settings of a redis replica, on the fly.

Examples of valid arguments include:

NO ONE (set no replication)
host port (set to the host and port of a redis server)

For more information, see  https://redis.io/commands/replicaof
	REPLICAOFr5   r7   r@   r8   s      r:   	replicaofManagementCommands.replicaof  s     ##KA$A&AAr=   c                 &    U R                   " S0 UD6$ )z
Tell the Redis server to save its data to disk,
blocking until the save is complete

For more information, see https://redis.io/commands/save
)SAVEr5   rS   s     r:   saveManagementCommands.save       ##5f55r=   r  nosavenowrz   abortc                    U(       a  U(       a  [        S5      eS/nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5         U R                  " U0 UD6  [	        S	5      e! [         a     gf = f)
a  Shutdown the Redis server.  If Redis has persistence configured,
data will be flushed before shutdown.
It is possible to specify modifiers to alter the behavior of the command:
``save`` will force a DB saving operation even if no save points are configured.
``nosave`` will prevent a DB saving operation even if one or more save points
are configured.
``now`` skips waiting for lagging replicas, i.e. it bypasses the first step in
the shutdown sequence.
``force`` ignores any errors that would normally prevent the server from exiting
``abort`` cancels an ongoing shutdown and cannot be combined with other flags.

For more information, see https://redis.io/commands/shutdown
+SHUTDOWN save and nosave cannot both be setSHUTDOWNr  NOSAVENOWFORCEABORTNSHUTDOWN seems to have failed.r   rK   r6   r   r   r7   r  r  r  rz   r  r8   r@   s           r:   shutdownManagementCommands.shutdown  s    , FIJJ|KKKK!KKKK KK 	  $1&1 9::  		s   B3 3
C ?C c                 Z    Uc  Uc  U R                   " S0 UD6$ U R                   " SX40 UD6$ )z
Set the server to be a replicated slave of the instance identified
by the ``host`` and ``port``. If called without arguments, the
instance is promoted to a master instead.

For more information, see https://redis.io/commands/slaveof
)SLAVEOFr   s   ONEr  r5   )r7   r  r  r8   s       r:   slaveofManagementCommands.slaveof  s9     <DL''KFKK##ItDVDDr=   numc                     SSK Jn  S/nUb  UR                  U5        U R                  5       R	                  SS5      nUSL a  / X#'   U R
                  " U0 UD6$ )z
Get the entries from the slowlog. If ``num`` is specified, get the
most recent ``num`` items.

For more information, see https://redis.io/commands/slowlog-get
r   rj  zSLOWLOG GETdecode_responsesFT)ro  rk  rK   get_connection_kwargsgetr6   )r7   r  r8   rk  r@   r  s         r:   slowlog_getManagementCommands.slowlog_get   sc     	.?KK557;;<NPUVt##%F ##T4V44r=   c                 &    U R                   " S0 UD6$ )zi
Get the number of items in the slowlog

For more information, see https://redis.io/commands/slowlog-len
)zSLOWLOG LENr5   rS   s     r:   slowlog_lenManagementCommands.slowlog_len1  s     ##<V<<r=   c                 &    U R                   " S0 UD6$ )zd
Remove all items in the slowlog

For more information, see https://redis.io/commands/slowlog-reset
)zSLOWLOG RESETr5   rS   s     r:   slowlog_reset ManagementCommands.slowlog_reset9       ##>v>>r=   c                 &    U R                   " S0 UD6$ )z
Returns the server time as a 2-item tuple of ints:
(seconds since epoch, microseconds into this second).

For more information, see https://redis.io/commands/time
)TIMEr5   rS   s     r:   timeManagementCommands.timeA  r  r=   num_replicasc                 *    U R                   " SX40 UD6$ )z
Redis synchronous replication
That returns the number of replicas that processed the query when
we finally have at least ``num_replicas``, or when the ``timeout`` was
reached.

For more information, see https://redis.io/commands/wait
WAITr5   )r7   r  r  r8   s       r:   waitManagementCommands.waitJ  s     ##FLLVLLr=   	num_localc                 ,    U R                   " SXU40 UD6$ )a  
This command blocks the current client until all previous write
commands by that client are acknowledged as having been fsynced
to the AOF of the local Redis and/or at least the specified number
of replicas.

For more information, see https://redis.io/commands/waitaof
WAITAOFr5   )r7   r
  r  r  r8   s        r:   waitaofManagementCommands.waitaofU  s&     ##y
;A
 	
r=   c                     [        S5      e)r@  z5HELLO is intentionally not implemented in the client.r(  r   s    r:   helloManagementCommands.hellod  s    
 "C
 	
r=   c                     [        S5      e)r@  z8FAILOVER is intentionally not implemented in the client.r(  r   s    r:   failoverManagementCommands.failoverm  s    
 "F
 	
r=   r   r   )T)NNNNNNNFr3   NNNN*)FFNFFFFFNN)`r   r   r   r   r   r   r   r   r   r   r&   r   r   r   rI   r   r   r   r   r   r   r   r   r   r   r   r   r#   r   r   r   r  r  r  r  r  r  r   r  r   r$  r*  r/  r9  r=  rA  r%   rD  rG  rJ  rM  rQ  rT  rW  r\  rc  rg  rr  rx  r~  r  r  r  r  r  floatr  rs   r"   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r=   r:   r   r     s   ?S ?HSM ?>
At 
A 
A,i ,F3 FY F "#"!% $" $4Dc]4D }4D sm	4D
 4D ~4D sm4D 4D 
4Dl=y = &*Dc]D6::6FD	D6@) @A9 AE74='%.'&/IJE	E0;Y ; #'!#
3-
 
 	

 
 
 
 

* #'!#
3-
 
 	

 
 
 
 

* "&!#:@:@ 3-:@ 	:@
 :@ :@ :@ :@ 
:@xEy EF3 FY FM3 Ms M M -255%)5	5 5C 5d 5	 58@) @=C =E)C.#2E,F =	=C 	=E)C.#2E,F 	=9

? ?
 !%"&!%	== 3-= #	=
 
=8FS FT%T#Y:O5P F
 #&LL.6L	LPP P T:%&	P 
PBI B@) @8) 8C C9 C
=* =9 =AT A	 A@D @y @
7i 
7O3 O OGC G G9 G?C ?i ?JHSM J J9 J":I :

	<uS%Z'8 	<y 	<-y - ".
.
 .
 	.

 .
 .
 .
 .
 sm.
 
.
`
s 
 
I 


>	 >Ey E 37JJ"*3-J	J$>	 >
>S >Y >6	 6>S >Y >6iot&; < 66	 6BI B6	 6 (;(; (; 	(;
 (; (; 
(;V AEESME08E	E5x} 5) 5"=y =? ?6	 6	M 	Ms 	M 	M

,/
:=
	


r=   r   c                      ^  \ rS rSrSU 4S jjrSU 4S jjrSU 4S jjrSU 4S jjr     SS\S	\S
\S\S\SS4S jjr	Sr
U =r$ )AsyncManagementCommandsiw  r3   Nc                 ,   >#    [         TU ]  " S0 UD6$ 7fNr   superr*  r7   r8   	__class__s     r:   r*  $AsyncManagementCommands.command_infox  s     w#-f--   c                 ,   >#    [         TU ]  " S0 UD6$ 7fr   )r"  rW  r#  s     r:   rW  &AsyncManagementCommands.debug_segfault{  s     w%///r&  c                 ,   >#    [         TU ]  " S0 UD6$ 7fr   )r"  r  r#  s     r:   r  %AsyncManagementCommands.memory_doctor~  s     w$.v..r&  c                 ,   >#    [         TU ]  " S0 UD6$ 7fr   )r"  r  r#  s     r:   r  #AsyncManagementCommands.memory_help  s     w",V,,r&  r  r  r  rz   r  c                   #    U(       a  U(       a  [        S5      eS/nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5         U R                  " U0 UD6I Sh  vN   [	        S	5      e N! [         a     gf = f7f)
a  Shutdown the Redis server.  If Redis has persistence configured,
data will be flushed before shutdown.  If the "save" option is set,
a data flush will be attempted even if there is no persistence
configured.  If the "nosave" option is set, no data flush will be
attempted.  The "save" and "nosave" options cannot both be set.

For more information, see https://redis.io/commands/shutdown
r  r  r  r  r  r  r  Nr  r  r  s           r:   r   AsyncManagementCommands.shutdown  s     " FIJJ|KKKK!KKKK KK 	&&7777 9::	 8 		s<   BCB? -B=.B? 2C=B? ?
C	CCCr   r  r  )r   r   r   r   r*  rW  r  r  r   r  r   __classcell__r$  s   @r:   r  r  w  sl    .0/-
 #;#; #; 	#;
 #; #; 
#; #;r=   r  c            
           \ rS rSrSr SS\S   S\S\\   4S jjrS	 r	S
\4S jr
 SS\S\S\S
\\   4S jjrS\S\4S jrS\S\S\4S jr\S 5       rS\4S jrSrg)BitFieldOperationi  z(
Command builder for BITFIELD commands.
Nclientredis.client.Redisredis.asyncio.client.Redisr   default_overflowc                 d    Xl         X l        X0l        / U l        SU l        U R                  5         g )NWRAP)r3  r   _default_overflow
operations_last_overflowrs   )r7   r3  r   r7  s       r:   __init__BitFieldOperation.__init__  s,     !18:$

r=   c                 |    / U l         SU l        U R                  U R                  =(       d    U R                  5        g)z<
Reset the state of the instance to when it was constructed
r9  N)r;  r<  overflowr:  r   s    r:   rs   BitFieldOperation.reset  s0     $d,,C0C0CDr=   r@  c                     UR                  5       nXR                  :w  a#  Xl        U R                  R                  SU45        U $ )z
Update the overflow algorithm of successive INCRBY operations
:param overflow: Overflow algorithm, one of WRAP, SAT, FAIL. See the
    Redis docs for descriptions of these algorithmsself.
:returns: a :py:class:`BitFieldOperation` instance.
OVERFLOW)upperr<  r;  rK   )r7   r@  s     r:   r@  BitFieldOperation.overflow  s>     >>#***"*OO""J#9:r=   fmtru  	incrementc                 j    Ub  U R                  U5        U R                  R                  SXU45        U $ )aX  
Increment a bitfield by a given amount.
:param fmt: format-string for the bitfield being updated, e.g. 'u8'
    for an unsigned 8-bit integer.
:param offset: offset (in number of bits). If prefixed with a
    '#', this is an offset multiplier, e.g. given the arguments
    fmt='u8', offset='#2', the offset will be 16.
:param int increment: value to increment the bitfield by.
:param str overflow: overflow algorithm. Defaults to WRAP, but other
    acceptable values are SAT and FAIL. See the Redis docs for
    descriptions of these algorithms.
:returns: a :py:class:`BitFieldOperation` instance.
INCRBY)r@  r;  rK   )r7   rF  ru  rG  r@  s        r:   incrbyBitFieldOperation.incrby  s4    ( MM(##yABr=   c                 @    U R                   R                  SX45        U $ )al  
Get the value of a given bitfield.
:param fmt: format-string for the bitfield being read, e.g. 'u8' for
    an unsigned 8-bit integer.
:param offset: offset (in number of bits). If prefixed with a
    '#', this is an offset multiplier, e.g. given the arguments
    fmt='u8', offset='#2', the offset will be 16.
:returns: a :py:class:`BitFieldOperation` instance.
GETr;  rK   )r7   rF  ru  s      r:   r  BitFieldOperation.get  s      	s34r=   r	  c                 B    U R                   R                  SXU45        U $ )a  
Set the value of a given bitfield.
:param fmt: format-string for the bitfield being read, e.g. 'u8' for
    an unsigned 8-bit integer.
:param offset: offset (in number of bits). If prefixed with a
    '#', this is an offset multiplier, e.g. given the arguments
    fmt='u8', offset='#2', the offset will be 16.
:param int value: value to set at the given position.
:returns: a :py:class:`BitFieldOperation` instance.
SETrN  )r7   rF  ru  r	  s       r:   setBitFieldOperation.set  s"     	sE:;r=   c                 j    SU R                   /nU R                   H  nUR                  U5        M     U$ )NBITFIELD)r   r;  r   )r7   r   opss      r:   r$  BitFieldOperation.command  s.    488$??CJJsO #
r=   r3   c                 l    U R                   nU R                  5         U R                  R                  " U6 $ )z
Execute the operation(s) in a single BITFIELD command. The return value
is a list of values corresponding to each operation. If the client
used to create this instance was a pipeline, the list of values
will be present within the pipeline's execute.
)r$  rs   r3  r6   )r7   r$  s     r:   executeBitFieldOperation.execute  s+     ,,

{{**G44r=   )r:  r<  r3  r   r;  r   )r   r   r   r   r   r   r   r   r=  rs   r@  r   rI   rJ  r  rR  propertyr$  r&   rY  r   r   r=   r:   r2  r2    s     +/	HI  #3-	E $ #'   	
 3-4s O s O C   	5 	5r=   r2  c                   Z   \ rS rSrSrS\S\S\4S jr   SS\S\	\
   S	\	\
   S
\	\   S\4
S jjr SS\S   S\S\	\   S\4S jjr SS\S   S\S\S\S\	\   S\4S jjrS\S\S\S\4S jr   SS\S\
S\	\
   S	\	\
   S
\	\   S\4S jjr  SS\S\S\	\   S\S\4
S jjrSS\S \
S\4S! jjr\rS"\S\4S# jrS\4S$ jrS\S\4S% jrS"\S\4S& jr\r    SS\S'\S(\S)\S*\S+\S\4S, jjr    SS\S-\ S(\S)\S*\S+\S\4S. jjr!S\S\
4S/ jr"S\S\4S0 jr#S\S\4S1 jr$     SS\S2\	\   S3\	\   S4\	\    S5\	\    S6\S\4S7 jjr%S\4S8 jr&S\S\
S\4S9 jr'S\S\
S	\
S\4S: jr(S\S\S\4S; jr)SS\S \
S\4S< jjr*\*r+SS\S \,S\4S= jjr-SS>\.S\4S? jjr/ SS@\SA\SB\S\S\4
SC jjr0  SS@\SA\SD\
SB\S\S\4SE jjr1S\2SF\S\4SG jr3SH\4\5\4   S\4SI jr6SH\4\5\4   S\4SJ jr7S\SK\
S\4SL jr8S\S\4SM jr9    SS\S'\S(\S)\S*\S+\S\4SN jjr:    SS\S-\ S(\S)\S*\S+\S\4SO jjr;S\S\
4SP jr<S\SQ\S\4SR jr=S\S\4SS jr> SS\ST\	\
   SU\S\4SV jjr?S\4SW jr@SB\SX\S\4SY jrASB\SX\4SZ jrB    SS\S[\,S\S\S\\S]\	\
   S^\	\
   S\4S_ jjrC        SS\S\S2\	\   S3\	\   S(\S)\S`\Sa\S4\	\    S5\	\    S\4Sb jjrDS\S\4Sc jrES\S\
S\
S\4Sd jrFS\S'\S\S\4Se jrGS\S\S\4Sf jrHS\S\
S\S\4Sg jrI     SSi\JSj   Sk\Sl\Sm\\JSh   \JS   4   Sn\So\Sp\	\
   Sq\S\4Sr jjrKS\S\4Ss jrLSS\S\
S	\
S\4St jjrMSF\S\4Su jrNS\S\4Sv jrOS\S\4Sw jrPS"\SS4Sx jrQSSy jrRS"\S\4Sz jrS    SS{\S|\Sn\	\   So\	\   Sp\	\
   Sq\	\   S\\\
\4   4S} jjrTS~rUg)BasicKeyCommandsi  z 
Redis basic key-based commands
r   r	  r3   c                 &    U R                  SX5      $ )z
Appends the string ``value`` to the value at ``key``. If ``key``
doesn't already exist, create it with a value of ``value``.
Returns the new length of the value at ``key``.

For more information, see https://redis.io/commands/append
APPENDr5   )r7   r   r	  s      r:   rK   BasicKeyCommands.append  s     ##Hc99r=   Nstartendr  c                     U/nUb&  Ub#  UR                  U5        UR                  U5        OUb  Ub  Ub  Uc  [        S5      eUb  UR                  U5        U R                  " S/UQ7SU/06$ )z
Returns the count of set bits in the value of ``key``.  Optional
``start`` and ``end`` parameters indicate which bytes to consider

For more information, see https://redis.io/commands/bitcount
z$Both start and end must be specifiedBITCOUNTrp   )rK   r   r6   )r7   r   ra  rb  r  paramss         r:   bitcountBasicKeyCommands.bitcount)  sz     MM% MM#CKS_BCCMM$##JDDseDDr=   r7   r4  r7  c                     [        XUS9$ )z
Return a BitFieldOperation instance to conveniently construct one or
more bitfield operations on ``key``.

For more information, see https://redis.io/commands/bitfield
)r7  )r2  )r7   r   r7  s      r:   bitfieldBasicKeyCommands.bitfield@  s     !=MNNr=   encodingru  itemsc                     USX#/nU=(       d    / nU H  u  p#UR                  SX#/5        M     U R                  " S/UQ7SU/06$ )aL  
Return an array of the specified bitfield values
where the first value is found using ``encoding`` and ``offset``
parameters and remaining values are result of corresponding
encoding/offset pairs in optional list ``items``
Read-only variant of the BITFIELD command.

For more information, see https://redis.io/commands/bitfield_ro
rM  BITFIELD_ROrp   r   r6   )r7   r   rk  ru  rl  re  s         r:   bitfield_roBasicKeyCommands.bitfield_roM  sT      uh/ %HMM5(34 !&##MGFG#GGr=   	operationdestrp   c                 *    U R                   " SX/UQ76 $ )z
Perform a bitwise operation using ``operation`` between ``keys`` and
store the result in ``dest``.

For more information, see https://redis.io/commands/bitop
BITOPr5   )r7   rr  rs  rp   s       r:   bitopBasicKeyCommands.bitopd  s     ##GYDtDDr=   bitc                 
   US;  a  [        S5      eX/nUSL=(       a    UR                  U5        Ub  Ub  UR                  U5        OUc  Ub  [        S5      eUb  UR                  U5        U R                  " S/UQ7SU/06$ )a,  
Return the position of the first bit set to 1 or 0 in a string.
``start`` and ``end`` defines search range. The range is interpreted
as a range of bytes and not a range of bits, so start=0 and end=2
means to look at the first three bytes.

For more information, see https://redis.io/commands/bitpos
)r   r-   zbit must be 0 or 1Nz0start argument is not set, when end is specifiedBITPOSrp   r   rK   r6   )r7   r   rx  ra  rb  r  re  s          r:   bitposBasicKeyCommands.bitposm  s      f011T2fmmE2MM#]sNOOMM$##HBvBSEBBr=   sourcedestinationr  r  c                     X/nUb  UR                  SU/5        U(       a  UR                  S5        U R                  " S/UQ76 $ )a  
Copy the value stored in the ``source`` key to the ``destination`` key.

``destination_db`` an alternative destination database. By default,
the ``destination`` key is created in the source Redis database.

``replace`` whether the ``destination`` key should be removed before
copying the value to it. By default, the value is not copied if
the ``destination`` key already exists.

For more information, see https://redis.io/commands/copy
DBREPLACECOPY)r   rK   r6   )r7   r~  r  r  r  re  s         r:   r  BasicKeyCommands.copy  sH    & &%MM401MM)$##F4V44r=   r  amountc                 &    U R                  SX5      $ )z
Decrements the value of ``key`` by ``amount``.  If no key exists,
the value will be initialized as 0 - ``amount``

For more information, see https://redis.io/commands/decrby
DECRBYr5   r7   r  r  s      r:   decrbyBasicKeyCommands.decrby       ##Hd;;r=   namesc                 (    U R                   " S/UQ76 $ )z0
Delete one or more keys specified by ``names``
DELr5   r7   r  s     r:   deleteBasicKeyCommands.delete  s     ##E2E22r=   c                 &    U R                  U5        g r   )r  r7   r  s     r:   __delitem__BasicKeyCommands.__delitem__  s    Dr=   c                 B    SSK Jn  0 n/ X2'   U R                  " SU40 UD6$ )z
Return a serialized version of the value stored at the specified key.
If key does not exist a nil bulk reply is returned.

For more information, see https://redis.io/commands/dump
r   rj  DUMPrn  )r7   r  rk  rq  s       r:   dumpBasicKeyCommands.dump  s,     	. "##FD<G<<r=   c                 .    U R                   " S/UQ7SU06$ )zh
Returns the number of ``names`` that exist

For more information, see https://redis.io/commands/exists
EXISTSrp   r5   r  s     r:   existsBasicKeyCommands.exists  s     ##HAuA5AAr=   r  nxxxgtltc                 n   [        U[        R                  5      (       a  [        UR	                  5       5      n[        5       nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U R                  " SX/UQ76 $ )a  
Set an expire flag on key ``name`` for ``time`` seconds with given
``option``. ``time`` can be represented by an integer or a Python timedelta
object.

Valid options are:
    NX -> Set expiry only when the key has no expiry
    XX -> Set expiry only when the key has an existing expiry
    GT -> Set expiry only when the new expiry is greater than current one
    LT -> Set expiry only when the new expiry is less than current one

For more information, see https://redis.io/commands/expire
NXXXGTLTEXPIREr]   datetime	timedeltarI   total_secondsr   rK   r6   r7   r  r  r  r  r  r  
exp_options           r:   expireBasicKeyCommands.expire  s    , dH..//t))+,DV
d#d#d#d###HdF:FFr=   whenc                 n   [        U[        R                  5      (       a  [        UR                  5       5      n[	        5       nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U R                  " SX/UQ76 $ )a  
Set an expire flag on key ``name`` with given ``option``. ``when``
can be represented as an integer indicating unix time or a Python
datetime object.

Valid options are:
    -> NX -- Set expiry only when the key has no expiry
    -> XX -- Set expiry only when the key has an existing expiry
    -> GT -- Set expiry only when the new expiry is greater than current one
    -> LT -- Set expiry only when the new expiry is less than current one

For more information, see https://redis.io/commands/expireat
r  r  r  r  EXPIREATr]   r  rI   	timestampr   rK   r6   r7   r  r  r  r  r  r  r  s           r:   expireatBasicKeyCommands.expireat  s    , dH--..t~~'(DV
d#d#d#d###JHZHHr=   c                 &    U R                  SU5      $ )z
Returns the absolute Unix timestamp (since January 1, 1970) in seconds
at which the given key will expire.

For more information, see https://redis.io/commands/expiretime

EXPIRETIMEr5   r7   r   s     r:   
expiretimeBasicKeyCommands.expiretime  s     ##L#66r=   c                 $    U R                  SX/S9$ )z}
Return the value at key ``name``, or None if the key doesn't exist

For more information, see https://redis.io/commands/get
rM  rp   r5   r  s     r:   r  BasicKeyCommands.get$  s     ##E4f#==r=   c                 &    U R                  SU5      $ )z
Get the value at key ``name`` and delete the key. This command
is similar to GET, except for the fact that it also deletes
the key on success (if and only if the key's value type
is a string).

For more information, see https://redis.io/commands/getdel
GETDELr5   r  s     r:   getdelBasicKeyCommands.getdel,  s     ##Hd33r=   expxexatpxatpersistc                     X#XE1n[        U5      S:  d  [        U5      S:  a  U(       a  [        S5      e[        X#XE5      nU(       a  UR                  S5        U R                  " SU/UQ76 $ )a~  
Get the value of key and optionally set its expiration.
GETEX is similar to GET, but is a write command with
additional options. All time parameters can be given as
datetime.timedelta or integers.

``ex`` sets an expire flag on key ``name`` for ``ex`` seconds.

``px`` sets an expire flag on key ``name`` for ``px`` milliseconds.

``exat`` sets an expire flag on key ``name`` for ``ex`` seconds,
specified in unix time.

``pxat`` sets an expire flag on key ``name`` for ``ex`` milliseconds,
specified in unix time.

``persist`` remove the time to live associated with ``name``.

For more information, see https://redis.io/commands/getex
   r-   K``ex``, ``px``, ``exat``, ``pxat``, and ``persist`` are mutually exclusive.PERSISTGETEX)r   r   r,   rK   r6   )	r7   r  r  r  r  r  r  opsetexp_optionss	            r:   getexBasicKeyCommands.getex7  sn    : $u:>SZ!^: 
 )=RT(Py)##GT@K@@r=   c                 D    U R                  U5      nUb  U$ [        U5      e)zO
Return the value at key ``name``, raises a KeyError if the key
doesn't exist.
)r  KeyErrorr7   r  r	  s      r:   __getitem__BasicKeyCommands.__getitem__b  s&    
 Ltnr=   c                 &    U R                  SXU/S9$ )z
Returns an integer indicating the value of ``offset`` in ``name``

For more information, see https://redis.io/commands/getbit
GETBITr  r5   )r7   r  ru  s      r:   getbitBasicKeyCommands.getbitl  s     ##Hd$#HHr=   c                 &    U R                  SXX1/S9$ )z
Returns the substring of the string value stored at ``key``,
determined by the offsets ``start`` and ``end`` (both are inclusive)

For more information, see https://redis.io/commands/getrange
GETRANGEr  r5   )r7   r   ra  rb  s       r:   getrangeBasicKeyCommands.getranget  s     ##JCe#LLr=   c                 &    U R                  SX5      $ )a  
Sets the value at key ``name`` to ``value``
and returns the old value at key ``name`` atomically.

As per Redis 6.2, GETSET is considered deprecated.
Please use SET with GET parameter in new code.

For more information, see https://redis.io/commands/getset
GETSETr5   r  s      r:   getsetBasicKeyCommands.getset}  s     ##Hd::r=   c                 &    U R                  SX5      $ )z
Increments the value of ``key`` by ``amount``.  If no key exists,
the value will be initialized as ``amount``

For more information, see https://redis.io/commands/incrby
rI  r5   r  s      r:   rJ  BasicKeyCommands.incrby  r  r=   c                 &    U R                  SX5      $ )z
Increments the value at key ``name`` by floating ``amount``.
If no key exists, the value will be initialized as ``amount``

For more information, see https://redis.io/commands/incrbyfloat
INCRBYFLOATr5   r  s      r:   incrbyfloatBasicKeyCommands.incrbyfloat  s     ##M4@@r=   r2  c                 *    U R                   " SU40 UD6$ )zg
Returns a list of keys matching ``pattern``

For more information, see https://redis.io/commands/keys
KEYSr5   r7   r2  r8   s      r:   rp   BasicKeyCommands.keys  s     ##FG>v>>r=   
first_listsecond_listsrcc                 0    XX4/nU R                   " S/UQ76 $ )z
Atomically returns and removes the first/last element of a list,
pushing it as the first/last element on the destination list.
Returns the element being popped and pushed.

For more information, see https://redis.io/commands/lmove
LMOVEr5   )r7   r  r  r  rs  re  s         r:   lmoveBasicKeyCommands.lmove  s$     35##G5f55r=   r  c                 2    XXEU/nU R                   " S/UQ76 $ )zX
Blocking version of lmove.

For more information, see https://redis.io/commands/blmove
BLMOVEr5   )r7   r  r  r  r  rs  re  s          r:   blmoveBasicKeyCommands.blmove  s&     3g>##H6v66r=   r@   c                 r    SSK Jn  [        X5      n0 nU(       d  / XC'   X$S'   U R                  " S/UQ70 UD6$ )zt
Returns a list of values ordered identically to ``keys``

For more information, see https://redis.io/commands/mget
r   )EMPTY_RESPONSErp   MGET)ro  r  r.   r6   )r7   rp   r@   r  rq  s        r:   mgetBasicKeyCommands.mget  sC     	0D'&(G###F=T=W==r=   mappingc                 |    / nUR                  5        H  nUR                  U5        M     U R                  " S/UQ76 $ )z
Sets key/values based on a mapping. Mapping is a dictionary of
key/value pairs. Both keys and values should be strings or types that
can be cast to a string via str().

For more information, see https://redis.io/commands/mset
MSETrl  r   r6   r7   r  rl  pairs       r:   msetBasicKeyCommands.mset  s;     MMODLL $##F3U33r=   c                 |    / nUR                  5        H  nUR                  U5        M     U R                  " S/UQ76 $ )aG  
Sets key/values based on a mapping if none of the keys are already set.
Mapping is a dictionary of key/value pairs. Both keys and values
should be strings or types that can be cast to a string via str().
Returns a boolean indicating if the operation was successful.

For more information, see https://redis.io/commands/msetnx
MSETNXr   r  s       r:   msetnxBasicKeyCommands.msetnx  s;     MMODLL $##H5u55r=   dbc                 &    U R                  SX5      $ )zw
Moves the key ``name`` to a different Redis database ``db``

For more information, see https://redis.io/commands/move
MOVEr5   )r7   r  r	  s      r:   moveBasicKeyCommands.move  s     ##FD55r=   c                 &    U R                  SU5      $ )z`
Removes an expiration on ``name``

For more information, see https://redis.io/commands/persist
r  r5   r  s     r:   r  BasicKeyCommands.persist  s     ##It44r=   c                 t   [        U[        R                  5      (       a  [        UR	                  5       S-  5      n[        5       nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U R                  " SX/UQ76 $ )a  
Set an expire flag on key ``name`` for ``time`` milliseconds
with given ``option``. ``time`` can be represented by an
integer or a Python timedelta object.

Valid options are:
    NX -> Set expiry only when the key has no expiry
    XX -> Set expiry only when the key has an existing expiry
    GT -> Set expiry only when the new expiry is greater than current one
    LT -> Set expiry only when the new expiry is less than current one

For more information, see https://redis.io/commands/pexpire
  r  r  r  r  PEXPIREr  r  s           r:   pexpireBasicKeyCommands.pexpire  s    , dH..//t))+d23DV
d#d#d#d###ItGJGGr=   c                 t   [        U[        R                  5      (       a  [        UR                  5       S-  5      n[	        5       nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U R                  " SX/UQ76 $ )a  
Set an expire flag on key ``name`` with given ``option``. ``when``
can be represented as an integer representing unix time in
milliseconds (unix time * 1000) or a Python datetime object.

Valid options are:
    NX -> Set expiry only when the key has no expiry
    XX -> Set expiry only when the key has an existing expiry
    GT -> Set expiry only when the new expiry is greater than current one
    LT -> Set expiry only when the new expiry is less than current one

For more information, see https://redis.io/commands/pexpireat
r  r  r  r  r  	PEXPIREATr  r  s           r:   	pexpireatBasicKeyCommands.pexpireat   s    , dH--..t~~'$./DV
d#d#d#d###KIjIIr=   c                 &    U R                  SU5      $ )z
Returns the absolute Unix timestamp (since January 1, 1970) in milliseconds
at which the given key will expire.

For more information, see https://redis.io/commands/pexpiretime
PEXPIRETIMEr5   r  s     r:   pexpiretimeBasicKeyCommands.pexpiretimeC  s     ##M377r=   time_msc                     [        U[        R                  5      (       a  [        UR	                  5       S-  5      nU R                  SXU5      $ )z
Set the value of key ``name`` to ``value`` that expires in ``time_ms``
milliseconds. ``time_ms`` can be represented by an integer or a Python
timedelta object

For more information, see https://redis.io/commands/psetex
r  PSETEXr]   r  r  rI   r  r6   )r7   r  r  r	  s       r:   psetexBasicKeyCommands.psetexL  sD     gx1122'//1D89G##HdUCCr=   c                 &    U R                  SU5      $ )z
Returns the number of milliseconds until the key ``name`` will expire

For more information, see https://redis.io/commands/pttl
PTTLr5   r  s     r:   pttlBasicKeyCommands.pttlX  s     ##FD11r=   rZ   
withvaluesc                     / nUb  UR                  U5        U(       a  UR                  S5        U R                  " SU/UQ76 $ )a!  
Return a random field from the hash value stored at key.

count: if the argument is positive, return an array of distinct fields.
If called with a negative count, the behavior changes and the command
is allowed to return the same field multiple times. In this case,
the number of returned fields is the absolute value of the
specified count.
withvalues: The optional WITHVALUES modifier changes the reply so it
includes the respective values of the randomly selected hash fields.

For more information, see https://redis.io/commands/hrandfield

WITHVALUES
HRANDFIELDr   )r7   r   rZ   r'  re  s        r:   
hrandfieldBasicKeyCommands.hrandfield`  sB      MM% MM,'##L#???r=   c                 &    U R                   " S0 UD6$ )za
Returns the name of a random key

For more information, see https://redis.io/commands/randomkey
)	RANDOMKEYr5   rS   s     r:   	randomkeyBasicKeyCommands.randomkeyx  r   r=   dstc                 &    U R                  SX5      $ )z[
Rename key ``src`` to ``dst``

For more information, see https://redis.io/commands/rename
RENAMEr5   r7   r  r1  s      r:   renameBasicKeyCommands.rename  s     ##Hc77r=   c                 &    U R                  SX5      $ )z~
Rename key ``src`` to ``dst`` if ``dst`` doesn't already exist

For more information, see https://redis.io/commands/renamenx
RENAMENXr5   r4  s      r:   renamenxBasicKeyCommands.renamenx  s     ##J99r=   ttlabsttlidletime	frequencyc                    XU/nU(       a  UR                  S5        U(       a  UR                  S5        Ub,  UR                  S5         UR                  [        U5      5        Ub,  UR                  S5         UR                  [        U5      5        U R                  " S/UQ76 $ ! [         a    [        S5      ef = f! [         a    [        S5      ef = f)a  
Create a key using the provided serialized value, previously obtained
using DUMP.

``replace`` allows an existing key on ``name`` to be overridden. If
it's not specified an error is raised on collision.

``absttl`` if True, specified ``ttl`` should represent an absolute Unix
timestamp in milliseconds in which the key will expire. (Redis 5.0 or
greater).

``idletime`` Used for eviction, this is the number of seconds the
key must be idle, prior to execution.

``frequency`` Used for eviction, this is the frequency counter of
the object stored at the key, prior to execution.

For more information, see https://redis.io/commands/restore
r  ABSTTLIDLETIMEzidletimemust be an integerFREQzfrequency must be an integerRESTORE)rK   rI   rJ   r   r6   )	r7   r  r;  r	  r  r<  r=  r>  re  s	            r:   restoreBasicKeyCommands.restore  s    : U#MM)$MM(#MM*%>c(m,  MM&!@c)n- ##I777  > <==>  @ >??@s   
B& 9B? &B<?Ckeepttlr  c                    X4X1n[        U5      S:  d  [        U5      S:  a  U(       a  [        S5      eU(       a  U(       a  [        S5      eX/n0 nUR                  [        X4X5      5        U(       a  UR	                  S5        U(       a  UR	                  S5        U(       a  UR	                  S5        U(       a  UR	                  S5        S	US
'   U R
                  " S/UQ70 UD6$ )a  
Set the value at key ``name`` to ``value``

``ex`` sets an expire flag on key ``name`` for ``ex`` seconds.

``px`` sets an expire flag on key ``name`` for ``px`` milliseconds.

``nx`` if set to True, set the value at key ``name`` to ``value`` only
    if it does not exist.

``xx`` if set to True, set the value at key ``name`` to ``value`` only
    if it already exists.

``keepttl`` if True, retain the time to live associated with the key.
    (Available since Redis 6.0)

``get`` if True, set the value at key ``name`` to ``value`` and return
    the old value stored at key, or None if the key did not exist.
    (Available since Redis 6.2)

``exat`` sets an expire flag on key ``name`` for ``ex`` seconds,
    specified in unix time.

``pxat`` sets an expire flag on key ``name`` for ``ex`` milliseconds,
    specified in unix time.

For more information, see https://redis.io/commands/set
r  r-   K``ex``, ``px``, ``exat``, ``pxat``, and ``keepttl`` are mutually exclusive.z)``nx`` and ``xx`` are mutually exclusive.KEEPTTLr  r  rM  Tr  rQ  )r   r   r   r,   rK   r6   )r7   r  r	  r  r  r  r  rF  r  r  r  r  r9   rq  s                 r:   rR  BasicKeyCommands.set  s    R $u:>SZ!^: 
 "GHH$(=*24>?MM)$MM$MM$MM% !GEN##E>F>g>>r=   c                 &    U R                  X5        g r   )rR  r  s      r:   __setitem__BasicKeyCommands.__setitem__	  s    r=   c                 P    U=(       a    S=(       d    SnU R                  SXU5      $ )z
Flag the ``offset`` in ``name`` as ``value``. Returns an integer
indicating the previous value of ``offset``.

For more information, see https://redis.io/commands/setbit
r-   r   SETBITr5   r7   r  ru  r	  s       r:   setbitBasicKeyCommands.setbit	  s'     ! q##HdEBBr=   c                     [        U[        R                  5      (       a  [        UR	                  5       5      nU R                  SXU5      $ )z
Set the value of key ``name`` to ``value`` that expires in ``time``
seconds. ``time`` can be represented by an integer or a Python
timedelta object.

For more information, see https://redis.io/commands/setex
SETEXr   )r7   r  r  r	  s       r:   setexBasicKeyCommands.setex	  s?     dH..//t))+,D##GT??r=   c                 &    U R                  SX5      $ )z|
Set the value of key ``name`` to ``value`` if key doesn't exist

For more information, see https://redis.io/commands/setnx
SETNXr5   r  s      r:   setnxBasicKeyCommands.setnx!	  s     ##GT99r=   c                 (    U R                  SXU5      $ )a  
Overwrite bytes in the value of ``name`` starting at ``offset`` with
``value``. If ``offset`` plus the length of ``value`` exceeds the
length of the original value, the new value will be larger than before.
If ``offset`` exceeds the length of the original value, null bytes
will be used to pad between the end of the previous value and the start
of what's being injected.

Returns the length of the new string.

For more information, see https://redis.io/commands/setrange
SETRANGEr5   rP  s       r:   setrangeBasicKeyCommands.setrange)	  s     ##JeDDr=   stringsalgoLCSvalue1value2specific_argumentr   idxminmatchlenwithmatchlenc	                    S/n
X;  a  SR                  U
5      n[        SU 35      eUS;  a  [        S5      eU(       a  U(       a  [        S5      eXR                  5       X#/nU(       a  UR                  S5        U(       a  UR                  S5         [	        U5        UR                  S	U/5        U(       a  UR                  S
5        U R                  " S/UQ7UUUUS.U	D6$ ! [         a     N?f = f)a(  
Implements complex algorithms that operate on strings.
Right now the only algorithm implemented is the LCS algorithm
(longest common substring). However new algorithms could be
implemented in the future.

``algo`` Right now must be LCS
``value1`` and ``value2`` Can be two strings or two keys
``specific_argument`` Specifying if the arguments to the algorithm
will be keys or strings. strings is the default.
``len`` Returns just the len of the match.
``idx`` Returns the match positions in each string.
``minmatchlen`` Restrict the list of matches to the ones of a given
minimal length. Can be provided only when ``idx`` set to True.
``withmatchlen`` Returns the matches with the len of the match.
Can be provided only when ``idx`` set to True.

For more information, see https://redis.io/commands/stralgo
ra  z, zThe supported algorithms are: )rp   r_  z-specific_argument can be only keys or stringsz(len and idx cannot be provided together.s   LENs   IDXs   MINMATCHLENs   WITHMATCHLENSTRALGO)r   re  rf  rg  )joinr   rD  rK   rI   r   	TypeErrorr6   )r7   r`  rb  rc  rd  r   re  rf  rg  r8   supported_algosupported_algos_strr9   s                r:   stralgoBasicKeyCommands.stralgo8	  s   @  %"&))N";<=P<QRSS$77KLL3FGG$(*A*A*CV#TMM&!MM&!	MM>;78 MM/*##

 #%
 
 	
  		s   C& &
C32C3c                 $    U R                  SX/S9$ )zx
Return the number of bytes stored in the value of ``name``

For more information, see https://redis.io/commands/strlen
STRLENr  r5   r  s     r:   strlenBasicKeyCommands.strlenx	  s     ##Hd#@@r=   c                 &    U R                  SXX1/S9$ )z
Return a substring of the string at key ``name``. ``start`` and ``end``
are 0-based integers specifying the portion of the string to return.
SUBSTRr  r5   r7   r  ra  rb  s       r:   substrBasicKeyCommands.substr	  s    
 ##Hd3V#LLr=   c                 (    U R                   " S/UQ76 $ )z
Alters the last access time of a key(s) ``*args``. A key is ignored
if it does not exist.

For more information, see https://redis.io/commands/touch
TOUCHr5   r<  s     r:   touchBasicKeyCommands.touch	  s     ##G3d33r=   c                 &    U R                  SU5      $ )z{
Returns the number of seconds until the key ``name`` will expire

For more information, see https://redis.io/commands/ttl
TTLr5   r  s     r:   r;  BasicKeyCommands.ttl	  s     ##E400r=   c                 $    U R                  SX/S9$ )z\
Returns the type of key ``name``

For more information, see https://redis.io/commands/type
TYPEr  r5   r  s     r:   typeBasicKeyCommands.type	       ##FDv#>>r=   c                 B    [         R                  " [        S5      5        g)z
Watches the values at keys ``names``, or None if the key doesn't exist

For more information, see https://redis.io/commands/watch
z!Call WATCH from a Pipeline objectNwarningswarnDeprecationWarningr  s     r:   watchBasicKeyCommands.watch	  s     	()LMNr=   c                 B    [         R                  " [        S5      5        g)zv
Unwatches all previously watched keys for a transaction

For more information, see https://redis.io/commands/unwatch
z#Call UNWATCH from a Pipeline objectNr  r   s    r:   unwatchBasicKeyCommands.unwatch	  s     	()NOPr=   c                 (    U R                   " S/UQ76 $ )zl
Unlink one or more keys specified by ``names``

For more information, see https://redis.io/commands/unlink
UNLINKr5   r  s     r:   unlinkBasicKeyCommands.unlink	  s     ##H5u55r=   key1key2c                     X/nU(       a  UR                  S5        U(       a  UR                  S5        US:w  a  UR                  SU/5        U(       a  UR                  S5        U R                  " S/UQ7SX/06$ )a  
Find the longest common subsequence between ``key1`` and ``key2``.
If ``len`` is true the length of the match will will be returned.
If ``idx`` is true the match position in each strings will be returned.
``minmatchlen`` restrict the list of matches to the ones of
the given ``minmatchlen``.
If ``withmatchlen`` the length of the match also will be returned.
For more information, see https://redis.io/commands/lcs
LENIDXr   MINMATCHLENWITHMATCHLENra  rp   rK   r   r6   )r7   r  r  r   re  rf  rg  r9   s           r:   lcsBasicKeyCommands.lcs	  sn    $ MM% MM% !MM=+67MM.)##EFFF$FFr=   r   r  r   NFr-   )FFFF)NNNNFg      ?r  )LEFTRIGHT)FFNN)NNFFFFNN)r_  FFNF)r  )FFr   F)Vr   r   r   r   r   r#   r   r&   rK   r   rI   r   rf  r   r2  ri  r   r   rp  rv  r|  r   r  r  decrr  r  r  r  __contains__r   r  r   r  r  r  r  r  r  r  r  r  rJ  incrr  r  r%   rp   r  r  r"   r  r   r   r  r  r  r  r  r  r  r!  r%  r+  r/  r5  r9  rD  rR  rL  rQ  rU  rY  r]  r   rn  rr  rw  r{  r;  r  r  r  r  r  r   r   r=   r:   r]  r]    s7
   :$ :z :i :  $!"EE }E c]	E
 smE 
E4 +/OFGOO #3-O 
	O$ !%HFGHH H  	H
 ~H 
H.Es E$ Et E	 E  $!"CC C }	C
 c]C smC 
CF )-55 5 !	5
 5 
54<4 < <Y < D3T 3i 3 = =) =BT Bi B L #G#G #G 	#G
 #G #G #G 
#GR #I#I #I 	#I
 #I #I #I 
#IJ7c 7c 7> > >	44 	4I 	4 !% $%)%))A)A W)A W	)A
 z")A z")A )A 
)AV I4 I I IMD M M3 M9 M
;4 
;
 
;y 
;<4 < <Y < DA Ae Ai A?H ? ? QX66,/6696JM6	6$ 77 7 	7
 7 7 
7 > >z >i >4GGZ$78 4Y 46ggz&9: 6y 66 63 69 65D 5Y 5 "H"H "H 	"H
 "H "H "H 
"HP !J!J !J 	!J
 !J !J !J 
!JF8s 8s 8
D4 
D' 
D* 
D2 2) 2 IN@@'}@AE@	@0;Y ;8$ 8T 8i 8:D :t : "&#'0808 08 	08
 08 08 3-08 C=08 
08l !% $%)%)D?D? D? W	D?
 WD? D? D? D? D? z"D? z"D? 
D?L Z C4 C CS CY C
@$ 
@g 
@j 
@Y 
@:$ :z :i :ET E3 Ez Ei E( IR%)">
en>
 >
 	>

 !!3WV_!DE>
 >
 >
 c]>
 >
 
>
@A4 AI AM4 M M# My M44 4I 41 1 1? ?) ?OD OT OQ6T 6i 6 $#%&',GG G d^	G
 d^G c]G tnG 
sC~	G Gr=   r]  c                      ^  \ rS rSrS\4S jrS\4S jrS\4S jrS\S\4S jr	S\S	S
4U 4S jjr
SU 4S jjrSrU =r$ )AsyncBasicKeyCommandsi	  r  c                     [        S5      e)Nz2Async Redis client does not support class deletionrk  r  s     r:   r  !AsyncBasicKeyCommands.__delitem__	  s    LMMr=   c                     [        S5      e)Nz3Async Redis client does not support class inclusionr  r  s     r:   r  "AsyncBasicKeyCommands.__contains__	      MNNr=   c                     [        S5      e)Nz3Async Redis client does not support class retrievalr  r  s     r:   r  !AsyncBasicKeyCommands.__getitem__	  r  r=   r	  c                     [        S5      e)Nz4Async Redis client does not support class assignmentr  r  s      r:   rL  !AsyncBasicKeyCommands.__setitem__	  s    NOOr=   r  r3   Nc                 &   >#    [         TU ]  " U6 $ 7fr   )r"  r  )r7   r  r$  s     r:   r  AsyncBasicKeyCommands.watch	  s     w}e$$s   c                 (   >#    [         TU ]  5       $ 7fr   )r"  r  r7   r$  s    r:   r  AsyncBasicKeyCommands.unwatch	  s     w     r   r  )r   r   r   r   r#   r  r  r  r   rL  r  r  r   r/  r0  s   @r:   r  r  	  s`    N NO OO OP PZ P%$ %4 %! !r=   r  c                      \ rS rSrSr S9S\S\\   S\\	\
   \
4   4S jjr S9S\S\\   S\\	\
   \
4   4S jjr S9S\S	\S\\   S\\	\\      \\   4   4S
 jjrSS.S\S\S\S\S\\   S\\
   4S jjrSS.S\S\S\S\\   S\\	\
   \
4   4
S jjrS\S\S\\	\\      \\   4   4S jrS\S\S\S\S\\	\   \4   4
S jrS\S\\	\   \4   4S jr S:S\S\\   S\\	\\\S4      \\\S4   4   4S jjrS\S\S\\	\   \4   4S jrS\S\S\\	\   \4   4S  jrS\S!\S"\S\\	\
   \
4   4S# jrS\S\S\S\\	\   \4   4S$ jrS\S\S\S\\	\   \4   4S% jrS\S!\S"\S\\	\   \4   4S& jr S:S\S\\   S\\	\\\S4      \\\S4   4   4S' jjrS\S	\S\\	\   \4   4S( jrS\S\S\\	\   \4   4S) jr S\S\S\\	\   \4   4S* jr!   S;S\S\S+\\   S\\   S,\\   S\\\S4   4S- jjr"        S<S\S!\\   S.\\   S/\\   S0\\\      S1\#S2\#S3\\   S4\\#   S\\\4   4S5 jjr$      S=S6\S!\\   S.\\   S/\\   S0\\\      S1\#S2\#S\
4S7 jjr%S8r&g)>ListCommandsi	  zR
Redis commands for List data type.
see: https://redis.io/topics/data-types#lists
rp   r  r3   c                 l    Uc  Sn[        US5      nUR                  U5        U R                  " S/UQ76 $ )a@  
LPOP a value off of the first non-empty list
named in the ``keys`` list.

If none of the lists in ``keys`` has a value to LPOP, then block
for ``timeout`` seconds, or until a value gets pushed on to one
of the lists.

If timeout is 0, then block indefinitely.

For more information, see https://redis.io/commands/blpop
Nr   BLPOPr.   rK   r6   r7   rp   r  s      r:   blpopListCommands.blpop	  <     ?GD$'G##G3d33r=   c                 l    Uc  Sn[        US5      nUR                  U5        U R                  " S/UQ76 $ )a@  
RPOP a value off of the first non-empty list
named in the ``keys`` list.

If none of the lists in ``keys`` has a value to RPOP, then block
for ``timeout`` seconds, or until a value gets pushed on to one
of the lists.

If timeout is 0, then block indefinitely.

For more information, see https://redis.io/commands/brpop
Nr   BRPOPr  r  s      r:   brpopListCommands.brpop
  r  r=   r  r1  c                 2    Uc  SnU R                  SXU5      $ )a,  
Pop a value off the tail of ``src``, push it on the head of ``dst``
and then return it.

This command blocks until a value is in ``src`` or until ``timeout``
seconds elapse, whichever is first. A ``timeout`` value of 0 blocks
forever.

For more information, see https://redis.io/commands/brpoplpush
r   
BRPOPLPUSHr5   )r7   r  r1  r  s       r:   
brpoplpushListCommands.brpoplpush
  s#     ?G##L#GDDr=   r-   )rZ   numkeysr@   	directionrZ   c                >    X/UQUPSPUPnU R                   " S/UQ76 $ )a,  
Pop ``count`` values (default 1) from first non-empty in the list
of provided key names.

When all lists are empty this command blocks the connection until another
client pushes to it or until the timeout, timeout of 0 blocks indefinitely

For more information, see https://redis.io/commands/blmpop
COUNTBLMPOPr5   )r7   r  r  r  rZ   r@   cmd_argss          r:   blmpopListCommands.blmpop+
  s6    " GtGYGGG##H8x88r=   num_keysc                    U/[        U5      -   U/-   nUS:w  a  UR                  SU/5        U R                  " S/UQ76 $ )z
Pop ``count`` values (default 1) first non-empty list key from the list
of args provided key names.

For more information, see https://redis.io/commands/lmpop
r-   r  LMPOP)r   r   r6   )r7   r  r  rZ   r@   r  s         r:   lmpopListCommands.lmpop@
  sI     :T
*i[8A:OOWe,-##G7h77r=   r  r  c                 &    U R                  SXU/S9$ )z
Return the item from list ``name`` at position ``index``

Negative indexes are supported and will return an item at the
end of the list

For more information, see https://redis.io/commands/lindex
LINDEXr  r5   )r7   r  r  s      r:   lindexListCommands.lindexS
  s     ##Hd#GGr=   whererefvaluer	  c                 (    U R                  SXX45      $ )z
Insert ``value`` in list ``name`` either immediately before or after
[``where``] ``refvalue``

Returns the new length of the list on success or -1 if ``refvalue``
is not in the list.

For more information, see https://redis.io/commands/linsert
LINSERTr5   )r7   r  r  r  r	  s        r:   linsertListCommands.linsert`
  s     ##ItHLLr=   c                 $    U R                  SX/S9$ )zb
Return the length of the list ``name``

For more information, see https://redis.io/commands/llen
LLENr  r5   r  s     r:   llenListCommands.llenn
  r  r=   Nc                 P    Ub  U R                  SX5      $ U R                  SU5      $ )aK  
Removes and returns the first elements of the list ``name``.

By default, the command pops a single element from the beginning of
the list. When provided with the optional ``count`` argument, the reply
will consist of up to count elements, depending on the list's length.

For more information, see https://redis.io/commands/lpop
LPOPr5   r7   r  rZ   s      r:   lpopListCommands.lpopv
  0     ''<<''55r=   valuesc                 *    U R                   " SU/UQ76 $ )zo
Push ``values`` onto the head of the list ``name``

For more information, see https://redis.io/commands/lpush
LPUSHr5   r7   r  r  s      r:   lpushListCommands.lpush
       ##GT;F;;r=   c                 *    U R                   " SU/UQ76 $ )z
Push ``value`` onto the head of the list ``name`` if ``name`` exists

For more information, see https://redis.io/commands/lpushx
LPUSHXr5   r  s      r:   lpushxListCommands.lpushx
       ##Hd<V<<r=   ra  rb  c                 &    U R                  SXX1/S9$ )z
Return a slice of the list ``name`` between
position ``start`` and ``end``

``start`` and ``end`` can be negative numbers just like
Python slicing notation

For more information, see https://redis.io/commands/lrange
LRANGEr  r5   rv  s       r:   lrangeListCommands.lrange
  s     ##Hd3V#LLr=   c                 (    U R                  SXU5      $ )a  
Remove the first ``count`` occurrences of elements equal to ``value``
from the list stored at ``name``.

The count argument influences the operation in the following ways:
    count > 0: Remove elements equal to value moving from head to tail.
    count < 0: Remove elements equal to value moving from tail to head.
    count = 0: Remove all elements equal to value.

    For more information, see https://redis.io/commands/lrem
LREMr5   )r7   r  rZ   r	  s       r:   lremListCommands.lrem
  s     ##FD??r=   c                 (    U R                  SXU5      $ )zr
Set element at ``index`` of list ``name`` to ``value``

For more information, see https://redis.io/commands/lset
LSETr5   )r7   r  r  r	  s       r:   lsetListCommands.lset
  s     ##FD??r=   c                 (    U R                  SXU5      $ )z
Trim the list ``name``, removing all values not within the slice
between ``start`` and ``end``

``start`` and ``end`` can be negative numbers just like
Python slicing notation

For more information, see https://redis.io/commands/ltrim
LTRIMr5   rv  s       r:   ltrimListCommands.ltrim
  s     ##GT#>>r=   c                 P    Ub  U R                  SX5      $ U R                  SU5      $ )aD  
Removes and returns the last elements of the list ``name``.

By default, the command pops a single element from the end of the list.
When provided with the optional ``count`` argument, the reply will
consist of up to count elements, depending on the list's length.

For more information, see https://redis.io/commands/rpop
RPOPr5   r  s      r:   rpopListCommands.rpop
  r  r=   c                 &    U R                  SX5      $ )z
RPOP a value off of the ``src`` list and atomically LPUSH it
on to the ``dst`` list.  Returns the value.

For more information, see https://redis.io/commands/rpoplpush
	RPOPLPUSHr5   r4  s      r:   	rpoplpushListCommands.rpoplpush
  s     ##K::r=   c                 *    U R                   " SU/UQ76 $ )zo
Push ``values`` onto the tail of the list ``name``

For more information, see https://redis.io/commands/rpush
RPUSHr5   r  s      r:   rpushListCommands.rpush
  r  r=   c                 *    U R                   " SU/UQ76 $ )z
Push ``value`` onto the tail of the list ``name`` if ``name`` exists

For more information, see https://redis.io/commands/rpushx
RPUSHXr5   r  s      r:   rpushxListCommands.rpushx
  r  r=   rankmaxlenc                     X/nUb  UR                  SU/5        Ub  UR                  SU/5        Ub  UR                  SU/5        U R                  " S/UQ7SU/06$ )a  
Get position of ``value`` within the list ``name``

 If specified, ``rank`` indicates the "rank" of the first element to
 return in case there are multiple copies of ``value`` in the list.
 By default, LPOS returns the position of the first occurrence of
 ``value`` in the list. When ``rank`` 2, LPOS returns the position of
 the second ``value`` in the list. If ``rank`` is negative, LPOS
 searches the list in reverse. For example, -1 would return the
 position of the last occurrence of ``value`` and -2 would return the
 position of the next to last occurrence of ``value``.

 If specified, ``count`` indicates that LPOS should return a list of
 up to ``count`` positions. A ``count`` of 2 would return a list of
 up to 2 positions. A ``count`` of 0 returns a list of all positions
 matching ``value``. When ``count`` is specified and but ``value``
 does not exist in the list, an empty list is returned.

 If specified, ``maxlen`` indicates the maximum number of list
 elements to scan. A ``maxlen`` of 1000 will only return the
 position(s) of items within the first 1000 entries in the list.
 A ``maxlen`` of 0 (the default) will scan the entire list.

 For more information, see https://redis.io/commands/lpos
RANKr  MAXLENLPOSrp   ro  )r7   r  r	  r  rZ   r  r9   s          r:   lposListCommands.lpos
  sm    B %)=MM64.)MM7E*+MM8V,-##FAVA4&AAr=   r  byr  descalphastoregroupsc
                    Ub  Ub  Ub  Uc  [        S5      eU/n
Ub  U
R                  SU/5        Ub  Ub  U
R                  SX#/5        UbK  [        U[        [        45      (       a  U
R                  SU/5        OU H  nU
R                  SU/5        M     U(       a  U
R                  S5        U(       a  U
R                  S5        Ub  U
R                  SU/5        U	(       a<  U(       a*  [        U[        [        45      (       d  [        U5      S	:  a  [        S
5      eSU	(       a  [        U5      OS0nU/US'   U R                  " S/U
Q70 UD6$ )aZ  
Sort and return the list, set or sorted set at ``name``.

``start`` and ``num`` allow for paging through the sorted data

``by`` allows using an external key to weight and sort the items.
    Use an "*" to indicate where in the key the item value is located

``get`` allows for returning items from external keys rather than the
    sorted data itself.  Use an "*" to indicate where in the key
    the item value is located

``desc`` allows for reversing the sort

``alpha`` allows for sorting lexicographically rather than numerically

``store`` allows for storing the result of the sort into
    the key ``store``

``groups`` if set to True and if ``get`` contains at least two
    elements, sort will return a list of tuples, each containing the
    values fetched from the arguments to ``get``.

For more information, see https://redis.io/commands/sort
N,``start`` and ``num`` must both be specifieds   BY   LIMITs   GET   DESCs   ALPHA   STOREr  zVwhen using "groups" the "get" argument must be specified and contain at least two keysr"  rp   SORT)r   r   r]   bytesr   rK   r   r6   )r7   r  ra  r  r  r  r  r   r!  r"  r9   grq  s                r:   sortListCommands.sort   s=   J #+3?u}JKK$(6>MM5"+&MM8U01?
 #s|,,vsm,AMM61+. MM'"MM(#MM8U+,*S5#,773s8a<  SXT:&##F?V?w??r=   r   c           
      &    U R                  XX4XVUS9$ )a  
Returns the elements contained in the list, set or sorted set at key.
(read-only variant of the SORT command)

``start`` and ``num`` allow for paging through the sorted data

``by`` allows using an external key to weight and sort the items.
    Use an "*" to indicate where in the key the item value is located

``get`` allows for returning items from external keys rather than the
    sorted data itself.  Use an "*" to indicate where in the key
    the item value is located

``desc`` allows for reversing the sort

``alpha`` allows for sorting lexicographically rather than numerically

For more information, see https://redis.io/commands/sort_ro
)ra  r  r  r  r  r   )r+  )r7   r   ra  r  r  r  r  r   s           r:   sort_roListCommands.sort_roi  s#    : yy##  
 	
r=   r   r   r   r  )NNNNFFNF)NNNNFF)'r   r   r   r   r   r   r   r$   r   r   r   r  r  r   r  r  rI   r  r  r  r  r  r  r    r  r  r  r  r   r  r  r  r  r  r  r   r+  r.  r   r   r=   r:   r  r  	  s    7844#+F#34	y$	%4, 7844#+F#34	y$	%4, ?@EE E+3F+;E	y#'#6	7E.  !99 9 	9
 9 }9 
$94  !88 8 	8
 }8 
y$	%8&HH #H	y#'#6	7HMM #M/2M;>M	y~s"	#M? ?y~s':!; ?  $66 }6 
ysD$/0%T42HH	I	6&<# < <539L3M <=3 = =E)C.#:M4N =
M3 
Ms 
M 
MyPT?T9U 
M@ @S @ @y~s?R9S @@ @S @ @y~s?R9S @
?# 
?c 
? 
?inc>Q8R 
?  $66 }6 
ysD$/0%T42HH	I	6&;S ;s ;uYs^S5H/I ;<# < <539L3M <=3 = =y~s7J1K = ## $+B+B +B sm	+B
 }+B +B 
sD$	+B`  $! #'#!&G@G@ }G@ c]	G@
 SMG@ d3i G@ G@ G@ }G@ G@ 
tSy	G@X  $! #'

 }
 c]	

 SM
 d3i 
 
 
 

 
r=   r  c                      \ rS rSrSr    SS\S\\S4   S\\   S\\	   S	\
4
S
 jjr   SS\\S4   S\\   S\\	   S	\4S jjr   SS\S\S\\S4   S\\   S	\
4
S jjr  SS\S\\S4   S\\   S	\4S jjr    SS\S\S\\S4   S\\   S\\S4   S	\
4S jjr   SS\	S\\S4   S\\   S\\S4   S	\4
S jjrSSS\4S\S\S\\S4   S\\   S\\\4   S	\
4S jjrSS\4S\S\\S4   S\\   S\\\4   S	\4
S jjrSrg)ScanCommandsi  z:
Redis SCAN commands.
see: https://redis.io/commands/scan
r   NcursormatchrZ   r   r3   c                     U/nUb  UR                  SU/5        Ub  UR                  SU/5        Ub  UR                  SU/5        U R                  " S/UQ70 UD6$ )a  
Incrementally return lists of key names. Also return a cursor
indicating the scan position.

``match`` allows for filtering the keys by pattern

``count`` provides a hint to Redis about the number of keys to
    return per batch.

``_type`` filters the returned values by a particular Redis type.
    Stock Redis instances allow for the following types:
    HASH, LIST, SET, STREAM, STRING, ZSET
    Additionally, Redis modules can expose other types as well.

For more information, see https://redis.io/commands/scan
   MATCH   COUNTr   SCANro  )r7   r3  r4  rZ   r   r8   r9   s          r:   scanScanCommands.scan  sk    0 %+8MM8U+,MM8U+,MM7E*+##F>V>v>>r=   c              +   t   #    SnUS:w  a*  U R                   " SXQX#S.UD6u  pVU Sh  vN   US:w  a  M)  gg N7fa  
Make an iterator using the SCAN command so that the client doesn't
need to remember the cursor position.

``match`` allows for filtering the keys by pattern

``count`` provides a hint to Redis about the number of keys to
    return per batch.

``_type`` filters the returned values by a particular Redis type.
    Stock Redis instances allow for the following types:
    HASH, LIST, SET, STREAM, STRING, ZSET
    Additionally, Redis modules can expose other types as well.
0r   )r3  r4  rZ   r   Nr   r9  )r7   r4  rZ   r   r8   r3  datas          r:   	scan_iterScanCommands.scan_iter  sL     * k99 %HNLF OO	 k s   %86
88r  c                     X/nUb  UR                  SU/5        Ub  UR                  SU/5        U R                  " S/UQ76 $ )a  
Incrementally return lists of elements in a set. Also return a cursor
indicating the scan position.

``match`` allows for filtering the keys by pattern

``count`` allows for hint the minimum number of returns

For more information, see https://redis.io/commands/sscan
r6  r7  SSCANro  )r7   r  r3  r4  rZ   r9   s         r:   sscanScanCommands.sscan  sO    " %)>MM8U+,MM8U+,##G5f55r=   c              #   j   #    SnUS:w  a%  U R                  XX#S9u  pEU Sh  vN   US:w  a  M$  gg N7fz
Make an iterator using the SSCAN command so that the client doesn't
need to remember the cursor position.

``match`` allows for filtering the keys by pattern

``count`` allows for hint the minimum number of returns
r=  r   )r3  r4  rZ   NrD  )r7   r  r4  rZ   r3  r?  s         r:   
sscan_iterScanCommands.sscan_iter  s:      k::d:TLFOO ks    31
33	no_valuesc                     X/nUb  UR                  SU/5        Ub  UR                  SU/5        Ub  UR                  S/5        U R                  " S/UQ7SU06$ )aO  
Incrementally return key/value slices in a hash. Also return a cursor
indicating the scan position.

``match`` allows for filtering the keys by pattern

``count`` allows for hint the minimum number of returns

``no_values`` indicates to return only the keys, without values.

For more information, see https://redis.io/commands/hscan
r6  r7  s   NOVALUESHSCANrK  ro  )r7   r  r3  r4  rZ   rK  r9   s          r:   hscanScanCommands.hscan  sh    ( %)>MM8U+,MM8U+, MM;-(##GJfJ	JJr=   c              #      #    SnUS:w  aF  U R                  XX#US9u  pVU(       a  U Sh  vN   OUR                  5        Sh  vN   US:w  a  ME  gg N' N7fa  
Make an iterator using the HSCAN command so that the client doesn't
need to remember the cursor position.

``match`` allows for filtering the keys by pattern

``count`` allows for hint the minimum number of returns

``no_values`` indicates to return only the keys, without values
r=  r   )r3  r4  rZ   rK  NrN  rl  )r7   r  r4  rZ   rK  r3  r?  s          r:   
hscan_iterScanCommands.hscan_iter  s[     " k::5 & LF ::<'' k
  's'   (AAAA
AAAscore_cast_funcc                     X/nUb  UR                  SU/5        Ub  UR                  SU/5        SU0nU R                  " S/UQ70 UD6$ )aX  
Incrementally return lists of elements in a sorted set. Also return a
cursor indicating the scan position.

``match`` allows for filtering the keys by pattern

``count`` allows for hint the minimum number of returns

``score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zscan
r6  r7  rU  ZSCANro  )r7   r  r3  r4  rZ   rU  r9   rq  s           r:   zscanScanCommands.zscan4  s^    ( MM8U+,MM8U+,$o6##G@f@@@r=   c              #   p   #    SnUS:w  a(  U R                  UUUUUS9u  pVU Sh  vN   US:w  a  M'  gg N7fa  
Make an iterator using the ZSCAN command so that the client doesn't
need to remember the cursor position.

``match`` allows for filtering the keys by pattern

``count`` allows for hint the minimum number of returns

``score_cast_func`` a callable used to cast the score return value
r=  r   )r3  r4  rZ   rU  NrX  )r7   r  r4  rZ   rU  r3  r?  s          r:   
zscan_iterScanCommands.zscan_iterP  sN     " k:: / & LF OO k s   #64
66r   )r   NNNr  )r   NNr  )r   r   r   r   r   rI   r   r%   r   r   r&   r9  r   r@  r#   rD  rI  r   rN  rS  r  r  r   rX  r]  r   r   r=   r:   r2  r2    s    '+##?? Xt^$? }	?
 }? 
?F (,##	Xt^$ } }	 
> '+#66 6 Xt^$	6
 }6 
66 (,#	 Xt^$ }	
 
, '+#'+KK K Xt^$	K
 }K t$K 
K@ (,#'+(( Xt^$( }	(
 t$( 
(< '+#16AA A Xt^$	A
 }A tX~.A 
A> (,#16 Xt^$ }	
 tX~. 
 r=   r2  c                      \ rS rSr   SS\\S4   S\\   S\\   S\	4S jjr
  SS\S\\S4   S\\   S\	4S	 jjr   SS\S\\S4   S\\   S
\\S4   S\	4
S jjrSS\4S\S\\S4   S\\   S\\\4   S\	4
S jjrSrg)AsyncScanCommandsim  Nr4  rZ   r   r3   c                   #    SnUS:w  a6  U R                   " SXQX#S.UD6I Sh  vN u  pVU H  nU7v   M
     US:w  a  M5  gg N7fr<  r>  )r7   r4  rZ   r   r8   r3  r?  ds           r:   r@  AsyncScanCommands.scan_itern  sY     * k!% "%"HN" LF  	 ks   !AAA Ar  c                   #    SnUS:w  a1  U R                  XX#S9I Sh  vN u  pEU H  nU7v   M
     US:w  a  M0  gg N7frG  rH  )r7   r  r4  rZ   r3  r?  rb  s          r:   rI  AsyncScanCommands.sscan_iter  sQ      k!%5 ", " LF  	 ks   ?=??rK  c                   #    SnUS:w  aV  U R                  XX#US9I Sh  vN u  pVU(       a  U H  nU7v   M
     OUR                  5        H  nU7v   M
     US:w  a  MU  gg NB7frQ  rR  )r7   r  r4  rZ   rK  r3  r?  its           r:   rS  AsyncScanCommands.hscan_iter  sm     " k!%5 ", " LF BH  **,BH ' ks   A$A">A$ A$rU  c                   #    SnUS:w  a4  U R                  UUUUUS9I Sh  vN u  pVU H  nU7v   M
     US:w  a  M3  gg N7fr[  r\  )r7   r  r4  rZ   rU  r3  r?  rb  s           r:   r]  AsyncScanCommands.zscan_iter  s[     " k!% / ", " LF   ks   AA AAr   r  r  )r   r   r   r   r   r%   r   rI   r   r   r@  r#   rI  r   rS  r  r  r   r]  r   r   r=   r:   r`  r`  m  s<    (,##	Xt^$ } }	 
@ (,#	 Xt^$ }	
 
2 (,#'+ Xt^$ }	
 t$ 
@ (,#16 Xt^$ }	
 tX~. 
 r=   r`  c                      \ rS rSrSrS\S\S\\\	   \	4   4S jr
S\S\\\	   \	4   4S jrS\S	\S\\\   \4   4S
 jrS\S\S	\S\\\	   \	4   4S jrS\S	\S\\\   \4   4S jr S$S\	S\\   S\	S\\\	   \	4   4S jjrS\S\S	\S\\\	   \	4   4S jrS\S\S\\\\S   \S   4      \\S   \S   4   4   4S jrS\S\\\   \4   4S jrS\S\S	\S\\\\\S   \S   4         \\\S   \S   4      4   4S jrS\S\S\S\\\   \4   4S jrS%S\S\\	   S\\\S4   4S jjr S%S\S\\	   S\\\S4   4S jjrS\S\S\\\	   \	4   4S  jrS\S	\S\\\   \4   4S! jrS\S\S	\S\\\	   \	4   4S" jr S#r!g)&SetCommandsi  zP
Redis commands for Set data type.
see: https://redis.io/topics/data-types#sets
r  r  r3   c                 *    U R                   " SU/UQ76 $ )z\
Add ``value(s)`` to set ``name``

For more information, see https://redis.io/commands/sadd
SADDr5   r  s      r:   saddSetCommands.sadd       ##FD:6::r=   c                 $    U R                  SX/S9$ )zj
Return the number of elements in set ``name``

For more information, see https://redis.io/commands/scard
SCARDr  r5   r  s     r:   scardSetCommands.scard       ##GT#??r=   rp   r@   c                 D    [        X5      nU R                  " S/UQ7SU06$ )zp
Return the difference of sets specified by ``keys``

For more information, see https://redis.io/commands/sdiff
SDIFFrp   r.   r6   r7   rp   r@   s      r:   sdiffSetCommands.sdiff  s)     D'##G>d>>>r=   rs  c                 @    [        X#5      nU R                  " SU/UQ76 $ )z
Store the difference of sets specified by ``keys`` into a new
set named ``dest``.  Returns the number of keys in the new set.

For more information, see https://redis.io/commands/sdiffstore

SDIFFSTOREry  r7   rs  rp   r@   s       r:   
sdiffstoreSetCommands.sdiffstore  s&     D'##L$>>>r=   c                 D    [        X5      nU R                  " S/UQ7SU06$ )zs
Return the intersection of sets specified by ``keys``

For more information, see https://redis.io/commands/sinter
SINTERrp   ry  rz  s      r:   sinterSetCommands.sinter  )     D'##H?t?$??r=   r   r  limitc                 @    U/UQSPUPnU R                   " S/UQ7SU06$ )aU  
Return the cardinality of the intersect of multiple sets specified by ``keys``.

When LIMIT provided (defaults to 0 and means unlimited), if the intersection
cardinality reaches limit partway through the computation, the algorithm will
exit and yield limit as the cardinality

For more information, see https://redis.io/commands/sintercard
LIMIT
SINTERCARDrp   r5   r7   r  rp   r  r@   s        r:   
sintercardSetCommands.sintercard  6     /$///##LC4CdCCr=   c                 @    [        X#5      nU R                  " SU/UQ76 $ )z
Store the intersection of sets specified by ``keys`` into a new
set named ``dest``.  Returns the number of keys in the new set.

For more information, see https://redis.io/commands/sinterstore
SINTERSTOREry  r  s       r:   sinterstoreSetCommands.sinterstore  &     D'##M4?$??r=   r	  r-   c                 &    U R                  SXU/S9$ )z
Return whether ``value`` is a member of set ``name``:
- 1 if the value is a member of the set.
- 0 if the value is not a member of the set or if key does not exist.

For more information, see https://redis.io/commands/sismember
	SISMEMBERr  r5   r  s      r:   	sismemberSetCommands.sismember+  s     ##KD6#JJr=   c                 $    U R                  SX/S9$ )zf
Return all members of the set ``name``

For more information, see https://redis.io/commands/smembers
SMEMBERSr  r5   r  s     r:   smembersSetCommands.smembers7  s     ##J6#BBr=   c                 H    [        X#5      nU R                  " SU/UQ7SU/06$ )a)  
Return whether each value in ``values`` is a member of the set ``name``
as a list of ``int`` in the order of ``values``:
- 1 if the value is a member of the set.
- 0 if the value is not a member of the set or if key does not exist.

For more information, see https://redis.io/commands/smismember

SMISMEMBERrp   ry  )r7   r  r  r@   s       r:   
smismemberSetCommands.smismember?  s-     F)##L$KKTFKKr=   r  r1  c                 (    U R                  SXU5      $ )zv
Move ``value`` from set ``src`` to set ``dst`` atomically

For more information, see https://redis.io/commands/smove
SMOVEr5   )r7   r  r1  r	  s       r:   smoveSetCommands.smoveP  s     ##GSu==r=   NrZ   c                 X    USL=(       a    U/=(       d    / nU R                   " SU/UQ76 $ )zm
Remove and return a random member of set ``name``

For more information, see https://redis.io/commands/spop
NSPOPr5   )r7   r  rZ   r@   s       r:   spopSetCommands.spopX  s2     T!.w4"##FD8488r=   numberc                 X    USL=(       a    U/=(       d    / nU R                   " SU/UQ76 $ )a  
If ``number`` is None, returns a random member of set ``name``.

If ``number`` is supplied, returns a list of ``number`` random
members of set ``name``. Note this is only available when running
Redis 2.6+.

For more information, see https://redis.io/commands/srandmember
NSRANDMEMBERr5   )r7   r  r  r@   s       r:   srandmemberSetCommands.srandmembera  s2     d"06B##M4?$??r=   c                 *    U R                   " SU/UQ76 $ )z_
Remove ``values`` from set ``name``

For more information, see https://redis.io/commands/srem
SREMr5   r  s      r:   sremSetCommands.sremp  rq  r=   c                 D    [        X5      nU R                  " S/UQ7SU06$ )zl
Return the union of sets specified by ``keys``

For more information, see https://redis.io/commands/sunion
SUNIONrp   ry  rz  s      r:   sunionSetCommands.sunionx  r  r=   c                 @    [        X#5      nU R                  " SU/UQ76 $ )z
Store the union of sets specified by ``keys`` into a new
set named ``dest``.  Returns the number of keys in the new set.

For more information, see https://redis.io/commands/sunionstore
SUNIONSTOREry  r  s       r:   sunionstoreSetCommands.sunionstore  r  r=   r   r0  r   )"r   r   r   r   r   r#   r    r   r   rI   ro  rt  r   r   r{  r   r  r  r  r  r   r  r   r  r  r   r  r   r  r  r  r  r  r   r   r=   r:   rl  rl    sT   
; ; ;539L3M ;@$ @53)<#= @?$ ?t ?iot6K0L ?
?
?#
?,0
?	y~s"	#
?@4 @ @y7L1M @ <=DD"&t*D58D	y~s"	#D
@
@ $
@-1
@	y~s"	#
@
K
K!$
K	ywqz71:567wqz7ST:?U9VV	W
KCT CeIcNC,?&@ CLL"&L/3L	$uWQZ3456U71:wqz)*+	-
L"> >D > >yPT?T9U >9 9hsm 9uS$PT_?U 9 37@@"*3-@	sD$	@; ; ;539L3M ;@4 @ @y7L1M @
@
@ $
@-1
@	y~s"	#
@r=   rl  c                   4   \ rS rSrSrS\S\S\S\4S jr	SS	.S\S\S\S
\
S   S\4
S jjr       S=S\S\\\4   S\S\\   S\S\S\\S4   S\\   S
\\
S      S\4S jjr   S>S\S\S\S\S\S\\   S\S\4S jjr     S?S\S\S\S\S\\\   \\   4   S\\   S\\   S\\   S \S\S\4S! jjrS\S\S\4S" jrSS	.S\S\S
\
S   S\4S# jjr   S@S\S\S\S$\S%\\   S\4S& jjrS\S\S\S\4S' jrS\S\S\4S( jrS\S\S\S\4S) jr SAS\S\S\S%\\   S\4
S* jjrS\S\S\4S+ jr S\S\4S, jr!SBS\S-\S\4S. jjr"S\S\4S/ jr#S\S\S\4S0 jr$  SCS\S\S1\S2\S\S\\S4   S\\   S\4S3 jjr%   SDS\S1\S2\S\\   S\4
S4 jjr&  SCS5\\\4   S\\   S6\\   S\4S7 jjr'   SES\(S\(S5\\\4   S\\   S6\\   S8\S\4S9 jjr)   SFS\S2\S1\S\\   S\4
S: jjr*     SGS\S\\   S\S\\S4   S\\   S
\\
S      S\4S; jjr+S<r,g)HStreamCommandsi  zQ
Redis commands for Stream data type.
see: https://redis.io/topics/streams-intro
r  	groupnameidsr3   c                 *    U R                   " SX/UQ76 $ )z
Acknowledges the successful processing of one or more messages.

Args:
    name: name of the stream.
    groupname: name of the consumer group.
    *ids: message ids to acknowledge.

For more information, see https://redis.io/commands/xack
XACKr5   )r7   r  r  r  s       r:   xackStreamCommands.xack  s     ##FDBcBBr=   KEEPREF)
ref_policyr  )r  DELREFACKEDc                    U(       d  [        S5      eUS;  a  [        S5      eXUS[        U5      /nUR                  U5        U R                  " S/UQ76 $ )z
Combines the functionality of XACK and XDEL. Acknowledges the specified
message IDs in the given consumer group and simultaneously attempts to
delete the corresponding entries from the stream.
z(XACKDEL requires at least one message ID   r  r  r  z9XACKDEL ref_policy must be one of: KEEPREF, DELREF, ACKEDIDSXACKDELr   r   r   r6   )r7   r  r  r  r  r9   s         r:   xackdelStreamCommands.xackdel  s\     FGG;;WXX:uc#h?c##I777r=   Nfieldsidr  approximate
nomkstreamminidr  c
                    / n
Ub  Ub  [        S5      eU	b  U	S;  a  [        S5      eUbi  [        U[        5      (       a  US:  a  [        S5      eU
R                  S5        U(       a  U
R                  S5        U
R                  [	        U5      5        Ub:  U
R                  S5        U(       a  U
R                  S5        U
R                  U5        Ub  U
R                  S	U/5        U(       a  U
R                  S
5        U	b  U
R                  U	5        U
R                  U5        [        U[        5      (       a  [        U5      S:X  a  [        S5      eUR                  5        H  nU
R                  U5        M     U R                  " SU/U
Q76 $ )au  
Add to a stream.
name: name of the stream
fields: dict of field/value pairs to insert into the stream
id: Location to insert this record. By default it is appended.
maxlen: truncate old stream members beyond this size.
Can't be specified with minid.
approximate: actual stream length may be slightly more than maxlen
nomkstream: When set to true, do not make a stream
minid: the minimum id in the stream to query.
Can't be specified with maxlen.
limit: specifies the maximum number of entries to retrieve
ref_policy: optional reference policy for consumer groups when trimming:
    - KEEPREF (default): When trimming, preserves references in consumer groups' PEL
    - DELREF: When trimming, removes all references from consumer groups' PEL
    - ACKED: When trimming, only removes entries acknowledged by all consumer groups

For more information, see https://redis.io/commands/xadd
z8Only one of ```maxlen``` or ```minid``` may be specifiedr  z6XADD ref_policy must be one of: KEEPREF, DELREF, ACKEDr   z(XADD maxlen must be non-negative integer   MAXLENr|      MINIDr%  s
   NOMKSTREAMz$XADD fields must be a non-empty dictXADD)
r   r]   rI   rK   r   r   dictr   rl  r6   )r7   r  r  r  r  r  r  r  r  r  r9   r  s               r:   xaddStreamCommands.xadd  sS   > $&%"3VWW!j8V&VTUUfc**fqj JKKMM)$d#MM#f+&MM(#d#MM% MM8U+,MM-(!MM*%b&$''3v;!+;BCCLLNDMM$ ###FD:6::r=   consumernamemin_idle_timestart_idrZ   justidc                 J    [        U5      S:  a  [        S5      e 0 nXX4U/n	 [        U5      S:  a  [        S5      eU	R                  SU/5        U(       a  U	R	                  S5        SUS'   U R
                  " S/U	Q70 UD6$ ! [         a     Ntf = f! [         a     NOf = f)	aD  
Transfers ownership of pending stream entries that match the specified
criteria. Conceptually, equivalent to calling XPENDING and then XCLAIM,
but provides a more straightforward way to deal with message delivery
failures via SCAN-like semantics.
name: name of the stream.
groupname: name of the consumer group.
consumername: name of a consumer that claims the message.
min_idle_time: filter messages that were idle less than this amount of
milliseconds.
start_id: filter messages with equal or greater ID.
count: optional integer, upper limit of the number of entries that the
command attempts to claim. Set to 100 by default.
justid: optional boolean, false by default. Return just an array of IDs
of messages successfully claimed, without returning the actual message

For more information, see https://redis.io/commands/xautoclaim
r   z6XAUTOCLAIM min_idle_time must be a nonnegative integer%XPENDING count must be a integer >= 0r7     JUSTIDTparse_justid
XAUTOCLAIM)rI   r   rk  r   rK   r6   )
r7   r  r  r  r  r  rZ   r  r8   r9   s
             r:   
xautoclaimStreamCommands.xautoclaim  s    8	=!A%L  & <I	5zA~ GHHMM8U+, MM)$%)F>"##LD6DVDD!  		  		s"   B -B 
BB
B"!B"message_idsidler  
retrycountrz   c                    [        U[        5      (       a  US:  a  [        S5      e[        U[        [        45      (       a  U(       d  [        S5      e0 nXU[        U5      /nUR                  [        U5      5        Ub<  [        U[        5      (       d  [        S5      eUR                  S[        U5      45        Ub<  [        U[        5      (       d  [        S5      eUR                  S[        U5      45        Ub<  [        U[        5      (       d  [        S5      eUR                  S	[        U5      45        U	(       a1  [        U	[        5      (       d  [        S
5      eUR                  S5        U
(       a6  [        U
[        5      (       d  [        S5      eUR                  S5        SUS'   U R                  " S/UQ70 UD6$ )aH  
Changes the ownership of a pending message.

name: name of the stream.

groupname: name of the consumer group.

consumername: name of a consumer that claims the message.

min_idle_time: filter messages that were idle less than this amount of
milliseconds

message_ids: non-empty list or tuple of message IDs to claim

idle: optional. Set the idle time (last time it was delivered) of the
message in ms

time: optional integer. This is the same as idle but instead of a
relative amount of milliseconds, it sets the idle time to a specific
Unix time (in milliseconds).

retrycount: optional integer. set the retry counter to the specified
value. This counter is incremented every time a message is delivered
again.

force: optional boolean, false by default. Creates the pending message
entry in the PEL even if certain specified IDs are not already in the
PEL assigned to a different client.

justid: optional boolean, false by default. Return just an array of IDs
of messages successfully claimed, without returning the actual message

For more information, see https://redis.io/commands/xclaim
r   z3XCLAIM min_idle_time must be a non negative integerzLXCLAIM message_ids must be a non empty list or tuple of message IDs to claimzXCLAIM idle must be an integers   IDLEzXCLAIM time must be an integers   TIMEz$XCLAIM retrycount must be an integers
   RETRYCOUNTzXCLAIM force must be a booleans   FORCEzXCLAIM justid must be a booleanr  Tr  XCLAIM)
r]   rI   r   r   tupler   r   r   rK   r6   )r7   r  r  r  r  r  r  r  r  rz   r  r8   r9   s                r:   xclaimStreamCommands.xclaim,  s   ^ ---1BQRR+e}55[0 
 $(\3}CU#Vd;'(dC(( @AAMM7CI./dC(( @AAMM7CI./!j#.. FGGMM=#j/:;eT** @AAMM(#fd++ ABBMM)$%)F>"##H@v@@@r=   c                 *    U R                   " SU/UQ76 $ )z
Deletes one or more messages from a stream.

Args:
    name: name of the stream.
    *ids: message ids to delete.

For more information, see https://redis.io/commands/xdel
XDELr5   )r7   r  r  s      r:   xdelStreamCommands.xdel  s     ##FD7377r=   c                    U(       d  [        S5      eUS;  a  [        S5      eXS[        U5      /nUR                  U5        U R                  " S/UQ76 $ )zv
Extended version of XDEL that provides more control over how message entries
are deleted concerning consumer groups.
z'XDELEX requires at least one message IDr  z8XDELEX ref_policy must be one of: KEEPREF, DELREF, ACKEDr  XDELEXr  )r7   r  r  r  r9   s        r:   xdelexStreamCommands.xdelex  sZ     EFF;;VWWE3s84c##H6v66r=   mkstreamentries_readc                     SXU/nU(       a  UR                  S5        Ub  UR                  SU/5        U R                  " U6 $ )a   
Create a new consumer group associated with a stream.
name: name of the stream.
groupname: name of the consumer group.
id: ID of the last item in the stream to consider already delivered.

For more information, see https://redis.io/commands/xgroup-create
zXGROUP CREATEs   MKSTREAMENTRIESREADr  )r7   r  r  r  r  r  r9   s          r:   xgroup_createStreamCommands.xgroup_create  sG      %4Tb#IMM+&#MM=,78##V,,r=   c                 (    U R                  SXU5      $ )a9  
Remove a specific consumer from a consumer group.
Returns the number of pending messages that the consumer had before it
was deleted.
name: name of the stream.
groupname: name of the consumer group.
consumername: name of consumer to delete

For more information, see https://redis.io/commands/xgroup-delconsumer
zXGROUP DELCONSUMERr5   r7   r  r  r  s       r:   xgroup_delconsumer!StreamCommands.xgroup_delconsumer  s     ##$8$<XXr=   c                 &    U R                  SX5      $ )z
Destroy a consumer group.
name: name of the stream.
groupname: name of the consumer group.

For more information, see https://redis.io/commands/xgroup-destroy
zXGROUP DESTROYr5   r7   r  r  s      r:   xgroup_destroyStreamCommands.xgroup_destroy  s     ##$4dFFr=   c                 (    U R                  SXU5      $ )aD  
Consumers in a consumer group are auto-created every time a new
consumer name is mentioned by some command.
They can be explicitly created by using this command.
name: name of the stream.
groupname: name of the consumer group.
consumername: name of consumer to create.

See: https://redis.io/commands/xgroup-createconsumer
zXGROUP CREATECONSUMERr5   r  s       r:   xgroup_createconsumer$StreamCommands.xgroup_createconsumer  s     ###Tl
 	
r=   c                 \    XU/nUb  UR                  SU/5        U R                  " S/UQ76 $ )a  
Set the consumer group last delivered ID to something else.
name: name of the stream.
groupname: name of the consumer group.
id: ID of the last item in the stream to consider already delivered.

For more information, see https://redis.io/commands/xgroup-setid
r  zXGROUP SETIDro  )r7   r  r  r  r  r9   s         r:   xgroup_setidStreamCommands.xgroup_setid  s;     2&#MM=,78##N<V<<r=   c                 &    U R                  SX5      $ )z
Returns general information about the consumers in the group.
name: name of the stream.
groupname: name of the consumer group.

For more information, see https://redis.io/commands/xinfo-consumers
zXINFO CONSUMERSr5   r  s      r:   xinfo_consumersStreamCommands.xinfo_consumers  s     ##$5tGGr=   c                 &    U R                  SU5      $ )z
Returns general information about the consumer groups of the stream.
name: name of the stream.

For more information, see https://redis.io/commands/xinfo-groups
zXINFO GROUPSr5   r  s     r:   xinfo_groupsStreamCommands.xinfo_groups  s     ##ND99r=   fullc                 p    U/n0 nU(       a  UR                  S5        SU0nU R                  " S/UQ70 UD6$ )z
Returns general information about the stream.
name: name of the stream.
full: optional boolean, false by default. Return full summary

For more information, see https://redis.io/commands/xinfo-stream
s   FULLr  zXINFO STREAMr   )r7   r  r  r9   rq  s        r:   xinfo_streamStreamCommands.xinfo_stream  sC     MM'"tnG##NGVGwGGr=   c                 $    U R                  SX/S9$ )zm
Returns the number of elements in a given stream.

For more information, see https://redis.io/commands/xlen
XLENr  r5   r  s     r:   xlenStreamCommands.xlen  r  r=   c                 &    U R                  SXU/S9$ )z
Returns information about pending messages of a group.
name: name of the stream.
groupname: name of the consumer group.

For more information, see https://redis.io/commands/xpending
XPENDINGr  r5   r  s      r:   xpendingStreamCommands.xpending  s     ##Jtf#MMr=   minmaxc                    X4U1S1:X  a"  Uc  Ub  [        S5      eU R                  X5      $ X/nUb  Ub  Uc  [        S5      e [        U5      S:  a  [        S5      eUR                  SU/5         [        U5      S:  a  [        S5      eUR                  X4U/5        U(       a  UR                  U5        U R                  " S/UQ7S	S
06$ ! [         a     Nhf = f! [         a     NJf = f)aq  
Returns information about pending messages, in a range.

name: name of the stream.
groupname: name of the consumer group.
idle: available from  version 6.2. filter entries by their
idle-time, given in milliseconds (optional).
min: minimum stream ID.
max: maximum stream ID.
count: number of messages to return
consumername: name of a consumer to filter by (optional).
Nznif XPENDING is provided with idle time or consumername, it must be provided with min, max and count parameterszNXPENDING must be provided with min, max and count parameters, or none of them.r   z$XPENDING idle must be a integer >= 0IDLEr  r  parse_detailT)r   r  rI   r   rk  rK   r6   )	r7   r  r  r  r  rZ   r  r  r9   s	            r:   xpending_rangeStreamCommands.xpending_range)  s   , e&<#;: 
 ==11";#+9 
	4y1} FGGMM64.)	5zA~ GHHMM3U+, MM,'##JKKdKK  		  		s$   -C 2-C 
CC
C*)C*c                     X#/nUbQ  [        U[        5      (       a  US:  a  [        S5      eUR                  S5        UR                  [	        U5      5        U R
                  " SU/UQ7SU/06$ )a{  
Read stream values within an interval.

name: name of the stream.

start: first stream ID. defaults to '-',
       meaning the earliest available.

finish: last stream ID. defaults to '+',
        meaning the latest available.

count: if set, only return this many items, beginning with the
       earliest available.

For more information, see https://redis.io/commands/xrange
r-   z'XRANGE count must be a positive integerr7  XRANGErp   r]   rI   r   rK   r   r6   )r7   r  r  r  rZ   r9   s         r:   xrangeStreamCommands.xrangeb  sk    . eS))UQY IJJMM(#MM#e*%##HdIVI4&IIr=   streamsblockc                 v   / nUbQ  [        U[        5      (       a  US:  a  [        S5      eUR                  S5        UR                  [	        U5      5        UbQ  [        U[        5      (       a  US:  a  [        S5      eUR                  S5        UR                  [	        U5      5        [        U[
        5      (       a  [        U5      S:X  a  [        S5      eUR                  S5        [        UR                  5       6 u  pVUR                  U5        UR                  U5        U R                  " S	/UQ7S
U06$ )at  
Block and monitor multiple streams for new data.

streams: a dict of stream names to stream IDs, where
           IDs indicate the last ID already seen.

count: if set, only return this many items, beginning with the
       earliest available.

block: number of milliseconds to wait, if nothing already present.

For more information, see https://redis.io/commands/xread
r   z*XREAD block must be a non-negative integer   BLOCKr-   z&XREAD count must be a positive integerr7  z&XREAD streams must be a non empty dict   STREAMSXREADrp   )r]   rI   r   rK   r   r  r   ziprl  r   r6   )r7   r%  rZ   r&  r9   rp   r  s          r:   xreadStreamCommands.xread  s    & eS))UQY LMMMM(#MM#e*%eS))UQY HIIMM(#MM#e*%'4((CLA,=DEEj!GMMO,df##G@f@4@@r=   noackc                    SX/nUbQ  [        U[        5      (       a  US:  a  [        S5      eUR                  S5        UR                  [	        U5      5        UbQ  [        U[        5      (       a  US:  a  [        S5      eUR                  S5        UR                  [	        U5      5        U(       a  UR                  S5        [        U[
        5      (       a  [        U5      S:X  a  [        S	5      eUR                  S
5        UR                  UR                  5       5        UR                  UR                  5       5        U R                  " S/UQ76 $ )a  
Read from a stream via a consumer group.

groupname: name of the consumer group.

consumername: name of the requesting consumer.

streams: a dict of stream names to stream IDs, where
       IDs indicate the last ID already seen.

count: if set, only return this many items, beginning with the
       earliest available.

block: number of milliseconds to wait, if nothing already present.
noack: do not add messages to the PEL

For more information, see https://redis.io/commands/xreadgroup
s   GROUPr-   z+XREADGROUP count must be a positive integerr7  r   z/XREADGROUP block must be a non-negative integerr(  s   NOACKz+XREADGROUP streams must be a non empty dictr)  
XREADGROUP)r]   rI   r   rK   r   r  r   r   rp   r  r6   )r7   r  r  r%  rZ   r&  r.  r9   s           r:   
xreadgroupStreamCommands.xreadgroup  s
   6 %-i#FeS))UQY MNNMM(#MM#e*%eS))UQY QRRMM(#MM#e*%MM(#'4((CLA,=IJJj!glln%gnn&'##L:6::r=   c                     X#/nUbQ  [        U[        5      (       a  US:  a  [        S5      eUR                  S5        UR                  [	        U5      5        U R
                  " SU/UQ7SU/06$ )a  
Read stream values within an interval, in reverse order.

name: name of the stream

start: first stream ID. defaults to '+',
       meaning the latest available.

finish: last stream ID. defaults to '-',
        meaning the earliest available.

count: if set, only return this many items, beginning with the
       latest available.

For more information, see https://redis.io/commands/xrevrange
r-   z*XREVRANGE count must be a positive integerr7  	XREVRANGErp   r"  )r7   r  r  r  rZ   r9   s         r:   	xrevrangeStreamCommands.xrevrange  sk    . %(:eS))UQY LMMMM(#MM#e*%##KLLdVLLr=   c                    / nUb  Ub  [        S5      eUc  Uc  [        S5      eUb  US;  a  [        S5      eUb  UR                  S5        Ub  UR                  S5        U(       a  UR                  S5        Ub  UR                  U5        Ub  UR                  U5        Ub"  UR                  S5        UR                  U5        Ub  UR                  U5        U R                  " S	U/UQ76 $ )
a  
Trims old messages from a stream.
name: name of the stream.
maxlen: truncate old stream messages beyond this size
Can't be specified with minid.
approximate: actual stream length may be slightly more than maxlen
minid: the minimum id in the stream to query
Can't be specified with maxlen.
limit: specifies the maximum number of entries to retrieve
ref_policy: optional reference policy for consumer groups:
    - KEEPREF (default): Trims entries but preserves references in consumer groups' PEL
    - DELREF: Trims entries and removes all references from consumer groups' PEL
    - ACKED: Only trims entries that were read and acknowledged by all consumer groups

For more information, see https://redis.io/commands/xtrim
z4Only one of ``maxlen`` or ``minid`` may be specifiedz0One of ``maxlen`` or ``minid`` must be specifiedr  z7XTRIM ref_policy must be one of: KEEPREF, DELREF, ACKEDr  r  r|   r%  XTRIMr{  )r7   r  r  r  r  r  r  r9   s           r:   xtrimStreamCommands.xtrim  s    2 $&%"3RSS>emNOO!j8V&VUVVMM)$MM(#MM$MM&!MM% MM(#MM% !MM*%##GT;F;;r=   r   )r  NTFNNN)z0-0NF)NNNFF)$FNr   r  r  )-+N)NNF)r=  r<  N)NTNNN)-r   r   r   r   r   r#   r!   r(   r&   r  r   r  r	   r    r   r   rI   r   r   r  r   r  r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r#  r,  r   r1  r5  r9  r   r   r=   r:   r  r    s6   
C C& C	 Ci C$ =F88 8 	8
 898 
84  $  (,#FJ=;=; VZ'(=; 	=;
 =; =; =; Y_%=; }=; W%ABC=; 
=;J $#1E1E 1E  	1E
 1E 1E }1E 1E 
1Et #"$(QAQA QA  	QA
 QA 4	?E),<<=QA smQA smQA SMQA QA QA 
QAf
8 
8Y 
89 
8  =F	77 7 89	7
 
70 &*-- - 	-
 - sm- 
-0YY%+Y;DY	YG4 GF Gy G

%+
;D
	
, '+== = 	=
 sm= 
=(HD HV H	 H: :) :H HT Hi H? ?) ?NT Nf N N" 04"7L7L 7L 	7L
 7L 7L ItO,7L sm7L 
7Lx #JJ J 	J
 }J 
JF  $#	$AdIo&$A }$A }	$A
 
$AV  $#-;-; -; dIo&	-;
 }-; }-; -; 
-;d #MM M 	M
 }M 
MF !% (,#FJ3<3< 3< 	3<
 Y_%3< }3< W%ABC3< 
3< 3<r=   r  c                      \ rS rSrSr      SMS\S\\\4   S\	S\	S\	S	\	S
\	S\	S\
4S jjrS\S\
4S jrS\S\S\S\
4S jrSNS\S\	S\
4S jjrS\S\S\
4S jrS\S\S\S\
4S jr SOS\S\\   S\	S\
4S jjr SPS\S\\\   \\\4   4   S\\   S\
4S jjr SQS\S\\   S\S\\\   \4   4S  jjrS! rSPS\S"\\   S\
4S# jjrSPS\S"\\   S\
4S$ jjr  SOS%\S"\\   S\	S\
4S& jjr!SQS\S'\"S\
4S( jjr#SQS\S'\"S\
4S) jjr$   SRS*\S\\   S\\	   S\\	   S"\\   S\\\%   \%4   4S+ jjr&   SRS'\S\S\\   S\\	   S\\	   S"\\   S\\%   4S, jjr'SSSS\SS4S\\S4   S\S-\S.\S/\	S0\	S1\	S\	S2\\(\)S4   S3\\   S4\\   S\
4S5 jjr*SS\SSSS4S\S-\S.\S/\	S\	S2\\(\)4   S0\	S1\	S3\\   S4\\   S\
4S6 jjr+S\4S\S-\S.\S\	S2\\(\)4   S\
4S7 jjr,     SSS\S\S-\S.\S0\	S1\	S/\	S3\\   S4\\   S\
4S8 jjr-  STS\S\S\S-\\   S4\\   S\
4S9 jjr.  STS\S\S\S-\\   S4\\   S\
4S: jjr/SSS\4S\S\S\S-\\   S4\\   S\	S2\\(\)4   S\
4S; jjr0SSS\4S\S\S\S-\\   S4\\   S\	S2\\(\)4   4S< jjr1S\4S\S\S=\	S2\\(\)4   S\
4
S> jjr2S\S?\3S\
4S@ jr4S\S\S\S\
4SA jr5S\S\S\S\
4SB jr6S\S\S\S\
4SC jr7S\4S\S\S=\	S2\\(\)4   S\
4
SD jjr8S\S\S\
4SE jr9SS\4S\\\   \\\4   4   S\\   S\	S2\\(\)4   S\
4
SF jjr: SPS\S\\\   \\\4   4   S\\   S\
4SG jjr;S%\SH\\   S\
4SI jr< SPSJ\S\\S4   S\\\   \\\4   4   S\\   S\
4
SK jjr=SLr>g)USortedSetCommandsi0  zk
Redis commands for Sorted Sets data type.
see: https://redis.io/topics/data-types-intro#redis-sorted-sets
Fr  r  r  r  chr  r  r  r3   c	                    U(       d  [        S5      eU(       a  U(       a  [        S5      eU(       a  U(       a  [        S5      eU(       a  [        U5      S:w  a  [        S5      eU(       a  U(       d  U(       a  [        S5      e/ n	0 n
U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S	5        U(       a  U	R                  S
5        SU
S'   U(       a  U	R                  S5        U(       a  U	R                  S5        UR                  5        H+  nU	R                  US   5        U	R                  US   5        M-     U R                  " SU/U	Q70 U
D6$ )a	  
Set any number of element-name, score pairs to the key ``name``. Pairs
are specified as a dict of element-names keys to score values.

``nx`` forces ZADD to only create new elements and not to update
scores for elements that already exist.

``xx`` forces ZADD to only update scores of elements that already
exist. New elements will not be added.

``ch`` modifies the return value to be the numbers of elements changed.
Changed elements include new elements that were added and elements
whose scores changed.

``incr`` modifies ZADD to behave like ZINCRBY. In this mode only a
single element/score pair can be specified and the score is the amount
the existing score will be incremented by. When using this mode the
return value of ZADD will be the new score of the element.

``lt`` only updates existing elements if the new score is less than
the current score. This flag doesn't prevent adding new elements.

``gt`` only updates existing elements if the new score is greater than
the current score. This flag doesn't prevent adding new elements.

The return value of ZADD varies based on the mode specified. With no
options, ZADD returns the number of new elements added to the sorted
set.

``nx``, ``lt``, and ``gt`` are mutually exclusive options.

See: https://redis.io/commands/ZADD
z-ZADD requires at least one element/score pairz)ZADD allows either 'nx' or 'xx', not bothz)ZADD allows either 'gt' or 'lt', not bothr-   zFZADD option 'incr' only works when passing a single element/score pairz/Only one of 'nx', 'lt', or 'gr' may be defined.s   NXs   XXs   CHs   INCRTas_scores   GTs   LTr   ZADD)r   r   rK   rl  r6   )r7   r  r  r  r  r@  r  r  r  r9   rq  r  s               r:   zaddSortedSetCommands.zadd6  s&   X KLL"GHH"GHHCLA%X  2MNN#%MM% MM% MM% MM'""&GJMM% MM% MMODMM$q'"MM$q'" $ ##FDE6EWEEr=   c                 $    U R                  SX/S9$ )zu
Return the number of elements in the sorted set ``name``

For more information, see https://redis.io/commands/zcard
ZCARDr  r5   r  s     r:   zcardSortedSetCommands.zcard  rv  r=   r  r  c                 &    U R                  SXX1/S9$ )z
Returns the number of elements in the sorted set at key ``name`` with
a score between ``min`` and ``max``.

For more information, see https://redis.io/commands/zcount
ZCOUNTr  r5   r7   r  r  r  s       r:   zcountSortedSetCommands.zcount  s     ##Hd6#JJr=   rp   
withscoresc                 z    [        U5      /UQnU(       a  UR                  S5        U R                  " S/UQ7SU06$ )z
Returns the difference between the first and all successive input
sorted sets provided in ``keys``.

For more information, see https://redis.io/commands/zdiff

WITHSCORESZDIFFrp   )r   rK   r6   )r7   rp   rO  r9   s       r:   zdiffSortedSetCommands.zdiff  s?     d)#d#MM,'##G@f@4@@r=   rs  c                 F    [        U5      /UQnU R                  " SU/UQ76 $ )z
Computes the difference between the first and all successive input
sorted sets provided in ``keys`` and stores the result in ``dest``.

For more information, see https://redis.io/commands/zdiffstore

ZDIFFSTORE)r   r6   )r7   rs  rp   r9   s       r:   
zdiffstoreSortedSetCommands.zdiffstore  s-     d)#d###L$@@@r=   r  r	  c                 (    U R                  SXU5      $ )z
Increment the score of ``value`` in sorted set ``name`` by ``amount``

For more information, see https://redis.io/commands/zincrby
ZINCRBYr5   )r7   r  r  r	  s       r:   zincrbySortedSetCommands.zincrby  s     ##ItUCCr=   N	aggregatec                 &    U R                  SSXUS9$ )a  
Return the intersect of multiple sorted sets specified by ``keys``.
With the ``aggregate`` option, it is possible to specify how the
results of the union are aggregated. This option defaults to SUM,
where the score of an element is summed across the inputs where it
exists. When this option is set to either MIN or MAX, the resulting
set will contain the minimum or maximum score of an element across
the inputs where it exists.

For more information, see https://redis.io/commands/zinter
ZINTERN)rO  _zaggregate)r7   rp   r]  rO  s       r:   zinterSortedSetCommands.zinter  s     $JWWr=   c                 (    U R                  SXU5      $ )a  
Intersect multiple sorted sets specified by ``keys`` into a new
sorted set, ``dest``. Scores in the destination will be aggregated
based on the ``aggregate``. This option defaults to SUM, where the
score of an element is summed across the inputs where it exists.
When this option is set to either MIN or MAX, the resulting set will
contain the minimum or maximum score of an element across the inputs
where it exists.

For more information, see https://redis.io/commands/zinterstore
ZINTERSTOREr`  r7   rs  rp   r]  s       r:   zinterstoreSortedSetCommands.zinterstore  s    " t9EEr=   r  r  c                 @    U/UQSPUPnU R                   " S/UQ7SU06$ )a[  
Return the cardinality of the intersect of multiple sorted sets
specified by ``keys``.
When LIMIT provided (defaults to 0 and means unlimited), if the intersection
cardinality reaches limit partway through the computation, the algorithm will
exit and yield limit as the cardinality

For more information, see https://redis.io/commands/zintercard
r  
ZINTERCARDrp   r5   r  s        r:   
zintercardSortedSetCommands.zintercard  r  r=   c                 &    U R                  SXX1/S9$ )z
Return the number of items in the sorted set ``name`` between the
lexicographical range ``min`` and ``max``.

For more information, see https://redis.io/commands/zlexcount
	ZLEXCOUNTr  r5   rL  s       r:   	zlexcountSortedSetCommands.zlexcount  s     ##KCf#MMr=   rZ   c                 f    USL=(       a    U/=(       d    / nSS0nU R                   " SU/UQ70 UD6$ )z
Remove and return up to ``count`` members with the highest scores
from the sorted set ``name``.

For more information, see https://redis.io/commands/zpopmax
NrO  TZPOPMAXr5   r7   r  rZ   r@   rq  s        r:   zpopmaxSortedSetCommands.zpopmax  A     T!.w4"&##ItFdFgFFr=   c                 f    USL=(       a    U/=(       d    / nSS0nU R                   " SU/UQ70 UD6$ )z
Remove and return up to ``count`` members with the lowest scores
from the sorted set ``name``.

For more information, see https://redis.io/commands/zpopmin
NrO  TZPOPMINr5   rs  s        r:   zpopminSortedSetCommands.zpopmin  rv  r=   r   c                     / nUb  UR                  U5        U(       a  UR                  S5        U R                  " SU/UQ76 $ )aB  
Return a random element from the sorted set value stored at key.

``count`` if the argument is positive, return an array of distinct
fields. If called with a negative count, the behavior changes and
the command is allowed to return the same field multiple times.
In this case, the number of returned fields is the absolute value
of the specified count.

``withscores`` The optional WITHSCORES modifier changes the reply so it
includes the respective scores of the randomly selected elements from
the sorted set.

For more information, see https://redis.io/commands/zrandmember
rQ  ZRANDMEMBERr   )r7   r   rZ   rO  re  s        r:   zrandmemberSortedSetCommands.zrandmember  sB    $ MM% MM,'##M3@@@r=   r  c                 l    Uc  Sn[        US5      nUR                  U5        U R                  " S/UQ76 $ )aX  
ZPOPMAX a value off of the first non-empty sorted set
named in the ``keys`` list.

If none of the sorted sets in ``keys`` has a value to ZPOPMAX,
then block for ``timeout`` seconds, or until a member gets added
to one of the sorted sets.

If timeout is 0, then block indefinitely.

For more information, see https://redis.io/commands/bzpopmax
Nr   BZPOPMAXr  r  s      r:   bzpopmaxSortedSetCommands.bzpopmax  s<     ?GD$'G##J666r=   c                 l    Uc  Sn[        US5      nUR                  U5        U R                  " S/UQ76 $ )aX  
ZPOPMIN a value off of the first non-empty sorted set
named in the ``keys`` list.

If none of the sorted sets in ``keys`` has a value to ZPOPMIN,
then block for ``timeout`` seconds, or until a member gets added
to one of the sorted sets.

If timeout is 0, then block indefinitely.

For more information, see https://redis.io/commands/bzpopmin
Nr   BZPOPMINr  r  s      r:   bzpopminSortedSetCommands.bzpopmin0  s<     ?G!-dD!9G##J666r=   r  c                     U/U-   nU(       a  U(       d  U(       d  U(       d  [         eU(       a  UR                  S5        OUR                  S5        US:w  a  UR                  SU/5        U R                  " S/UQ76 $ )z
Pop ``count`` values (default 1) off of the first non-empty sorted set
named in the ``keys`` list.
For more information, see https://redis.io/commands/zmpop
MINMAXr-   r  ZMPOPr   rK   r   r6   )r7   r  rp   r  r  rZ   r@   s          r:   zmpopSortedSetCommands.zmpopC  sg     zD CSOKKKKA:KK%()##G3d33r=   c                     X/UQnU(       a  U(       d  U(       d  U(       d  [        S5      eU(       a  UR                  S5        OUR                  S5        UR                  SU/5        U R                  " S/UQ76 $ )ac  
Pop ``count`` values (default 1) off of the first non-empty sorted set
named in the ``keys`` list.

If none of the sorted sets in ``keys`` has a value to pop,
then block for ``timeout`` seconds, or until a member gets added
to one of the sorted sets.

If timeout is 0, then block indefinitely.

For more information, see https://redis.io/commands/bzmpop
z+Either min or max, but not both must be setr  r  r  BZMPOPr  )r7   r  r  rp   r  r  rZ   r@   s           r:   bzmpopSortedSetCommands.bzmpop\  sh    * (4(CSIJJKKKKWe$%##H4t44r=   ra  rb  r  byscorebylexrU  ru  r  c                    U(       a  U(       a  [        S5      eUb  Ub  Ub  Uc  [        S5      eU(       a  U	(       a  [        S5      eU/nU(       a  UR                  U5        UR                  X4U/5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        Ub  Ub  UR                  SX/5        U	(       a  UR                  S5        XS	.nU/US
'   U R                  " U0 UD6$ )Nz8``byscore`` and ``bylex`` can not be specified together.z.``offset`` and ``num`` must both be specified.z;``withscores`` not supported in combination with ``bylex``.BYSCOREBYLEXREVr  rQ  rO  rU  rp   r  )r7   r$  rs  r  ra  rb  r  r  r  rO  rU  ru  r  r9   rq  s                  r:   _zrangeSortedSetCommands._zrange|  s     uVWW3;COLMMZM  MM$tC()MM)$MM'"MM% #/MM7F01MM,'!+P&##V7w77r=   c                     U(       d'  U(       d   U	c  U
c  U(       a  U R                  XX5U5      $ U R                  SSUUUUUUUUU	U
5      $ )a  
Return a range of values from sorted set ``name`` between
``start`` and ``end`` sorted in ascending order.

``start`` and ``end`` can be negative, indicating the end of the range.

``desc`` a boolean indicating whether to sort the results in reversed
order.

``withscores`` indicates to return the scores along with the values.
The return type is a list of (value, score) pairs.

``score_cast_func`` a callable used to cast the score return value.

``byscore`` when set to True, returns the range of elements from the
sorted set having scores equal or between ``start`` and ``end``.

``bylex`` when set to True, returns the range of elements from the
sorted set between the ``start`` and ``end`` lexicographical closed
range intervals.
Valid ``start`` and ``end`` must start with ( or [, in order to specify
whether the range interval is exclusive or inclusive, respectively.

``offset`` and ``num`` are specified, then return a slice of the range.
Can't be provided when using ``bylex``.

For more information, see https://redis.io/commands/zrange
NZRANGE)	zrevranger  )r7   r  ra  rb  r  rO  rU  r  r  ru  r  s              r:   zrangeSortedSetCommands.zrange  s\    V u&.S[d>>$sPP||
 	
r=   c                 p    SXU/nU(       a  UR                  S5        XES.nXS'   U R                  " U0 UD6$ )a  
Return a range of values from sorted set ``name`` between
``start`` and ``end`` sorted in descending order.

``start`` and ``end`` can be negative, indicating the end of the range.

``withscores`` indicates to return the scores along with the values
The return type is a list of (value, score) pairs

``score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zrevrange
	ZREVRANGE
   WITHSCORESr  rp   r   )r7   r  ra  rb  rO  rU  r9   rq  s           r:   r  SortedSetCommands.zrevrange  sD    * tC0MM-(!+P##V7w77r=   c
                 :    U R                  SUUUUUUUSSUU	5      $ )a{  
Stores in ``dest`` the result of a range of values from sorted set
``name`` between ``start`` and ``end`` sorted in ascending order.

``start`` and ``end`` can be negative, indicating the end of the range.

``byscore`` when set to True, returns the range of elements from the
sorted set having scores equal or between ``start`` and ``end``.

``bylex`` when set to True, returns the range of elements from the
sorted set between the ``start`` and ``end`` lexicographical closed
range intervals.
Valid ``start`` and ``end`` must start with ( or [, in order to specify
whether the range interval is exclusive or inclusive, respectively.

``desc`` a boolean indicating whether to sort the results in reversed
order.

``offset`` and ``num`` are specified, then return a slice of the range.
Can't be provided when using ``bylex``.

For more information, see https://redis.io/commands/zrangestore
ZRANGESTOREFN)r  )
r7   rs  r  ra  rb  r  r  r  ru  r  s
             r:   zrangestoreSortedSetCommands.zrangestore  s:    F ||
 	
r=   c                     Ub  Ub  Ub  Uc  [        S5      eSXU/nUb  Ub  UR                  SXE/5        U R                  " USU/06$ )z
Return the lexicographical range of values from sorted set ``name``
between ``min`` and ``max``.

If ``start`` and ``num`` are specified, then return a slice of the
range.

For more information, see https://redis.io/commands/zrangebylex
r$  ZRANGEBYLEXr%  rp   r   r   r6   )r7   r  r  r  ra  r  r9   s          r:   zrangebylexSortedSetCommands.zrangebylex0  sa    " #+3?u}JKKC0MM8U01##V94&99r=   c                     Ub  Ub  Ub  Uc  [        S5      eSXU/nUb  Ub  UR                  SXE/5        U R                  " USU/06$ )z
Return the reversed lexicographical range of values from sorted set
``name`` between ``max`` and ``min``.

If ``start`` and ``num`` are specified, then return a slice of the
range.

For more information, see https://redis.io/commands/zrevrangebylex
r$  ZREVRANGEBYLEXr  rp   r  )r7   r  r  r  ra  r  r9   s          r:   zrevrangebylex SortedSetCommands.zrevrangebylexH  sa    " #+3?u}JKK"Ds3MM7E/0##V94&99r=   c                     Ub  Ub  Ub  Uc  [        S5      eSXU/nUb  Ub  UR                  SXE/5        U(       a  UR                  S5        XgS.n	U/U	S'   U R                  " U0 U	D6$ )a  
Return a range of values from the sorted set ``name`` with scores
between ``min`` and ``max``.

If ``start`` and ``num`` are specified, then return a slice
of the range.

``withscores`` indicates to return the scores along with the values.
The return type is a list of (value, score) pairs

`score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zrangebyscore
r$  ZRANGEBYSCOREr  rQ  r  rp   r   r   rK   r6   )
r7   r  r  r  ra  r  rO  rU  r9   rq  s
             r:   zrangebyscoreSortedSetCommands.zrangebyscore`  s    0 #+3?u}JKK!4c2MM7E/0MM,'!+P&##V7w77r=   c                     Ub  Ub  Ub  Uc  [        S5      eSXU/nUb  Ub  UR                  SXE/5        U(       a  UR                  S5        XgS.n	U/U	S'   U R                  " U0 U	D6$ )a  
Return a range of values from the sorted set ``name`` with scores
between ``min`` and ``max`` in descending order.

If ``start`` and ``num`` are specified, then return a slice
of the range.

``withscores`` indicates to return the scores along with the values.
The return type is a list of (value, score) pairs

``score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zrevrangebyscore
r$  ZREVRANGEBYSCOREr  rQ  r  rp   r  )
r7   r  r  r  ra  r  rO  rU  r9   rq  s
             r:   zrevrangebyscore"SortedSetCommands.zrevrangebyscore  s    0 #+3?u}JKK$d5MM7E/0MM,'!+P&##V7w77r=   	withscorec                 f    SX/nU(       a  UR                  S5        X4S.nU R                  " U0 UD6$ )a9  
Returns a 0-based value indicating the rank of ``value`` in sorted set
``name``.
The optional WITHSCORE argument supplements the command's
reply with the score of the element returned.

``score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zrank
ZRANK	WITHSCOREr  rU  r   r7   r  r	  r  rU  r9   rq  s          r:   zrankSortedSetCommands.zrank  s;    " 4'MM+& )N##V7w77r=   r  c                 *    U R                   " SU/UQ76 $ )zm
Remove member ``values`` from sorted set ``name``

For more information, see https://redis.io/commands/zrem
ZREMr5   r  s      r:   zremSortedSetCommands.zrem  rq  r=   c                 (    U R                  SXU5      $ )z
Remove all elements in the sorted set ``name`` between the
lexicographical range specified by ``min`` and ``max``.

Returns the number of elements removed.

For more information, see https://redis.io/commands/zremrangebylex
ZREMRANGEBYLEXr5   rL  s       r:   zremrangebylex SortedSetCommands.zremrangebylex  s     ##$4dEEr=   c                 (    U R                  SXU5      $ )a6  
Remove all elements in the sorted set ``name`` with ranks between
``min`` and ``max``. Values are 0-based, ordered from smallest score
to largest. Values can be negative indicating the highest scores.
Returns the number of elements removed

For more information, see https://redis.io/commands/zremrangebyrank
ZREMRANGEBYRANKr5   rL  s       r:   zremrangebyrank!SortedSetCommands.zremrangebyrank  s     ##$5t#FFr=   c                 (    U R                  SXU5      $ )z
Remove all elements in the sorted set ``name`` with scores
between ``min`` and ``max``. Returns the number of elements removed.

For more information, see https://redis.io/commands/zremrangebyscore
ZREMRANGEBYSCOREr5   rL  s       r:   zremrangebyscore"SortedSetCommands.zremrangebyscore  s     ##$63GGr=   c                 f    SX/nU(       a  UR                  S5        X4S.nU R                  " U0 UD6$ )aK  
Returns a 0-based value indicating the descending rank of
``value`` in sorted set ``name``.
The optional ``withscore`` argument supplements the command's
reply with the score of the element returned.

``score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zrevrank
ZREVRANKr  r  r   r  s          r:   zrevrankSortedSetCommands.zrevrank  s;    " d*MM+& )N##V7w77r=   c                 &    U R                  SXU/S9$ )zz
Return the score of element ``value`` in sorted set ``name``

For more information, see https://redis.io/commands/zscore
ZSCOREr  r5   r  s      r:   zscoreSortedSetCommands.zscore  s     ##Hd#GGr=   c           	      *    U R                  SSUUUUS9$ )aU  
Return the union of multiple sorted sets specified by ``keys``.
``keys`` can be provided as dictionary of keys and their weights.
Scores will be aggregated based on the ``aggregate``, or SUM if
none is provided.

``score_cast_func`` a callable used to cast the score return value

For more information, see https://redis.io/commands/zunion
ZUNIONNr  r`  )r7   rp   r]  rO  rU  s        r:   zunionSortedSetCommands.zunion	  s.    " !+   
 	
r=   c                 (    U R                  SXU5      $ )z
Union multiple sorted sets specified by ``keys`` into
a new sorted set, ``dest``. Scores in the destination will be
aggregated based on the ``aggregate``, or SUM if none is provided.

For more information, see https://redis.io/commands/zunionstore
ZUNIONSTOREr`  rf  s       r:   zunionstoreSortedSetCommands.zunionstore#  s     t9EEr=   membersc                 `    U(       d  [        S5      eU/U-   nU R                  " S/UQ7SU/06$ )a:  
Returns the scores associated with the specified members
in the sorted set stored at key.
``members`` should be a list of the member name.
Return type is a list of score.
If the member does not exist, a None will be returned
in corresponding position.

For more information, see https://redis.io/commands/zmscore
z(ZMSCORE members must be a non-empty listZMSCORErp   r   )r7   r   r  r9   s       r:   zmscoreSortedSetCommands.zmscore2  s;     FGG##ICCcUCCr=   r$  c                 T   U/nUb  UR                  U5        UR                  [        U5      5        [        U[        5      (       a   UR	                  5       UR                  5       psOS nUR                  U5        U(       a"  UR                  S5        UR                  U5        U(       aB  UR                  5       S;   a#  UR                  S5        UR                  U5        O[        S5      eUR                  SS5      (       a  UR                  S5        X5S'   U R                  " U0 UD6$ )	Ns   WEIGHTS)SUMr  r  s	   AGGREGATEz!aggregate can be sum, min or max.rO  Fr  rp   )rK   r   r]   r  rp   r  r   rD  r   r  r6   )r7   r$  rs  rp   r]  rq  r9   weightss           r:   ra  SortedSetCommands._zaggregateB  s     %,9MM$c$i dD!! IIK'GdMM*%MM'" $99l+i( CDD;;|U++MM-(##V7w77r=   r   )FFFFFFr  r  r   r0  )FFr-   )FFFNNr  )?r   r   r   r   r   r#   r   r   r   r   r&   rD  rH  r*   rM  r"   rS  rW  r  r[  r   r   rb  r   r   rg  rI   r   r   rk  ro  rt  ry  r}  r)   r  r  r   r  r  r  r   r  r  r  r  r  r  r  r  r  r    r  r  r  r  r  r  r  r  r  ra  r   r   r=   r:   r?  r?  0  s	    KFKF *,-KF 	KF
 KF KF KF KF KF 
KFZ@$ @9 @K4 Kl K K) K
A% 
AT 
Ai 
AAt A5 AY ADD D% D
 Dy D PUXX&.smXHLX	X( $(	FF HTNGGUN$;;<F C=	F
 
F( ;<DD"&s)D47D	y~s"	#DN	GD 	G# 	G) 	G	GD 	G# 	G) 	G JOAA (ABFA	A47U 7[ 7 7&7U 7[ 7 7. $# 44 3i4 d^	4
 d^4 }4 
y$	%4< $# 55 5 3i	5
 d^5 d^5 }5 
$5N  7< $!'8 D$J'8 	'8
 '8 '8 '8 '8 '8 '8 tXt34'8 '8 c]'8 
'8\  16 $!;
;
 ;
 	;

 ;
 ;
 tX~.;
 ;
 ;
 ;
 c];
 
;
D !1688 8 	8
 8 tX~.8 
8D  $!0
0
 0
 	0

 0
 0
 0
 0
 0
 c]0
 
0
n  $!:: : 	:
 }: c]: 
::  $!:: : 	:
 }: c]: 
::  $! 16!8!8 !8 	!8
 }!8 c]!8 !8 tX~.!8 
!8P  $! 16!8!8 !8 	!8
 }!8 c]!8 !8 tX~.!8N  1688 8 	8
 tX~.8 
82; ; ;9 ;	F4 	Fj 	Fz 	Fi 	F	GD 	Gs 	G 	G 	G	H	H+	H2>	H		H  1688 8 	8
 tX~.8 
82H4 H
 Hy H $( 16
HTNGGUN$;;<
 C=
 	

 tX~.
 

< $(	FF HTNGGUN$;;<F C=	F
 
FD4 D$s) D	 D* $(88 D$J8 HTNGGUN$;;<	8
 C=8 
8 8r=   r?  c                   V    \ rS rSrSrS\S\S\4S jrS\S\4S jr	S	\S\S\4S
 jr
Srg)HyperlogCommandsie  zf
Redis commands of HyperLogLogs data type.
see: https://redis.io/topics/data-types-intro#hyperloglogs
r  r  r3   c                 *    U R                   " SU/UQ76 $ )zv
Adds the specified elements to the specified HyperLogLog.

For more information, see https://redis.io/commands/pfadd
PFADDr5   r  s      r:   pfaddHyperlogCommands.pfaddk  r  r=   sourcesc                 (    U R                   " S/UQ76 $ )z
Return the approximated cardinality of
the set observed by the HyperLogLog at key(s).

For more information, see https://redis.io/commands/pfcount
PFCOUNTr5   )r7   r  s     r:   pfcountHyperlogCommands.pfcounts  s     ##I888r=   rs  c                 *    U R                   " SU/UQ76 $ )zp
Merge N different HyperLogLogs into a single one.

For more information, see https://redis.io/commands/pfmerge
PFMERGEr5   )r7   rs  r  s      r:   pfmergeHyperlogCommands.pfmerge|  s     ##It>g>>r=   r   N)r   r   r   r   r   r#   r    r&   r  r  r  r   r   r=   r:   r  r  e  sN    
<$ < <I <9 9 9?D ?D ?Y ?r=   r  c                       \ rS rSrSrSrSrg)HashDataPersistOptionsi  FNXFXXr   N)r   r   r   r   r  r  r   r   r=   r:   r  r    s     C Cr=   r  c                   P   \ rS rSrSrS\S\S\\\   \4   4S jr	S\S\S\\\
   \
4   4S jrS\S\S\\\\      \\   4   4S	 jrS\S\\\   \4   4S
 jrS\S\S\\\\\\\4            \\\\\4         4   4S jrSSSSSS.S\S\S\\   S\\   S\\   S\\   S\
S\\\\\\\4            \\\\\4         4   4S jjr S?S\S\S\S\\\   \4   4S jjr S@S\S\S\S\\\   \4   4S jjrS\S\\\   \4   4S jrS\S\\\   \4   4S jr    SAS\S\\   S\\   S\\   S\\   S\\\   \4   4S jjr          SBS\S\\   S\\   S\\   S\\   S\\   S\\   S\\   S\\   S\\   S\
S\\\   \4   4S  jjrS\S\S\S\\\
   \
4   4S! jr \!" S"S#S$S%9S\S\S\\\   \4   4S& j5       r"S\S\S'\S\\\   \4   4S( jr#S\S\\\   \4   4S) jr$S\S\S\\\   \4   4S* jr%SSSSS+.S\S,\S-\S.\
S/\
S0\
S1\
S\&4S2 jjr'SSSSS+.S\S3\S-\S.\
S/\
S0\
S1\
S\&4S4 jjr(SSSSS+.S\S5\S-\S.\
S/\
S0\
S1\
S\&4S6 jjr)SSSSS+.S\S7\S-\S.\
S/\
S0\
S1\
S\&4S8 jjr*S\S-\S\&4S9 jr+S\S-\S\&4S: jr,S\S-\S\&4S; jr-S\S-\S\&4S< jr.S\S-\S\&4S= jr/S>r0g)CHashCommandsi  z_
Redis commands for Hash data type.
see: https://redis.io/topics/data-types-intro#redis-hashes
r  rp   r3   c                 *    U R                   " SU/UQ76 $ )z^
Delete ``keys`` from hash ``name``

For more information, see https://redis.io/commands/hdel
HDELr5   r7   r  rp   s      r:   hdelHashCommands.hdel  s     ##FD8488r=   r   c                 &    U R                  SXU/S9$ )z
Returns a boolean indicating if ``key`` exists within hash ``name``

For more information, see https://redis.io/commands/hexists
HEXISTSr  r5   r7   r  r   s      r:   hexistsHashCommands.hexists  s     ##Itv#FFr=   c                 &    U R                  SXU/S9$ )zp
Return the value of ``key`` within the hash ``name``

For more information, see https://redis.io/commands/hget
HGETr  r5   r  s      r:   hgetHashCommands.hget  s     ##FDTF#CCr=   c                 $    U R                  SX/S9$ )zr
Return a Python dict of the hash's name/value pairs

For more information, see https://redis.io/commands/hgetall
HGETALLr  r5   r  s     r:   hgetallHashCommands.hgetall  s     ##It&#AAr=   c                 t    [        U5      S:X  a  [        S5      eU R                  " SUS[        U5      /UQ76 $ )a8  
Return the value of ``key`` within the hash ``name`` and
delete the field in the hash.
This command is similar to HGET, except for the fact that it also deletes
the key on success from the hash with the provided ```name```.

Available since Redis 8.0
For more information, see https://redis.io/commands/hgetdel
r   z/'hgetdel' should have at least one key providedHGETDELFIELDS)r   r   r6   r  s      r:   hgetdelHashCommands.hgetdel  s;     t9>MNN##ItXs4yP4PPr=   NF)r  r  r  r  r  r  r  r  r  r  c                   U(       d  [        S5      eX#XE1n[        U5      S:  d  [        U5      S:  a  U(       a  [        S5      e[        X#XE5      n	U(       a  U	R                  S5        U R                  " SU/U	QSP[        U5      PUQ76 $ )a0  
Return the values of ``key`` and ``keys`` within the hash ``name``
and optionally set their expiration.

``ex`` sets an expire flag on ``kyes`` for ``ex`` seconds.

``px`` sets an expire flag on ``keys`` for ``px`` milliseconds.

``exat`` sets an expire flag on ``keys`` for ``ex`` seconds,
specified in unix time.

``pxat`` sets an expire flag on ``keys`` for ``ex`` milliseconds,
specified in unix time.

``persist`` remove the time to live associated with the ``keys``.

Available since Redis 8.0
For more information, see https://redis.io/commands/hgetex
z.'hgetex' should have at least one key providedr  r-   r  r  HGETEXr  )r   r   r,   rK   r6   )
r7   r  r  r  r  r  r  rp   r  r  s
             r:   hgetexHashCommands.hgetex  s    > LMM$u:>SZ!^: 
 )=RT(Py)##
 
 	

 I
 
 	
r=   r  c                 (    U R                  SXU5      $ )z|
Increment the value of ``key`` in hash ``name`` by ``amount``

For more information, see https://redis.io/commands/hincrby
HINCRBYr5   r7   r  r   r  s       r:   hincrbyHashCommands.hincrby  s     ##It&AAr=   c                 (    U R                  SXU5      $ )z
Increment the value of ``key`` in hash ``name`` by floating ``amount``

For more information, see https://redis.io/commands/hincrbyfloat
HINCRBYFLOATr5   r  s       r:   hincrbyfloatHashCommands.hincrbyfloat  s     ##NDvFFr=   c                 $    U R                  SX/S9$ )zi
Return the list of keys within hash ``name``

For more information, see https://redis.io/commands/hkeys
HKEYSr  r5   r  s     r:   hkeysHashCommands.hkeys  rv  r=   c                 $    U R                  SX/S9$ )zj
Return the number of elements in hash ``name``

For more information, see https://redis.io/commands/hlen
HLENr  r5   r  s     r:   hlenHashCommands.hlen   r  r=   r	  r  rl  c                    Uc  U(       d  U(       d  [        S5      e/ nU(       a  UR                  U5        Ub  UR                  X#45        U(       a(  UR                  5        H  nUR                  U5        M     U R                  " SU/UQ76 $ )a<  
Set ``key`` to ``value`` within hash ``name``,
``mapping`` accepts a dict of key/value pairs that will be
added to hash ``name``.
``items`` accepts a list of key/value pairs that will be
added to hash ``name``.
Returns the number of fields that were added.

For more information, see https://redis.io/commands/hset
z'hset' with no key value pairsHSET)r   r   rl  r6   )r7   r  r   r	  r  rl  r9   r  s           r:   hsetHashCommands.hset(  sy    & ;wu<==MM% ?MM3,'d# ( ##FD:6::r=   data_persist_optionrF  c                    Uc  U(       d  U(       d  [        S5      eU(       a  [        U5      S-  S:w  a  [        S5      eXgX1n[        U5      S:  d  [        U5      S:  a  U(       a  [        S5      e[        XgX5      nU
(       a  UR                  U
R                  5        U(       a  UR                  S5        / nU(       a  UR                  U5        Ub  UR                  X#45        U(       a(  UR                  5        H  nUR                  U5        M     U R                  " SU/UQS	P[        [        U5      S-  5      PUQ76 $ )
a#  
Set ``key`` to ``value`` within hash ``name``

``mapping`` accepts a dict of key/value pairs that will be
added to hash ``name``.

``items`` accepts a list of key/value pairs that will be
added to hash ``name``.

``ex`` sets an expire flag on ``keys`` for ``ex`` seconds.

``px`` sets an expire flag on ``keys`` for ``px`` milliseconds.

``exat`` sets an expire flag on ``keys`` for ``ex`` seconds,
    specified in unix time.

``pxat`` sets an expire flag on ``keys`` for ``ex`` milliseconds,
    specified in unix time.

``data_persist_option`` can be set to ``FNX`` or ``FXX`` to control the
    behavior of the command.
    ``FNX`` will set the value for each provided key to each
        provided value only if all do not already exist.
    ``FXX`` will set the value for each provided key to each
        provided value only if all already exist.

``keepttl`` if True, retain the time to live associated with the keys.

Returns the number of fields that were added.

Available since Redis 8.0
For more information, see https://redis.io/commands/hsetex
z 'hsetex' with no key value pairsr  r   zR'hsetex' with odd number of items. 'items' must contain a list of key/value pairs.r-   rH  rI  HSETEXr  )	r   r   r,   rK   r	  r   rl  r6   rI   )r7   r  r   r	  r  rl  r  r  r  r  r0  rF  r  r  r9   r  s                   r:   hsetexHashCommands.hsetexI  s8   ^ ;wu>??SZ!^q(B 
 $u:>SZ!^: 
 )=RT(P2889y)MM% ?MM3,'d# ( ##d
(
*2
47Fa4H
KQ
 	
r=   c                 (    U R                  SXU5      $ )z
Set ``key`` to ``value`` within hash ``name`` if ``key`` does not
exist.  Returns 1 if HSETNX created a field, otherwise 0.

For more information, see https://redis.io/commands/hsetnx
HSETNXr5   )r7   r  r   r	  s       r:   hsetnxHashCommands.hsetnx  s     ##Hd??r=   z4.0.0zUse 'hset' instead.hmset)versionreasonr  c                     U(       d  [        S5      e/ nUR                  5        H  nUR                  U5        M     U R                  " SU/UQ76 $ )z
Set key to value within hash ``name`` for each corresponding
key and value from the ``mapping`` dict.

For more information, see https://redis.io/commands/hmset
z"'hmset' with 'mapping' of length 0HMSET)r   rl  r   r6   )r7   r  r  rl  r  s        r:   r9  HashCommands.hmset  sL     @AAMMODLL $##GT:E::r=   r@   c                 H    [        X#5      nU R                  " SU/UQ7SU/06$ )zu
Returns a list of values ordered identically to ``keys``

For more information, see https://redis.io/commands/hmget
HMGETrp   ry  )r7   r  rp   r@   s       r:   hmgetHashCommands.hmget  s-     D'##GTFDFvFFr=   c                 $    U R                  SX/S9$ )zk
Return the list of values within hash ``name``

For more information, see https://redis.io/commands/hvals
HVALSr  r5   r  s     r:   hvalsHashCommands.hvals  rv  r=   c                 &    U R                  SXU/S9$ )z
Return the number of bytes stored in the value of ``key``
within hash ``name``

For more information, see https://redis.io/commands/hstrlen
HSTRLENr  r5   r  s      r:   hstrlenHashCommands.hstrlen  s     ##Itv#FFr=   )r  r  r  r  secondsr  r  r  r  r  c                   X4XV/n[        U5      S:  a  [        S5      e[        U[        R                  5      (       a  [        UR                  5       5      n/ n	U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U R                  " SX/U	QSP[        U5      PUQ76 $ )	a  
Sets or updates the expiration time for fields within a hash key, using relative
time in seconds.

If a field already has an expiration time, the behavior of the update can be
controlled using the `nx`, `xx`, `gt`, and `lt` parameters.

The return value provides detailed information about the outcome for each field.

For more information, see https://redis.io/commands/hexpire

Args:
    name: The name of the hash key.
    seconds: Expiration time in seconds, relative. Can be an integer, or a
             Python `timedelta` object.
    fields: List of fields within the hash to apply the expiration time to.
    nx: Set expiry only when the field has no expiry.
    xx: Set expiry only when the field has an existing expiry.
    gt: Set expiry only when the new expiry is greater than the current one.
    lt: Set expiry only when the new expiry is less than the current one.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `0` if the specified NX | XX | GT | LT condition was not met.
        - `1` if the expiration time was set or updated.
        - `2` if the field was deleted because the specified expiration time is
          in the past.
r-   4Only one of 'nx', 'xx', 'gt', 'lt' can be specified.r  r  r  r  HEXPIREr  
sumrJ   r]   r  r  rI   r  rK   r6   r   )
r7   r  rK  r  r  r  r  r  
conditionsrq  s
             r:   hexpireHashCommands.hexpire  s    N b%
z?QSTTgx1122'//12GNN4 NN4 NN4 NN4 ##t
'.
08
:=f+
HN
 	
r=   millisecondsc                   X4XV/n[        U5      S:  a  [        S5      e[        U[        R                  5      (       a  [        UR                  5       S-  5      n/ n	U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U R                  " SX/U	QS	P[        U5      PUQ76 $ )
a  
Sets or updates the expiration time for fields within a hash key, using relative
time in milliseconds.

If a field already has an expiration time, the behavior of the update can be
controlled using the `nx`, `xx`, `gt`, and `lt` parameters.

The return value provides detailed information about the outcome for each field.

For more information, see https://redis.io/commands/hpexpire

Args:
    name: The name of the hash key.
    milliseconds: Expiration time in milliseconds, relative. Can be an integer,
                  or a Python `timedelta` object.
    fields: List of fields within the hash to apply the expiration time to.
    nx: Set expiry only when the field has no expiry.
    xx: Set expiry only when the field has an existing expiry.
    gt: Set expiry only when the new expiry is greater than the current one.
    lt: Set expiry only when the new expiry is less than the current one.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `0` if the specified NX | XX | GT | LT condition was not met.
        - `1` if the expiration time was set or updated.
        - `2` if the field was deleted because the specified expiration time is
          in the past.
r-   rM  r  r  r  r  r  HPEXPIREr  rO  )
r7   r  rT  r  r  r  r  r  rQ  rq  s
             r:   hpexpireHashCommands.hpexpire  s    N b%
z?QSTTlH$6$677|99;dBCLNN4 NN4 NN4 NN4 ##
-4
6>
@CF
NT
 	
r=   unix_time_secondsc                   X4XV/n[        U5      S:  a  [        S5      e[        U[        R                  5      (       a  [	        UR                  5       5      n/ n	U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U R                  " SUU/U	QSP[        U5      PUQ76 $ )	a!  
Sets or updates the expiration time for fields within a hash key, using an
absolute Unix timestamp in seconds.

If a field already has an expiration time, the behavior of the update can be
controlled using the `nx`, `xx`, `gt`, and `lt` parameters.

The return value provides detailed information about the outcome for each field.

For more information, see https://redis.io/commands/hexpireat

Args:
    name: The name of the hash key.
    unix_time_seconds: Expiration time as Unix timestamp in seconds. Can be an
                       integer or a Python `datetime` object.
    fields: List of fields within the hash to apply the expiration time to.
    nx: Set expiry only when the field has no expiry.
    xx: Set expiry only when the field has an existing expiration time.
    gt: Set expiry only when the new expiry is greater than the current one.
    lt: Set expiry only when the new expiry is less than the current one.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `0` if the specified NX | XX | GT | LT condition was not met.
        - `1` if the expiration time was set or updated.
        - `2` if the field was deleted because the specified expiration time is
          in the past.
r-   rM  r  r  r  r  	HEXPIREATr  	rP  rJ   r]   r  rI   r  rK   r6   r   )
r7   r  rY  r  r  r  r  r  rQ  rq  s
             r:   	hexpireatHashCommands.hexpireatJ  s    N b%
z?QSTT'):):;; #$5$?$?$A BNN4 NN4 NN4 NN4 ##
 	

 
 K
 
 	
r=   unix_time_millisecondsc                   X4XV/n[        U5      S:  a  [        S5      e[        U[        R                  5      (       a  [	        UR                  5       S-  5      n/ n	U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U(       a  U	R                  S5        U R                  " SUU/U	QS	P[        U5      PUQ76 $ )
a!  
Sets or updates the expiration time for fields within a hash key, using an
absolute Unix timestamp in milliseconds.

If a field already has an expiration time, the behavior of the update can be
controlled using the `nx`, `xx`, `gt`, and `lt` parameters.

The return value provides detailed information about the outcome for each field.

For more information, see https://redis.io/commands/hpexpireat

Args:
    name: The name of the hash key.
    unix_time_milliseconds: Expiration time as Unix timestamp in milliseconds.
                            Can be an integer or a Python `datetime` object.
    fields: List of fields within the hash to apply the expiry.
    nx: Set expiry only when the field has no expiry.
    xx: Set expiry only when the field has an existing expiry.
    gt: Set expiry only when the new expiry is greater than the current one.
    lt: Set expiry only when the new expiry is less than the current one.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `0` if the specified NX | XX | GT | LT condition was not met.
        - `1` if the expiration time was set or updated.
        - `2` if the field was deleted because the specified expiration time is
          in the past.
r-   rM  r  r  r  r  r  
HPEXPIREATr  r\  )
r7   r  r_  r  r  r  r  r  rQ  rq  s
             r:   
hpexpireatHashCommands.hpexpireat  s    N b%
z?QSTT,h.?.?@@%()?)I)I)Kd)R%S"NN4 NN4 NN4 NN4 ##"
 	

 
 K
 
 	
r=   c                 @    U R                   " SUS[        U5      /UQ76 $ )a:  
Removes the expiration time for each specified field in a hash.

For more information, see https://redis.io/commands/hpersist

Args:
    name: The name of the hash key.
    fields: A list of fields within the hash from which to remove the
            expiration time.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `-1` if the field exists but has no associated expiration time.
        - `1` if the expiration time was successfully removed from the field.
HPERSISTr  r6   r   )r7   r  r  s      r:   hpersistHashCommands.hpersist  s$    " ##JhFUfUUr=   c                 H    U R                   " SUS[        U5      /UQ7SU/06$ )as  
Returns the expiration times of hash fields as Unix timestamps in seconds.

For more information, see https://redis.io/commands/hexpiretime

Args:
    key: The hash key.
    fields: A list of fields within the hash for which to get the expiration
            time.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `-1` if the field exists but has no associated expire time.
        - A positive integer representing the expiration Unix timestamp in
          seconds, if the field has an associated expiration time.
HEXPIRETIMEr  rp   rf  r7   r   r  s      r:   hexpiretimeHashCommands.hexpiretime  s6    $ ##3#f+
8>
FIU
 	
r=   c                 H    U R                   " SUS[        U5      /UQ7SU/06$ )a~  
Returns the expiration times of hash fields as Unix timestamps in milliseconds.

For more information, see https://redis.io/commands/hpexpiretime

Args:
    key: The hash key.
    fields: A list of fields within the hash for which to get the expiration
            time.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `-1` if the field exists but has no associated expire time.
        - A positive integer representing the expiration Unix timestamp in
          milliseconds, if the field has an associated expiration time.
HPEXPIRETIMEr  rp   rf  rk  s      r:   hpexpiretimeHashCommands.hpexpiretime  s6    $ ##C3v;
9?
GJe
 	
r=   c                 H    U R                   " SUS[        U5      /UQ7SU/06$ )aH  
Returns the TTL (Time To Live) in seconds for each specified field within a hash
key.

For more information, see https://redis.io/commands/httl

Args:
    key: The hash key.
    fields: A list of fields within the hash for which to get the TTL.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `-1` if the field exists but has no associated expire time.
        - A positive integer representing the TTL in seconds if the field has
          an associated expiration time.
HTTLr  rp   rf  rk  s      r:   httlHashCommands.httl  s6    $ ##C3v;
17
?Be
 	
r=   c                 H    U R                   " SUS[        U5      /UQ7SU/06$ )aS  
Returns the TTL (Time To Live) in milliseconds for each specified field within a
hash key.

For more information, see https://redis.io/commands/hpttl

Args:
    key: The hash key.
    fields: A list of fields within the hash for which to get the TTL.

Returns:
    Returns a list which contains for each field in the request:
        - `-2` if the field does not exist, or if the key does not exist.
        - `-1` if the field exists but has no associated expire time.
        - A positive integer representing the TTL in milliseconds if the field
          has an associated expiration time.
HPTTLr  rp   rf  rk  s      r:   hpttlHashCommands.hpttl#  s6    $ ##S(CK
28
@Cu
 	
r=   r   r  r  )NNNN)
NNNNNNNNNF)1r   r   r   r   r   r   r   r   rI   r  r   r  r   r  r  r  r   r)  r  r#   r   r   r  r  r  r"  r&  r*  r   r.  r  r3  r7  r+   r9  rA  rE  rI  r&   rR  rW  r]  rb  rg  rl  rp  rt  rx  r   r   r=   r:   r  r    s   
9 9S 9U9S>33F-G 9GC Gc GeIdOT4I.J GDD!D	y#'#6	7DBC BE)D/4*?$@ BQQ #Q	(4c5j 1234htE#u*DU?V6WW
Q. !% $%)%)5
5
 5
 W	5

 W5
 z"5
 z"5
 5
 
(4c5j 1234htE#u*DU?V6WW
5
p 23BB!B+.B	y~s"	#B 47GG!G+0G	y&	'G@# @%	$(="> @? ?y~s':!; ? "#"& $;; c]; }	;
 $; ~; 
y~s"	#;H "#"& $ $ $%)%)@DQ
Q
 c]Q
 }	Q

 $Q
 ~Q
 WQ
 WQ
 z"Q
 z"Q
 &&<=Q
 Q
 
y~s"	#Q
f@3 @S @ @yPT?T9U @ $
;# ; ;y~s7J1K ;
;G# GT G$ G54RVAV;W G@# @%	$(="> @GC Gc GeIcNC4G.H G :
:
 :
 	:

 :
 :
 :
 :
 
:
B :
:
 :
 	:

 :
 :
 :
 :
 
:
B @
@
 &@
 	@

 @
 @
 @
 @
 
@
N @
@
 !+@
 	@

 @
 @
 @
 @
 
@
DVT VC VI V&
t 
c 
i 
,
 
s 
y 
,
 
s 
y 
,
 
 
	 
r=   r  c                   v    \ rS rSrSrSSS\4S jr   SS\\\	   S4   S	\\
\   S4   S
\S   4S jjrS rSrg)Scripti=  A
An executable Lua script object returned by ``register_script``
registered_clientr5  scriptc                     Xl         X l        [        U[        5      (       a!  U R	                  5       nUR                  U5      n[        R                  " U5      R                  5       U l	        g r   )
r}  r~  r]   r   r}   r   hashlibsha1	hexdigestshar7   r}  r~  r   s       r:   r=  Script.__init__B  sS    !2 fc"" &&(G^^F+F<<'113r=   Nrp   r@   r3  )r5  Nc                    U=(       d    / nU=(       d    / nUc  U R                   n[        U5      [        U5      -   nSSKJn  [	        X45      (       a  UR
                  R                  U 5         UR                  " U R                  [        U5      /UQ76 $ ! [         aJ    UR                  U R                  5      U l        UR                  " U R                  [        U5      /UQ76 s $ f = f)1Execute the script, passing any required ``args``r   Pipeline)r}  r  ro  r  r]   scriptsaddevalshar  r   r   script_loadr~  r7   rp   r@   r3  r  s        r:   __call__Script.__call__N  s     zrzr>++FT{U4[()f''NNt$	>>>$((CI=== 	> ))$++6DH>>$((CI===	>s   /&B AC*)C*c                      U R                   R                  5       $ ! [         a'    U R                   R                  R                  5       s $ f = f)z4Get the encoder to encode string scripts into bytes.)r}  r}   AttributeErrorconnection_poolr   s    r:   r}   Script.get_encoderi  sK    	H))5577 	H ))99EEGG	Hs    .AAr}  r~  r  r  )r   r   r   r   r   r'   r=  r   r   r#   r
   r   r  r}   r   r   r=   r:   r{  r{  =  sp    
4*> 
4 
4 -12648	>HTND()> HZ($./> 01	>6Hr=   r{  c                   p    \ rS rSrSrSSS\4S jr   SS\\\	   S4   S	\\
\   S4   S
\S   4S jjrSrg)AsyncScripti|  r|  r}  r6  r~  c                 0   Xl         X l        [        U[        5      (       a,   UR                  R                  5       nUR                  U5      n[        R                  " U5      R                  5       U l        g ! [         a    UR                  5       n NWf = fr   )r}  r~  r]   r   r  r}   r  r   r  r  r  r  r  s       r:   r=  AsyncScript.__init__  s    
 "3 fc"":+;;GGI ^^F+F<<'113	 " :+779:s   A8 8BBNrp   r@   r3  )r6  Nc                   #    U=(       d    / nU=(       d    / nUc  U R                   n[        U5      [        U5      -   nSSKJn  [	        X45      (       a  UR
                  R                  U 5         UR                  " U R                  [        U5      /UQ76 I Sh  vN $  N! [         a\    UR                  U R                  5      I Sh  vN  U l        UR                  " U R                  [        U5      /UQ76 I Sh  vN  s $ f = f7f)r  Nr   r  )r}  r  redis.asyncio.clientr  r]   r  r  r  r  r   r   r  r~  r  s        r:   r  AsyncScript.__call__  s      zrzr>++FT{U4[(1f''NNt$	D#d)CdCCCC 	D $//<<<DH#d)CdCCCC	DsT   A.D1*B" B B" D B" "(D
C4D?D DDDDr  r  )r   r   r   r   r   r'   r=  r   r   r#   r
   r   r  r   r   r=   r:   r  r  |  sw    474 4, -126<@	DHTND()D HZ($./D 89	D Dr=   r  c                       \ rS rSrSrS\S\S\4S jrS\S\S\4S jr	SS	\
S\4S
 jjrSS	\
S\4S jjrS\4S jrS\S\4S jrS\S\4S jrSrg)PubSubCommandsi  z;
Redis PubSub commands.
see https://redis.io/topics/pubsub
r   messager3   c                 *    U R                   " SX40 UD6$ )z
Publish ``message`` on ``channel``.
Returns the number of subscribers the message was delivered to.

For more information, see https://redis.io/commands/publish
PUBLISHr5   )r7   r   r  r8   s       r:   publishPubSubCommands.publish  s     ##IwJ6JJr=   shard_channelc                 &    U R                  SX5      $ )z
Posts a message to the given shard channel.
Returns the number of clients that received the message

For more information, see https://redis.io/commands/spublish
SPUBLISHr5   )r7   r  r  s      r:   spublishPubSubCommands.spublish  s     ##JGGr=   r2  c                 *    U R                   " SU40 UD6$ )z
Return a list of channels that have at least one subscriber

For more information, see https://redis.io/commands/pubsub-channels
zPUBSUB CHANNELSr5   r  s      r:   pubsub_channelsPubSubCommands.pubsub_channels  s     ##$5wI&IIr=   c                 *    U R                   " SU40 UD6$ )z
Return a list of shard_channels that have at least one subscriber

For more information, see https://redis.io/commands/pubsub-shardchannels
zPUBSUB SHARDCHANNELSr5   r  s      r:   pubsub_shardchannels#PubSubCommands.pubsub_shardchannels  s     ##$:GNvNNr=   c                 &    U R                   " S0 UD6$ )zt
Returns the number of subscriptions to patterns

For more information, see https://redis.io/commands/pubsub-numpat
)zPUBSUB NUMPATr5   rS   s     r:   pubsub_numpatPubSubCommands.pubsub_numpat  r   r=   r@   c                 .    U R                   " S/UQ70 UD6$ )z
Return a list of (channel, number of subscribers) tuples
for each channel given in ``*args``

For more information, see https://redis.io/commands/pubsub-numsub
zPUBSUB NUMSUBr5   r  s      r:   pubsub_numsubPubSubCommands.pubsub_numsub  s     ##OEdEfEEr=   c                 .    U R                   " S/UQ70 UD6$ )z
Return a list of (shard_channel, number of subscribers) tuples
for each channel given in ``*args``

For more information, see https://redis.io/commands/pubsub-shardnumsub
zPUBSUB SHARDNUMSUBr5   r  s      r:   pubsub_shardnumsub!PubSubCommands.pubsub_shardnumsub  s      ##$8J4J6JJr=   r   Nr  )r   r   r   r   r   r   r   r&   r  r  r%   r  r  r  r  r  r   r   r=   r:   r  r    s    
Kx K* K9 KHh H H	 HJx JI JOH O O? ?F8 F) FK Ky Kr=   r  c                      \ rS rSrSrS\S\S\S\\\	4   S\\
\   \4   4
S jrS\S\S\\\	4   S\\
\   \4   4S	 jrS\S\S\\\	4   S\\
\   \4   4S
 jrS\S\S\S\\\	4   S\\
\   \4   4
S jrS\S\S\\\	4   S\\
\   \4   4S jrS\S\S\\\	4   S\\
\   \4   4S jrS\S\4S jrSS jr SS\\S   \S   4   S\4S jjrS\4S jrS\S\4S jrSSS\S\4S jrSrg)ScriptCommandsi  zo
Redis Lua script commands. see:
https://redis.io/ebook/part-3-next-steps/chapter-11-scripting-redis-with-lua/
r$  r~  r  keys_and_argsr3   c                 *    U R                   " XU/UQ76 $ r   r5   )r7   r$  r~  r  r  s        r:   _evalScriptCommands._eval  s     ##GWM}MMr=   c                 *    U R                   " SX/UQ76 $ )a[  
Execute the Lua ``script``, specifying the ``numkeys`` the script
will touch and the key names and argument values in ``keys_and_args``.
Returns the result of the script.

In practice, use the object returned by ``register_script``. This
function exists purely for Redis API completion.

For more information, see  https://redis.io/commands/eval
EVALr  r7   r~  r  r  s       r:   evalScriptCommands.eval  s     zz&&BMBBr=   c                 *    U R                   " SX/UQ76 $ )a  
The read-only variant of the EVAL command

Execute the read-only Lua ``script`` specifying the ``numkeys`` the script
will touch and the key names and argument values in ``keys_and_args``.
Returns the result of the script.

For more information, see  https://redis.io/commands/eval_ro
EVAL_ROr  r  s       r:   eval_roScriptCommands.eval_ro  s     zz)VE}EEr=   r  c                 *    U R                   " XU/UQ76 $ r   r5   )r7   r$  r  r  r  s        r:   _evalshaScriptCommands._evalsha#  s     ##G'JMJJr=   c                 *    U R                   " SX/UQ76 $ )a  
Use the ``sha`` to execute a Lua script already registered via EVAL
or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the
key names and argument values in ``keys_and_args``. Returns the result
of the script.

In practice, use the object returned by ``register_script``. This
function exists purely for Redis API completion.

For more information, see  https://redis.io/commands/evalsha
EVALSHAr  r7   r  r  r  s       r:   r  ScriptCommands.evalsha,  s     }}YE}EEr=   c                 *    U R                   " SX/UQ76 $ )aZ  
The read-only variant of the EVALSHA command

Use the ``sha`` to execute a read-only Lua script already registered via EVAL
or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the
key names and argument values in ``keys_and_args``. Returns the result
of the script.

For more information, see  https://redis.io/commands/evalsha_ro

EVALSHA_ROr  r  s       r:   
evalsha_roScriptCommands.evalsha_ro<  s     }}\3H-HHr=   r@   c                 (    U R                   " S/UQ76 $ )a  
Check if a script exists in the script cache by specifying the SHAs of
each script as ``args``. Returns a list of boolean values indicating if
if each already script exists in the cache_data.

For more information, see  https://redis.io/commands/script-exists
zSCRIPT EXISTSr5   r<  s     r:   script_existsScriptCommands.script_existsK  s     ##O;d;;r=   Nc                     [        S5      e)Nz<SCRIPT DEBUG is intentionally not implemented in the client.r(  r<  s     r:   script_debugScriptCommands.script_debugU  r,  r=   	sync_typerm  ASYNCc                 \    US;  a  [        S5      eUc  / nOU/nU R                  " S/UQ76 $ )zFlush all scripts from the script cache_data.

``sync_type`` is by default SYNC (synchronous) but it can also be
              ASYNC.

For more information, see  https://redis.io/commands/script-flush
)rm  r  NzpSCRIPT FLUSH defaults to SYNC in redis > 6.2, or accepts SYNC/ASYNC. For older versions, of redis leave as None.zSCRIPT FLUSHr   )r7   r  r9   s      r:   script_flushScriptCommands.script_flushZ  sI     33* 
 F[F##N<V<<r=   c                 $    U R                  S5      $ )zj
Kill the currently executing Lua script

For more information, see https://redis.io/commands/script-kill
zSCRIPT KILLr5   r   s    r:   script_killScriptCommands.script_killr  s     ##M22r=   c                 &    U R                  SU5      $ )z
Load a Lua ``script`` into the script cache_data. Returns the SHA.

For more information, see https://redis.io/commands/script-load
zSCRIPT LOADr5   r7   r~  s     r:   r  ScriptCommands.script_loadz  s     ##M6::r=   r7   r5  c                     [        X5      $ z
Register a Lua ``script`` specifying the ``keys`` it will touch.
Returns a Script object that is callable and hides the complexity of
deal with scripts, keys, and shas. This is the preferred way to work
with Lua scripts.
)r{  r  s     r:   register_scriptScriptCommands.register_script  s     d##r=   r   r  r   )r   r   r   r   r   r   rI   r   r#   r   r   r  r  r  r  r  r  r&   r  r  r   r  r  r'   r  r{  r  r   r   r=   r:   r  r    s6   
NN N 	N
 dJ./N 
y~s"	#NCC$'C9>tZ?O9PC	y~s"	#CFF$'F9>tZ?O9PF	y~s"	#FKK K 	K
 dJ./K 
y~s"	#KFF!$F6;D*<L6MF	y~s"	#F II!$I6;D*<L6MI	y~s"	#I<3 <9 <
 EI=wv0@@A=	=03Y 3;+ ;) ;$2 $K $F $r=   r  c                   B   ^  \ rS rSrS	U 4S jjrSSS\S\4S jrSrU =r	$ )
AsyncScriptCommandsi  r3   c                 (   >#    [         TU ]  5       $ 7fr   )r"  r  )r7   r@   r$  s     r:   r   AsyncScriptCommands.script_debug       w#%%r  r7   r6  r~  c                     [        X5      $ r  )r  r  s     r:   r  #AsyncScriptCommands.register_script  s     4((r=   r   r  )
r   r   r   r   r  r'   r  r  r   r/  r0  s   @r:   r  r    s,    &
)*
)
) 

) 
)r=   r  c                      \ rS rSrSr   S+S\S\\   S\S\S\S\	4S	 jjr
 S,S\S\S\S\\   S\	4
S jjrS\S\S\	4S jrS\S\S\	4S jr         S-S\S\S\S\S\\   S\S\S\S\\   S\\   S\\   S\\   S\S\	4S jjr         S-S\S\S\S\\   S\S\S\S\\   S\\   S\\S
4   S\\S
4   S\S\	4S jjrS\S \S!\\S
4   S\	4S" jr             S.S\S\\S
4   S\\S
4   S\\S
4   S\S\\S
4   S#\\S
4   S$\\S
4   S\\   S\\   S\S\S\S\S\	4S% jjr           S/S&\S\S\\   S\\   S\\   S\S\\   S#\\   S$\\   S\\   S\\   S\S'\S\	4S( jjrS\S \S!\\S
4   S\	4S) jrS*rg
)0GeoCommandsi  zf
Redis Geospatial commands.
see: https://redis.com/redis-best-practices/indexing-patterns/geospatial/
r  r  r  r  r@  r3   c                 L   U(       a  U(       a  [        S5      e[        U5      S-  S:w  a  [        S5      eU/nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        UR                  U5        U R                  " S/UQ76 $ )	a  
Add the specified geospatial items to the specified key identified
by the ``name`` argument. The Geospatial items are given as ordered
members of the ``values`` argument, each item or place is formed by
the triad longitude, latitude and name.

Note: You can use ZREM to remove elements.

``nx`` forces ZADD to only create new elements and not to update
scores for elements that already exist.

``xx`` forces ZADD to only update scores of elements that already
exist. New elements will not be added.

``ch`` modifies the return value to be the numbers of elements changed.
Changed elements include new elements that were added and elements
whose scores changed.

For more information, see https://redis.io/commands/geoadd
z+GEOADD allows either 'nx' or 'xx', not both   r   z4GEOADD requires places with lon, lat and name valuesr  r  CHGEOADD)r   r   rK   r   r6   )r7   r  r  r  r  r@  r9   s          r:   geoaddGeoCommands.geoadd  s    8 "IJJv;?aRSSMM$MM$MM$f##H6v66r=   Nplace1place2unitc                     XU/nU(       a  US;  a  [        S5      eU(       a  UR                  U5        U R                  " S/UQ7SU/06$ )z
Return the distance between ``place1`` and ``place2`` members of the
``name`` key.
The units must be one of the following : m, km mi, ft. By default
meters are used.

For more information, see https://redis.io/commands/geodist
mkmmiftzGEODIST invalid unitGEODISTrp   r{  )r7   r  r  r  r  r9   s         r:   geodistGeoCommands.geodist  sQ     %)&#9D 77233MM$##IDDdVDDr=   c                 2    U R                   " SU/UQ7SU/06$ )z
Return the geo hash string for each item of ``values`` members of
the specified key identified by the ``name`` argument.

For more information, see https://redis.io/commands/geohash
GEOHASHrp   r5   r  s      r:   geohashGeoCommands.geohash  s#     ##ItJfJD6JJr=   c                 2    U R                   " SU/UQ7SU/06$ )z
Return the positions of each item of ``values`` as members of
the specified key identified by the ``name`` argument. Each position
is represented by the pairs lon and lat.

For more information, see https://redis.io/commands/geopos
GEOPOSrp   r5   r  s      r:   geoposGeoCommands.geopos  s#     ##HdIVI4&IIr=   	longitudelatituderadiuswithdist	withcoordwithhashrZ   r+  r!  
store_distanyc                 :    U R                  SUUUUUUUUU	U
UUUS9$ )ax  
Return the members of the specified key identified by the
``name`` argument which are within the borders of the area specified
with the ``latitude`` and ``longitude`` location and the maximum
distance from the center specified by the ``radius`` value.

The units must be one of the following : m, km mi, ft. By default

``withdist`` indicates to return the distances of each place.

``withcoord`` indicates to return the latitude and longitude of
each place.

``withhash`` indicates to return the geohash string of each place.

``count`` indicates to return the number of elements up to N.

``sort`` indicates to return the places in a sorted way, ASC for
nearest to fairest and DESC for fairest to nearest.

``store`` indicates to save the places names in a sorted set named
with a specific key, each element of the destination sorted set is
populated with the score got from the original geo sorted set.

``store_dist`` indicates to save the places names in a sorted set
named with a specific key, instead of ``store`` the sorted set
destination score is set with the distance.

For more information, see https://redis.io/commands/georadius
	GEORADIUS	r  r  r  r  rZ   r+  r!  r  r  _georadiusgeneric)r7   r  r  r  r  r  r  r  r  rZ   r+  r!  r  r  s                 r:   	georadiusGeoCommands.georadius  sG    \ %%! & 
 	
r=   memberc                 8    U R                  SUUUUUUUUU	U
UUS9$ )aR  
This command is exactly like ``georadius`` with the sole difference
that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing
inside the geospatial index represented by the sorted set.

For more information, see https://redis.io/commands/georadiusbymember
GEORADIUSBYMEMBERr  r  )r7   r  r  r  r  r  r  r  rZ   r+  r!  r  r  s                r:   georadiusbymemberGeoCommands.georadiusbymember1  sC    . %%! & 
 	
r=   r$  r@   r8   c                 &   [        U5      nUS   (       a  US   S;  a  [        S5      eUS   (       a  UR                  US   5        OUR                  S5        US   (       a  US   c  [        S5      eS H!  u  pVX5   (       d  M  UR                  U5        M#     US   b1  UR                  S	US   /5        US   (       a  UR                  S
5        US   (       aA  US   S:X  a  UR                  S5        O&US   S:X  a  UR                  S5        O[        S5      eUS   (       a  US   (       a  [        S5      eUS   (       a  UR                  SUS   /5        US   (       a  UR                  SUS   /5        U R                  " U/UQ70 UD6$ )Nr  r  zGEORADIUS invalid unitr  r  rZ   z+``any`` can't be provided without ``count``))r  WITHDIST)r  	WITHCOORD)r  WITHHASHr  ANYr+  ASCDESCzGEORADIUS invalid sortr!  r  z3GEORADIUS store and store_dist cant be set togetherr'  	   STOREDIST)r   r   rK   r   r6   r7   r$  r@   r8   r9   arg_name	byte_reprs          r:   r  GeoCommands._georadiusgenericX  sw    d&>fVn4KK455F^MM&.)MM#%=VG_4IJJ$
H
 i($
 '?&MM7F7O45e}e$&>f~&e$6)f% 899'?vl3QRR'?MM8VG_56,MM<)=>?##G?f???r=   widthheightc                 @    U R                  SUUUUUUUUU	U
UUUUSSS9$ )aS  
Return the members of specified key identified by the
``name`` argument, which are within the borders of the
area specified by a given shape. This command extends the
GEORADIUS command, so in addition to searching within circular
areas, it supports searching within rectangular areas.

This command should be used in place of the deprecated
GEORADIUS and GEORADIUSBYMEMBER commands.

``member`` Use the position of the given existing
 member in the sorted set. Can't be given with ``longitude``
 and ``latitude``.

``longitude`` and ``latitude`` Use the position given by
this coordinates. Can't be given with ``member``
``radius`` Similar to GEORADIUS, search inside circular
area according the given radius. Can't be given with
``height`` and ``width``.
``height`` and ``width`` Search inside an axis-aligned
rectangle, determined by the given height and width.
Can't be given with ``radius``

``unit`` must be one of the following : m, km, mi, ft.
`m` for meters (the default value), `km` for kilometers,
`mi` for miles and `ft` for feet.

``sort`` indicates to return the places in a sorted way,
ASC for nearest to furthest and DESC for furthest to nearest.

``count`` limit the results to the first count matching items.

``any`` is set to True, the command will return as soon as
enough matches are found. Can't be provided without ``count``

``withdist`` indicates to return the distances of each place.
``withcoord`` indicates to return the latitude and longitude of
each place.

``withhash`` indicates to return the geohash string of each place.

For more information, see https://redis.io/commands/geosearch
	GEOSEARCHNr  r  r  r  r  r,  r-  r+  rZ   r  r  r  r  r!  r  _geosearchgeneric)r7   r  r  r  r  r  r  r,  r-  r+  rZ   r  r  r  r  s                  r:   	geosearchGeoCommands.geosearch  sP    z %%# & 
 	
r=   rs  	storedistc                 B    U R                  SUUUUUUUUU	U
UUSSSSUS9$ )a  
This command is like GEOSEARCH, but stores the result in
``dest``. By default, it stores the results in the destination
sorted set with their geospatial information.
if ``store_dist`` set to True, the command will stores the
items in a sorted set populated with their distance from the
center of the circle or box, as a floating-point number.

For more information, see https://redis.io/commands/geosearchstore
GEOSEARCHSTORENr0  r1  )r7   rs  r  r  r  r  r  r  r,  r-  r+  rZ   r  r5  s                 r:   geosearchstoreGeoCommands.geosearchstore  sR    4 %% % & 
 	
r=   c                    [        U5      nUS   c  US   b  US   c  [        S5      eUS   (       a5  US   (       d
  US   (       a  [        S5      eUR                  SUS   /5        US   b   US   b  UR                  SUS   US   /5        US   c  US	   b  US
   c  [        S5      eUS   c  [        S5      eUS   R                  5       S;  a  [        S5      eUS   (       a9  US	   (       d
  US
   (       a  [        S5      eUR                  SUS   US   /5        US	   (       a(  US
   (       a  UR                  SUS	   US
   US   /5        US   (       a]  US   R	                  5       S:X  a  UR                  S5        O4US   R	                  5       S:X  a  UR                  S5        O[        S5      eUS   (       a2  UR                  SUS   /5        US   (       a  UR                  S5        OUS   (       a  [        S5      eS H!  u  pVX5   (       d  M  UR                  U5        M#     US:X  a  US    OUS!   /US"'   U R                  " U/UQ70 UD6$ )#Nr  r  r  z4GEOSEARCH must have member or longitude and latitudez?GEOSEARCH member and longitude or latitude cant be set togethers
   FROMMEMBERs
   FROMLONLATr  r,  r-  z.GEOSEARCH must have radius or width and heightr  zGEOSEARCH must have unitr  zGEOSEARCH invalid unitz9GEOSEARCH radius and width or height cant be set togethers   BYRADIUSs   BYBOXr+  r%  s   ASCr&  r&  zGEOSEARCH invalid sortrZ   r7  r  s   ANYz1GEOSEARCH ``any`` can't be provided without count))r  s   WITHDIST)r  s	   WITHCOORD)r  s   WITHHASH)r  r'  r/  r   r-   rp   )r   r   r   r   rD  rK   r6   r(  s          r:   r2  GeoCommands._geosearchgeneric  s    d (#k"*fZ.@.H VWW(k"fZ&8U  MM=&*:;<+*vj/A/MMM=&*=vj?QRS (#g&&*:*B PQQ&>!677&>!)@@455(g&"2O  MM;x(8&.IJ'?vh/MM8VG_fX6FvWX &>f~##%.f%%%'61g& 899 '?MM8VG_56e}f%E]OPP$
H i($
 &-%;$q'aIv##G?f???r=   r   )FFFr   )	NFFFNNNNF)NNNr  NNNNNFFFF)NNNr  NNNNNFF)r   r   r   r   r   r#   r   r   r   r&   r  r    r   r   r  r  r
  r  rI   r  r   r  r  r3  r8  r2  r   r   r=   r:   r  r    s    (7(7 $(7 	(7
 (7 (7 
(7V QUEE"(E28E@HE	E$KD K6 Ki KJ4 J& JY J  ##" $%)=
=
 =
 	=

 =
 sm=
 =
 =
 =
 }=
 sm=
 ~=
 TN=
 =
 
=
H ##"#'(,%
%
 %
 	%

 sm%
 %
 %
 %
 }%
 sm%
 T4Z %
 $*%%
 %
 
%
N,@,@#-,@9>z4?O9P,@	,@b '+(,'+%)$(%)"#O
O
 fdl#O
 %	O

 t$O
 O
 eTk"O
 UD[!O
 eTk"O
 smO
 }O
 O
 O
 O
 O
  
!O
j $(%)$("&!%"&"#-
-
 -
  	-

 E?-
 5/-
 -
 -
 -
 -
 sm-
 }-
 -
 -
 
-
^@@@@#-@@9>z4?O9P@@	@@r=   r  c            	           \ rS rSrSrS\4S jr  SS\S\\	\      S\\	\      S\4S	 jjr
S\4S
 jrS\4S jrSS jrS\4S jrS\4S jrS\4S jrSrg)ModuleCommandsiL  zC
Redis Module commands.
see: https://redis.io/topics/modules-intro
r3   c                 *    U R                   " SU/UQ76 $ )z
Loads the module from ``path``.
Passes all ``*args`` to the module, during loading.
Raises ``ModuleError`` if a module is not found at ``path``.

For more information, see https://redis.io/commands/module-load
zMODULE LOADr5   )r7   pathr@   s      r:   module_loadModuleCommands.module_loadR  s     ##M4?$??r=   Nr?  rq  r@   c                     / nUb"  UR                  S5        UR                  U5        Ub"  UR                  S5        UR                  U5        U R                  " SU/UQ76 $ )z
Loads a module from a dynamic library at runtime with configuration directives.

For more information, see https://redis.io/commands/module-loadex
CONFIGARGSzMODULE LOADEXr  )r7   r?  rq  r@   r9   s        r:   module_loadexModuleCommands.module_loadex\  s]     MM(#MM'"MM&!MM$##OTCFCCr=   c                 &    U R                  SU5      $ )z
Unloads the module ``name``.
Raises ``ModuleError`` if ``name`` is not in loaded modules.

For more information, see https://redis.io/commands/module-unload
zMODULE UNLOADr5   r  s     r:   module_unloadModuleCommands.module_unloadq  s     ##OT::r=   c                 $    U R                  S5      $ )z
Returns a list of dictionaries containing the name and version of
all loaded modules.

For more information, see https://redis.io/commands/module-list
zMODULE LISTr5   r   s    r:   module_listModuleCommands.module_listz  s     ##M22r=   c                     [        S5      er'  r(  r   s    r:   r*  ModuleCommands.command_info  r,  r=   c                 $    U R                  S5      $ )Nr.  r5   r   s    r:   r/  ModuleCommands.command_count  s    ##O44r=   c                 (    U R                   " S/UQ76 $ )NzCOMMAND GETKEYSr5   r<  s     r:   command_getkeysModuleCommands.command_getkeys  s    ##$5===r=   c                 $    U R                  S5      $ )Nr#  r5   r   s    r:   r$  ModuleCommands.command  s    ##I..r=   r   r  r  )r   r   r   r   r   r&   r@  r   r   r   rE  rH  rK  r*  r/  rR  r$  r   r   r=   r:   r=  r=  L  s    
@) @ (,$(	DD $s)$D tCy!	D
 
D*;Y ;3Y 3

5y 5>	 >/ /r=   r=  c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )AsyncModuleCommandsi  c                 (   >#    [         TU ]  5       $ 7fr   r!  r  s    r:   r*   AsyncModuleCommands.command_info  r  r  r   r  )r   r   r   r   r*  r   r/  r0  s   @r:   rW  rW    s    & &r=   rW  c                   B    \ rS rSrSrS\4S jrS\4S jrS\4S jrSr	g)	ClusterCommandsi  z"
Class for Redis Cluster commands
r3   c                 P    U R                   " SUR                  5        3/UQ70 UD6$ )NzCLUSTER )r6   rD  )r7   cluster_argr@   r8   s       r:   clusterClusterCommands.cluster  s.    ##h{/@/@/B.C$DVtVvVVr=   c                 &    U R                   " S0 UD6$ )z
Disables read queries for a connection to a Redis Cluster slave node.

For more information, see https://redis.io/commands/readwrite
)	READWRITEr5   rS   s     r:   	readwriteClusterCommands.readwrite  r   r=   c                 &    U R                   " S0 UD6$ )z
Enables read queries for a connection to a Redis Cluster replica node.

For more information, see https://redis.io/commands/readonly
)READONLYr5   rS   s     r:   readonlyClusterCommands.readonly  rV   r=   r   N)
r   r   r   r   r   r&   r^  rb  rf  r   r   r=   r:   r[  r[    s-    Wy W;Y ;:I :r=   r[  c            
          \ rS rSrSr SS\S\\   S\\	\   \4   4S jjr
S\S\\	\   \4   4S jrSS	\S\\	\   \4   4S
 jjr SS\\   S\\   S\\	\   \4   4S jjrS\S\S\S\\	\   \4   4S jrS\S\S\\	\   \4   4S jrS\S\S\\	\   \4   4S jrS\\	\   \4   4S jr SS\S\\   S\\	\   \4   4S jjrS\\	\   \4   4S jrS\\	\   \4   4S jrSrg)FunctionCommandsi  z
Redis Function commands
coder  r3   c                 b    U(       a  S/O/ nUR                  U5        U R                  " S/UQ76 $ )aP  
Load a library to Redis.
:param code: the source code (must start with
Shebang statement that provides a metadata about the library)
:param replace: changes the behavior to overwrite the existing library
with the new contents.
Return the library name that was loaded.

For more information, see https://redis.io/commands/function-load
r  zFUNCTION LOADr   )r7   rj  r  r9   s       r:   function_loadFunctionCommands.function_load  s1     !()Rd##O=f==r=   libraryc                 &    U R                  SU5      $ )z
Delete the library called ``library`` and all its functions.

For more information, see https://redis.io/commands/function-delete
zFUNCTION DELETEr5   )r7   rn  s     r:   function_delete FunctionCommands.function_delete  s     ##$5w??r=   r  c                 &    U R                  SU5      $ )z`
Deletes all the libraries.

For more information, see https://redis.io/commands/function-flush
zFUNCTION FLUSHr5   r  s     r:   function_flushFunctionCommands.function_flush  s     ##$4d;;r=   withcodec                 `    SU/nU(       a  UR                  S5        U R                  " S/UQ76 $ )z
Return information about the functions and libraries.

Args:

    library: specify a pattern for matching library names
    withcode: cause the server to include the libraries source implementation
        in the reply
LIBRARYNAMEWITHCODEzFUNCTION LISTr   )r7   rn  ru  r@   s       r:   function_listFunctionCommands.function_list  s3     w'KK
###O;d;;r=   r$  r  r  c                 *    U R                   " XU/UQ76 $ r   r5   )r7   r$  functionr  r  s        r:   _fcallFunctionCommands._fcall  s     ##GwOOOr=   c                 *    U R                   " SX/UQ76 $ )zO
Invoke a function.

For more information, see https://redis.io/commands/fcall
FCALLr}  r7   r|  r  r  s       r:   fcallFunctionCommands.fcall  s     {{7HFFFr=   c                 *    U R                   " SX/UQ76 $ )z
This is a read-only variant of the FCALL command that cannot
execute commands that modify data.

For more information, see https://redis.io/commands/fcall_ro
FCALL_ROr  r  s       r:   fcall_roFunctionCommands.fcall_ro  s     {{:xI=IIr=   c                 >    SSK Jn  0 n/ X!'   U R                  " S0 UD6$ )zw
Return the serialized payload of loaded libraries.

For more information, see https://redis.io/commands/function-dump
r   rj  )zFUNCTION DUMPrn  rp  s      r:   function_dumpFunctionCommands.function_dump  s(     	. "##?w??r=   payloadpolicyc                 &    U R                  SX5      $ )z
Restore libraries from the serialized ``payload``.
You can use the optional policy argument to provide a policy
for handling existing libraries.

For more information, see https://redis.io/commands/function-restore
zFUNCTION RESTOREr5   )r7   r  r  s      r:   function_restore!FunctionCommands.function_restore  s     ##$6HHr=   c                 $    U R                  S5      $ )zq
Kill a function that is currently executing.

For more information, see https://redis.io/commands/function-kill
zFUNCTION KILLr5   r   s    r:   function_killFunctionCommands.function_kill  s     ##O44r=   c                 $    U R                  S5      $ )z
Return information about the function that's currently running
and information about the available execution engines.

For more information, see https://redis.io/commands/function-stats
zFUNCTION STATSr5   r   s    r:   function_statsFunctionCommands.function_stats%  s     ##$455r=   r   Nr  rl  )r  F)r_  )r   r   r   r   r   r   r   r   r   r   rl  rp  rs  r   ry  rI   r   r}  r  r  r  r  r  r  r   r   r=   r:   ri  ri    s   
 49>>"*4.>	y~s"	#>"@s @uYs^S5H/I @<3 <E)C.#:M4N < HM<}<6>tn<	y$	%<"PP/2PDGP	y~s"	#P
G!$G69G	y~s"	#G	J!$	J69	J	y~s"	#	J@uYs^S%89 @ 5=
I
I$,SM
I	y~s"	#
I5uYs^S%89 56iot&; < 6r=   ri  c                       \ rS rSrSrSrg)DataAccessCommandsi2  z
A class containing all of the implemented data access redis commands.
This class is to be used as a mixin for synchronous Redis clients.
r   Nr   r   r   r   r   r   r   r=   r:   r  r  2      r=   r  c                       \ rS rSrSrSrg)AsyncDataAccessCommandsiC  z
A class containing all of the implemented data access redis commands.
This class is to be used as a mixin for asynchronous Redis clients.
r   Nr  r   r=   r:   r  r  C  r  r=   r  c                       \ rS rSrSrSrg)CoreCommandsiT  z~
A class containing all of the implemented redis commands. This class is
to be used as a mixin for synchronous Redis clients.
r   Nr  r   r=   r:   r  r  T      r=   r  c                       \ rS rSrSrSrg)AsyncCoreCommandsid  z
A class containing all of the implemented redis commands. This class is
to be used as a mixin for asynchronous Redis clients.
r   Nr  r   r=   r:   r  r  d  r  r=   r  )_r  r  r  enumr   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   redis.exceptionsr   r   r   r   redis.typingr   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   redis.utilsr+   r,   helpersr.   r  redisro  r0   AsyncACLCommandsr   r  r2  r]  r  r  AsyncListCommandsr2  r`  rl  AsyncSetCommandsr  AsyncStreamCommandsr?  AsyncSortedSetCommandsr  AsyncHyperlogCommandsr  r  AsyncHashCommandsr{  r  r  AsyncPubSubCommandsr  r  r  AsyncGeoCommandsr=  rW  r[  AsyncClusterCommandsri  AsyncFunctionCommandsr  r  r  r  r   r=   r:   <module>r     s          & S R     *
 "K<" K<\
  g
) g
T0;0 0;fm5 m5`yG' yGx!, !(^
# ^
B ! \# \~l l^o@" o@d  Y
<% Y
<x % o8( o8d + ?' ?@ ) T e

# e

P ! <H <H~2D 2Dj@K% @KF % R$% R$j). )"i@" i@X  C/% C/L&. &
:& :2 ' y6 y6x ) "" r=   