
    ng\j$                   t   S SK Jr  S SKrS SKrS SKr S SKrS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  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/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQJRrR  S S
KSJTrTJUrUJVrVJWrWJXrX  SSKYJZrZ  SSK[J\r\Jr  SSK]J^r^J_r_  \(       a  S SK`raS SKbraS SKcraS SKdra " S S\05      re\erf " S S\
5      rg " S S\05      rh " S S\h5      ri " S S5      rj " S S\
5      rk " S S\05      rl " S S\l5      rm " S  S!\05      rn\nro " S" S#\
5      rp " S$ S%\
5      rq " S& S'\
5      rr " S( S)\05      rs\srt " S* S+\05      ru " S, S-\u5      rv " S. S/\05      rw\wrx " S0 S1\05      ry\yrz " S2 S3\05      r{\{r| " S4 S5\05      r}\}r~ " S6 S7\
5      r " S8 S9\05      r\r " S: S;5      r " S< S=5      r " S> S?\05      r\r " S@ SA\05      r " SB SC\5      r " SD SE\05      r\r " SF SG\05      r " SH SI\5      r " SJ SK\05      r\r " SL SM5      r\r " SN SO\l\}\\\n\s\u\w\y\{5      r " SP SQ\m\~\\\o\t\v\x\z\|5      r " SR SS\e\\\h\\\\5
      r " ST SU\f\\\i\\\\5
      rg! \ a    Sr GNf = f)V    )annotationsNTF)Enum)TYPE_CHECKINGAnyAsyncIterator	AwaitableCallableDictIterableIteratorListLiteralMappingOptionalSequenceTupleUnionoverload)"record_streaming_lag_from_response)ConnectionError	DataErrorNoScriptError
RedisError).
AbsExpiryTACLGetUserData
ACLLogDataAnyKeyTAsyncClientProtocolBitfieldOffsetTBlockingListPopResponseBlockingZSetPopResponseChannelTClientTrackingInfoResponseCommandGetKeysAndFlagsResponseCommandsProtocol	ConsumerT
EncodableTExpiryTFieldTGeoCoordinateGeoRadiusResponseGeoSearchResponseGroupTHRandFieldResponseHScanResponseKeysTKeyTLCSCommandResponseListMultiPopResponseNumberPatternT	ResponseTScanResponseScriptTextTSortResponseStralgoResponse	StreamIdTStreamRangeResponseSyncClientProtocolTimeoutSecTXClaimResponseXPendingRangeResponseXReadGroupResponseXReadResponseZMPopResponseZRandMemberResponseZScanResponseZScoreBoundTZSetRangeResponse)deprecated_functionexperimental_argsexperimental_methodextract_expire_flagsstr_if_bytes   )PubSubDirection)record_pubsub_messager      )at_most_one_value_setlist_or_argsc                     \ rS rSrSr\ S/     S0S jj5       r\ S/     S1S jj5       r S/   S2S jjr\        S3S j5       r\        S4S j5       rS5S	 jr\S6S
 j5       r\      S7S j5       rS8S jr\ S/     S9S jj5       r	\ S/     S:S jj5       r	S/S;S jjr	\      S<S j5       r
\      S=S j5       r
    S>S jr
\S?S j5       r\    S@S j5       rSAS jr\S?S j5       r\    S@S j5       rSAS jr\ S/     SBS jj5       r\ S/     SCS jj5       r S/   SDS jjr\SES j5       r\SFS j5       rSGS jr\SES j5       r\SFS  j5       rSGS! jr\SES" j5       r\SFS# j5       rSGS$ jr\             SH                               SIS% jj5       r\             SH                               SJS& jj5       r             SH                             SKS' jjr\S?S( j5       r\    S@S) j5       rSAS* jr\SLS+ j5       r\SMS, j5       rSNS- jrS.rg)OACLCommandsn   zL
Redis Access Control List (ACL) commands.
see: https://redis.io/topics/acl
Nc                    g N selfcategorykwargss      N/home/edenadmin/noVNC/venv/lib/python3.13/site-packages/redis/commands/core.pyacl_catACLCommands.acl_catt             c                    g rW   rX   rY   s      r]   r^   r_   y        (+ra   c                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)rZ   r[   r\   piecess       r]   r^   r_   ~   s*     2:H:r##IAA&AAra   c                    g rW   rX   rZ   usernameargsr\   s       r]   
acl_dryrunACLCommands.acl_dryrun        ra   c                    g rW   rX   ri   s       r]   rl   rm           "%ra   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 DRYRUNre   ri   s       r]   rl   rm      s!     ##L(LTLVLLra   c                    g rW   rX   rZ   rj   r\   s      r]   acl_deluserACLCommands.acl_deluser       PSra   c                    g rW   rX   rs   s      r]   rt   ru           ra   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 DELUSERre   rs   s      r]   rt   ru      s     ##MGHGGGra   c                    g rW   rX   rZ   bitsr\   s      r]   acl_genpassACLCommands.acl_genpass   rn   ra   c                    g rW   rX   r{   s      r]   r}   r~      rp   ra   c                    / 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   rf   )rZ   r|   r\   rg   bs        r]   r}   r~      sz     Iq5AH$$a 
 ##MEFEfEE	  U s   .A A!c                    g rW   rX   rs   s      r]   acl_getuserACLCommands.acl_getuser   rx   ra   c                    g rW   rX   rs   s      r]   r   r           %(ra   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 GETUSERre   rs   s      r]   r   r      s     ##M8FvFFra   c                    g rW   rX   rZ   r\   s     r]   acl_helpACLCommands.acl_help       KNra   c                    g rW   rX   r   s     r]   r   r      rc   ra   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 HELPre   r   s     r]   r   r           ##9&99ra   c                    g rW   rX   r   s     r]   acl_listACLCommands.acl_list   r   ra   c                    g rW   rX   r   s     r]   r   r      rc   ra   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 LISTre   r   s     r]   r   r      r   ra   c                    g rW   rX   rZ   countr\   s      r]   acl_logACLCommands.acl_log       ra   c                    g rW   rX   r   s      r]   r   r          !$ra   c                    / 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)
isinstancer   r   r   rf   )rZ   r   r\   rk   s       r]   r   r     sO     eS)) BCCKK##I????ra   c                    g rW   rX   r   s     r]   acl_log_resetACLCommands.acl_log_reset"      CFra   c                    g rW   rX   r   s     r]   r   r   %      ORra   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   re   )rZ   r\   rk   s      r]   r   r   (  s&     z##I????ra   c                    g rW   rX   r   s     r]   acl_loadACLCommands.acl_load2      >Ara   c                    g rW   rX   r   s     r]   r   r   5      JMra   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 LOADre   r   s     r]   r   r   8       ##9&99ra   c                    g rW   rX   r   s     r]   acl_saveACLCommands.acl_saveC  r   ra   c                    g rW   rX   r   s     r]   r   r   F  r   ra   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 SAVEre   r   s     r]   r   r   I  r   ra   c                    g rW   rX   rZ   rj   enablednopass	passwordshashed_passwords
categoriescommandskeyschannels	selectorsreset
reset_keysreset_channelsreset_passwordsr\   s                   r]   acl_setuserACLCommands.acl_setuserT  s    $ ra   c                    g rW   rX   r   s                   r]   r   r   h  s    $ ra   c           	     	   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   >%srP   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_encoderr   r   rR   	enumerateencode
startswithdecoderf   )rZ   rj   r   r   r   r   r   r   r   r   r   r   r   r   r   r\   encoderrg   ipasswordhashed_passwordr[   cmdkeychannels                            r]   r   r   |  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Era   c                    g rW   rX   r   s     r]   	acl_usersACLCommands.acl_users;      LOra   c                    g rW   rX   r   s     r]   r   r   >  rc   ra   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 USERSre   r   s     r]   r   r   C  s    
 ##:6::ra   c                    g rW   rX   r   s     r]   
acl_whoamiACLCommands.acl_whoamiJ      GJra   c                    g rW   rX   r   s     r]   r   r   M      SVra   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 WHOAMIre   r   s     r]   r   r   P  s    
 ##;F;;ra   rX   rW   )rZ   r=   r[   
str | Nonereturnlist[bytes | str])rZ   r   r[   r   r   Awaitable[list[bytes | str]])r[   r   r   0list[bytes | str] | Awaitable[list[bytes | str]])rZ   r=   rj   strrk   r'   r   bytes | str)rZ   r   rj   r   rk   r'   r   Awaitable[bytes | str])rj   r   rk   r'   r   $bytes | str | Awaitable[bytes | str])rZ   r=   rj   r   r   r   )rZ   r   rj   r   r   Awaitable[int])rj   r   r   int | Awaitable[int])rZ   r=   r|   
int | Noner   r   )rZ   r   r|   r   r   r   )r|   r   r   r   )rZ   r=   rj   r   r   r   )rZ   r   rj   r   r   zAwaitable[ACLGetUserData])rj   r   r   z*ACLGetUserData | Awaitable[ACLGetUserData]rZ   r=   r   r   rZ   r   r   r   r   r   )rZ   r=   r   r   r   r   )rZ   r   r   r   r   zAwaitable[ACLLogData])r   r   r   z"ACLLogData | Awaitable[ACLLogData]rZ   r=   r   boolrZ   r   r   Awaitable[bool]r   bool | Awaitable[bool])FFNNNNNNNFFFF) rZ   r=   rj   r   r   r   r   r   r   str | Iterable[str] | Noner   r   r   Iterable[str] | Noner   r   r   Iterable[KeyT] | Noner   Iterable[ChannelT] | Noner   !Iterable[Tuple[str, KeyT]] | Noner   r   r   r   r   r   r   r   r   r   ) rZ   r   rj   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   )rj   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   rZ   r=   r   r   rZ   r   r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r   r^   rl   rt   r}   r   r   r   r   r   r   r   r   r   r   __static_attributes__rX   ra   r]   rT   rT   n   sF   
 9=   ,6 	    :>+!+-7+	%+ +
 &*B"B	9B  ,/8B	  %!%-0%9C%	% %M S S!.1	 H 59 (2	  6:%!%)3%	% %F*  ,/	  (!(-0(	"( (
G
G	3
G N N+!+	%+ +: N N+!+	%+ +: 6: )3	  7;$!$*4$	$ $
 #'@@	+@$ F FR R@ A AM M	: A AM M	:  047;+/)-&*.27; $ %   	
 . 5 ) ' $ , 5    " 
# &  047;+/)-&*.27; $ %!  	
 . 5 ) ' $ , 5    " 
# , 047;+/)-&*.27; $ %}F}F }F 	}F
 .}F 5}F )}F '}F $}F ,}F 5}F }F }F }F }F" 
 #}F~ O O+!+	%+ +; J JV V<ra   rT   c                      \ rS rSrSrSrSrg)HotkeysMetricsTypesi[  CPUNETrX   N)r  r  r  r  r  r  r
  rX   ra   r]   r  r  [  s    
C
Cra   r  c                  `   \ rS rSrSr\ S       SS jj5       r\ S       SS jj5       r S     SS jjr\SS j5       r\    SS j5       rSS	 jr\ S     SS jj5       r\ S     SS jj5       rSSS jjr\SS j5       r	\SS j5       r	SS jr	\SS j5       r
\      SS j5       r
SS jr
\       S                 SS jj5       r\       S                 SS jj5       r       S               SS jjr\SS j5       r\    SS j5       r  SS jr\S/ 4       SS jj5       r\S/ 4       SS jj5       rS/ 4     SS jjr\SS j5       r\    SS j5       rSS jr\SS  j5       r\SS! j5       rSS" jr\      SS# j5       r\      GS S$ j5       rGSS% jr\SS& j5       r\SS' j5       rSS( jr\S/ S)S)S)S)4               GSS* jj5       r\S/ S)S)S)S)4               GSS+ jj5       rS/ S)S)S)S)4             GSS, jjr\S/ S)S)S)S)4               GSS- jj5       r\S/ S)S)S)S)4               GSS. jj5       rS/ S)S)S)S)4             GSS/ jjr\S
S/ S)S)S)S)4                 GSS0 jj5       r\S
S/ S)S)S)S)4                 GSS1 jj5       rS
S/ S)S)S)S)4               GSS2 jjr\    GSS3 j5       r\    GS	S4 j5       r  GS
S5 jr\GSS6 j5       r\      GSS7 j5       rGSS8 jr\        GSS9 j5       r\        GSS: j5       rGSS; jr\ GS       GSS< jj5       r\ GS       GSS= jj5       r GS     GSS> jjr\ S       GSS? jj5       r\ S       GSS@ jj5       r S     GSSA jjr\GSSB j5       r\    GSSC j5       rGSSD jr\GSSE j5       r\      GSSF j5       rGSSG jr\GSSH j5       r\      GSSI j5       rGSSJ jr\GSSK j5       r\    GSSL j5       r  GS SM jrGS!SN jr\SSO j5       r\SSP j5       rSSQ jr\   GS"         GS#SR jj5       r \   GS"         GS$SS jj5       r    GS"       GS%ST jjr \      GS&SU j5       r!\      GS'SV j5       r!    GS(SW jr!SX r"\ GS)       GS*SY jj5       r#\ GS)       GS+SZ jj5       r# GS)     GS,S[ jjr#\          GS-S\ j5       r$\          GS.S] j5       r$        GS/S^ jr$\GS0S_ j5       r%\GS1S` j5       r%GS2Sa jr%\GSSb j5       r&\    GSSc j5       r&GSSd jr&\SSe j5       r'\SSf j5       r'SSg jr'\      GS3Sh j5       r(\      GS4Si j5       r(GS5Sj jr(GS!Sk jr)\GS6Sl j5       r*\      GS7Sm j5       r*GS8Sn jr*\ GS     GS9So jj5       r+\ GS     GS:Sp jj5       r+GSGS;Sq jjr+\ GS     GS9Sr jj5       r,\ GS     GS:Ss jj5       r,GSGS;St jjr,\GS<Su j5       r-\GS=Sv j5       r-GS>Sw jr-\GS?Sx j5       r.\        GS@Sy j5       r.GSASz jr.\GSBS{ j5       r/\        GSCS| j5       r/GSDS} jr/\GSES~ j5       r0\GSFS j5       r0GSGS jr0\ S       GSHS jj5       r1\ S       GSIS jj5       r1 S     GSJS jjr1\GSKS j5       r2\    GSLS j5       r2GSMS jr2S r3S r4\      GSNS j5       r5\      GSOS j5       r5GSPS jr5\GSS j5       r6\GSS j5       r6GSS jr6\   GSQ                   GSRS jj5       r7\   GSQ                   GSSS jj5       r7   GSQ                 GSTS jjr7\GSUS j5       r8\        GSVS j5       r8GSWS jr8GS!S jr9GS!S jr:\GSXS j5       r;\    GSYS j5       r;GSZS jr;\GSS j5       r<\    GSS j5       r<GSS jr<\ S       GS[S jj5       r=\ S       GS\S jj5       r=SGS]S jjr=\GS0S j5       r>\GS1S j5       r>GS2S jr>S r?\GS^S j5       r@\      GS_S j5       r@    GS`S jr@\GSaS j5       rA\    GSbS j5       rA  GScS jrA\GSdS j5       rB\GSeS j5       rBGSfS jrB\GS0S j5       rC\GS1S j5       rCGSgS jrC\GS0S j5       rD\GS1S j5       rDGS2S jrD\GSS j5       rE\    GSS j5       rEGSS jrE\GS0S j5       rF\GS1S j5       rFGS2S jrF     GSh           GSiS jjrG\  GSj       GSkS jj5       rH\  GSj       GSlS jj5       rH GSj     GSmS jjrH\ S     GSnS jj5       rI\ S     GSoS jj5       rI S   GSpS jjrI\SS j5       rJ\SS j5       rJSS jrJ\GS0S j5       rK\GS1S j5       rKGS2S jrK\GSqS j5       rL\GSrS j5       rLGSsS jrL\        GStS j5       rM\        GSuS j5       rMGSvS jrM\          GSwS j5       rN\          GSxS j5       rN        GSyS jrNS rOS rP\    GSz             GS{S jj5       rQ\    GSz             GS|S jj5       rQ    GSz           GS}S jjrQ\GSS j5       rR\GSS j5       rRGSS jrR\GSS j5       rS\    GSS j5       rSGSS jrS\    GS~S j5       rT\    GSS j5       rT  GSS jrTSrUg(  ManagementCommandsi`  z
Redis management commands
Nc                    g rW   rX   rZ   r   rj   r\   s       r]   authManagementCommands.authe       ra   c                    g rW   rX   r  s       r]   r  r  m       ra   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r   rf   )rZ   r   rj   r\   rg   s        r]   r  r  u  sB     MM(#h##F>V>v>>ra   c                    g rW   rX   r   s     r]   bgrewriteaofManagementCommands.bgrewriteaof  rv   ra   c                    g rW   rX   r   s     r]   r  r         ),ra   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
)BGREWRITEAOFre   r   s     r]   r  r         ##=f==ra   Tc                    g rW   rX   rZ   scheduler\   s      r]   bgsaveManagementCommands.bgsave       !ra   c                    g rW   rX   r$  s      r]   r&  r'    r  ra   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  )rZ   r%  r\   rg   s       r]   r&  r'    s3     MM*%##H@v@@@ra   c                    g rW   rX   rZ   s    r]   roleManagementCommands.role  s    58ra   c                    g rW   rX   r.  s    r]   r/  r0    s    ADra   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
ROLEre   r.  s    r]   r/  r0    s     ##F++ra   c                    g rW   rX   rZ   addressr\   s      r]   client_killManagementCommands.client_kill      UXra   c                    g rW   rX   r5  s      r]   r7  r8    r   ra   c                *    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 KILLre   r5  s      r]   r7  r8    s     ##M7EfEEra   c                    g rW   rX   	rZ   _id_typeaddrskipmeladdrusermaxager\   s	            r]   client_kill_filter%ManagementCommands.client_kill_filter  s     ra   c                    g rW   rX   r>  s	            r]   rF  rG    s     ra   c                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)rO     NO   IDs   ADDRs   LADDRs   USERs   MAXAGEzVCLIENT KILL <filter> <value> ... ... <filter> <value> must specify at least one filterr<  )r   lowerr   extendr   r   rf   )rZ   r?  r@  rA  rB  rC  rD  rE  r\   rk   client_typess              r]   rF  rG    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Cra   c                    g rW   rX   r   s     r]   client_infoManagementCommands.client_info      QTra   c                    g rW   rX   r   s     r]   rV  rW  !       +.ra   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 INFOre   r   s     r]   rV  rW  &  s     ##<V<<ra   c                    g rW   rX   rZ   r@  	client_idr\   s       r]   client_listManagementCommands.client_list1  s      #ra   c                    g rW   rX   r]  s       r]   r_  r`  9  s     +.ra   c                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
)rJ  rK  replicarM  z!CLIENT LIST _type must be one of rN  zclient_id must be a listrQ  zCLIENT LIST)r   rR  r   r   r   listrf   )rZ   r@  r^  r\   rk   rT  s         r]   r_  r`  A  s     DL5z!5"CLCS TUUKK KK)T**677KKD##MCDCFCCra   c                    g rW   rX   r   s     r]   client_getname!ManagementCommands.client_getname\      RUra   c                    g rW   rX   r   s     r]   rf  rg  _  r  ra   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 GETNAMEre   r   s     r]   rf  rg  d  s     ##???ra   c                    g rW   rX   r   s     r]   client_getredir"ManagementCommands.client_getredirn      DGra   c                    g rW   rX   r   s     r]   rl  rm  q  rv   ra   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 GETREDIRre   r   s     r]   rl  rm  t  s     ##@@@ra   c                    g rW   rX   rZ   replyr\   s      r]   client_replyManagementCommands.client_reply}  s    
 ra   c                    g rW   rX   rr  s      r]   rt  ru    s    
 "%ra   c                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
)ONOFFSKIPzCLIENT REPLY must be one of zCLIENT REPLYr   rf   )rZ   rs  r\   repliess       r]   rt  ru    s:    & (:7+FGG##NEDVDDra   c                    g rW   rX   r   s     r]   r^  ManagementCommands.client_id  r   ra   c                    g rW   rX   r   s     r]   r^  r~    r   ra   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 IDre   r   s     r]   r^  r~         ##:6::ra   Fc                    g rW   rX   rZ   clientidprefixbcastoptinoptoutnoloops          r]   client_tracking_on%ManagementCommands.client_tracking_on       ra   c                    g rW   rX   r  s          r]   r  r         "%ra   c           	     *    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_trackingr  s          r]   r  r    s      ##(E&
 	
ra   c                    g rW   rX   r  s          r]   client_tracking_off&ManagementCommands.client_tracking_off  r  ra   c                    g rW   rX   r  s          r]   r  r    r  ra   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]   r  r    s      ##8U6
 	
ra   c                    g rW   rX   	rZ   onr  r  r  r  r  r  r\   s	            r]   r  "ManagementCommands.client_tracking  s     ra   c                    g rW   rX   r  s	            r]   r  r    s     "%ra   c                   [        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0 UD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 bcastrx  ry  REDIRECTPREFIXBCASTOPTINOPTOUTNOLOOPzCLIENT TRACKING)lenr   rS  r   rf   )rZ   r  r  r  r  r  r  r  r\   rg   ps              r]   r  r    s    R v;!@AA$E7MM:x01AMM8Q-( MM'"MM'"MM(#MM(###$5II&IIra   c                    g rW   rX   r   s     r]   client_trackinginfo&ManagementCommands.client_trackinginfoY       &)ra   c                    g rW   rX   r   s     r]   r  r  ^       14ra   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 TRACKINGINFOre   r   s     r]   r  r  c  s     ##DVDDra   c                    g rW   rX   rZ   namer\   s      r]   client_setname!ManagementCommands.client_setnamen  r   ra   c                    g rW   rX   r  s      r]   r  r  q       ra   c                *    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 SETNAMEre   r  s      r]   r  r  v  s     ##$4dEfEEra   c                    g rW   rX   rZ   attrvaluer\   s       r]   client_setinfo!ManagementCommands.client_setinfo       ra   c                    g rW   rX   r  s       r]   r  r    r  ra   c                *    U R                   " SX40 UD6$ )zw
Sets the current connection library name or version
For more information see https://redis.io/commands/client-setinfo
zCLIENT SETINFOre   r  s       r]   r  r    s    
 ##$4dLVLLra   c                    g rW   rX   rZ   r^  errorr\   s       r]   client_unblock!ManagementCommands.client_unblock  r  ra   c                    g rW   rX   r  s       r]   r  r    r  ra   c                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)r   r   rf   )rZ   r^  r  r\   rk   s        r]   r  r    s7     !#i.1KK!##T4V44ra   c                    g rW   rX   rZ   timeoutallr\   s       r]   client_pauseManagementCommands.client_pause  r  ra   c                    g rW   rX   r  s       r]   r  r    r  ra   c                    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   r   r   r   rf   )rZ   r  r  r\   rk   s        r]   r  r    sP    . G-'3''EFFKK ##T4V44ra   c                    g rW   rX   r   s     r]   client_unpause!ManagementCommands.client_unpause  r   ra   c                    g rW   rX   r   s     r]   r  r    rp   ra   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 UNPAUSEre   r   s     r]   r  r         ##???ra   c                    g rW   rX   rZ   modes     r]   client_no_evict"ManagementCommands.client_no_evict      MPra   c                    g rW   rX   r  s     r]   r  r    rp   ra   c                &    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-EVICTre   r  s     r]   r  r    s     ##$5t<<ra   c                    g rW   rX   r  s     r]   client_no_touch"ManagementCommands.client_no_touch  r  ra   c                    g rW   rX   r  s     r]   r  r    rp   ra   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-TOUCHre   r  s     r]   r  r    s     ##$5t<<ra   c                    g rW   rX   r   s     r]   commandManagementCommands.command
  rh  ra   c                    g rW   rX   r   s     r]   r  r         03ra   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
)COMMANDre   r   s     r]   r  r    s     ##888ra   c                    [        S5      eNz<COMMAND INFO is intentionally not implemented in the client.NotImplementedErrorr   s     r]   command_infoManagementCommands.command_info      !J
 	
ra   c                    g rW   rX   r   s     r]   command_count ManagementCommands.command_count!      BEra   c                    g rW   rX   r   s     r]   r  r  $      NQra   c                &    U R                   " S0 UD6$ )N)COMMAND COUNTre   r   s     r]   r  r  '  s    ##>v>>ra   c                    g rW   rX   rZ   moduler[   patterns       r]   command_listManagementCommands.command_list*        ra   c                    g rW   rX   r  s       r]   r  r  2       (+ra   c                    / 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)rS  insertrf   )rZ   r  r[   r  rg   s        r]   r  r  :  su     MM8V,-MM8X./MM9g./MM!Z(##N<V<<ra   c                    g rW   rX   rZ   rk   s     r]   command_getkeysandflags*ManagementCommands.command_getkeysandflagsV       *-ra   c                    g rW   rX   r  s     r]   r  r  [       58ra   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 GETKEYSANDFLAGSre   r  s     r]   r  r  `  s     ##$=EEEra   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_docsj  s    
 "J
 	
ra   c                    g rW   rX   rZ   r  rk   r\   s       r]   
config_getManagementCommands.config_gets  rc   ra   c                    g rW   rX   r  s       r]   r  r  x       36ra   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 GETre   r  s       r]   r  r  }  s!     ##L'KDKFKKra   c                    g rW   rX   rZ   r  r  rk   r\   s        r]   
config_setManagementCommands.config_set       ra   c                    g rW   rX   r  s        r]   r  r         ra   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 SETre   r  s        r]   r  r    s!     ##L$OOOOra   c                    g rW   rX   r   s     r]   config_resetstat#ManagementCommands.config_resetstat      FIra   c                    g rW   rX   r   s     r]   r!  r"    rh  ra   c                &    U R                   " S0 UD6$ )z`
Reset runtime statistics

For more information, see https://redis.io/commands/config-resetstat
)zCONFIG RESETSTATre   r   s     r]   r!  r"    s     ##A&AAra   c                    g rW   rX   r   s     r]   config_rewrite!ManagementCommands.config_rewrite  r   ra   c                    g rW   rX   r   s     r]   r'  r(    rp   ra   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 REWRITEre   r   s     r]   r'  r(    r  ra   c                    g rW   rX   r   s     r]   dbsizeManagementCommands.dbsize      ;>ra   c                    g rW   rX   r   s     r]   r,  r-    r   ra   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
)DBSIZEre   r   s     r]   r,  r-    s     ##777ra   c                    g rW   rX   rZ   r   r\   s      r]   debug_objectManagementCommands.debug_object       .1ra   c                    g rW   rX   r3  s      r]   r4  r5    s     9<ra   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 OBJECTre   r3  s      r]   r4  r5    s     ##NCB6BBra   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  r   s     r]   debug_segfault!ManagementCommands.debug_segfault      !
 	
ra   c                    g rW   rX   rZ   r  r\   s      r]   echoManagementCommands.echo      TWra   c                    g rW   rX   r>  s      r]   r?  r@    rp   ra   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
ECHOre   r>  s      r]   r?  r@    s     ##FE<V<<ra   c                    g rW   rX   rZ   asynchronousr\   s      r]   flushallManagementCommands.flushall  r  ra   c                    g rW   rX   rF  s      r]   rH  rI    r  ra   c                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  rZ   rG  r\   rk   s       r]   rH  rI    s3     KK!##J@@@@ra   c                    g rW   rX   rF  s      r]   flushdbManagementCommands.flushdb  r  ra   c                    g rW   rX   rF  s      r]   rP  rQ    r  ra   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
rL  FLUSHDBr  rN  s       r]   rP  rQ  #  s3     KK!##I????ra   c                    g rW   rX   r.  s    r]   syncManagementCommands.sync1  s    14ra   c                    g rW   rX   r.  s    r]   rV  rW  4      =@ra   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.clientr\  rf   rZ   r\  optionss      r]   rV  rW  7  s(     	. "##6g66ra   c                    g rW   rX   rZ   replicationidoffsets      r]   psyncManagementCommands.psyncC  r   ra   c                    g rW   rX   rd  s      r]   rg  rh  F       ra   c                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   r[  PSYNCr_  )rZ   re  rf  r\  rb  s        r]   rg  rh  K  s,     	. "##G]NgNNra   c                    g rW   rX   rZ   firstsecondr\   s       r]   swapdbManagementCommands.swapdbX  r9  ra   c                    g rW   rX   rn  s       r]   rq  rr  [  r  ra   c                *    U R                   " SX40 UD6$ )zP
Swap two databases

For more information, see https://redis.io/commands/swapdb
SWAPDBre   rn  s       r]   rq  rr  `  s     ##HeFvFFra   c                    g rW   rX   rZ   indexr\   s      r]   selectManagementCommands.selecth      HKra   c                    g rW   rX   rw  s      r]   ry  rz  k  rA  ra   c                *    U R                   " SU40 UD6$ )zSSelect the Redis logical database at index.

See: https://redis.io/commands/select
SELECTre   rw  s      r]   ry  rz  n  s    
 ##He>v>>ra   c                    g rW   rX   rZ   sectionrk   r\   s       r]   infoManagementCommands.infou       ra   c                    g rW   rX   r  s       r]   r  r  }  s     %(ra   c                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  re   r  s       r]   r  r    s:     ?''9&99''I$I&IIra   c                    g rW   rX   r   s     r]   lastsaveManagementCommands.lastsave  r   ra   c                    g rW   rX   r   s     r]   r  r    rc   ra   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
)LASTSAVEre   r   s     r]   r  r    s     ##9&99ra   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       "
 	
ra   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  ra   c                    g rW   rX   rZ   version_numbersr\   s      r]   lolwutManagementCommands.lolwut  rn   ra   c                    g rW   rX   r  s      r]   r  r    rp   ra   c                `    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)LOLWUTre   r  s      r]   r  r    s7     ''(8U?UfUU'';F;;ra   c                    g rW   rX   r.  s    r]   r   ManagementCommands.reset      8;ra   c                    g rW   rX   r.  s    r]   r   r    rn  ra   c                $    U R                  S5      $ )zdPerform a full reset on the connection's server-side context.

See: https://redis.io/commands/reset
RESETre   r.  s    r]   r   r    s    
 ##G,,ra   c	                    g rW   rX   
rZ   hostportr   destination_dbr  copyreplacer  r\   s
             r]   migrateManagementCommands.migrate  s     ra   c	                    g rW   rX   r  s
             r]   r  r    s     "%ra   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 )rR   r   r   rS  rf   )rZ   r  r  r   r  r  r  r  r  r\   rg   s              r]   r  r    s    > D"%?@@MM'"MM*%MM'"MM$gd##t2~
AG
KQ
 	
ra   c                    g rW   rX   rZ   infotyper   r\   s       r]   objectManagementCommands.object5  r9  ra   c                    g rW   rX   r  s       r]   r  r  8  rx   ra   c                .    U R                   " SX4SU0UD6$ )z:
Return the encoding, idletime, or refcount about the key
OBJECTr  re   r  s       r]   r  r  =  s,     ##h
.6
:@
 	
ra   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  r   s     r]   memory_doctor ManagementCommands.memory_doctorE  r<  ra   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  r   s     r]   memory_helpManagementCommands.memory_helpN  r<  ra   c                    g rW   rX   r   s     r]   memory_statsManagementCommands.memory_statsW  r   ra   c                    g rW   rX   r   s     r]   r  r  Z  r   ra   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 STATSre   r   s     r]   r  r  _       ##=f==ra   c                    g rW   rX   r   s     r]   memory_malloc_stats&ManagementCommands.memory_malloc_statsg  rv   ra   c                    g rW   rX   r   s     r]   r  r  j  rp   ra   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-STATSre   r   s     r]   r  r  o  s     ##DVDDra   c                    g rW   rX   rZ   r   samplesr\   s       r]   memory_usageManagementCommands.memory_usagew  r   ra   c                    g rW   rX   r  s       r]   r  r  |  r   ra   c                    / 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   r   rS  rf   )rZ   r   r  r\   rk   s        r]   r  r    sD     gs##KKW-.##NCI$I&IIra   c                    g rW   rX   r   s     r]   memory_purgeManagementCommands.memory_purge  r  ra   c                    g rW   rX   r   s     r]   r  r    r  ra   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 PURGEre   r   s     r]   r  r    r  ra   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
 	
ra   c                    g rW   rX   rZ   events     r]   latency_history"ManagementCommands.latency_history  rh  ra   c                    g rW   rX   r  s     r]   r  r    r  ra   c                &    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 HISTORYre   r  s     r]   r  r    s     ##$5u==ra   c                    g rW   rX   r.  s    r]   latency_latest!ManagementCommands.latency_latest  r   ra   c                    g rW   rX   r.  s    r]   r  r         47ra   c                $    U R                  S5      $ )zo
Reports the latest latency events logged.

For more information, see https://redis.io/commands/latency-latest
zLATENCY LATESTre   r.  s    r]   r  r    s     ##$455ra   c                    g rW   rX   rZ   eventss     r]   latency_reset ManagementCommands.latency_reset  r#  ra   c                    g rW   rX   r  s     r]   r  r    rh  ra   c                (    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 RESETre   r  s     r]   r  r    s     ##O=f==ra   c                    g rW   rX   r   s     r]   pingManagementCommands.ping      :=ra   c                    g rW   rX   r   s     r]   r  r    r#  ra   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
)PINGre   r   s     r]   r  r    s     ##5f55ra   c                    g rW   rX   r   s     r]   quitManagementCommands.quit  r  ra   c                    g rW   rX   r   s     r]   r  r    r#  ra   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
)QUITre   r   s     r]   r  r    s     ##5f55ra   c                    g rW   rX   rZ   rk   r\   s      r]   	replicaofManagementCommands.replicaof  r  ra   c                    g rW   rX   r  s      r]   r  r    rp   ra   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
	REPLICAOFre   r  s      r]   r  r    s     ##KA$A&AAra   c                    g rW   rX   r   s     r]   saveManagementCommands.save  r  ra   c                    g rW   rX   r   s     r]   r  r    r#  ra   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
)SAVEre   r   s     r]   r  r         ##5f55ra   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  [	        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   r   rf   r   r   rZ   r  nosavenowr   abortr\   rk   s           r]   shutdownManagementCommands.shutdown#  s    , FIJJ|KKKK!KKKK KK 	  $1&1 9::  		s   B3 3
C ?C c                    g rW   rX   rZ   r  r  r\   s       r]   slaveofManagementCommands.slaveofM  r  ra   c                    g rW   rX   r  s       r]   r  r  U  r  ra   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
)SLAVEOFrP  s   ONEr  re   r  s       r]   r  r  ]  s9     <DL''KFKK##ItDVDDra   c                    g rW   rX   rZ   numr\   s      r]   slowlog_getManagementCommands.slowlog_getk        #ra   c                    g rW   rX   r  s      r]   r   r!  p  rZ  ra   c                    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   r[  zSLOWLOG GETdecode_responsesFT)r`  r\  r   get_connection_kwargsgetrf   )rZ   r  r\   r\  rk   r%  s         r]   r   r!  u  sc     	.?KK557;;<NPUVt##%F ##T4V44ra   c                    g rW   rX   r   s     r]   slowlog_lenManagementCommands.slowlog_len      @Cra   c                    g rW   rX   r   s     r]   r)  r*    r   ra   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 LENre   r   s     r]   r)  r*    s     ##<V<<ra   c                    g rW   rX   r   s     r]   slowlog_reset ManagementCommands.slowlog_reset  r   ra   c                    g rW   rX   r   s     r]   r/  r0    r   ra   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 RESETre   r   s     r]   r/  r0         ##>v>>ra   c                    g rW   rX   r   s     r]   timeManagementCommands.time      EHra   c                    g rW   rX   r   s     r]   r5  r6    rX  ra   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
)TIMEre   r   s     r]   r5  r6    r  ra   c                    g rW   rX   rZ   num_replicasr  r\   s       r]   waitManagementCommands.wait       ra   c                    g rW   rX   r<  s       r]   r>  r?    rx   ra   c                *    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
WAITre   r<  s       r]   r>  r?    s     ##FLLVLLra   c                    g rW   rX   rZ   	num_localr=  r  r\   s        r]   waitaofManagementCommands.waitaof       ra   c                    g rW   rX   rE  s        r]   rG  rH          #ra   c                ,    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
WAITAOFre   rE  s        r]   rG  rH    s&     ##y
;A
 	
ra   c                    [        S5      e)r  z5HELLO is intentionally not implemented in the client.r  r.  s    r]   helloManagementCommands.hello  s    
 "C
 	
ra   c                    [        S5      e)r  z8FAILOVER is intentionally not implemented in the client.r  r.  s    r]   failoverManagementCommands.failover  s    
 "F
 	
ra   c                    g rW   rX   rZ   metricsr   durationsample_ratioslotsr\   s          r]   hotkeys_start ManagementCommands.hotkeys_start  r  ra   c                    g rW   rX   rU  s          r]   rZ  r[  	  r  ra   c                   SS/nUR                  S[        U5      /5        UR                  U Vs/ s H  n[        UR                  5      PM     sn5        Ub  UR                  SU/5        Ub  UR                  SU/5        Ub  UR                  SU/5        Ub<  UR	                  S5        UR	                  [        U5      5        UR                  U5        U R
                  " U0 UD6$ s  snf )a@  
Start collecting hotkeys data.
Returns an error if there is an ongoing collection session.

Args:
    count: The number of keys to collect in each criteria (CPU and network consumption)
    metrics: List of metrics to track. Supported values: [HotkeysMetricsTypes.CPU, HotkeysMetricsTypes.NET]
    duration: Automatically stop the collection after `duration` seconds
    sample_ratio: Commands are sampled with probability 1/ratio (1 means no sampling)
    slots: Only track keys on the specified hash slots

For more information, see https://redis.io/commands/hotkeys-start
HOTKEYSSTARTMETRICSCOUNTDURATIONSAMPLESLOTS)rS  r  r   r  r   rf   )	rZ   rV  r   rW  rX  rY  r\   rk   ms	            r]   rZ  r[  	  s    , (1'&: 	YG-.737aS\734 KK%() KKX./ #KK<01 KK KKE
#KK##T4V44) 4s   C)c                    g rW   rX   r   s     r]   hotkeys_stopManagementCommands.hotkeys_stopA	      ILra   c                    g rW   rX   r   s     r]   rg  rh  D	  r9  ra   c                &    U R                   " S0 UD6$ )z
Stop the ongoing hotkeys collection session (if any).
The results of the last collection session are kept for consumption with HOTKEYS GET.

For more information, see https://redis.io/commands/hotkeys-stop
)zHOTKEYS STOPre   r   s     r]   rg  rh  G	  r"  ra   c                    g rW   rX   r   s     r]   hotkeys_reset ManagementCommands.hotkeys_resetP	  r   ra   c                    g rW   rX   r   s     r]   rm  rn  S	  rp   ra   c                &    U R                   " S0 UD6$ )z
Discard the last hotkeys collection session results (in order to save memory).
Error if there is an ongoing collection session.

For more information, see https://redis.io/commands/hotkeys-reset
)zHOTKEYS RESETre   r   s     r]   rm  rn  X	  s     ##>v>>ra   c                    g rW   rX   r   s     r]   hotkeys_getManagementCommands.hotkeys_geta	  rc   ra   c                    g rW   rX   r   s     r]   rr  rs  f	  r  ra   c                &    U R                   " S0 UD6$ )al  
Retrieve the result of the ongoing collection session (if any),
or the last collection session (if any).

HOTKEYS GET response is wrapped in an array for aggregation support.
Each node returns a single-element array, allowing multiple node
responses to be concatenated by DMC or other aggregators.

For more information, see https://redis.io/commands/hotkeys-get
)zHOTKEYS GETre   r   s     r]   rr  rs  k	  s      ##<V<<ra   rX   rW   )rZ   r=   r   r   rj   r   r   r   )rZ   r   r   r   rj   r   r   r   )r   r   rj   r   r   r   )rZ   r=   r   bool | bytes | str)rZ   r   r   Awaitable[bool | bytes | str])r   2bool | bytes | str | Awaitable[bool | bytes | str])T)rZ   r=   r%  r   r   rv  )rZ   r   r%  r   r   rw  )r%  r   r   rx  )rZ   r=   r   	list[Any])rZ   r   r   Awaitable[list[Any]])r    list[Any] | Awaitable[list[Any]])rZ   r=   r6  r   r   z
bool | int)rZ   r   r6  r   r   zAwaitable[bool | int])r6  r   r   z"bool | int | Awaitable[bool | int])NNNNNNN)rZ   r=   r?  r   r@  r   rA  r   rB  bool | NonerC  r|  rD  r   rE  r   r   r   )rZ   r   r?  r   r@  r   rA  r   rB  r|  rC  r|  rD  r   rE  r   r   r   )r?  r   r@  r   rA  r   rB  r|  rC  r|  rD  r   rE  r   r   r   )rZ   r=   r   zdict[str, str | int])rZ   r   r   zAwaitable[dict[str, str | int]])r   z6dict[str, str | int] | Awaitable[dict[str, str | int]])rZ   r=   r@  r   r^  List[EncodableT]r   zlist[dict[str, str]])rZ   r   r@  r   r^  r}  r   zAwaitable[list[dict[str, str]]])r@  r   r^  r}  r   z6list[dict[str, str]] | Awaitable[list[dict[str, str]]]rZ   r=   r   bytes | str | NonerZ   r   r   Awaitable[bytes | str | None]r   2bytes | str | None | Awaitable[bytes | str | None]rZ   r=   r   r   rZ   r   r   r   r   r   )rZ   r=   rs  Literal['ON', 'OFF', 'SKIP']r   r   )rZ   r   rs  r  r   r   )rs  r  r   r   )rZ   r=   r  r   r  Sequence[KeyT]r  r   r  r   r  r   r  r   r   r   )rZ   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   )rZ   r=   r  r   r  r   r  r  r  r   r  r   r  r   r  r   r   r   )rZ   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   )rZ   r=   r   r#   )rZ   r   r   z%Awaitable[ClientTrackingInfoResponse])r   zBClientTrackingInfoResponse | Awaitable[ClientTrackingInfoResponse])rZ   r=   r  r   r   r   )rZ   r   r  r   r   r   )r  r   r   r   )rZ   r=   r  r   r  r   r   r   )rZ   r   r  r   r  r   r   r   )r  r   r  r   r   r   F)rZ   r=   r^  r   r  r   r   r   )rZ   r   r^  r   r  r   r   r   )r^  r   r  r   r   r   )rZ   r=   r  r   r  r   r   r   )rZ   r   r  r   r  r   r   r   )r  r   r  r   r   r   r  r  r  )rZ   r=   r  r   r   r   )rZ   r   r  r   r   r   )r  r   r   r   rZ   r=   r   zdict[str, dict[str, Any]]rZ   r   r   z$Awaitable[dict[str, dict[str, Any]]]r   z@dict[str, dict[str, Any]] | Awaitable[dict[str, dict[str, Any]]]r   NoneNNN)
rZ   r=   r  r   r[   r   r  r   r   r   )
rZ   r   r  r   r[   r   r  r   r   r   )r  r   r[   r   r  r   r   r   )rZ   r=   rk   r   r   r$   )rZ   r   rk   r   r   z)Awaitable[CommandGetKeysAndFlagsResponse])rk   r   r   zJCommandGetKeysAndFlagsResponse | Awaitable[CommandGetKeysAndFlagsResponse]*)rZ   r=   r  r5   rk   r5   r   zdict[str | None, str | None])rZ   r   r  r5   rk   r5   r   z'Awaitable[dict[str | None, str | None]])r  r5   rk   r5   r   zFdict[str | None, str | None] | Awaitable[dict[str | None, str | None]])
rZ   r=   r  r1   r  r'   rk   Union[KeyT, EncodableT]r   r   )
rZ   r   r  r1   r  r'   rk   r  r   r   )r  r1   r  r'   rk   r  r   r   r   r   r   )rZ   r=   r   r1   r   z"dict[str, str | int] | bytes | str)rZ   r   r   r1   r   z-Awaitable[dict[str, str | int] | bytes | str])r   r1   r   zRdict[str, str | int] | bytes | str | Awaitable[dict[str, str | int] | bytes | str])rZ   r=   r  r'   r   r   )rZ   r   r  r'   r   r   )r  r'   r   r   )rZ   r=   rG  r   r   r   )rZ   r   rG  r   r   r   )rG  r   r   r   rZ   r=   r   bytesrZ   r   r   Awaitable[bytes]r   bytes | Awaitable[bytes])rZ   r=   re  r   rf  r   r   r  )rZ   r   re  r   rf  r   r   r  )re  r   rf  r   r   r  )rZ   r=   ro  r   rp  r   r   r   )rZ   r   ro  r   rp  r   r   r   )ro  r   rp  r   r   r   )rZ   r=   rx  r   r   r   )rZ   r   rx  r   r   r   )rx  r   r   r   )rZ   r=   r  Optional[str]rk   r   r   dict[str, Any])rZ   r   r  r  rk   r   r   Awaitable[dict[str, Any]])r  r  rk   r   r   *dict[str, Any] | Awaitable[dict[str, Any]])rZ   r=   r   zdatetime.datetime)rZ   r   r   zAwaitable[datetime.datetime])r   z0datetime.datetime | Awaitable[datetime.datetime])rZ   r=   r  Union[str, float]r   r   )rZ   r   r  r  r   r   )r  r  r   r   )FFN)rZ   r=   r  r   r  r   r   r0   r  r   r  r   r  r   r  r   r  r   r   r   )rZ   r   r  r   r  r   r   r0   r  r   r  r   r  r   r  r   r  r   r   r   )r  r   r  r   r   r0   r  r   r  r   r  r   r  r   r  r   r   r   )rZ   r=   r  r   r   r1   r   r   )rZ   r   r  r   r   r1   r   Awaitable[Any])r  r   r   r1   r   Any | Awaitable[Any])rZ   r=   r   r  )rZ   r   r   r  )r   r  )rZ   r=   r   r1   r  r   r   r   )rZ   r   r   r1   r  r   r   Awaitable[int | None])r   r1   r  r   r   "int | None | Awaitable[int | None])rZ   r=   r  r   r   zlist[list[int]])rZ   r   r  r   r   zAwaitable[list[list[int]]])r  r   r   z,list[list[int]] | Awaitable[list[list[int]]])rZ   r=   r   zlist[list[bytes | str | int]])rZ   r   r   z(Awaitable[list[list[bytes | str | int]]])r   zHlist[list[bytes | str | int]] | Awaitable[list[list[bytes | str | int]]])rZ   r=   r  r   r   r   )rZ   r   r  r   r   r   )r  r   r   r   )r   zUnion[Awaitable[bool], bool]FFFFFr  r   r  r   r  r   r   r   r  r   r   r  NN)rZ   r=   r  r   r  r   r   r   )rZ   r   r  r   r  r   r   r   )r  r   r  r   r   r   )rZ   r=   r  r   r   list[dict[str, Any]])rZ   r   r  r   r   Awaitable[list[dict[str, Any]]])r  r   r   6list[dict[str, Any]] | Awaitable[list[dict[str, Any]]])rZ   r=   r   tuple[int, int])rZ   r   r   zAwaitable[tuple[int, int]])r   z,tuple[int, int] | Awaitable[tuple[int, int]])rZ   r=   r=  r   r  r   r   r   )rZ   r   r=  r   r  r   r   r   )r=  r   r  r   r   r   )
rZ   r=   rF  r   r=  r   r  r   r   	list[int])
rZ   r   rF  r   r=  r   r  r   r   Awaitable[list[int]])rF  r   r=  r   r  r   r    list[int] | Awaitable[list[int]]NNNN)rZ   r=   rV  List[HotkeysMetricsTypes]r   r   rW  r   rX  r   rY  List[int] | Noner   r   )rZ   r   rV  r  r   r   rW  r   rX  r   rY  r  r   r   )rV  r  r   r   rW  r   rX  r   rY  r  r   r   )rZ   r=   r   zlist[dict[str | bytes, Any]])rZ   r   r   z'Awaitable[list[dict[str | bytes, Any]]])r   zLUnion[Awaitable[list[dict[str | bytes, Any]]], list[dict[str | bytes, Any]]])Vr  r  r  r  r	  r   r  r  r&  r/  r7  rF  rV  r_  rf  rl  rt  r^  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r'  r,  r4  r:  r?  rH  rP  rV  rg  rq  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/  r5  r>  rG  rO  rR  rZ  rg  rm  rr  r
  rX   ra   r]   r  r  `  s      $  
 
    $! 
 
  59??'1?	? S S,!,	&, ,> 37! !,0!	! ! 48,!,-1,	&, ,A 8 8D D, X X$!$,/$	$ $F   "!!
 

 
 	

 
 
 
 
 

 
   "!!
!

 
 	

 
 
 
 
 

 
  "!!4D4D 4D 	4D
 4D 4D 4D 4D 
4Dl T T.!.	(. .	=	?	=  !&(# ## $#
 
# #  !&(.!.. $.
 
). . #'bDD3CD	?D6 U U,!,	&, ,@ G GS SA  + 
	  %!%+% 
 	% %E0 A AM M;   $!#   	
    
    $!#%!%% % 	%
 % % % 
 % %  $!#

 
 	

 
 
 
 
0
&   $!#   	
    
    $!#%!%% % 	%
 % % % 
 % %  $!#

 
 	

 
 
 
 
0
&  #!#
 

 
 	

 
 
 
 
 

 
  #!#
%!
%
% 
% 	
%
 
% 
% 
% 
% 
 
% 
% #!#:J:J :J 	:J
 :J :J :J :J 
0:Jx ) )	#) ) 4!4	.4 4	E	K	E R R!),	 F  (+47	  !),58	 M @E -09=	  AF!.1:>	 
 -255%)5	5  <@ +.59	  =A!,/6:	 
 )-55!%5	5< N N%!%	% %@ P P%!%),%	% %= P P%!%),%	% %	= U U3!3	-3 39	I9

 E EQ Q?  "#"	       	 
 
     "#"	+!++ + 	+
 
&+ + "#"	== = 	=
 
:=8 - -),-	'- - 8!8*-8	28 8FF	SF
 69+ ++3+BJ+	%+ + 7:6!6,46CK6	06 6
 #&LL.6L	OL    '	 
  !  '	 
 PP P '	P 
 P I IU UB N N%!%	% %@ > >J J8 1 1'+1	+1 1 <!<(,<	6< <C
 W W%!%*4%	% %= 7< 04	  8=!15	 A A 7< 04	  8=!15	 @ @ 4 4@ @
7 V V!25?B	 O X X!*-7:	 G K KW W?  "&  
 
   "&(!(( (
 
#( ( (,J$J47J	3J& N N+!+	%+ +:

  4E	  %!%5F%	% %< ; ;G G-     	
      
   %!%% % 	%
 % % % % % 
 % %( .
.
 .
 	.

 .
 .
 .
 .
 .
 
0.
` X X!-07;	 


 O O(!(	"( (> S S%!%	% %E CG '+6@	  DH$!$(,$7A$	$ $J$ E EQ Q>
 U U)!)*-)	#) )>>	5> V V7!7	17 76	Q6 I IU U> = =I I6 = =I I6 P P%!%	% %B = =I I6 (;(; (; 	(;
 (; (; 
(;T     
 
    ! 
 
  ;?EE-7E	E 48# #'1#	# # 59.!.(2.	(. .
 !%55	?5& C CO O= F FR R? H HT T6  03>A	  !14?B	 	M    	 
  #!## # 	# 
# #

,/
:=
	)


  !##'"& *  	
 !   
   !##'"&%!%*% % 	%
 !%  % 
 % % !##'"&.5*.5 .5 	.5
 !.5  .5 
0.5` L LX X> M M%!%	% %? + +	%+ + 6!6	06 6=
= =ra   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 jjrSr	U =r
$ )AsyncManagementCommandsi~	  c                ,   >#    [         TU ]  " S0 UD6$ 7fNrX   superr  rZ   r\   	__class__s     r]   r  $AsyncManagementCommands.command_info	  s     w#-f--   c                ,   >#    [         TU ]  " S0 UD6$ 7fr  )r  r:  r  s     r]   r:  &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  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rX   r  r  r  )r  r  r  r  r  r:  r  r  r  r
  __classcell__r  s   @r]   r  r  ~	  sl    .0/-
 #;#; #; 	#;
 #; #; 
#; #;ra   r  c                      \ rS rSrSr S     SS jjrS rSS jr S       SS jjrSS jr	SS	 jr
\S
 5       rSS jrSrg)BitFieldOperationi	  z(
Command builder for BITFIELD commands.
Nc                d    Xl         X l        X0l        / U l        SU l        U R                  5         g )NWRAP)clientr   _default_overflow
operations_last_overflowr   )rZ   r  r   default_overflows       r]   __init__BitFieldOperation.__init__	  s,     !18:$

ra   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
r  N)r  r  overflowr  r.  s    r]   r   BitFieldOperation.reset	  s0     $d,,C0C0CDra   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  r   )rZ   r  s     r]   r  BitFieldOperation.overflow	  s>     >>#***"*OO""J#9:ra   c                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  r   )rZ   fmtrf  	incrementr  s        r]   incrbyBitFieldOperation.incrby	  s4    ( MM(##yABra   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  r   )rZ   r  rf  s      r]   r'  BitFieldOperation.get	  s      	s34ra   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.
SETr  )rZ   r  rf  r  s       r]   setBitFieldOperation.set 
  s"     	sE:;ra   c                j    SU R                   /nU R                   H  nUR                  U5        M     U$ )NBITFIELD)r   r  rS  )rZ   r   opss      r]   r  BitFieldOperation.command
  s.    488$??CJJsO #
ra   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  r   r  rf   )rZ   r  s     r]   executeBitFieldOperation.execute
  s+     ,,

{{**G44ra   )r  r  r  r   r  rW   )r  9Union['redis.client.Redis', 'redis.asyncio.client.Redis']r   r   r  r  )r  r   )r  r   rf  r   r  r   r  r  )r  r   rf  r   )r  r   rf  r   r  r   )r   r6   )r  r  r  r  r	  r  r   r  r  r'  r  propertyr  r  r
  rX   ra   r]   r  r  	  s     +/	I  (	E$ #'   	
  4  	5ra   r  c                      \ rS rSrSrSrSrg)DataPersistOptionsi!
  NXXXrX   N)r  r  r  r  r  r  r
  rX   ra   r]   r  r  !
  s     
B 
Bra   r  c                     \ rS rSrSr\SS j5       r\        SS j5       rSS jr\   S           SS jj5       r\   S           SS jj5       r   S         SS	 jjr S       SS
 jjr\ S           SS jj5       r	\ S           SS jj5       r	 S           SS jjr	\          SS j5       r
\          SS j5       r
SS jr
\   S             SS jj5       r\   S             SS jj5       r   S           SS jjr\  S           SS jj5       r\  S           SS jj5       r  S         SS jjr\SSS jj5       r\ S       SS jj5       rSSS jjr\r\SS j5       r\SS j5       rSS jrSS jr\    S             SS jj5       r\    S             SS  jj5       r\" 5           S           SS! jj5       r\SS" j5       r\SS# j5       rSS$ jr\SS% j5       r\SS& j5       rSS' jr\r\    S               SS( jj5       r\    S               SS) jj5       r    S             SS* jjr\    S               SS+ jj5       r\    S               SS, jj5       r    S             SS- jjr\SS. j5       r\SS/ j5       rSS0 jr\" 5       SS1 j5       r\SS2 j5       r\      SS3 j5       r\" 5       SS4 j5       r\SS5 j5       r\SS6 j5       rSS7 jr\SS8 j5       r\      SS9 j5       rSS: jr\     S               SS; jj5       r\     S               SS< jj5       r     S             SS= jjrSS> jr\SS? j5       r\        SS@ j5       rSSA jr\          SSB j5       r \          SSC j5       r SSD jr \        SSE j5       r!\        SSF j5       r!SSG jr!\SSSH jj5       r"\ S       SSI jj5       r"SSSJ jjr"\"r#\ S       SSK jj5       r$\ S       GS SL jj5       r$SGSSM jjr$\SSSSSSSSSSSSN.                           GSSO jj5       r%\SSSSSSSSSSSSN.                           GSSP jj5       r%SSSSSSSSSSSSN.                         GSSQ jjr%\ GS     GSSR jj5       r&\ GS     GSSS jj5       r& GS   GSST jjr&\  GS	           GS
SU jj5       r'\  GS	           GSSV jj5       r' GS	         GSSW jjr'\  GS	             GSSX jj5       r(\  GS	             GSSY jj5       r(  GS	           GSSZ jjr(\        GSS[ j5       r)\        GSS\ j5       r)      GSS] jr)\      GSS^ j5       r*\      GSS_ j5       r*GSS` jr*\      GS                 GSSa jj5       r+\      GS                 GSSb jj5       r+      GS               GSSc jjr+\      GSSd j5       r,\      GSSe j5       r,GSSf jr,\GSSg j5       r-\GSSh j5       r-GSSi jr-\GSSj j5       r.\GSSk j5       r.GSSl jr.\    S               SSm jj5       r/\    S               SSn jj5       r/    S             SSo jjr/\    S               SSp jj5       r0\    S               SSq jj5       r0    S             SSr jjr0\SSs j5       r1\SSt j5       r1SSu jr1\          GS Sv j5       r2\          GS!Sw j5       r2        GS"Sx jr2\GS#Sy j5       r3\GS$Sz j5       r3GS%S{ jr3\  S         GS&S| jj5       r4\  S         GS'S} jj5       r4 S       GS(S~ jjr4\GS)S j5       r5\    GS*S j5       r5GS+S jr5\GS,S j5       r6\GS-S j5       r6GS.S jr6\GS,S j5       r7\        GS-S j5       r7GS.S jr7\    GS/                 GS0S jj5       r8\    GS/                 GS1S jj5       r8    GS/               GS2S jjr8\            GS3                               GS4S jj5       r9\            GS3                               GS5S jj5       r9\:" / SQ5                  GS6                             GS7S jj5       r9GS8S jr;\          GS9S j5       r<\          GS:S j5       r<GS;S jr<\          GS<S j5       r=\          GS=S j5       r=\>" SSSS9        GS>S j5       r=\GS?S j5       r?\        GS@S j5       r?GSAS jr?\          GSBS j5       r@\          GSCS j5       r@        GSDS jr@\     GSE                   GSFS jj5       rA\     GSE                   GSGS jj5       rA     GSE                 GSHS jjrA\GS#S j5       rB\GS$S j5       rBGS%S jrB\ GSI         GSJS jj5       rC\ GSI         GSKS jj5       rCGSIGSLS jjrC\GSMS j5       rD\GSNS j5       rDGSOS jrD\GS#S j5       rE\GS$S j5       rEGS%S jrE\GSPS j5       rF\GSQS j5       rFGSRS jrFGSSS jrGGSTS jrH\SS j5       rI\SS j5       rISS jrI\    GSU               GSVS jj5       rJ\    GSU               GSWS jj5       rJ    GSU             GSXS jjrJSrKg(Y  BasicKeyCommandsi+
  z 
Redis basic key-based commands
c                    g rW   rX   rZ   r   r  s      r]   r   BasicKeyCommands.append0
  r   ra   c                    g rW   rX   r  s      r]   r   r  3
  rx   ra   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
APPENDre   r  s      r]   r   r  8
  s     ##Hc99ra   Nc                    g rW   rX   rZ   r   startendr  s        r]   bitcountBasicKeyCommands.bitcountB
       ra   c                    g rW   rX   r  s        r]   r  r  K
       ra   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BITCOUNTr   )r   r   rf   )rZ   r   r  r  r  paramss         r]   r  r  T
  sz     MM% MM#CKS_BCCMM$##JDDseDDra   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
)r  )r  )rZ   r   r  s      r]   bitfieldBasicKeyCommands.bitfieldk
  s     !=MNNra   c                    g rW   rX   rZ   r   encodingrf  itemss        r]   bitfield_roBasicKeyCommands.bitfield_rox
  rI  ra   c                    g rW   rX   r  s        r]   r  r  
  rK  ra   c                    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
r  BITFIELD_ROr   rS  rf   )rZ   r   r	  rf  r
  r  s         r]   r  r  
  sT      uh/ %HMM5(34 !&##MGFG#GGra   c                    g rW   rX   rZ   	operationdestr   s       r]   bitopBasicKeyCommands.bitop
  r@  ra   c                    g rW   rX   r  s       r]   r  r  
  rx   ra   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
BITOPre   r  s       r]   r  r  
  s     ##GYDtDDra   c                    g rW   rX   rZ   r   bitr  r  r  s         r]   bitposBasicKeyCommands.bitpos
       ra   c                    g rW   rX   r  s         r]   r  r  
       ra   c                
   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   rP   zbit must be 0 or 1Nz0start argument is not set, when end is specifiedBITPOSr   r   r   rf   )rZ   r   r  r  r  r  r  s          r]   r  r  
  s      f011T2fmmE2MM#]sNOOMM$##HBvBSEBBra   Fc                    g rW   rX   rZ   sourcedestinationr  r  s        r]   r  BasicKeyCommands.copy
  r  ra   c                    g rW   rX   r&  s        r]   r  r)  
  r  ra   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)rS  r   rf   )rZ   r'  r(  r  r  r  s         r]   r  r)  
  sH    & &%MM401MM)$##F4V44ra   c                    g rW   rX   rZ   r  amounts      r]   decrbyBasicKeyCommands.decrby  r  ra   c                    g rW   rX   r0  s      r]   r2  r3    rx   ra   c                &    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
DECRBYre   r0  s      r]   r2  r3         ##Hd;;ra   c                    g rW   rX   rZ   namess     r]   deleteBasicKeyCommands.delete&      ?Bra   c                    g rW   rX   r9  s     r]   r;  r<  )  r   ra   c                (    U R                   " S/UQ76 $ )z0
Delete one or more keys specified by ``names``
DELre   r9  s     r]   r;  r<  ,  s     ##E2E22ra   c                &    U R                  U5        g rW   )r;  rZ   r  s     r]   __delitem__BasicKeyCommands.__delitem__2  s    Dra   c                    g rW   rX   rZ   r  ifeqifneifdeqifdnes         r]   delexBasicKeyCommands.delex5  r  ra   c                    g rW   rX   rF  s         r]   rK  rL  ?  r!  ra   c                    X#XE4 Vs/ s H  ofSLPM     nn[        U5      S:  a  [        S5      eSU/nUb  USU/-  nO Ub  USU/-  nOUb  USU/-  nO
Ub  USU/-  nU R                  " U6 $ s  snf )	a  
Conditionally removes the specified key.

Warning:
**Experimental** since 7.1.
This API may change or be removed without notice.
The API may change based on feedback.

Arguments:
    name: KeyT - the key to delete
    ifeq match-valu: Optional[Union[bytes, str]] - Delete the key only if its value is equal to match-value
    ifne match-value: Optional[Union[bytes, str]] - Delete the key only if its value is not equal to match-value
    ifdeq match-digest: Optional[str] - Delete the key only if the digest of its value is equal to match-digest
    ifdne match-digest: Optional[str] - Delete the key only if the digest of its value is not equal to match-digest

Returns:
    int: 1 if the key was deleted, 0 otherwise.
Raises:
    redis.exceptions.ResponseError: if key exists but is not a string
                                    and a condition is specified.
    ValueError: if more than one condition is provided.


Requires Redis 8.4 or greater.
For more information, see https://redis.io/commands/delex
NrP   z2Only one of IFEQ/IFNE/IFDEQ/IFDNE may be specifiedDELEXIFEQIFNEIFDEQIFDNE)sumr   rf   )	rZ   r  rG  rH  rI  rJ  xcondsrg   s	            r]   rK  rL  I  s    F *.U(BC(B1$(BCu:>QRR4vtn$Fvtn$Fw&&Fw&&F##V,, Ds   A.c                    g rW   rX   rB  s     r]   dumpBasicKeyCommands.dump|  rn  ra   c                    g rW   rX   rB  s     r]   rX  rY    rv   ra   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   r[  DUMPr_  )rZ   r  r\  rb  s       r]   rX  rY    s,     	. "##FD<G<<ra   c                    g rW   rX   r9  s     r]   existsBasicKeyCommands.exists  r=  ra   c                    g rW   rX   r9  s     r]   r^  r_    r   ra   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
EXISTSr   re   r9  s     r]   r^  r_    s     ##HAuA5AAra   c                    g rW   rX   rZ   r  r5  nxxxgtlts          r]   expireBasicKeyCommands.expire       ra   c                    g rW   rX   rd  s          r]   ri  rj         ra   c                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
r  r  GTLTEXPIREr   datetime	timedeltar   total_secondsrd  r   rf   rZ   r  r5  re  rf  rg  rh  
exp_options           r]   ri  rj    s    , dH..//t))+,DV
d#d#d#d###HdF:FFra   c                    g rW   rX   rZ   r  whenre  rf  rg  rh  s          r]   expireatBasicKeyCommands.expireat  rk  ra   c                    g rW   rX   ry  s          r]   r{  r|    rm  ra   c                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  ro  rp  EXPIREATr   rs  r   	timestamprd  r   rf   rZ   r  rz  re  rf  rg  rh  rw  s           r]   r{  r|    s    , dH--..t~~'(DV
d#d#d#d###JHZHHra   c                    g rW   rX   rZ   r   s     r]   
expiretimeBasicKeyCommands.expiretime  r=  ra   c                    g rW   rX   r  s     r]   r  r    r   ra   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

EXPIRETIMEre   r  s     r]   r  r    s     ##L#66ra   c                    [         (       d  [        S5      e[        R                  " U5      R	                  5       nU R                  5       R                  (       d  UR                  5       nU$ )a  
Compute the hexadecimal digest of the value locally, without sending it to the server.

This is useful for conditional operations like IFDEQ/IFDNE where you need to
compute the digest client-side before sending a command.

Warning:
**Experimental** - This API may change or be removed without notice.

Arguments:
  - value: Union[bytes, str] - the value to compute the digest of.
    If a string is provided, it will be encoded using UTF-8 before hashing,
    which matches Redis's default encoding behavior.

Returns:
  - (str | bytes) the XXH3 digest of the value as a hex string (16 hex characters).
    Returns bytes if decode_responses is False, otherwise returns str.

For more information, see https://redis.io/commands/digest
zXXHASH support requires the optional 'xxhash' library. Install it with 'pip install xxhash' or use this package's extra with 'pip install redis[xxhash]' to enable this feature.)
HAS_XXHASHr  xxhashxxh3_64	hexdigestr   r%  r   )rZ   r  local_digests      r]   digest_localBasicKeyCommands.digest_local$  s]    , z%F  ~~e,668 !22'..0Lra   c                    g rW   rX   rB  s     r]   digestBasicKeyCommands.digestJ  r   ra   c                    g rW   rX   rB  s     r]   r  r  M  r  ra   c                &    U R                  SU5      $ )a  
Return the digest of the value stored at the specified key.

Warning:
**Experimental** since 7.1.
This API may change or be removed without notice.
The API may change based on feedback.

Arguments:
  - name: KeyT - the key to get the digest of

Returns:
  - None if the key does not exist
  - (bulk string) the XXH3 digest of the value as a hex string
Raises:
  - ResponseError if key exists but is not a string


Requires Redis 8.4 or greater.
For more information, see https://redis.io/commands/digest
DIGESTre   rB  s     r]   r  r  R  s    4 ##Hd33ra   c                    g rW   rX   rB  s     r]   r'  BasicKeyCommands.getn  ri  ra   c                    g rW   rX   rB  s     r]   r'  r  q  r9  ra   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
r  r   re   rB  s     r]   r'  r  t  s     ##E4f#==ra   c                    g rW   rX   rB  s     r]   getdelBasicKeyCommands.getdel|  r   ra   c                    g rW   rX   rB  s     r]   r  r    r  ra   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
GETDELre   rB  s     r]   r  r    s     ##Hd33ra   c                    g rW   rX   rZ   r  expxexatpxatpersists          r]   getexBasicKeyCommands.getex       !ra   c                    g rW   rX   r  s          r]   r  r         ),ra   c                    [        USLUSLUSLUSLU45      (       d  [        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
NK``ex``, ``px``, ``exat``, ``pxat``, and ``persist`` are mutually exclusive.PERSISTGETEX)rQ   r   rK   r   rf   )rZ   r  r  r  r  r  r  exp_optionss           r]   r  r    s    : %$$D D 
 
 : 
 )=RT(Py)##GT@K@@ra   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rZ   r  r  s      r]   __getitem__BasicKeyCommands.__getitem__  s&    
 Ltnra   c                    g rW   rX   rZ   r  rf  s      r]   getbitBasicKeyCommands.getbit  r   ra   c                    g rW   rX   r  s      r]   r  r    rx   ra   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  re   r  s      r]   r  r    s     ##Hd$#HHra   c                    g rW   rX   rZ   r   r  r  s       r]   getrangeBasicKeyCommands.getrange  rn   ra   c                    g rW   rX   r  s       r]   r  r    rp   ra   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  re   r  s       r]   r  r    s     ##JCe#LLra   c                    g rW   rX   r  s      r]   getsetBasicKeyCommands.getset  r(  ra   c                    g rW   rX   r  s      r]   r  r    r  ra   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
GETSETre   r  s      r]   r  r    s     ##Hd::ra   c                    g rW   rX   r0  s      r]   r  BasicKeyCommands.incrby   r  ra   c                    g rW   rX   r0  s      r]   r  r  #  rx   ra   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
r  re   r0  s      r]   r  r  (  r7  ra   c                    g rW   rX   r0  s      r]   incrbyfloatBasicKeyCommands.incrbyfloat3       ra   c                    g rW   rX   r0  s      r]   r  r  8  rj  ra   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
INCRBYFLOATre   r0  s      r]   r  r  =  s     ##M4@@ra   )byfloatbyintlbounduboundsaturater  r  r  r  r  enxc                   g rW   rX   rZ   r  r  r  r  r  r  r  r  r  r  r  r  s                r]   increxBasicKeyCommands.increxF  s      &)ra   c                   g rW   rX   r  s                r]   r  r  X  s      14ra   c               t   [        USLUSL45      (       d  [        S5      e[        USLUSLU	SLU
SLU45      (       d  [        S5      eU(       a  Uc  Uc  U	c  U
c  [        S5      eU/nUb  UR                  SU45        O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(       a  UR                  S	5        UR                  [	        XxX5      5        U(       a  UR                  S
5        U(       a  UR                  S5        U R
                  " S/UQ76 $ )a&  
Increment the numeric value at key ``name`` and return the new value
and the actual increment.

``byfloat`` increments a floating point value by the provided amount.

``byint`` increments an integer value by the provided amount.

If neither ``byfloat`` nor ``byint`` is specified, the value is
incremented by one.

``lbound`` and ``ubound`` constrain the valid range of the result.

If ``saturate`` is True, out-of-bounds results are saturated to the
specified bound, or to the type limit when no bound is specified.
Otherwise, out-of-bounds results are rejected, leaving the value and
TTL unchanged and returning the current value and zero as the actual
increment.

``enx`` applies the expiration only when the key does not already
have an expiration, and requires ``ex``, ``px``, ``exat``, or ``pxat``.
Nz1``byfloat`` and ``byint`` are mutually exclusive.r  z>``enx`` requires one of ``ex``, ``px``, ``exat``, or ``pxat``.BYFLOATBYINTLBOUNDUBOUNDSATURATEr  ENXINCREX)rQ   r   rS  r   rK   rf   )rZ   r  r  r  r  r  r  r  r  r  r  r  r  rg   s                 r]   r  r  j  s]   L %t#T!
 
 OPP$$$D D 
 
 : 
 2:"*$,P  %)6MM9g./MM7E*+MM8V,-MM8V,-MM*%*24>?MM)$MM% ##H6v66ra   c                    g rW   rX   rZ   r  r\   s      r]   r   BasicKeyCommands.keys  r`   ra   c                    g rW   rX   r  s      r]   r   r    rc   ra   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
KEYSre   r  s      r]   r   r    s     ##FG>v>>ra   c                    g rW   rX   rZ   
first_listsecond_listsrcr  s        r]   lmoveBasicKeyCommands.lmove  s     !ra   c                    g rW   rX   r  s        r]   r  r         ),ra   c                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
LMOVEre   )rZ   r  r  r  r  r  s         r]   r  r    s$     35##G5f55ra   c                    g rW   rX   rZ   r  r  r  r  r  s         r]   blmoveBasicKeyCommands.blmove  s     !ra   c                    g rW   rX   r  s         r]   r  r    s     ),ra   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
BLMOVEre   )rZ   r  r  r  r  r  r  s          r]   r  r    s&     3g>##H6v66ra   c                    g rW   rX   rZ   r   rk   s      r]   mgetBasicKeyCommands.mget       $'ra   c                    g rW   rX   r  s      r]   r  r         /2ra   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$ )a  
Returns a list of values ordered identically to ``keys``

** Important ** When this method is used with Cluster clients, all keys
        must be in the same hash slot, otherwise a RedisClusterException
        will be raised.

For more information, see https://redis.io/commands/mget
r   )EMPTY_RESPONSEr   MGET)r`  r  rR   rf   )rZ   r   rk   r  rb  s        r]   r  r  "  sC     	0D'&(G###F=T=W==ra   c                    g rW   rX   rZ   mappings     r]   msetBasicKeyCommands.mset7  r  ra   c                    g rW   rX   r  s     r]   r  r  <  r  ra   c                |    / nUR                  5        H  nUR                  U5        M     U R                  " S/UQ76 $ )a  
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().

** Important ** When this method is used with Cluster clients, all keys
        must be in the same hash slot, otherwise a RedisClusterException
        will be raised.

For more information, see https://redis.io/commands/mset
MSETr
  rS  rf   rZ   r  r
  pairs       r]   r  r  A  s;     MMODLL $##F3U33ra   c                    g rW   rX   rZ   r  data_persist_optionr  r  r  r  keepttls           r]   msetexBasicKeyCommands.msetexR  s     ra   c                    g rW   rX   r  s           r]   r  r  ^  s     ra   c                   [        USLUSLUSLUSLU45      (       d  [        S5      e/ nU(       a  UR                  UR                  5        UR	                  [        X4XV5      5        U(       a  UR                  S5        S[        U5      /n	UR                  5        H  n
U	R	                  U
5        M     U R                  " / U	QUQ76 $ )a  
Sets key/values based on the provided ``mapping`` items.

** Important ** When this method is used with Cluster clients, all keys
                must be in the same hash slot, otherwise a RedisClusterException
                will be raised.

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

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

``ex`` sets an expire flag on the keys in ``mapping`` for ``ex`` seconds.

``px`` sets an expire flag on the keys in ``mapping`` for ``px`` milliseconds.

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

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

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

Returns the number of fields that were added.

Available since Redis 8.4
For more information, see https://redis.io/commands/msetex
NK``ex``, ``px``, ``exat``, ``pxat``, and ``keepttl`` are mutually exclusive.KEEPTTLMSETEX)	rQ   r   r   r  rS  rK   r  r
  rf   )rZ   r  r  r  r  r  r  r  r  rg   r  s              r]   r  r  j  s    V %$$D D 
 
 : 
 )+2889/CDy)CL)MMODMM$ $ ##:V:k::ra   c                    g rW   rX   r  s     r]   msetnxBasicKeyCommands.msetnx  r  ra   c                    g rW   rX   r  s     r]   r$  r%    r  ra   c                |    / nUR                  5        H  nUR                  U5        M     U R                  " S/UQ76 $ )a  
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.

** Important ** When this method is used with Cluster clients, all keys
                must be in the same hash slot, otherwise a RedisClusterException
                will be raised.

For more information, see https://redis.io/commands/msetnx
MSETNXr  r  s       r]   r$  r%    s;     MMODLL $##H5u55ra   c                    g rW   rX   rZ   r  dbs      r]   moveBasicKeyCommands.move  r7  ra   c                    g rW   rX   r*  s      r]   r,  r-    rX  ra   c                &    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
MOVEre   r*  s      r]   r,  r-    s     ##FD55ra   c                    g rW   rX   rB  s     r]   r  BasicKeyCommands.persist  r=  ra   c                    g rW   rX   rB  s     r]   r  r2    r   ra   c                &    U R                  SU5      $ )z`
Removes an expiration on ``name``

For more information, see https://redis.io/commands/persist
r  re   rB  s     r]   r  r2    s     ##It44ra   c                    g rW   rX   rd  s          r]   pexpireBasicKeyCommands.pexpire  rk  ra   c                    g rW   rX   rd  s          r]   r6  r7    rm  ra   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  ro  rp  PEXPIRErr  rv  s           r]   r6  r7    s    , dH..//t))+d23DV
d#d#d#d###ItGJGGra   c                    g rW   rX   ry  s          r]   	pexpireatBasicKeyCommands.pexpireat%  rk  ra   c                    g rW   rX   ry  s          r]   r=  r>  0  rm  ra   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  ro  rp  	PEXPIREATr  r  s           r]   r=  r>  ;  s    , dH--..t~~'$./DV
d#d#d#d###KIjIIra   c                    g rW   rX   r  s     r]   pexpiretimeBasicKeyCommands.pexpiretime^  r+  ra   c                    g rW   rX   r  s     r]   rC  rD  a  r   ra   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
PEXPIRETIMEre   r  s     r]   rC  rD  d  s     ##M377ra   c                    g rW   rX   rZ   r  time_msr  s       r]   psetexBasicKeyCommands.psetexm  r  ra   c                    g rW   rX   rI  s       r]   rK  rL  r  r  ra   c                    [        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   rs  rt  r   ru  rf   rI  s       r]   rK  rL  w  sD     gx1122'//1D89G##HdUCCra   c                    g rW   rX   rB  s     r]   pttlBasicKeyCommands.pttl  r.  ra   c                    g rW   rX   rB  s     r]   rR  rS    r   ra   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
PTTLre   rB  s     r]   rR  rS    s     ##FD11ra   c                    g rW   rX   rZ   r   r   
withvaluess       r]   
hrandfieldBasicKeyCommands.hrandfield  s     !ra   c                    g rW   rX   rX  s       r]   rZ  r[    s     ),ra   c                    / nUb  UR                  U5        U(       a  UR                  S5        U R                  " SU/UQ7SU0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
HRANDFIELDrY  r  )rZ   r   r   rY  r  s        r]   rZ  r[    sG      MM% MM,'##L#VV:VVra   c                    g rW   rX   r   s     r]   	randomkeyBasicKeyCommands.randomkey  r  ra   c                    g rW   rX   r   s     r]   ra  rb    r  ra   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
)	RANDOMKEYre   r   s     r]   ra  rb    s     ##:6::ra   c                    g rW   rX   rZ   r  dsts      r]   renameBasicKeyCommands.rename  r{  ra   c                    g rW   rX   rg  s      r]   ri  rj    rA  ra   c                &    U R                  SX5      $ )z[
Rename key ``src`` to ``dst``

For more information, see https://redis.io/commands/rename
RENAMEre   rg  s      r]   ri  rj    s     ##Hc77ra   c                    g rW   rX   rg  s      r]   renamenxBasicKeyCommands.renamenx  r   ra   c                    g rW   rX   rg  s      r]   ro  rp    r  ra   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
RENAMENXre   rg  s      r]   ro  rp    s     ##J99ra   c                    g rW   rX   rZ   r  ttlr  r  absttlidletime	frequencys           r]   restoreBasicKeyCommands.restore  s     ra   c                    g rW   rX   ru  s           r]   rz  r{    s     "%ra   c                   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)r   r   r   r   rf   )	rZ   r  rv  r  r  rw  rx  ry  r  s	            r]   rz  r{    s    : U#MM)$MM(#MM*%>c(m,  MM&!@c)n- ##I777  > <==>  @ >??@s   
B& 9B? &B<?Cc                    g rW   rX   rZ   r  r  r  r  re  rf  r  r'  r  r  rG  rH  rI  rJ  s                  r]   r  BasicKeyCommands.set5  s    " %(ra   c                    g rW   rX   r  s                  r]   r  r  H  s    " 03ra   )rG  rH  rI  rJ  c           	        [        USLUSLU	SLU
SLU45      (       d  [        S5      e[        UUUSLUSLUSLUSL45      (       d  [        S5      eX/n0 nU(       a  UR                  S5        OtU(       a  UR                  S5        O[Ub  UR                  SU45        ODUb  UR                  SU45        O-Ub  UR                  SU45        OUb  UR                  S	U45        U(       a  UR                  S
5        SUS'   UR                  [	        X4X5      5        U(       a  UR                  S5        U R
                  " S/UQ70 UD6$ )u  
Set the value at key ``name`` to ``value``

Warning:
**Experimental** since 7.1.
The usage of the arguments ``ifeq``, ``ifne``, ``ifdeq``, and ``ifdne``
is experimental. The API or returned results when those parameters are used
may change based on feedback.

``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.

``ifeq`` set the value at key ``name`` to ``value`` only if the current
    value exactly matches the argument.
    If key doesn’t exist - it won’t be created.
    (Requires Redis 8.4 or greater)

``ifne`` set the value at key ``name`` to ``value`` only if the current
    value does not exactly match the argument.
    If key doesn’t exist - it will be created.
    (Requires Redis 8.4 or greater)

``ifdeq`` set the value at key ``name`` to ``value`` only if the current
    value XXH3 hex digest exactly matches the argument.
    If key doesn’t exist - it won’t be created.
    (Requires Redis 8.4 or greater)

``ifdne`` set the value at key ``name`` to ``value`` only if the current
    value XXH3 hex digest does not exactly match the argument.
    If key doesn’t exist - it will be created.
    (Requires Redis 8.4 or greater)

For more information, see https://redis.io/commands/set
Nr   zP``nx``, ``xx``, ``ifeq``, ``ifne``, ``ifdeq``, ``ifdne`` are mutually exclusive.r  r  rP  rQ  rR  rS  r  Tr'  r!  r  )rQ   r   r   rS  rK   rf   )rZ   r  r  r  r  re  rf  r  r'  r  r  rG  rH  rI  rJ  rg   rb  s                    r]   r  r  [  sv   R %$$D D 
 
 :  %D D T!T!	
 	
 b  %)= MM$MM$MM64.)MM64.)MM7E*+MM7E*+MM% !GEN*24>?MM)$##E>F>g>>ra   c                &    U R                  X5        g rW   )r  r  s      r]   __setitem__BasicKeyCommands.__setitem__  s    ra   c                    g rW   rX   rZ   r  rf  r  s       r]   setbitBasicKeyCommands.setbit  r@  ra   c                    g rW   rX   r  s       r]   r  r    rx   ra   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
rP   r   SETBITre   r  s       r]   r  r    s'     ! q##HdEBBra   c                    g rW   rX   rZ   r  r5  r  s       r]   setexBasicKeyCommands.setex  r  ra   c                    g rW   rX   r  s       r]   r  r    r  ra   z2.6.12zUse 'set' instead.r  versionreasonr  c                    [        U[        R                  5      (       a  [        UR	                  5       5      nU R                  SXU5      $ )a5  
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.

As per Redis 2.6.12, SETEX is considered deprecated.
Please use SET with EX parameter in new code.

For more information, see https://redis.io/commands/setex
SETEXrP  r  s       r]   r  r    s?    $ dH..//t))+,D##GT??ra   c                    g rW   rX   r  s      r]   setnxBasicKeyCommands.setnx  rv   ra   c                    g rW   rX   r  s      r]   r  r    r  ra   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
SETNXre   r  s      r]   r  r    s     ##GT99ra   c                    g rW   rX   r  s       r]   setrangeBasicKeyCommands.setrange$  r@  ra   c                    g rW   rX   r  s       r]   r  r  )  rx   ra   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
SETRANGEre   r  s       r]   r  r  .  s     ##JeDDra   c	                    g rW   rX   
rZ   algovalue1value2specific_argumentr  idxminmatchlenwithmatchlenr\   s
             r]   stralgoBasicKeyCommands.stralgo?  s     ra   c	                    g rW   rX   r  s
             r]   r  r  M  s     &)ra   c	                   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
LCSz, zThe supported algorithms are: )r   stringsz-specific_argument can be only keys or stringsz(len and idx cannot be provided together.s   LENs   IDXs   MINMATCHLENs   WITHMATCHLENSTRALGO)r  r  r  r  )joinr   r  r   r   rS  	TypeErrorrf   )rZ   r  r  r  r  r  r  r  r  r\   supported_algosupported_algos_strrg   s                r]   r  r  [  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                    g rW   rX   rB  s     r]   strlenBasicKeyCommands.strlen  rY  ra   c                    g rW   rX   rB  s     r]   r  r    ri  ra   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  re   rB  s     r]   r  r    s     ##Hd#@@ra   c                    g rW   rX   rZ   r  r  r  s       r]   substrBasicKeyCommands.substr  rn   ra   c                    g rW   rX   r  s       r]   r  r    rp   ra   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  re   r  s       r]   r  r    s     ##Hd3V#LLra   c                    g rW   rX   r  s     r]   touchBasicKeyCommands.touch  rY  ra   c                    g rW   rX   r  s     r]   r  r    ri  ra   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
TOUCHre   r  s     r]   r  r    s     ##G3d33ra   c                    g rW   rX   rB  s     r]   rv  BasicKeyCommands.ttl  r  ra   c                    g rW   rX   rB  s     r]   rv  r    r#  ra   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
TTLre   rB  s     r]   rv  r    s     ##E400ra   c                    g rW   rX   rB  s     r]   typeBasicKeyCommands.type  r   ra   c                    g rW   rX   rB  s     r]   r  r    r   ra   c                $    U R                  SX/S9$ )z\
Returns the type of key ``name``

For more information, see https://redis.io/commands/type
TYPEr  re   rB  s     r]   r  r         ##FDv#>>ra   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DeprecationWarningr9  s     r]   watchBasicKeyCommands.watch  s     	()LMNra   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Pra   c                    g rW   rX   r9  s     r]   unlinkBasicKeyCommands.unlink  r=  ra   c                    g rW   rX   r9  s     r]   r  r    r   ra   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
UNLINKre   r9  s     r]   r  r    s     ##H5u55ra   c                    g rW   rX   rZ   key1key2r  r  r  r  s          r]   lcsBasicKeyCommands.lcs  r  ra   c                    g rW   rX   r  s          r]   r  r    r  ra   c                    X/nU(       a  UR                  S5        U(       a  UR                  S5        Ub  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 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WITHMATCHLENr  r   r   rS  rf   )rZ   r  r  r  r  r  r  rg   s           r]   r  r    ss    $ $(,MM% MM% "{a'7MM=+67MM.)##EFFF$FFra   rX   )rZ   r=   r   r1   r  r'   r   r   )rZ   r   r   r1   r  r'   r   r   )r   r1   r  r'   r   r   r  )rZ   r=   r   r1   r  r   r  r   r  r   r   r   )rZ   r   r   r1   r  r   r  r   r  r   r   r   )
r   r1   r  r   r  r   r  r   r   r   rW   )rZ   r  r   r1   r  r   r   r  )rZ   r=   r   r1   r	  r   rf  r   r
  (list[tuple[str, BitfieldOffsetT]] | Noner   r  )rZ   r   r   r1   r	  r   rf  r   r
  r  r   r  )rZ   r  r   r1   r	  r   rf  r   r
  r  r   r  )
rZ   r=   r  r   r  r1   r   r1   r   r   )
rZ   r   r  r   r  r1   r   r1   r   r   )r  r   r  r1   r   r1   r   r   )rZ   r=   r   r1   r  r   r  r   r  r   r  r   r   r   )rZ   r   r   r1   r  r   r  r   r  r   r  r   r   r   )r   r1   r  r   r  r   r  r   r  r   r   r   NF)rZ   r=   r'  r   r(  r   r  r   r  r   r   r   )rZ   r   r'  r   r(  r   r  r   r  r   r   r   )
r'  r   r(  r   r  r   r  r   r   r   rP   )rZ   r=   r  r1   r1  r   r   r   )rZ   r   r  r1   r1  r   r   r   )r  r1   r1  r   r   r   )rZ   r=   r:  r1   r   r   )rZ   r   r:  r1   r   r   )r:  r1   r   r   r  r1   r  )rZ   r=   r  r1   rG  r  rH  r  rI  r   rJ  r   r   r   )rZ   r   r  r1   rG  r  rH  r  rI  r   rJ  r   r   r   )r  r1   rG  r  rH  r  rI  r   rJ  r   r   r   )rZ   r=   r  r1   r   zbytes | None)rZ   r   r  r1   r   zAwaitable[bytes | None])r  r1   r   z&bytes | None | Awaitable[bytes | None])FFFF)rZ   r=   r  r1   r5  r(   re  r   rf  r   rg  r   rh  r   r   r   )rZ   r   r  r1   r5  r(   re  r   rf  r   rg  r   rh  r   r   r   )r  r1   r5  r(   re  r   rf  r   rg  r   rh  r   r   r   )rZ   r=   r  r1   rz  r   re  r   rf  r   rg  r   rh  r   r   r   )rZ   r   r  r1   rz  r   re  r   rf  r   rg  r   rh  r   r   r   )r  r1   rz  r   re  r   rf  r   rg  r   rh  r   r   r   )rZ   r=   r   r   r   r   )rZ   r   r   r   r   r   )r   r   r   r   )r  r   r   r   )rZ   r=   r  r1   r   zstr | bytes | None)rZ   r   r  r1   r   zAwaitable[str | bytes | None])r  r1   r   z2str | bytes | None | Awaitable[str | bytes | None])rZ   r=   r  r1   r   r  )rZ   r   r  r1   r   r  )r  r1   r   r  )NNNNF)rZ   r=   r  r1   r  ExpiryT | Noner  r  r  AbsExpiryT | Noner  r  r  r   r   r  )rZ   r   r  r1   r  r  r  r  r  r  r  r  r  r   r   r  )r  r1   r  r  r  r  r  r  r  r  r  r   r   r  )rZ   r=   r  r1   rf  r   r   r   )rZ   r   r  r1   rf  r   r   r   )r  r1   rf  r   r   r   )
rZ   r=   r   r1   r  r   r  r   r   r   )
rZ   r   r   r1   r  r   r  r   r   r   )r   r1   r  r   r  r   r   r   )rZ   r=   r  r1   r  r'   r   r  )rZ   r   r  r1   r  r'   r   r  )r  r1   r  r'   r   r  g      ?)rZ   r=   r  r1   r1  floatr   r  )rZ   r   r  r1   r1  r  r   Awaitable[float])r  r1   r1  r  r   float | Awaitable[float])rZ   r=   r  r1   r  EncodableT | Noner  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r   r  r   r   zlist[Number | bytes | str])rZ   r   r  r1   r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r   r  r   r   z%Awaitable[list[Number | bytes | str]])r  r1   r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r   r  r   r   zBlist[Number | bytes | str] | Awaitable[list[Number | bytes | str]]r  rZ   r=   r  r5   r   r   rZ   r   r  r5   r   r   r  r5   r   r   )LEFTRIGHT)rZ   r=   r  r   r  r   r  r   r  r   r   r  )rZ   r   r  r   r  r   r  r   r  r   r   r  )
r  r   r  r   r  r   r  r   r   r  )rZ   r=   r  r   r  r   r  r   r  r   r  r   r   r  )rZ   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  )rZ   r=   r   r0   rk   r'   r   list[bytes | str | None])rZ   r   r   r0   rk   r'   r   #Awaitable[list[bytes | str | None]])r   r0   rk   r'   r   >list[bytes | str | None] | Awaitable[list[bytes | str | None]])rZ   r=   r  Mapping[AnyKeyT, EncodableT]r   r   )rZ   r   r  r
  r   r   )r  r
  r   r   )NNNNNF)rZ   r=   r  r
  r  DataPersistOptions | Noner  r  r  r  r  r  r  r  r  r   r   r   )rZ   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   )rZ   r=   r  r1   r+  r   r   r   )rZ   r   r  r1   r+  r   r   r   )r  r1   r+  r   r   r   )rZ   r=   r  r1   r   r   )rZ   r   r  r1   r   r   )r  r1   r   r   )
rZ   r=   r  r1   rJ  r(   r  r'   r   r   )
rZ   r   r  r1   rJ  r(   r  r'   r   r   )r  r1   rJ  r(   r  r'   r   r   rZ   r=   r  r1   r   r   rZ   r   r  r1   r   r   r  r1   r   r   )
rZ   r=   r   r1   r   r   rY  r   r   r.   )
rZ   r   r   r1   r   r   rY  r   r   zAwaitable[HRandFieldResponse])r   r1   r   r   rY  r   r   z2HRandFieldResponse | Awaitable[HRandFieldResponse]r~  r  r  )rZ   r=   r  r1   rh  r1   r   r   )rZ   r   r  r1   rh  r1   r   r   )r  r1   rh  r1   r   r   )FFNN)rZ   r=   r  r1   rv  r  r  r'   r  r   rw  r   rx  r   ry  r   r   r   )rZ   r   r  r1   rv  r  r  r'   r  r   rw  r   rx  r   ry  r   r   r   )r  r1   rv  r  r  r'   r  r   rw  r   rx  r   ry  r   r   r   )............) rZ   r=   r  r1   r  r'   r  r  r  r  re  r   rf  r   r  r   r'  r   r  r  r  r  rG  r  rH  r  rI  r   rJ  r   r   zbool | str | bytes | None) rZ   r   r  r1   r  r'   r  r  r  r  re  r   rf  r   r  r   r'  r   r  r  r  r  rG  r  rH  r  rI  r   rJ  r   r   z$Awaitable[bool | str | bytes | None])NNFFFFNNNNNN)r  r1   r  r'   r  r  r  r  re  r   rf  r   r  r   r'  r   r  r  r  r  rG  r  rH  r  rI  r   rJ  r   r   z@bool | str | bytes | None | Awaitable[bool | str | bytes | None]r  r1   r  r'   )
rZ   r=   r  r1   rf  r   r  r   r   r   )
rZ   r   r  r1   rf  r   r  r   r   r   )r  r1   rf  r   r  r   r   r   )
rZ   r=   r  r1   r5  r(   r  r'   r   r   )
rZ   r   r  r1   r5  r(   r  r'   r   r   )r  r1   r5  r(   r  r'   r   r   )rZ   r=   r  r1   r  r'   r   r   )rZ   r   r  r1   r  r'   r   r   )r  r1   r  r'   r   r   )
rZ   r=   r  r1   rf  r   r  r'   r   r   )
rZ   r   r  r1   rf  r   r  r'   r   r   )r  r1   rf  r   r  r'   r   r   )r  FFNF)rZ   r=   r  Literal['LCS']r  r1   r  r1   r  $Literal['strings'] | Literal['keys']r  r   r  r   r  r   r  r   r   r:   )rZ   r   r  r  r  r1   r  r1   r  r  r  r   r  r   r  r   r  r   r   zAwaitable[StralgoResponse])r  r  r  r1   r  r1   r  r  r  r   r  r   r  r   r  r   r   z,StralgoResponse | Awaitable[StralgoResponse]))
rZ   r=   r  r1   r  r   r  r   r   r   )
rZ   r   r  r1   r  r   r  r   r   r   )r  r1   r  r   r  r   r   r   )rZ   r=   rk   r1   r   r   )rZ   r   rk   r1   r   r   )rk   r1   r   r   )rZ   r=   r  r1   r   r   )rZ   r   r  r1   r   r   )r  r1   r   r   r:  r1   r   r  r  )FFr   F)rZ   r=   r  r   r  r   r  r|  r  r|  r  r   r  r|  r   r2   )rZ   r   r  r   r  r   r  r|  r  r|  r  r   r  r|  r   zAwaitable[LCSCommandResponse])r  r   r  r   r  r|  r  r|  r  r   r  r|  r   z2LCSCommandResponse | Awaitable[LCSCommandResponse])Lr  r  r  r  r	  r   r   r  r  r  r  r  r  r2  decrr;  rC  rK  rJ   rX  r^  __contains__ri  r{  r  r  r  r'  r  r  r  r  r  r  r  incrr  r  r   r  r  r  r  r  r$  r,  r  r6  r=  rC  rK  rR  rZ  ra  ri  ro  rz  r  rI   r  r  r  rH   r  r  r  r  r  r  rv  r  r  r  r  r  r
  rX   ra   r]   r  r  +
  s#    R R!(,5?	 :  !   	
  
   !!  	
  
  !EE E 	E
 E 
E4 (,OGOO %O 
	O  ;?    	
 8 
   ;?#!## #  	#
 8# 
# # ;?HGHH H  	H
 8H 
*H.  -08<EI	  !.19=FJ	 E 
 !   	
   
  
 !!  	
   
  !CC C 	C
 C C 
C> 
 &*   #	
  
  
 &*!  #	
  
  &*55 5 #	5
 5 
 54 Q Q=>!)-7:	 < DB BN N3  $(#'    ! !	
   
   $(#'  ! ! !	
   
   $(#'  0-0- !0- !	0-
 0- 0- 
0- 0-d G GS S= B BN NB L
    	
    
  
 !  	
    
  #G#G #G 	#G
 #G #G #G 
 #GJ 
    	
    
  
 !  	
    
  #I#I #I 	#I
 #I #I #I 
 #IJ B BN N7 # #J O O,!,)-,	&, , 4 46 L LX X> O O,!,)-,	&, ,4  "!"&"&! !! ! 	!
  !  ! ! 
! !  "!"&"&,!,, , 	,
  ,  , , 
', , "!"&"&0A0A 0A 	0A
  0A  0A 0A 
>0Ad M M!)-7:	 I  '+47>A	  %!%(,%58%?B%	% %	M ! !(,!5?!	! ! ,!,)-,6@,	&, ,; Q Q=>!)-7:	 < D>A (,6;	  ?B!)-7<	 A 
 &*#'$($(!!"&"&) )) #	)
 !) ") ") ) ) )  )  ) ) ) 
$) )" 
 &*#'$($(!!"&"&4!44 #	4
 !4 "4 "4 4 4 4  4  4 4 4 
/4 4* &*#'$($(!!"&"&U7U7 #	U7
 !U7 "U7 "U7 U7 U7 U7  U7  U7 U7 U7 
LU7n 69   +3 	    7:+!+,4+	%+ +
 #&??	9? 
 ! !! ! 	!
 ! 
! ! 
 ,!,, , 	,
 , 
', , QX66,/6696JM6	=6  ! !! ! 	!
 ! ! 
! !  ,!,, , 	,
 , , 
', , 77 7 	7
 7 7 
>7  ' '(-'6@'	!' ' 2!2).27A2	,2 2>>",>	G>*  +G	  !,H	 4"  :>!!"&"&	 	-	 7	 		
 	  	  	 	 
	 	  :>!!"&"&	!	-	 7	 		
 	  	  	 	 
	 	 :>!!"&"&G;-G; 7G; 	G;
 G;  G;  G; G; 
G;R  +G	  !,H	 6$ H HT T6 B BN N5 
    	
    
  
 !  	
    
  "H"H "H 	"H
 "H "H "H 
 "HH 
    	
    
  
 !  	
    
  !J!J !J 	!J
 !J !J !J 
 !JF C CO O8  (,7>GQ	  !)-8?HR	 DD#*D3=D	D > >J J2  ! 	! !! ! 	!
 
! !  ! 	,!,, , 	,
 
', , GLWW *W?CW	;W0 P P,!,	&, ,; K KW W8 M M!(,37	 :  # $	 		 	 		
 	 	 	 	 
	 	  # $	%!	%	% 	% 		%
 	% 	% 	% 	% 
 	% 	%  # $0808 08 	08
 08 08 08 08 
008d 
 ! "%"%#&#&( (( ( 	(
 ( ( ( ( (  (  ( !( !( ( (  
#!( ($ 
 ! "%"%#&#&3!33 3 	3
 3 3 3 3 3  3  3 !3 !3 3 3  
.!3 3$ 9:
 "!"&"&#'#'  ?? ? 	?
 ? ? ? ? ?  ?  ? !? !? ? ?  
L!? ;?B  (,69BE	  !)-7:CF	 C  (,4;DN	  !)-5<EO	  #
@@ '@0:@	@
@" S S!)-6@	 :  (,69BL	  !)-7:CM	 EE"%E.8E	E"  CL"&"   	
 @      
   CL"&")!)) ) 	)
 @) ) )  ) ) 
$) )$ CL"&">
>
 >
 	>

 @>
 >
 >
  >
 >
 
6>
@ @ @L LA EG (,58?B	  FH%!%)-%69%@C%	% %M M @ @L L4 = =I I1 F FR R?OQ B BN N6 
 ! "#$)! !! ! 	!
 !  ! "! 
! ! 
 ! "#$),!,, , 	,
 ,  , ", 
', , ! "#$)GG G 	G
 G  G "G 
<G Gra   r  c                  d   ^  \ rS rSrS	S jrS	S jrS	S jrS
S jrSU 4S jjrSU 4S jjr	Sr
U =r$ )AsyncBasicKeyCommandsi9  c                    [        S5      e)Nz2Async Redis client does not support class deletionr  rB  s     r]   rC  !AsyncBasicKeyCommands.__delitem__:  s    LMMra   c                    [        S5      e)Nz3Async Redis client does not support class inclusionr  rB  s     r]   r  "AsyncBasicKeyCommands.__contains__=      MNNra   c                    [        S5      e)Nz3Async Redis client does not support class retrievalr  rB  s     r]   r  !AsyncBasicKeyCommands.__getitem__@  r  ra   c                    [        S5      e)Nz4Async Redis client does not support class assignmentr  r  s      r]   r  !AsyncBasicKeyCommands.__setitem__C  s    NOOra   c                &   >#    [         TU ]  " U6 $ 7frW   )r  r  )rZ   r:  r  s     r]   r  AsyncBasicKeyCommands.watchF  s     w}e$$s   c                (   >#    [         TU ]  5       $ 7frW   )r  r  rZ   r  s    r]   r  AsyncBasicKeyCommands.unwatchI  s     w     rX   r  r  r  r  )r  r  r  r  rC  r  r  r  r  r  r
  r  r  s   @r]   r  r  9  s*    NOOP%! !ra   r  c                  	   \ rS rSrSr\ SI       SJS jj5       r\ SI       SKS jj5       r SI     SLS jjr\ SI       SJS jj5       r\ SI       SKS jj5       r SI     SLS jjr\ SI         SMS	 jj5       r\ SI         SNS
 jj5       rSISOS jjr\SS.             SPS jj5       r	\SS.             SQS jj5       r	SS.           SRS jjr	\SS.           SSS jj5       r
\SS.           STS jj5       r
SS.         SUS jjr
\        SVS j5       r\        SWS j5       rSXS jr\            SYS j5       r\            SZS j5       r          S[S jr\S\S j5       r\S]S j5       rS^S jr\ S_       S`S jj5       r\ S_       SaS jj5       r S_     SbS  jjr\ScS! j5       r\        SdS" j5       rSeS# jr\ScS$ j5       r\        SdS% j5       rSeS& jr\          SfS' j5       r\          SgS( j5       r        ShS) jr\SiS* j5       r\          SjS+ j5       rSkS, jr\SlS- j5       r\          SmS. j5       rSnS/ jr\SoS0 j5       r\          SpS1 j5       rSqS2 jr\ S_       S`S3 jj5       r\ S_       SaS4 jj5       r S_     SbS5 jjr\        SrS6 j5       r\        SsS7 j5       rStS8 jr\ScS9 j5       r\        SdS: j5       rSeS; jr\SuS< j5       r\        SvS= j5       rSwS> jr\   Sx             SyS? jj5       r\   Sx             SzS@ jj5       r   Sx           S{SA jjr\        S|                     S}SB jj5       r\        S|                     S~SC jj5       r        S|                   SSD jjr\      S                 SSE jj5       r\      S                 SSF jj5       r      S               SSG jjrSHrg)ListCommandsiM  zR
Redis commands for List data type.
see: https://redis.io/topics/data-types#lists
c                    g rW   rX   rZ   r   r  s      r]   blpopListCommands.blpopS       #&ra   c                    g rW   rX   r,  s      r]   r-  r.  X  r6  ra   c                l    Uc  Sn[        US5      nUR                  U5        U R                  " S/UQ76 $ )a7  
LPOP a value off of the first non-empty list
named in ``keys``.

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rR   r   rf   r,  s      r]   r-  r.  ]  <     ?GD$'G##G3d33ra   c                    g rW   rX   r,  s      r]   brpopListCommands.brpopr  r/  ra   c                    g rW   rX   r,  s      r]   r6  r7  w  r6  ra   c                l    Uc  Sn[        US5      nUR                  U5        U R                  " S/UQ76 $ )a7  
RPOP a value off of the first non-empty list
named in ``keys``.

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   BRPOPr3  r,  s      r]   r6  r7  |  r4  ra   c                    g rW   rX   rZ   r  rh  r  s       r]   
brpoplpushListCommands.brpoplpush  r(  ra   c                    g rW   rX   r<  s       r]   r=  r>    r  ra   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   
BRPOPLPUSHre   r<  s       r]   r=  r>    s#     ?G##L#GDDra   rP   )r   c                   g rW   rX   rZ   r  numkeys	directionr   rk   s         r]   blmpopListCommands.blmpop  s      #ra   c                   g rW   rX   rC  s         r]   rF  rG    s     +.ra   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
ra  BLMPOPre   )rZ   r  rD  rE  r   rk   cmd_argss          r]   rF  rG    s6    " GtGYGGG##H8x88ra   c                   g rW   rX   rZ   num_keysrE  r   rk   s        r]   lmpopListCommands.lmpop  rK  ra   c                   g rW   rX   rM  s        r]   rO  rP    s     +.ra   c                   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
rP   ra  LMPOP)rd  rS  rf   )rZ   rN  rE  r   rk   rK  s         r]   rO  rP    sI     :T
*i[8A:OOWe,-##G7h77ra   c                    g rW   rX   rZ   r  rx  s      r]   lindexListCommands.lindex  r(  ra   c                    g rW   rX   rU  s      r]   rV  rW    r  ra   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  re   rU  s      r]   rV  rW    s     ##Hd#GGra   c                    g rW   rX   rZ   r  whererefvaluer  s        r]   linsertListCommands.linsert  r@  ra   c                    g rW   rX   r\  s        r]   r_  r`    rx   ra   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
LINSERTre   r\  s        r]   r_  r`    s     ##ItHLLra   c                    g rW   rX   rB  s     r]   llenListCommands.llen)  r.  ra   c                    g rW   rX   rB  s     r]   re  rf  ,  r   ra   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  re   rB  s     r]   re  rf  /  r  ra   Nc                    g rW   rX   rZ   r  r   s      r]   lpopListCommands.lpop7      
 25ra   c                    g rW   rX   rk  s      r]   rl  rm  >      
 =@ra   c                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
LPOPre   rk  s      r]   rl  rm  E  0      ''<<''55ra   c                    g rW   rX   rZ   r  valuess      r]   lpushListCommands.lpushZ  r  ra   c                    g rW   rX   ru  s      r]   rw  rx  ]  rx   ra   c                *    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
LPUSHre   ru  s      r]   rw  rx  b       ##GT;F;;ra   c                    g rW   rX   ru  s      r]   lpushxListCommands.lpushxj  r  ra   c                    g rW   rX   ru  s      r]   r~  r  m  rx   ra   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
LPUSHXre   ru  s      r]   r~  r  r       ##Hd<V<<ra   c                    g rW   rX   r  s       r]   lrangeListCommands.lrangez  r`   ra   c                    g rW   rX   r  s       r]   r  r    rc   ra   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  re   r  s       r]   r  r    s     ##Hd3V#LLra   c                    g rW   rX   rZ   r  r   r  s       r]   lremListCommands.lrem  r   ra   c                    g rW   rX   r  s       r]   r  r    rx   ra   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
LREMre   r  s       r]   r  r    s     ##FD??ra   c                    g rW   rX   rZ   r  rx  r  s       r]   lsetListCommands.lset  rA  ra   c                    g rW   rX   r  s       r]   r  r    r  ra   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
LSETre   r  s       r]   r  r    s     ##FD??ra   c                    g rW   rX   r  s       r]   ltrimListCommands.ltrim  r   ra   c                    g rW   rX   r  s       r]   r  r    r  ra   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
LTRIMre   r  s       r]   r  r    s     ##GT#>>ra   c                    g rW   rX   rk  s      r]   rpopListCommands.rpop  rn  ra   c                    g rW   rX   rk  s      r]   r  r    rp  ra   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
RPOPre   rk  s      r]   r  r    rs  ra   c                    g rW   rX   rg  s      r]   	rpoplpushListCommands.rpoplpush  r(  ra   c                    g rW   rX   rg  s      r]   r  r    r  ra   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
	RPOPLPUSHre   rg  s      r]   r  r    s     ##K::ra   c                    g rW   rX   ru  s      r]   rpushListCommands.rpush  r  ra   c                    g rW   rX   ru  s      r]   r  r    rx   ra   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
RPUSHre   ru  s      r]   r  r    r|  ra   c                    g rW   rX   ru  s      r]   rpushxListCommands.rpushx  r   ra   c                    g rW   rX   ru  s      r]   r  r    rx   ra   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
RPUSHXre   ru  s      r]   r  r    r  ra   c                    g rW   rX   rZ   r  r  rankr   maxlens         r]   lposListCommands.lpos$  s     "%ra   c                    g rW   rX   r  s         r]   r  r  .  s     -0ra   c                    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
RANKra  MAXLENLPOSr   r  )rZ   r  r  r  r   r  rg   s          r]   r  r  8  sm    B %)=MM64.)MM7E*+MM8V,-##FAVA4&AAra   c
                    g rW   rX   
rZ   r  r  r  byr'  descalphastoregroupss
             r]   sortListCommands.sorte  s     ra   c
                    g rW   rX   r  s
             r]   r  r  s  s     #&ra   c
                   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   STORErM   zVwhen using "groups" the "get" argument must be specified and contain at least two keysr  r   SORT)r   rS  r   r  r   r   r  rf   )rZ   r  r  r  r  r'  r  r  r  r  rg   grb  s                r]   r  r    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??ra   c                    g rW   rX   rZ   r   r  r  r  r'  r  r  s           r]   sort_roListCommands.sort_ro        ra   c                    g rW   rX   r  s           r]   r  r         (+ra   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
)r  r  r  r'  r  r  )r  r  s           r]   r  r    s#    : yy##  
 	
ra   rX   r   )rZ   r=   r   r0   r  Number | Noner   r    )rZ   r   r   r0   r  r  r   z"Awaitable[BlockingListPopResponse])r   r0   r  r  r   z<BlockingListPopResponse | Awaitable[BlockingListPopResponse])
rZ   r=   r  r1   rh  r1   r  r  r   r  )
rZ   r   r  r1   rh  r1   r  r  r   r  )r  r1   rh  r1   r  r  r   r  )rZ   r=   r  r  rD  r   rk   r   rE  r   r   r   r   r3   )rZ   r   r  r  rD  r   rk   r   rE  r   r   r   r   Awaitable[ListMultiPopResponse])r  r  rD  r   rk   r   rE  r   r   r   r   6ListMultiPopResponse | Awaitable[ListMultiPopResponse])rZ   r=   rN  r   rk   r   rE  r   r   r   r   r3   )rZ   r   rN  r   rk   r   rE  r   r   r   r   r  )
rN  r   rk   r   rE  r   r   r   r   r  rZ   r=   r  r1   rx  r   r   r  rZ   r   r  r1   rx  r   r   r  r  r1   rx  r   r   r  )rZ   r=   r  r1   r]  r   r^  r   r  r   r   r   )rZ   r   r  r1   r]  r   r^  r   r  r   r   r   )
r  r1   r]  r   r^  r   r  r   r   r   r  r  r  rW   )rZ   r=   r  r1   r   r   r   &bytes | str | list[bytes | str] | None)rZ   r   r  r1   r   r   r   1Awaitable[bytes | str | list[bytes | str] | None])r  r1   r   r   r   Zbytes | str | list[bytes | str] | None | Awaitable[bytes | str | list[bytes | str] | None]rZ   r=   r  r1   rv  r)   r   r   rZ   r   r  r1   rv  r)   r   r   r  r1   rv  r)   r   r   )
rZ   r=   r  r1   r  r   r  r   r   r   )
rZ   r   r  r1   r  r   r  r   r   r   )r  r1   r  r   r  r   r   r   )
rZ   r=   r  r1   r   r   r  r   r   r   )
rZ   r   r  r1   r   r   r  r   r   r   )r  r1   r   r   r  r   r   r   )
rZ   r=   r  r1   rx  r   r  r   r   r   )
rZ   r   r  r1   rx  r   r  r   r   r   )r  r1   rx  r   r  r   r   r   )
rZ   r=   r  r1   r  r   r  r   r   r   )
rZ   r   r  r1   r  r   r  r   r   r   )r  r1   r  r   r  r   r   r   )rZ   r=   r  r1   rh  r1   r   r  )rZ   r   r  r1   rh  r1   r   r  )r  r1   rh  r1   r   r  )rZ   r=   r  r1   rv  r   r   r   )rZ   r   r  r1   rv  r   r   r   )r  r1   rv  r   r   r   r  )rZ   r=   r  r1   r  r   r  r   r   r   r  r   r   zint | list[int] | None)rZ   r   r  r1   r  r   r  r   r   r   r  r   r   z!Awaitable[int | list[int] | None])r  r1   r  r   r  r   r   r   r  r   r   z:int | list[int] | None | Awaitable[int | list[int] | None])NNNNFFNF)rZ   r=   r  r1   r  r   r  r   r  r   r'  list[str] | Noner  r   r  r   r  r   r  r|  r   r9   )rZ   r   r  r1   r  r   r  r   r  r   r'  r  r  r   r  r   r  r   r  r|  r   zAwaitable[SortResponse])r  r1   r  r   r  r   r  r   r'  r  r  r   r  r   r  r   r  r|  r   z&SortResponse | Awaitable[SortResponse])NNNNFF)rZ   r=   r   r   r  r   r  r   r  r   r'  r  r  r   r  r   r   r   )rZ   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   )r  r  r  r  r	  r   r-  r6  r=  rF  rO  rV  r_  re  rl  rw  r~  r  r  r  r  r  r  r  r  r  r  r  r
  rX   ra   r]   r*  r*  M  sz   
 HI& &(-&8E&	 & & IJ1!1).19F1	+1 1
 5644$14	E4* HI& &(-&8E&	 & & IJ1!1).19F1	+1 1
 5644$14	E4* QR! !'+!26!AN!	! ! RS,!,(,,37,BO,	&, ,E"  # ## # 	#
 # # 
# #  .!.. . 	.
 . . 
). . 99 9 	9
 9 9 
@9*  # ## # 	#
 # 
# #  .!.. . 	.
 . 
). . 88 8 	8
 8 
@8& ! !(,!58!	! ! ,!,)-,69,	&, ,H  (,58DGPS	  !)-69EHQT	 MM!$M03M<?M	M > >J J?  !5 55 5 
0	5 5  !@!@@ @ 
;	@ @ !66 6
	6* P P!)-8>	 < Q Q!)-8>	 =    (, 58 ?B 	    +!+)-+69+@C+	%+ +MM!$M+.M	9M V V!)-69BE	 @ W W!)-69BE	 @ V V!)-69@C	 
?  !5 55 5 
0	5 5  !@!@@ @ 
;	@ @ !66 6
	6* ! !'+!26!	! ! ,!,(,,37,	&, ,	; P P!)-8>	 < N N!)-8;	 = 
   !% %% % 	%
 % % 
 % % 
   !0!00 0 	0
 0 0 
+0 0   !+B+B +B 	+B
 +B +B 
F+BZ  ! $ #   	
       
   ! $ #&!&& & 	&
 & & & & & & 
!& &  ! $ #G@G@ G@ 	G@
 G@ G@ G@ G@ G@ G@ 
0G@R  ! $	  	 	  	  		 
 	  	  	  	  
	  	   ! $	+!	+	+ 	+ 		+
 	+ 	+ 	+ 	+ 
&	+ 	+ ! $

 
 	

 
 
 
 
 
:
 
ra   r*  c                  4    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rg)ArrayAggregateOperationsi  SUMMINMAXANDORXORMATCHUSEDrX   N)r  r  r  r  r  r  r  r  r  r  r  r  r
  rX   ra   r]   r  r    s*    
C
C
C
C	B
CEDra   r  c                  $    \ rS rSrSrSrSrSrSrg)ArrayPredicateTypei  EXACTr  GLOBRErX   N)	r  r  r  r  r  r  r  r  r
  rX   ra   r]   r  r    s    EED	Bra   r  c                      \ rS rSrSrSrSrg)ArrayPredicateCombinatori  r  r  rX   N)r  r  r  r  r  r  r
  rX   ra   r]   r  r    s    
C	Bra   r  c                     \ rS rSrSr\          S;S j5       r\          S<S j5       rS=S jr\        S>S j5       r\        S?S j5       rS@S jr\        SAS	 j5       r\        SBS
 j5       rSCS jr\        SDS j5       r	\        SES j5       r	      SFS jr	\          SGS j5       r
\          SHS j5       r
        SIS jr
\ SJ           SKS jj5       r\ SJ           SLS jj5       r SJ         SMS jjr\    SN                   SOS jj5       r\    SN                   SPS jj5       r    SN                 SQS jjr\SRS j5       r\        SSS j5       rSTS jr\        SUS j5       r\        SVS j5       rSWS jr\SXS j5       r\SYS  j5       rSZS! jr\SXS" j5       r\SYS# j5       rSZS$ jr\ S[       S\S% jj5       r\ S[       S]S& jj5       r S[     S^S' jjr\S_S( j5       r\S`S) j5       rSaS* jr\SbS+ j5       r\ScS, j5       rSdS- jr\SeS. j5       r\        SfS/ j5       rSgS0 jr\          ShS1 j5       r\          SiS2 j5       rSjS3 jr\ S[         SkS4 jj5       r\ S[         SlS5 jj5       r S[       SmS6 jjr\ SJ             SnS7 jj5       r\ SJ             SoS8 jj5       r SJ           SpS9 jjrS:rg)qArrayCommandsi  z%
Redis commands for Array data type.
c                    g rW   rX   rZ   r  rx  rv  s       r]   arsetArrayCommands.arset#  r@  ra   c                    g rW   rX   r  s       r]   r  r  (  rx   ra   c                *    U R                   " SX/UQ76 $ )a>  
Set one or more contiguous ``values`` in the array stored at ``name``
starting at ``index``. When multiple values are provided, they are
stored at consecutive indices beginning at ``index``.

Returns the number of new slots that were set (previously empty).

For more information, see https://redis.io/commands/arset
ARSETre   r  s       r]   r  r  -  s     ##GTB6BBra   c                    g rW   rX   rZ   r  r  s      r]   armsetArrayCommands.armset9  r@  ra   c                    g rW   rX   r  s      r]   r  r  >  rx   ra   c                ~    / nUR                  5        H  nUR                  U5        M     U R                  " SU/UQ76 $ )a3  
Set multiple index/value pairs in the array stored at ``name``.
``mapping`` is a dictionary of zero-based integer indices to values.
Pairs may be non-contiguous and in any order.

Returns the number of new slots that were set (previously empty).

For more information, see https://redis.io/commands/armset
ARMSETr  rZ   r  r  r
  r  s        r]   r  r  C  s=     MMODLL $##Hd;U;;ra   c                    g rW   rX   rU  s      r]   argetArrayCommands.argetR  r(  ra   c                    g rW   rX   rU  s      r]   r  r  W  r  ra   c                &    U R                  SX5      $ )z
Return the value at ``index`` in the array stored at ``name``.

Returns ``None`` if ``name`` does not exist or no value is set at
``index``.

For more information, see https://redis.io/commands/arget
ARGETre   rU  s      r]   r  r  \  s     ##GT99ra   c                    g rW   rX   rZ   r  indicess      r]   armgetArrayCommands.armgeti  r  ra   c                    g rW   rX   r  s      r]   r  r  n  r	  ra   c                *    U R                   " SU/UQ76 $ )a  
Return the values at the specified ``indices`` in the array stored at
``name``. The reply preserves the order of the requested indices and
returns ``None`` for any index that is not set or when ``name`` does
not exist.

For more information, see https://redis.io/commands/armget
ARMGETre   r  s      r]   r  r  s  s     ##Hd=W==ra   c                    g rW   rX   r  s       r]   
argetrangeArrayCommands.argetrange  r  ra   c                    g rW   rX   r  s       r]   r  r    r	  ra   c                (    U R                  SXU5      $ )z
Return the values in the inclusive index range [``start``, ``end``]
in the array stored at ``name``. If ``start`` is greater than ``end``,
elements are returned in reverse index order.

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

ARGETRANGEre   r  s       r]   r  r    s     ##L$sCCra   Nc                    g rW   rX   rZ   r  r  r  limits        r]   arscanArrayCommands.arscan  r  ra   c                    g rW   rX   r  s        r]   r!  r"    s     47ra   c                \    XU/nUb  UR                  SU/5        U R                  " S/UQ76 $ )a  
Iterate populated elements of the array stored at ``name`` in the
inclusive range [``start``, ``end``] and return a list of
``[index, value]`` pairs in traversal order:
``[[idx1, val1], [idx2, val2], ...]``. Empty slots are skipped. If
``start`` is greater than ``end``, the iteration is reversed.

``limit`` caps the number of populated elements returned. When
omitted, all populated elements in range are returned.

For more information, see https://redis.io/commands/arscan
r  ARSCANr  )rZ   r  r  r  r   rg   s         r]   r!  r"    s;    & S)MM8U+,##H6v66ra   c	                    g rW   rX   	rZ   r  r  r  
predicates
combinatorr   rY  nocases	            r]   argrepArrayCommands.argrep  s     58ra   c	                    g rW   rX   r'  s	            r]   r+  r,    s	     @Cra   c	                H   XU/n	U H"  u  pU	R                  U
R                  U/5        M$     Ub  U	R                  UR                  5        Ub  U	R                  SU/5        U(       a  U	R                  S5        U(       a  U	R                  S5        U R                  " S/U	Q76 $ )a}  
Search elements of the array stored at ``name`` within the inclusive
index range [``start``, ``end``] using one or more textual
``predicates``. Each predicate is a ``(type, value)`` tuple where
``type`` is a member of ``ArrayPredicateType``
(``EXACT``, ``MATCH``, ``GLOB``, ``RE``).

Multiple predicates are combined via ``combinator``
(``ArrayPredicateCombinator.AND`` or ``OR``); the server defaults to
OR when omitted. ``limit`` caps the number of matches.
``withvalues=True`` returns a list of ``[index, value]`` pairs
(``[[idx, val], ...]``) instead of a flat list of indices.
``nocase=True`` makes all comparisons case-insensitive.

Without ``withvalues``, returns a flat list of matching indices in
traversal order. With ``withvalues``, returns a list of
``[index, value]`` pairs in traversal order. Empty slots are
skipped.

For more information, see https://redis.io/commands/argrep
r  s
   WITHVALUESs   NOCASEARGREP)rS  r  r   rf   )rZ   r  r  r  r(  r)  r   rY  r*  rg   predicate_typer  s               r]   r+  r,    s    H S)%/!NMM>//78 &0!MM***+MM8U+,MM-(MM)$##H6v66ra   c                    g rW   rX   r  s      r]   ardelArrayCommands.ardel  r   ra   c                    g rW   rX   r  s      r]   r2  r3    rx   ra   c                *    U R                   " SU/UQ76 $ )a  
Delete elements at the specified ``indices`` in the array stored at
``name``. Deleting an index that does not exist counts as zero
elements deleted and does not modify the array.

Returns the number of elements deleted.

For more information, see https://redis.io/commands/ardel
ARDELre   r  s      r]   r2  r3    s     ##GT<G<<ra   c                    g rW   rX   rZ   r  rangess      r]   
ardelrangeArrayCommands.ardelrange  r@  ra   c                    g rW   rX   r8  s      r]   r:  r;  $  rx   ra   c                h    U/nU H  u  pEUR                  XE/5        M     U R                  " S/UQ76 $ )a  
Delete elements within one or more inclusive index ranges in the
array stored at ``name``. Each range is a ``(start, end)`` tuple.
If ``start`` is greater than ``end`` for a given pair, the range is
processed in ascending order regardless. Multiple pairs may overlap;
each element is counted at most once.

Returns the number of elements deleted.

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

ARDELRANGEr  )rZ   r  r9  rg   r  r  s         r]   r:  r;  )  s;     v JEMM5,' !##L:6::ra   c                    g rW   rX   rB  s     r]   arcountArrayCommands.arcount:  r   ra   c                    g rW   rX   rB  s     r]   r@  rA  =  r   ra   c                &    U R                  SU5      $ )z
Return the number of non-empty elements in the array stored at
``name``. Returns 0 if ``name`` does not exist.

For more information, see https://redis.io/commands/arcount
ARCOUNTre   rB  s     r]   r@  rA  @  s     ##It44ra   c                    g rW   rX   rB  s     r]   arlenArrayCommands.arlenI      <?ra   c                    g rW   rX   rB  s     r]   rF  rG  L  r{  ra   c                &    U R                  SU5      $ )z
Return the length of the array stored at ``name``, defined as the
maximum set index plus one. Returns 0 if ``name`` does not exist.

For more information, see https://redis.io/commands/arlen
ARLENre   rB  s     r]   rF  rG  O  s     ##GT22ra   c                    g rW   rX   rZ   r  fulls      r]   arinfoArrayCommands.arinfoX  rx   ra   c                    g rW   rX   rM  s      r]   rO  rP  ]  r   ra   c                ^    U/nU(       a  UR                  S5        U R                  " S/UQ76 $ )a`  
Return metadata about the array stored at ``name`` as a dictionary.
When ``full`` is ``True``, additionally include per-slice statistics
(dense/sparse slice counts, average sizes, fill rates), which makes
the call O(N) instead of O(1).

Raises ``ResponseError`` when the key does not exist.

For more information, see https://redis.io/commands/arinfo
   FULLARINFOr  )rZ   r  rN  rg   s       r]   rO  rP  b  s0     vMM'"##H6v66ra   c                    g rW   rX   rB  s     r]   arnextArrayCommands.arnextt  rn  ra   c                    g rW   rX   rB  s     r]   rV  rW  w  rv   ra   c                &    U R                  SU5      $ )a  
Return the next index ``ARINSERT`` would use for the array stored at
``name``. Returns 0 if ``name`` does not exist or no insert happened
yet, and ``None`` when the insertion cursor is exhausted (next insert
would overflow).

For more information, see https://redis.io/commands/arnext
ARNEXTre   rB  s     r]   rV  rW  z  s     ##Hd33ra   c                    g rW   rX   rU  s      r]   arseekArrayCommands.arseek  ri  ra   c                    g rW   rX   rU  s      r]   r\  r]    r9  ra   c                &    U R                  SX5      $ )a  
Set the insert cursor of the array stored at ``name`` to ``index``.
Subsequent ``ARINSERT`` and ``ARRING`` operations begin inserting at
this position.

Returns 1 if the cursor was set, 0 if ``name`` does not exist.

For more information, see https://redis.io/commands/arseek
ARSEEKre   rU  s      r]   r\  r]    s     ##Hd::ra   c                    g rW   rX   ru  s      r]   arinsertArrayCommands.arinsert  rv   ra   c                    g rW   rX   ru  s      r]   rb  rc    rx   ra   c                *    U R                   " SU/UQ76 $ )a  
Insert one or more ``values`` at consecutive indices in the array
stored at ``name``, beginning at the current insert cursor position.
The cursor advances by one for each value inserted. Use ``ARNEXT``
to inspect the current cursor position and ``ARSEEK`` to reposition
it.

Returns the last index where a value was inserted.

For more information, see https://redis.io/commands/arinsert
ARINSERTre   ru  s      r]   rb  rc    s     ##J>v>>ra   c                    g rW   rX   rZ   r  sizerv  s       r]   arringArrayCommands.arring  r@  ra   c                    g rW   rX   rh  s       r]   rj  rk    rx   ra   c                *    U R                   " SX/UQ76 $ )a  
Insert one or more ``values`` into the array stored at ``name`` as a
fixed-size ring buffer of ``size`` slots. Each value is placed at
``insert_idx % size``, wrapping back to index 0 once the end is
reached and overwriting older values when full. If ``size`` is
smaller than the current window, the array is truncated to fit.

Returns the last index where a value was inserted.

For more information, see https://redis.io/commands/arring
ARRINGre   rh  s       r]   rj  rk    s     ##HdB6BBra   c                    g rW   rX   rZ   r  r   revs       r]   arlastitemsArrayCommands.arlastitems  r  ra   c                    g rW   rX   rp  s       r]   rr  rs    r	  ra   c                ^    X/nU(       a  UR                  S5        U R                  " S/UQ76 $ )a{  
Return up to ``count`` most recently inserted elements from the array
stored at ``name``. If the array contains fewer elements than
``count``, all elements are returned.

When ``rev`` is ``True``, elements are returned in reverse
chronological order (most recent first) instead of the default
oldest-first order.

For more information, see https://redis.io/commands/arlastitems
s   REVARLASTITEMSr  )rZ   r  r   rq  rg   s        r]   rr  rs    s0     }MM&!##M;F;;ra   c                    g rW   rX   rZ   r  r  r  r  r  s         r]   aropArrayCommands.arop       $'ra   c                    g rW   rX   rx  s         r]   ry  rz    s     /2ra   c                l    XX4R                   /nUb  UR                  U5        U R                  " S/UQ76 $ )a  
Perform an aggregate ``operation`` on elements of the array stored at
``name`` in the inclusive index range [``start``, ``end``]. The range
is always scanned from the lower to the higher index regardless of
argument order.

``operation`` is one of the members of ``ArrayAggregateOperations``.
``value`` is required when ``operation`` is
``ArrayAggregateOperations.MATCH`` and specifies the value to compare
against.

Returns a bulk string for ``SUM``, ``MIN`` and ``MAX``, an integer
for ``AND``, ``OR``, ``XOR``, ``MATCH`` and ``USED``, or ``None``
when no elements match the operation.

For more information, see https://redis.io/commands/arop
AROP)r  r   rf   )rZ   r  r  r  r  r  rg   s          r]   ry  rz    s:    2 S//:MM% ##F4V44ra   rX   )
rZ   r=   r  r1   rx  r   rv  r)   r   r   )
rZ   r   r  r1   rx  r   rv  r)   r   r   )r  r1   rx  r   rv  r)   r   r   )rZ   r=   r  r1   r  Mapping[int, FieldT]r   r   )rZ   r   r  r1   r  r  r   r   )r  r1   r  r  r   r   r  r  r  )rZ   r=   r  r1   r  r   r   r  )rZ   r   r  r1   r  r   r   r  )r  r1   r  r   r   r	  )
rZ   r=   r  r1   r  r   r  r   r   r  )
rZ   r   r  r1   r  r   r  r   r   r  )r  r1   r  r   r  r   r   r	  rW   )rZ   r=   r  r1   r  r   r  r   r   r   r   zlist[list[int | bytes | str]])rZ   r   r  r1   r  r   r  r   r   r   r   z(Awaitable[list[list[int | bytes | str]]])
r  r1   r  r   r  r   r   r   r   zHlist[list[int | bytes | str]] | Awaitable[list[list[int | bytes | str]]])NNFF)rZ   r=   r  r1   r  r   r  r   r(  +list[tuple[ArrayPredicateType, EncodableT]]r)  ArrayPredicateCombinator | Noner   r   rY  r   r*  r   r   z)list[int] | list[list[int | bytes | str]])rZ   r   r  r1   r  r   r  r   r(  r  r)  r  r   r   rY  r   r*  r   r   z4Awaitable[list[int] | list[list[int | bytes | str]]])r  r1   r  r   r  r   r(  r  r)  r  r   r   rY  r   r*  r   r   z`list[int] | list[list[int | bytes | str]] | Awaitable[list[int] | list[list[int | bytes | str]]])rZ   r=   r  r1   r  r   r   r   )rZ   r   r  r1   r  r   r   r   )r  r1   r  r   r   r   )rZ   r=   r  r1   r9  r  r   r   )rZ   r   r  r1   r9  r  r   r   )r  r1   r9  r  r   r   r  r  r  r  )rZ   r=   r  r1   rN  r   r   zdict[str, int])rZ   r   r  r1   rN  r   r   zAwaitable[dict[str, int]])r  r1   rN  r   r   z*dict[str, int] | Awaitable[dict[str, int]])rZ   r=   r  r1   r   r   )rZ   r   r  r1   r   r  )r  r1   r   r  )rZ   r=   r  r1   rx  r   r   r   )rZ   r   r  r1   rx  r   r   r   )r  r1   rx  r   r   r   r  r  r  )
rZ   r=   r  r1   ri  r   rv  r)   r   r   )
rZ   r   r  r1   ri  r   rv  r)   r   r   )r  r1   ri  r   rv  r)   r   r   )
rZ   r=   r  r1   r   r   rq  r   r   r  )
rZ   r   r  r1   r   r   rq  r   r   r  )r  r1   r   r   rq  r   r   r	  )rZ   r=   r  r1   r  r   r  r   r  r  r  r  r   zbytes | str | int | None)rZ   r   r  r1   r  r   r  r   r  r  r  r  r   z#Awaitable[bytes | str | int | None])r  r1   r  r   r  r   r  r  r  r  r   z>bytes | str | int | None | Awaitable[bytes | str | int | None])r  r  r  r  r	  r   r  r  r  r  r  r!  r+  r2  r:  r@  rF  rO  rV  r\  rb  rj  rr  ry  r
  rX   ra   r]   r  r    s	     (,58CI	  !)-69DJ	 
C  (,7K	  !)-8L	 < ! !(,!58!	! ! ,!,)-,69,	&, ,: ' '(,'8;'	!' ' 2!2)-29<2	,2 2>>$'>	G> ' '(,'58'?B'	!' ' 2!2)-2692@C2	,2 2
D
D!$
D+.
D	G
D  !, ,, , 	,
 , 
', ,  !7!77 7 	7
 7 
27 7 !77 7 	7
 7 
R70  7;  
8 
8
8 
8 	
8
 @
8 4
8 
8 
8 
8 
3
8 
8  7;  
C!
C
C 
C 	
C
 @
C 4
C 
C 
C 
C 
>
C 
C$ 7;  /7/7 /7 	/7
 @/7 4/7 /7 /7 /7	?/7b N N!)-9<	 
=  (,7F	  !)-8G	 ;" A AM M5 ? ?K K3 ;@ (,48	  <A(!()-(59(	"( (
 (-77 $7	37$ G GS S	4 L LX X
; S S!)-8>	 ?  (,47BH	  !)-58CI	 C FK' '(,'58'?C'	!' ' GL2!2)-2692@D2	,2 2
 38<<!$<+/<	G<&  $(' '' ' 	'
 ,' !' 
"' '  $(2!22 2 	2
 ,2 !2 
-2 2 $(55 5 	5
 ,5 !5 
J5 5ra   r  c                     \ rS rSrSr\    S           SS jj5       r\    S           SS jj5       r    S         SS jjr   S       SS jjr\   S           SS	 jj5       r\   S           SS
 jj5       r   S         SS jjr  S        S!S jjr	\    S             S"S jj5       r
\    S             S#S jj5       r
    S           S$S jjr
   S         S%S jjr\SSS\4             S&S jj5       r\SSS\4             S'S jj5       rSSS\4           S(S jjrSS\4         S)S jjrSrg)*ScanCommandsi  z:
Redis SCAN commands.
see: https://redis.io/commands/scan
r   Nc                    g rW   rX   rZ   cursormatchr   r@  r\   s         r]   scanScanCommands.scan  s     ra   c                    g rW   rX   r  s         r]   r  r  (  s     #&ra   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   COUNTrN  SCANr  )rZ   r  r  r   r@  r\   rg   s          r]   r  r  2  sk    0 %+8MM8U+,MM8U+,MM7E*+##F>V>v>>ra   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   )r  r  r   r@  NrX   r  )rZ   r  r   r@  r\   r  datas          r]   	scan_iterScanCommands.scan_iterS  sL     * k99 %HNLF OO	 k s   %86
88c                    g rW   rX   rZ   r  r  r  r   s        r]   sscanScanCommands.sscano       ra   c                    g rW   rX   r  s        r]   r  r  x       #&ra   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
r  r  SSCANr  )rZ   r  r  r  r   rg   s         r]   r  r    sO    " %)>MM8U+,MM8U+,##G5f55ra   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   )r  r  r   Nr  )rZ   r  r  r   r  r  s         r]   
sscan_iterScanCommands.sscan_iter  s:      k::d:TLFOO ks    31
33c                    g rW   rX   rZ   r  r  r  r   	no_valuess         r]   hscanScanCommands.hscan       ra   c                    g rW   rX   r  s         r]   r  r    r{  ra   c                    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
r  r  s   NOVALUESHSCANr  r  )rZ   r  r  r  r   r  rg   s          r]   r  r    sh    ( %)>MM8U+,MM8U+, MM;-(##GJfJ	JJra   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   )r  r  r   r  Nr  r
  )rZ   r  r  r   r  r  r  s          r]   
hscan_iterScanCommands.hscan_iter  s[     " k::5 & LF ::<'' k
  's'   (AAAA
AAAc                    g rW   rX   rZ   r  r  r  r   score_cast_funcs         r]   zscanScanCommands.zscan  r  ra   c                    g rW   rX   r  s         r]   r  r    r{  ra   c                    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
r  r  r  ZSCANr  )rZ   r  r  r  r   r  rg   rb  s           r]   r  r    s^    ( MM8U+,MM8U+,$o6##G@f@@@ra   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   )r  r  r   r  Nr  )rZ   r  r  r   r  r  r  s          r]   
zscan_iterScanCommands.zscan_iter(  sN     " k:: / & LF OO k s   #64
66rX   )r   NNN)rZ   r=   r  r   r  PatternT | Noner   r   r@  r   r   r7   )rZ   r   r  r   r  r  r   r   r@  r   r   Awaitable[ScanResponse])
r  r   r  r  r   r   r@  r   r   &ScanResponse | Awaitable[ScanResponse]r  )r  Union[PatternT, None]r   Optional[int]r@  r  r   r   )r   NN)rZ   r=   r  r1   r  r   r  r  r   r   r   r7   )rZ   r   r  r1   r  r   r  r  r   r   r   r  )
r  r1   r  r   r  r  r   r   r   r  r  )r  r1   r  r  r   r  r   r   )rZ   r=   r  r1   r  r   r  r  r   r   r  r|  r   r/   )rZ   r   r  r1   r  r   r  r  r   r   r  r|  r   zAwaitable[HScanResponse])r  r1   r  r   r  r  r   r   r  r|  r   z(HScanResponse | Awaitable[HScanResponse])
r  r1   r  r  r   r  r  Union[bool, None]r   r   )rZ   r=   r  r1   r  r   r  r  r   r   r  type | Callabler   rE   )rZ   r   r  r1   r  r   r  r  r   r   r  r  r   zAwaitable[ZScanResponse])r  r1   r  r   r  r  r   r   r  r  r   z(ZScanResponse | Awaitable[ZScanResponse])
r  r1   r  r  r   r  r  Union[type, Callable]r   r   )r  r  r  r  r	  r   r  r  r  r  r  r  r  r  r  r
  rX   ra   r]   r  r    s   
  !%     	
  
   !%  &!&& & 	&
 & 
!& & !%  ?? ? 	?
 ? 
0?F (,##	$  	 
8  !%    	
  
   !% &!&& & 	&
 & 
!& & !% 66 6 	6
 6 
066 (,#	 % 	
 
&  !% !%   	
   
   !% !%'!'' ' 	'
 ' ' 
"' ' !% !%KK K 	K
 K K 
2K@ (,#'+(( %( 	(
 %( 
(6  !% +0   	
  ) 
   !% +0'!'' ' 	'
 ' )' 
"' ' !% +0AA A 	A
 A )A 
2A> (,#16 % 	
 / 
 ra   r  c                      \ rS rSr   S       S	S jjr  S
       SS jjr   S         SS jjrSS\4         SS jjrSr	g)AsyncScanCommandsiE  Nc                  #    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  )rZ   r  r   r@  r\   r  r  ds           r]   r  AsyncScanCommands.scan_iterF  sY     * k!% "%"HN" LF  	 ks   !AAA A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r  r  )rZ   r  r  r   r  r  r  s          r]   r  AsyncScanCommands.sscan_iterc  sQ      k!%5 ", " LF  	 ks   ?=??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r  r  )rZ   r  r  r   r  r  r  its           r]   r  AsyncScanCommands.hscan_itery  sm     " k!%5 ", " LF BH  **,BH ' ks   A$A">A$ A$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  )rZ   r  r  r   r  r  r  r  s           r]   r  AsyncScanCommands.zscan_iter  s[     " k!% / ", " LF   ks   AA AArX   r  )r  r  r   r  r@  r  r   r   r  )r  r1   r  r  r   r  r   r   )
r  r1   r  r  r   r  r  r  r   r   )
r  r1   r  r  r   r  r  r  r   r   )
r  r  r  r  r  r  r  r  r  r
  rX   ra   r]   r  r  E  s     (,##	$  	 
@ (,#	 % 	
 
2 (,#'+ % 	
 % 
@ (,#16 % 	
 / 
 ra   r  c                  h   \ rS rSrSr\S5S j5       r\        S6S j5       rS7S jr\S8S j5       r\S9S j5       rS:S jr\        S;S	 j5       r\        S<S
 j5       r      S=S jr\          S>S j5       r	\          S?S j5       r	S@S jr	\        S;S j5       r
\        S<S j5       r
      S=S jr
\ SA         SBS jj5       r\ SA         SCS jj5       r SA       SDS jjr\          SES j5       r\          SFS j5       rSGS jr\        SHS j5       r\        SIS j5       rSJS jr\SKS j5       r\      SLS j5       rSMS jr\          SNS j5       r\          SOS j5       r        SPS  jr\SQS! j5       r\          SRS" j5       rSSS# jr\ ST       SUS% jj5       r\ ST       SVS& jj5       rSTSWS' jjr\ ST       SXS( jj5       r\ ST       SYS) jj5       rSTSZS* jjr\S5S+ j5       r\        S6S, j5       rS7S- jr\        S;S. j5       r\        S<S/ j5       r      S=S0 jr\          SES1 j5       r\          SFS2 j5       rSGS3 jrS4rg$)[SetCommandsi  zP
Redis commands for Set data type.
see: https://redis.io/topics/data-types#sets
c                    g rW   rX   ru  s      r]   saddSetCommands.sadd  r   ra   c                    g rW   rX   ru  s      r]   r  r    rx   ra   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
SADDre   ru  s      r]   r  r         ##FD:6::ra   c                    g rW   rX   rB  s     r]   scardSetCommands.scard  rH  ra   c                    g rW   rX   rB  s     r]   r  r    r{  ra   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  re   rB  s     r]   r  r         ##GT#??ra   c                    g rW   rX   r  s      r]   sdiffSetCommands.sdiff  rj  ra   c                    g rW   rX   r  s      r]   r  r         '*ra   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
SDIFFr   rR   rf   r  s      r]   r  r    s)     D'##G>d>>>ra   c                    g rW   rX   rZ   r  r   rk   s       r]   
sdiffstoreSetCommands.sdiffstore  r@  ra   c                    g rW   rX   r  s       r]   r  r    rx   ra   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

SDIFFSTOREr  r  s       r]   r  r    s&     D'##L$>>>ra   c                    g rW   rX   r  s      r]   sinterSetCommands.sinter  rj  ra   c                    g rW   rX   r  s      r]   r  r    r  ra   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
SINTERr   r  r  s      r]   r  r    )     D'##H?t?$??ra   c                    g rW   rX   rZ   rD  r   r   s       r]   
sintercardSetCommands.sintercard  r@  ra   c                    g rW   rX   r  s       r]   r  r    rx   ra   c                @    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
SINTERCARDr   re   rZ   rD  r   r   rk   s        r]   r  r     6     /$///##LC4CdCCra   c                    g rW   rX   r  s       r]   sinterstoreSetCommands.sinterstore/  r@  ra   c                    g rW   rX   r  s       r]   r  r  4  rx   ra   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
SINTERSTOREr  r  s       r]   r  r  9  &     D'##M4?$??ra   c                    g rW   rX   r  s      r]   	sismemberSetCommands.sismemberC  r/  ra   c                    g rW   rX   r  s      r]   r  r  H  r6  ra   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  re   r  s      r]   r  r  M  s     ##KD6#JJra   c                    g rW   rX   rB  s     r]   smembersSetCommands.smembersY  r   ra   c                    g rW   rX   rB  s     r]   r  r  \  r  ra   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  re   rB  s     r]   r  r  a  s     ##J6#BBra   c                    g rW   rX   rZ   r  rv  rk   s       r]   
smismemberSetCommands.smismemberi  r  ra   c                    g rW   rX   r  s       r]   r  r  n  r  ra   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

SMISMEMBERr   r  r  s       r]   r  r  s  s-     F)##L$KKTFKKra   c                    g rW   rX   rZ   r  rh  r  s       r]   smoveSetCommands.smove  r   ra   c                    g rW   rX   r  s       r]   r  r     r  ra   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
SMOVEre   r  s       r]   r  r     s     ##GSu==ra   Nc                    g rW   rX   rk  s      r]   spopSetCommands.spop  r  ra   c                    g rW   rX   rk  s      r]   r%  r&    s     <?ra   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SPOPre   )rZ   r  r   rk   s       r]   r%  r&    s2     T!.w4"##FD8488ra   c                    g rW   rX   rZ   r  numbers      r]   srandmemberSetCommands.srandmember  s     25ra   c                    g rW   rX   r+  s      r]   r-  r.    s     =@ra   c                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SRANDMEMBERre   )rZ   r  r,  rk   s       r]   r-  r.    s2     d"06B##M4?$??ra   c                    g rW   rX   ru  s      r]   sremSetCommands.srem  r   ra   c                    g rW   rX   ru  s      r]   r3  r4    rx   ra   c                *    U R                   " SU/UQ76 $ )z_
Remove ``values`` from set ``name``

For more information, see https://redis.io/commands/srem
SREMre   ru  s      r]   r3  r4    r  ra   c                    g rW   rX   r  s      r]   sunionSetCommands.sunion  rj  ra   c                    g rW   rX   r  s      r]   r9  r:    r  ra   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
SUNIONr   r  r  s      r]   r9  r:    r  ra   c                    g rW   rX   r  s       r]   sunionstoreSetCommands.sunionstore  r@  ra   c                    g rW   rX   r  s       r]   r?  r@    rx   ra   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
SUNIONSTOREr  r  s       r]   r?  r@    r	  ra   rX   r  r  r  r  r  r  )rZ   r=   r   r   rk   r   r   set[bytes | str])rZ   r   r   r   rk   r   r   Awaitable[set[bytes | str]])r   r   rk   r   r   .set[bytes | str] | Awaitable[set[bytes | str]])
rZ   r=   r  r   r   r   rk   r   r   r   )
rZ   r   r  r   r   r   rk   r   r   r   )r  r   r   r   rk   r   r   r   r  )
rZ   r=   rD  r   r   
List[KeyT]r   r   r   r   )
rZ   r   rD  r   r   rG  r   r   r   r   )rD  r   r   rG  r   r   r   r   )
rZ   r=   r  r1   r   r   rk   r   r   r   )
rZ   r   r  r1   r   r   rk   r   r   r   )r  r1   r   r   rk   r   r   r   )rZ   r=   r  r1   r  r   r   zLiteral[0] | Literal[1])rZ   r   r  r1   r  r   r   z"Awaitable[Literal[0] | Literal[1]])r  r1   r  r   r   z<Literal[0] | Literal[1] | Awaitable[Literal[0] | Literal[1]])rZ   r=   r  r1   r   rD  )rZ   r   r  r1   r   rE  )r  r1   r   rF  )
rZ   r=   r  r1   rv  r   rk   r   r   zlist[Literal[0] | Literal[1]])
rZ   r   r  r1   rv  r   rk   r   r   z(Awaitable[list[Literal[0] | Literal[1]]])r  r1   rv  r   rk   r   r   zHlist[Literal[0] | Literal[1]] | Awaitable[list[Literal[0] | Literal[1]]])
rZ   r=   r  r1   rh  r1   r  r   r   r   )
rZ   r   r  r1   rh  r1   r  r   r   r   )r  r1   rh  r1   r  r   r   r   rW   )rZ   r=   r  r1   r   r   r   z%bytes | str | set[bytes | str] | None)rZ   r   r  r1   r   r   r   z0Awaitable[bytes | str | set[bytes | str] | None])r  r1   r   r   r   zXbytes | str | set[bytes | str] | None | Awaitable[bytes | str | set[bytes | str] | None])rZ   r=   r  r1   r,  r   r   r  )rZ   r   r  r1   r,  r   r   r  )r  r1   r,  r   r   r  )r  r  r  r  r	  r   r  r  r  r  r  r  r  r  r  r  r  r%  r-  r3  r9  r?  r
  rX   ra   r]   r  r    s   
 O O!)-8>	 ; ? ?K K@  (,59	  *!*)-*6:*	$* *	?	?!%	?	7	?  (+37@D	  !),48AE	 ?  (,59	  *!*)-*6:*	$* *	@	@!%	@	7	@ OP +.6@IL	  PQ!,/7AJM	 
 <=DD",D58D	D  (,48AE	  !)-59BF	 @ & &(,&58&	 & & 1!1)-1691	+1 1
K O O*!*)-*	$* *C , ,(,,6:,CG,	&, , 7!7)-77;7DH7	17 7LL"&L/3L	QL V V!(,37@C	 > BF4 4(,45?4	.4 4 CG?!?)-?6@?	9? ?	9 CG5 5(,56@5	/5 5 DH@!@)-@7A@	:@ @@ O O!)-8>	 ;  (,59	  *!*)-*6:*	$* *	@	@!%	@	7	@  (,48AE	  !)-59BF	 @ra   r  c                     \ rS rSrSr\          STS j5       r\          SUS j5       r        SVS jr\SS.           SWS jj5       r\SS.           SXS	 jj5       rSS.         SYS
 jjr\         SZ                         S[S jj5       r\         SZ                         S\S jj5       r         SZ                       S]S jjr\  S^         S_S jj5       r	\  S^         S`S jj5       r	  S^       SaS jjr	\   Sb                 ScS jj5       r
\   Sb                 SdS jj5       r
   Sb               SeS jjr
\     Sf                       SgS jj5       r\     Sf                       ShS jj5       r     Sf                     SiS jjr\SjS j5       r\        SkS j5       rSlS jr\SS.         SmS jj5       r\SS.         SnS jj5       rSS.       SoS jjr\   Sp             SqS jj5       r\   Sp             SrS  jj5       r   Sp           SsS! jjr\          StS" j5       r\          SuS# j5       r        SvS$ jr\        SwS% j5       r\        SxS& j5       rSyS' jr\          StS( j5       r\          SuS) j5       r        SvS* jr\ Sz           S{S+ jj5       r\ Sz           S|S, jj5       r Sz         S}S- jjr\        S~S. j5       r\        SS/ j5       r      SS0 jr\SS1 j5       r\      SS2 j5       r    SS3 jr\ S       SS4 jj5       r\ S       SS5 jj5       r S     SS6 jjr\SS7 j5       r\SS8 j5       rSS9 jr\SSS:.               SS; jj5       r\SSS:.               SS< jj5       rSSS:.             SS= jjr\        SS> j5       r\        SS? j5       r      SS@ jr\  S^                 SSA jj5       r\  S^                 SSB jj5       r  S^               SSC jjr\   S           SSD jj5       r\   S           SSE jj5       r   S         SSF jjr\  S^         SSG jj5       r\  S^         SSH jj5       r  S^       SSI jjr\    S                 SSJ jj5       r\    S                 SSK jj5       r    S               SSL jjr\   S           SSM jj5       r\   S           SSN jj5       r   S         SSO jjr\     S               SSP jj5       r\     S               SSQ jj5       r     S             SSR jjrSSrg)StreamCommandsi  zQ
Redis commands for Stream data type.
see: https://redis.io/topics/streams-intro
c                    g rW   rX   rZ   r  	groupnameidss       r]   xackStreamCommands.xack  r@  ra   c                    g rW   rX   rK  s       r]   rN  rO    rx   ra   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
XACKre   rK  s       r]   rN  rO    s     ##FDBcBBra   KEEPREF)
ref_policyc                   g rW   rX   rZ   r  rL  rT  rM  s        r]   xackdelStreamCommands.xackdel  r  ra   c                   g rW   rX   rV  s        r]   rW  rX  $  r   ra   c                   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   ACKEDDELREFrS  z9XACKDEL ref_policy must be one of: KEEPREF, DELREF, ACKEDIDSXACKDELr   r  rS  rf   )rZ   r  rL  rT  rM  rg   s         r]   rW  rX  -  s\     FGG;;WXX:uc#h?c##I777ra   NFc                    g rW   rX   rZ   r  fieldsidr  approximate
nomkstreamminidr   rT  idmpautoidmps               r]   xaddStreamCommands.xaddC  s     ra   c                    g rW   rX   rb  s               r]   rj  rk  S  s     "%ra   c                2   / nUb  Ub  [        S5      eU
b  Ub  [        S5      eU
c  Ub  US:w  a  [        S5      eU	b  U	S;  a  [        S5      eU(       a  UR                  S5        U	b  UR                  U	5        U
b  UR                  SU
/5        UbI  [        U[        5      (       a  [        U5      S	:w  a  [        S
5      eUR                  SUS   US   /5        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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 $ )ap  
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
idmpauto: Producer ID for automatic idempotent ID calculation.
    Automatically calculates an idempotent ID based on entry content to prevent
    duplicate entries. Can only be used with id='*'. Creates an IDMP map if it
    doesn't exist yet. The producer ID must be unique per producer and consistent
    across restarts.
idmp: Tuple of (producer_id, idempotent_id) for explicit idempotent ID.
    Uses a specific idempotent ID to prevent duplicate entries. Can only be used
    with id='*'. The producer ID must be unique per producer and consistent across
    restarts. The idempotent ID must be unique per message and per producer.
    Shorter idempotent IDs require less memory and allow faster processing.
    Creates an IDMP map if it doesn't exist yet.

For more information, see https://redis.io/commands/xadd
z8Only one of ```maxlen``` or ```minid``` may be specifiedz9Only one of ```idmpauto``` or ```idmp``` may be specifiedr  z.IDMPAUTO and IDMP can only be used with id='*'r[  z6XADD ref_policy must be one of: KEEPREF, DELREF, ACKEDs
   NOMKSTREAMs   IDMPAUTOrM   z9XADD idmp must be a tuple of (producer_id, idempotent_id)s   IDMPr   rP   z(XADD maxlen must be non-negative integer   MAXLENr      MINIDr  z$XADD fields must be a non-empty dictXADD)r   r   rS  r   tupler  r   r   dictr
  rf   )rZ   r  rc  rd  r  re  rf  rg  r   rT  rh  ri  rg   r  s                 r]   rj  rk  c  s   X $&%"3VWWD$4WXX D$4")LMM!j8V&VTUUMM-(!MM*%MM;12dE**c$i1nO  MM7DGT!W56fc**fqj JKKMM)$d#MM#f+&MM(#d#MM% MM8U+,b&$''3v;!+;BCCLLNDMM$ ###FD:6::ra   c                    g rW   rX   rZ   r  idmp_durationidmp_maxsizes       r]   xcfgsetStreamCommands.xcfgset       ra   c                    g rW   rX   rt  s       r]   rw  rx         "%ra   c                X   Uc  Uc  [        S5      e/ nUb?  [        U[        5      (       a  US:  d  US:  a  [        S5      eUR                  SU/5        Ub?  [        U[        5      (       a  US:  d  US:  a  [        S5      eUR                  SU/5        U R                  " S	U/UQ76 $ )
u  
Configure the idempotency parameters for a stream's IDMP map.

Sets how long Redis remembers each idempotent ID (iid) and the maximum
number of iids to track. This command clears the existing IDMP map
(Redis forgets all previously stored iids), but only if the configuration
value actually changes.

Args:
    name: The name of the stream.
    idmp_duration: How long Redis remembers each iid in seconds.
        Default: 100 seconds (or value set by stream-idmp-duration config).
        Minimum: 1 second, Maximum: 300 seconds.
        Redis won't forget an iid for this duration (unless maxsize is reached).
        Should accommodate application crash recovery time.
    idmp_maxsize: Maximum number of iids Redis remembers per producer ID (pid).
        Default: 100 iids (or value set by stream-idmp-maxsize config).
        Minimum: 1 iid, Maximum: 1,000,000 (1M) iids.
        Should be set to: mark-delay [in msec] × (messages/msec) + margin.
        Example: 10K msgs/sec (10 msgs/msec), 80 msec mark-delay
        → maxsize = 10 × 80 + margin = 1000 iids.

Returns:
    OK on success.

For more information, see https://redis.io/commands/xcfgset
z>XCFGSET requires at least one of idmp_duration or idmp_maxsizerP   i,  z:XCFGSET idmp_duration must be an integer between 1 and 300s   IDMP-DURATIONi@B z?XCFGSET idmp_maxsize must be an integer between 1 and 1,000,000s   IDMP-MAXSIZEXCFGSET)r   r   r   rS  rf   )rZ   r  ru  rv  rg   s        r]   rw  rx    s    B  \%9P  $&$}c22 1$ 3&P  MM+];<#|S11!#')U  MM?L9:##It=f==ra   c                    g rW   rX   rZ   r  rL  consumernamemin_idle_timestart_idr   justids           r]   
xautoclaimStreamCommands.xautoclaim       ra   c                    g rW   rX   r  s           r]   r  r          #ra   c                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 >= 0r     JUSTIDTparse_justid
XAUTOCLAIM)r   r   r  rS  r   rf   )
rZ   r  rL  r  r  r  r   r  r\   rg   s
             r]   r  r  %  s    8	=!A%L  & <I	5zA~ GHHMM8U+, MM)$%)F>"##LD6DVDD!  		  		s"   B -B 
BB
B"!B"c                    g rW   rX   rZ   r  rL  r  r  message_idsidler5  
retrycountr   r  s              r]   xclaimStreamCommands.xclaimX  s     ra   c                    g rW   rX   r  s              r]   r  r  g  s     %(ra   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 integer
   RETRYCOUNTzXCLAIM force must be a boolean   FORCEzXCLAIM justid must be a booleanr  Tr  XCLAIM)
r   r   r   rd  rq  r   rS  r   r   rf   )rZ   r  rL  r  r  r  r  r5  r  r   r  r\   rg   s                r]   r  r  v  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@@@ra   c                    g rW   rX   rZ   r  rM  s      r]   xdelStreamCommands.xdel  r   ra   c                    g rW   rX   r  s      r]   r  r    rx   ra   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
XDELre   r  s      r]   r  r    s     ##FD7377ra   c                   g rW   rX   rZ   r  rT  rM  s       r]   xdelexStreamCommands.xdelex       ra   c                   g rW   rX   r  s       r]   r  r    r  ra   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`  )rZ   r  rT  rM  rg   s        r]   r  r    sZ     EFF;;VWWE3s84c##H6v66ra   c                    g rW   rX   rZ   r  rL  rd  mkstreamentries_reads         r]   xgroup_createStreamCommands.xgroup_create  s     ra   c                    g rW   rX   r  s         r]   r  r    s     ra   c                    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  )rZ   r  rL  rd  r  r  rg   s          r]   r  r    sG      %4Tb#IMM+&#MM=,78##V,,ra   c                    g rW   rX   rZ   r  rL  r  s       r]   xgroup_delconsumer!StreamCommands.xgroup_delconsumer-  r@  ra   c                    g rW   rX   r  s       r]   r  r  2  r  ra   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 DELCONSUMERre   r  s       r]   r  r  :  s     ##$8$<XXra   c                    g rW   rX   rZ   r  rL  s      r]   xgroup_destroyStreamCommands.xgroup_destroyI  r  ra   c                    g rW   rX   r  s      r]   r  r  N  r  ra   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 DESTROYre   r  s      r]   r  r  S  s     ##$4dFFra   c                    g rW   rX   r  s       r]   xgroup_createconsumer$StreamCommands.xgroup_createconsumer]  r@  ra   c                    g rW   rX   r  s       r]   r  r  b  r  ra   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 CREATECONSUMERre   r  s       r]   r  r  j  s     ###Tl
 	
ra   c                    g rW   rX   rZ   r  rL  rd  r  s        r]   xgroup_setidStreamCommands.xgroup_setid{  r  ra   c                    g rW   rX   r  s        r]   r  r    r  ra   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 SETIDr  )rZ   r  rL  rd  r  rg   s         r]   r  r    s;     2&#MM=,78##N<V<<ra   c                    g rW   rX   r  s      r]   xinfo_consumersStreamCommands.xinfo_consumers  r"  ra   c                    g rW   rX   r  s      r]   r  r    rZ  ra   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 CONSUMERSre   r  s      r]   r  r    s     ##$5tGGra   c                    g rW   rX   rB  s     r]   xinfo_groupsStreamCommands.xinfo_groups  rA  ra   c                    g rW   rX   rB  s     r]   r  r    rZ  ra   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 GROUPSre   rB  s     r]   r  r    s     ##ND99ra   c                    g rW   rX   rM  s      r]   xinfo_streamStreamCommands.xinfo_stream  rx   ra   c                    g rW   rX   rM  s      r]   r  r    r   ra   c                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
rS  rN  zXINFO STREAMr  )rZ   r  rN  rg   rb  s        r]   r  r    sC     MM'"tnG##NGVGwGGra   c                    g rW   rX   rB  s     r]   xlenStreamCommands.xlen  r.  ra   c                    g rW   rX   rB  s     r]   r  r    r   ra   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  re   rB  s     r]   r  r    r  ra   )r  r   c                   g rW   rX   rZ   r  rL  r  r  r   rM  s          r]   xnackStreamCommands.xnack       ra   c                   g rW   rX   r  s          r]   r  r         ra   c               ,   U(       d  [        S5      eUS;  a  [        S5      eXUS[        U5      /nUR                  U5        Ub$  US:  a  [        S5      eUR                  SU/5        U(       a  UR                  S5        U R                  " S	/UQ76 $ )
aB  
Negatively acknowledges one or more messages in a consumer group's
Pending Entries List (PEL).

Args:
    name: name of the stream.
    groupname: name of the consumer group.
    mode: the nacking mode. One of SILENT, FAIL, or FATAL.
        SILENT: consumer shutting down; decrements delivery counter.
        FAIL: consumer unable to process; delivery counter unchanged.
        FATAL: invalid/malicious message; delivery counter set to max.
    *ids: one or more message IDs to NACK.
    retrycount: optional integer >= 0. Overrides the mode's implicit
        delivery counter adjustment with an exact value.
    force: if True, creates a new unowned PEL entry for any ID not
        already in the group's PEL.

Returns:
    The number of messages successfully NACKed.

For more information, see https://redis.io/commands/xnack
z&XNACK requires at least one message ID>   FAILFATALSILENTz.XNACK mode must be one of: SILENT, FAIL, FATALr^  r   zXNACK retrycount must be >= 0r  r  XNACK)r   r  rS  r   rf   )rZ   r  rL  r  r  r   rM  rg   s           r]   r  r  	  s    > DEE22LMMuc#h?c!A~ ?@@MM=*56MM(###G5f55ra   c                    g rW   rX   r  s      r]   xpendingStreamCommands.xpending;  rx   ra   c                    g rW   rX   r  s      r]   r  r  @  r   ra   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  re   r  s      r]   r  r  E  s     ##Jtf#MMra   c                    g rW   rX   rZ   r  rL  minmaxr   r  r  s           r]   xpending_rangeStreamCommands.xpending_rangeQ  s     !$ra   c                    g rW   rX   r  s           r]   r  r  ]  s     ,/ra   c                   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  r   rS  r  r   rf   )	rZ   r  rL  r  r  r   r  r  rg   s	            r]   r  r  i  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                    g rW   rX   rZ   r  r  r  r   s        r]   xrangeStreamCommands.xrange       &)ra   c                    g rW   rX   r  s        r]   r  r         14ra   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
rP   z'XRANGE count must be a positive integerr  XRANGEr   r   r   r   r   r   rf   )rZ   r  r  r  r   rg   s         r]   r  r    sk    . eS))UQY IJJMM(#MM#e*%##HdIVI4&IIra   c                    g rW   rX   rZ   streamsr   blocks       r]   xreadStreamCommands.xread  s     ra   c                    g rW   rX   r	  s       r]   r	  r		         $'ra   c                  ^ / 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m[        R                  " T5      (       a  U4S jnU" 5       $ [        TS9  T$ )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   BLOCKrP   z&XREAD count must be a positive integerr  z&XREAD streams must be a non empty dict   STREAMSXREADr   c                 N   >#    TI S h  vN n [        U S9I S h  vN   U $  N N7f)Nresponseasync_record_streaming_lag)actual_responser	  s    r]   _record_and_return0StreamCommands.xread.<locals>._record_and_return  s)     (0.0/JJJ&& #1Js   %!%#%%r	  )r   r   r   r   r   rr  r  zipr
  rS  rf   inspectiscoroutiner   )	rZ   r	  r   r	  rg   r   rv  r	  r	  s	           @r]   r	  r		    s0   & 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''D&DtDx((' &'' /AOra   c                    g rW   rX   rZ   rL  r  r	  r   r	  noackclaim_min_idle_times           r]   
xreadgroupStreamCommands.xreadgroup  s     !ra   c                    g rW   rX   r	  s           r]   r	  r 	  $  s     ),ra   c                  ^^ 0 nSTU/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bL  [        U[        5      (       a  US:  a  [        S	5      eU	R                  S
5        U	R                  U5        XxS'   [        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0 UD6m[        R                  " T5      (       a  UU4S jn
U
" 5       $ [        TTS9  T$ )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

claim_min_idle_time: accepts an integer type and represents a
                     time interval in milliseconds

For more information, see https://redis.io/commands/xreadgroup
s   GROUPrP   z+XREADGROUP count must be a positive integerr  r   z/XREADGROUP block must be a non-negative integerr	  s   NOACKz=XREADGROUP claim_min_idle_time must be a non-negative integers   CLAIMr	  z+XREADGROUP streams must be a non empty dictr	  
XREADGROUPc                 P   >#    TI S h  vN n [        U TS9I S h  vN   U $  N N7f)Nr	  consumer_groupr	  )r	  rL  r	  s    r]   r	  5StreamCommands.xreadgroup.<locals>._record_and_returnn  s7     (0.0,#,   '& #1s   &"&$&&r%	  )r   r   r   r   r   rr  r  rS  r   rv  rf   r	  r	  r   )rZ   rL  r  r	  r   r	  r	  r	  rb  rg   r	  r	  s    `         @r]   r	  r 	  0  s   > $,i#FeS))UQY MNNMM(#MM#e*%eS))UQY QRRMM(#MM#e*%MM(#*1377;NQR;RS  MM(#MM-.-@)*'4((CLA,=IJJj!glln%gnn&'''IvIIx((' &'' /!( Ora   c                    g rW   rX   rZ   r  r  r  r   s        r]   	xrevrangeStreamCommands.xrevrange  r  ra   c                    g rW   rX   r)	  s        r]   r*	  r+	    r 	  ra   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
rP   z*XREVRANGE count must be a positive integerr  	XREVRANGEr   r	  )rZ   r  r  r  r   rg   s         r]   r*	  r+	    sk    . %(:eS))UQY LMMMM(#MM#e*%##KLLdVLLra   c                    g rW   rX   rZ   r  r  re  rg  r   rT  s          r]   xtrimStreamCommands.xtrim  r  ra   c                    g rW   rX   r0	  s          r]   r1	  r2	    r  ra   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, ACKEDrn  ro  r   r  XTRIMr$  )rZ   r  r  re  rg  r   rT  rg   s           r]   r1	  r2	    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;;ra   rX   )
rZ   r=   r  r1   rL  r-   rM  r;   r   r   )
rZ   r   r  r1   rL  r-   rM  r;   r   r   )r  r1   rL  r-   rM  r;   r   r   )rZ   r=   r  r1   rL  r-   rM  r;   rT  %Literal['KEEPREF', 'DELREF', 'ACKED']r   r   )rZ   r   r  r1   rL  r-   rM  r;   rT  r6	  r   r   )
r  r1   rL  r-   rM  r;   rT  r6	  r   r   )	r  NTFNNNNN)rZ   r=   r  r1   rc  Dict[FieldT, EncodableT]rd  r;   r  r   re  r   rf  r   rg  StreamIdT | Noner   r   rT  ,Literal['KEEPREF', 'DELREF', 'ACKED'] | Nonerh  r   ri  tuple[str, bytes] | Noner   r   )rZ   r   r  r1   rc  r7	  rd  r;   r  r   re  r   rf  r   rg  r8	  r   r   rT  r9	  rh  r   ri  r:	  r   r   )r  r1   rc  r7	  rd  r;   r  r  re  r   rf  r   rg  zUnion[StreamIdT, None]r   r   rT  r9	  rh  r   ri  r:	  r   r   r  )
rZ   r=   r  r1   ru  r   rv  r   r   r   )
rZ   r   r  r1   ru  r   rv  r   r   r   )r  r1   ru  r   rv  r   r   r   )z0-0NF)rZ   r=   r  r1   rL  r-   r  r&   r  r   r  r;   r   r   r  r   r   ry  )rZ   r   r  r1   rL  r-   r  r&   r  r   r  r;   r   r   r  r   r   rz  )r  r1   rL  r-   r  r&   r  r   r  r;   r   r   r  r   r   r{  )NNNFF)rZ   r=   r  r1   rL  r-   r  r&   r  r   r  (Union[List[StreamIdT], Tuple[StreamIdT]]r  r   r5  r   r  r   r   r   r  r   r   r?   )rZ   r   r  r1   rL  r-   r  r&   r  r   r  r;	  r  r   r5  r   r  r   r   r   r  r   r   zAwaitable[XClaimResponse])r  r1   rL  r-   r  r&   r  r   r  r;	  r  r   r5  r   r  r   r   r   r  r   r   z*XClaimResponse | Awaitable[XClaimResponse])rZ   r=   r  r1   rM  r;   r   r   )rZ   r   r  r1   rM  r;   r   r   )r  r1   rM  r;   r   r   )
rZ   r=   r  r1   rM  r;   rT  r6	  r   r   )
rZ   r   r  r1   rM  r;   rT  r6	  r   r   )r  r1   rM  r;   rT  r6	  r   r   )$FN)rZ   r=   r  r1   rL  r-   rd  r;   r  r   r  r   r   r   )rZ   r   r  r1   rL  r-   rd  r;   r  r   r  r   r   r   )r  r1   rL  r-   rd  r;   r  r   r  r   r   r   )
rZ   r=   r  r1   rL  r-   r  r&   r   r   )
rZ   r   r  r1   rL  r-   r  r&   r   r   )r  r1   rL  r-   r  r&   r   r   )rZ   r=   r  r1   rL  r-   r   r   )rZ   r   r  r1   rL  r-   r   r   )r  r1   rL  r-   r   r   rW   )rZ   r=   r  r1   rL  r-   rd  r;   r  r   r   r   )rZ   r   r  r1   rL  r-   rd  r;   r  r   r   r   )
r  r1   rL  r-   rd  r;   r  r   r   r   )rZ   r=   r  r1   rL  r-   r   r  )rZ   r   r  r1   rL  r-   r   r  )r  r1   rL  r-   r   r  )rZ   r=   r  r1   r   r  )rZ   r   r  r1   r   r  )r  r1   r   r  r  )rZ   r=   r  r1   rN  r   r   r  )rZ   r   r  r1   rN  r   r   r  )r  r1   rN  r   r   r  r  r  r  )rZ   r=   r  r1   rL  r-   r  "Literal['SILENT', 'FAIL', 'FATAL']rM  r;   r  r   r   r   r   r   )rZ   r   r  r1   rL  r-   r  r=	  rM  r;   r  r   r   r   r   r   )r  r1   rL  r-   r  r=	  rM  r;   r  r   r   r   r   r   )rZ   r=   r  r1   rL  r-   r   r  )rZ   r   r  r1   rL  r-   r   r  )r  r1   rL  r-   r   r  )rZ   r=   r  r1   rL  r-   r  r;   r  r;   r   r   r  ConsumerT | Noner  r   r   r@   )rZ   r   r  r1   rL  r-   r  r;   r  r;   r   r   r  r>	  r  r   r   z Awaitable[XPendingRangeResponse])r  r1   rL  r-   r  r;   r  r;   r   r   r  r>	  r  r   r   z8XPendingRangeResponse | Awaitable[XPendingRangeResponse])-+N)rZ   r=   r  r1   r  r;   r  r;   r   r   r   StreamRangeResponse | None)rZ   r   r  r1   r  r;   r  r;   r   r   r   %Awaitable[StreamRangeResponse | None])
r  r1   r  r;   r  r;   r   r   r   BStreamRangeResponse | None | Awaitable[StreamRangeResponse | None])
rZ   r=   r	  Dict[KeyT, StreamIdT]r   r   r	  r   r   rB   )
rZ   r   r	  rD	  r   r   r	  r   r   zAwaitable[XReadResponse])r	  rD	  r   r   r	  r   r   z(XReadResponse | Awaitable[XReadResponse])NNFN)rZ   r=   rL  r   r  r   r	  rD	  r   r   r	  r   r	  r   r	  r   r   rA   )rZ   r   rL  r   r  r   r	  rD	  r   r   r	  r   r	  r   r	  r   r   zAwaitable[XReadGroupResponse])rL  r   r  r   r	  rD	  r   r   r	  r   r	  r   r	  r   r   z2XReadGroupResponse | Awaitable[XReadGroupResponse])r@	  r?	  N)rZ   r=   r  r1   r  r;   r  r;   r   r   r   rA	  )rZ   r   r  r1   r  r;   r  r;   r   r   r   rB	  )
r  r1   r  r;   r  r;   r   r   r   rC	  )NTNNN)rZ   r=   r  r1   r  r   re  r   rg  r8	  r   r   rT  r9	  r   r   )rZ   r   r  r1   r  r   re  r   rg  r8	  r   r   rT  r9	  r   r   )r  r1   r  r   re  r   rg  r8	  r   r   rT  r9	  r   r   ) r  r  r  r  r	  r   rN  rW  rj  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r	  r*	  r1	  r
  rX   ra   r]   rI  rI    s   
  (,9?GP	  !)-:@HQ	 CC%+C3<C	C  =F   	
 : 
   =F!  	
 : 
  =F88 8 	8
 :8 
8, 
 !  "& CG#)-  ) 	
       A  ' 
  
 !  "& CG#)-%!%% )% 	%
 % % %  % % A% % '% 
 % %&  $  (, CG#)-X;X; )X; 	X;
 X; X; X; &X; X; AX; X; 'X; 
0X;t  %)#'	  " !	
 
   %)#'	%!%% "% !	%
 
 % % %)#'	>>>> ">> !	>>
 
0>>@  $ 	 		 	  		
 	 	 	 	 
	 	  $ 	#!	#	# 	#  		#
 	# 	# 	# 	# 
	# 	#" $ 1E1E 1E  	1E
 1E 1E 1E 1E 
*1Ef   !%    	
  >      
    !%(!(( (  	(
 ( >( ( ( ( ( ( 
#( (*  !%QAQA QA  	QA
 QA >QA QA QA QA QA QA 
4QAf O O!)-5>	 
8 
 =F	   :	
 
  
 =F	!  :	
 
  =F	77 7 :	7
 
7( 
 #'   	
  ! 
  
 #'!  	
  ! 
  #'-- - 	-
 - !- 
 -0  (,9?OX	  !   	
 
 YY%+Y;DY	Y  (,9?	  !)-:@	 G  (,9?OX	  !   	
 
 

%+
;D
	
"  $(   	
 ! 
   $(!  	
 ! 
  $(== = 	=
 != 
 =( # #(,#9?#	# # .!.)-.:@.	(. .
H
H%+
H	?
H W W.!.)-.	(. .	:	:	?	: ;@ (,48	  <A(!()-(59(	"( (
 (-HH $H	3H" > >J J?  "&   1	
    
   "&!  1	
    
   "&0606 06 1	06
 06 06 06 
06d  (,9?	  (!()-(:@(	"( (
N
N%+
N	3
N  *.	$ 	$	$ 	$ 		$
 	$ 	$ '	$ 	$ 
	$ 	$  *.	/!	/	/ 	/ 		/
 	/ 	/ '	/ 	/ 
*	/ 	/$ *.7L7L 7L 	7L
 7L 7L '7L 7L 
B7Lr   ) )) ) 	)
 ) 
$) )   4!44 4 	4
 4 
/4 4  JJ J 	J
 J 
NJ@  ! 	 &  	
 
   ! 	'!'&' ' 	'
 
"' ' ! 	2&2 2 	2
 
22h  ! *.	! 	!	! 	! '		!
 	! 	! 	! (	! 
	! 	!  ! *.	,!	,	, 	, '		,
 	, 	, 	, (	, 
'	, 	,  ! *.NN N '	N
 N N N (N 
<N`   ) )) ) 	)
 ) 
$) )   4!44 4 	4
 4 
/4 4  MM M 	M
 M 
NM@  " "& CG   	
    A 
   " "& CG!  	
    A 
  " "& CG3<3< 3< 	3<
  3< 3< A3< 
3< 3<ra   rI  c                  H   \ rS rSrSr\      Sn                   SoS jj5       r\      Sn                   SpS jj5       r      Sn                 SqS jjr\SrS j5       r\SsS j5       rStS	 jr\          SuS
 j5       r\          SvS j5       r        SwS jr\ Sx       SyS jj5       r	\ Sx       SzS jj5       r	 Sx     S{S jjr	\S|S j5       r
\        S}S j5       r
S~S jr
\          SS j5       r\          SS j5       rSS jr\  S         SS jj5       r\  S         SS jj5       r S       SS jjr\ S       SS jj5       r\ S         SS jj5       r S       SS jjr\ S         SS jj5       r\ S         SS jj5       r S       SS jjr\          SS  j5       r\          SS! j5       r        SS" jr\ S       SS# jj5       r\ S       SS$ jj5       r S     SS% jjr\ S       SS& jj5       r\ S       SS' jj5       r S     SS( jjr\  S         SS) jj5       r\  S         SS* jj5       r S       SS+ jjr\ S       SS, jj5       r\ S       SS- jj5       r S     SS. jjr\ S       SS/ jj5       r\ S       SS0 jj5       r S     SS1 jjr\   S             SS2 jj5       r\   S             SS3 jj5       r   S           SS4 jjr\   S               SS5 jj5       r\   S               SS6 jj5       r   S             SS7 jjrSSSS\SS4                       SS8 jjr\SS\SSSS4                       SS9 jj5       r\SS\SSSS4                       SS: jj5       rSS\SSSS4                     SS; jjr\S\4             SS< jj5       r\S\4             SS= jj5       rS\4           SS> jjr\     S                     SS? jj5       r\     S                     SS@ jj5       r     S                   SSA jjr\  S             SSB jj5       r\  S             SSC jj5       r  S           SSD jjr\  S             SSE jj5       r\  S             SSF jj5       r  S           SSG jjr\SSS\4                 SSH jj5       r\SSS\4                 SSI jj5       rSSS\4               SSJ jjr\SSS\4                 SSK jj5       r\SSS\4                 SSL jj5       rSSS\4               SSM jjr\S\4           SSN jj5       r \S\4           SSO jj5       r S\4         SSP jjr \SSQ j5       r!\        SSR j5       r!SSS jr!\          SST j5       r"\          SSU j5       r"        SSV jr"\          SSW j5       r#\          SSX j5       r#SSY jr#\          SuSZ j5       r$\          SvS[ j5       r$        SwS\ jr$\S\4           SS] jj5       r%\S\4           SS^ jj5       r%S\4         SS_ jjr%\        SS` j5       r&\        SSa j5       r&SSb jr&\SS\4           SSc jj5       r'\SS\4           SSd jj5       r'SS\4         SSe jjr'\ S         SSf jj5       r(\ S         SSg jj5       r( S       SSh jjr(\        SSi j5       r)\        SSj j5       r)      SSk jr) S         SSl jjr*Smr+g)SortedSetCommandsi  zk
Redis commands for Sorted Sets data type.
see: https://redis.io/topics/data-types-intro#redis-sorted-sets
Fc	                    g rW   rX   	rZ   r  r  re  rf  chr  rg  rh  s	            r]   zaddSortedSetCommands.zadd  s     !ra   c	                    g rW   rX   rH	  s	            r]   rJ	  rK	    s     ),ra   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 bothrP   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  r   r
  rf   )rZ   r  r  re  rf  rI	  r  rg  rh  rg   rb  r  s               r]   rJ	  rK	  !  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Era   c                    g rW   rX   rB  s     r]   zcardSortedSetCommands.zcardn  rH  ra   c                    g rW   rX   rB  s     r]   rQ	  rR	  q  r{  ra   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  re   rB  s     r]   rQ	  rR	  t  r  ra   c                    g rW   rX   rZ   r  r  r  s       r]   zcountSortedSetCommands.zcount|  r@  ra   c                    g rW   rX   rW	  s       r]   rX	  rY	    rx   ra   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  re   rW	  s       r]   rX	  rY	    s     ##Hd6#JJra   c                    g rW   rX   rZ   r   
withscoress      r]   zdiffSortedSetCommands.zdiff  r`   ra   c                    g rW   rX   r^	  s      r]   r`	  ra	    rc   ra   c                z    [        U5      /UQnU(       a  UR                  S5        U R                  " S/UQ7XS.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ZDIFF)r   r_	  )r  r   rf   )rZ   r   r_	  rg   s       r]   r`	  ra	    s?     d)#d#MM,'##GWfW4WWra   c                    g rW   rX   rZ   r  r   s      r]   
zdiffstoreSortedSetCommands.zdiffstore  r  ra   c                    g rW   rX   rg	  s      r]   rh	  ri	    rx   ra   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  rf   )rZ   r  r   rg   s       r]   rh	  ri	    s-     d)#d###L$@@@ra   c                    g rW   rX   rZ   r  r1  r  s       r]   zincrbySortedSetCommands.zincrby       ra   c                    g rW   rX   rn	  s       r]   ro	  rp	    r/  ra   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
ZINCRBYre   rn	  s       r]   ro	  rp	    s     ##ItUCCra   Nc                    g rW   rX   rZ   r   	aggregater_	  s       r]   zinterSortedSetCommands.zinter  r  ra   c                    g rW   rX   rv	  s       r]   rx	  ry	    r  ra   c                &    U R                  SSXUS9$ )uS  
Return the intersect of multiple sorted sets specified by ``keys``.

With the ``aggregate`` option, it is possible to specify how the
results of the intersection are aggregated. Available aggregation
modes:

- ``SUM`` (default): the score of an element is summed across the
  inputs where it exists.
  Score = SUM(score₁×weight₁, score₂×weight₂, ...)
- ``MIN``: the resulting set will contain the minimum score of an
  element across the inputs where it exists.
  Score = MIN(score₁×weight₁, score₂×weight₂, ...)
- ``MAX``: the resulting set will contain the maximum score of an
  element across the inputs where it exists.
  Score = MAX(score₁×weight₁, score₂×weight₂, ...)
- ``COUNT``: ignores the original scores and counts weighted set
  membership. Each element's score is the sum of the weights of
  the input sets that contain it.
  Score = SUM(weight₁, weight₂, ...) for sets containing the element.
  When all weights are 1 (default), the score equals the number
  of input sets containing the element.

For more information, see https://redis.io/commands/zinter
ZINTERN)r_	  _zaggregaterv	  s       r]   rx	  ry	    s    8 $JWWra   c                    g rW   rX   rZ   r  r   rw	  s       r]   zinterstoreSortedSetCommands.zinterstore  r  ra   c                    g rW   rX   r	  s       r]   r	  r	     r  ra   c                (    U R                  SXU5      $ )uF  
Intersect multiple sorted sets specified by ``keys`` into a new
sorted set, ``dest``. Scores in the destination will be aggregated
based on the ``aggregate``.

Available aggregation modes:

- ``SUM`` (default): the score of an element is summed across the
  inputs where it exists.
  Score = SUM(score₁×weight₁, score₂×weight₂, ...)
- ``MIN``: the resulting set will contain the minimum score of an
  element across the inputs where it exists.
  Score = MIN(score₁×weight₁, score₂×weight₂, ...)
- ``MAX``: the resulting set will contain the maximum score of an
  element across the inputs where it exists.
  Score = MAX(score₁×weight₁, score₂×weight₂, ...)
- ``COUNT``: ignores the original scores and counts weighted set
  membership. Each element's score is the sum of the weights of
  the input sets that contain it.
  Score = SUM(weight₁, weight₂, ...) for sets containing the element.
  When all weights are 1 (default), the score equals the number
  of input sets containing the element.

For more information, see https://redis.io/commands/zinterstore
ZINTERSTOREr}	  r	  s       r]   r	  r	         > t9EEra   c                    g rW   rX   r  s       r]   
zintercardSortedSetCommands.zintercard.   r@  ra   c                    g rW   rX   r  s       r]   r	  r	  3   rx   ra   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  
ZINTERCARDr   re   r  s        r]   r	  r	  8   r  ra   c                    g rW   rX   rW	  s       r]   	zlexcountSortedSetCommands.zlexcountG   r@  ra   c                    g rW   rX   rW	  s       r]   r	  r	  L   rx   ra   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  re   rW	  s       r]   r	  r	  Q   s     ##KCf#MMra   c                    g rW   rX   rk  s      r]   zpopmaxSortedSetCommands.zpopmax\   r`   ra   c                    g rW   rX   rk  s      r]   r	  r	  a   rc   ra   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
Nr_	  TZPOPMAXre   rZ   r  r   rk   rb  s        r]   r	  r	  f   A     T!.w4"&##ItFdFgFFra   c                    g rW   rX   rk  s      r]   zpopminSortedSetCommands.zpopmins   r`   ra   c                    g rW   rX   rk  s      r]   r	  r	  x   rc   ra   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
Nr_	  TZPOPMINre   r	  s        r]   r	  r	  }   r	  ra   c                    g rW   rX   rZ   r   r   r_	  s       r]   zrandmemberSortedSetCommands.zrandmember   s     "ra   c                    g rW   rX   r	  s       r]   r	  r	     s     *-ra   c                    / nUb  UR                  U5        U(       a  UR                  S5        U R                  " SU/UQ7SU0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
rd	  ZRANDMEMBERr_	  r  )rZ   r   r   r_	  r  s        r]   r	  r	     sG    $ MM% MM,'##M3WWJWWra   c                    g rW   rX   r,  s      r]   bzpopmaxSortedSetCommands.bzpopmax   r/  ra   c                    g rW   rX   r,  s      r]   r	  r	     r6  ra   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   BZPOPMAXr3  r,  s      r]   r	  r	     s<     ?GD$'G##J666ra   c                    g rW   rX   r,  s      r]   bzpopminSortedSetCommands.bzpopmin   r/  ra   c                    g rW   rX   r,  s      r]   r	  r	     r6  ra   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   BZPOPMINr3  r,  s      r]   r	  r	     s<     ?G!-dD!9G##J666ra   c                    g rW   rX   rZ   rN  r   r  r  r   s         r]   zmpopSortedSetCommands.zmpop   r  ra   c                    g rW   rX   r	  s         r]   r	  r	     r{  ra   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
r  r  rP   ra  ZMPOPr   r   rS  rf   )rZ   rN  r   r  r  r   rk   s          r]   r	  r	  !  sg     zD CSOKKKKA:KK%()##G3d33ra   c                    g rW   rX   rZ   r  rD  r   r  r  r   s          r]   bzmpopSortedSetCommands.bzmpop!  s     ra   c                    g rW   rX   r	  s          r]   r	  r	  *!  s     $'ra   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  ra  BZMPOPr	  )rZ   r  rD  r   r  r  r   rk   s           r]   r	  r	  5!  sh    * (4(CSIJJKKKKWe$%##H4t44ra   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  rd	  r_	  r  r   r	  )rZ   r  r  r  r  r  r  byscorebylexr_	  r  rf  r  rg   rb  s                  r]   _zrangeSortedSetCommands._zrangeU!  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7ra   c                    g rW   rX   rZ   r  r  r  r  r_	  r  r	  r	  rf  r  s              r]   zrangeSortedSetCommands.zrange~!  s      ra   c                    g rW   rX   r	  s              r]   r	  r	  !  s     (+ra   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	  r	  s              r]   r	  r	  !  s\    V u&.S[d>>$sPP||
 	
ra   c                    g rW   rX   rZ   r  r  r  r_	  r  s         r]   r	  SortedSetCommands.zrevrange!        ra   c                    g rW   rX   r	  s         r]   r	  r	  !       (+ra   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	  r   r  )rZ   r  r  r  r_	  r  rg   rb  s           r]   r	  r	  !  sD    * tC0MM-(!+P##V7w77ra   c
                    g rW   rX   
rZ   r  r  r  r  r	  r	  r  rf  r  s
             r]   zrangestoreSortedSetCommands.zrangestore	"  s     ra   c
                    g rW   rX   r	  s
             r]   r	  r	  "  s     ra   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	  r	  s
             r]   r	  r	  %"  s:    F ||
 	
ra   c                    g rW   rX   rZ   r  r  r  r  r  s         r]   zrangebylexSortedSetCommands.zrangebylexW"  r	  ra   c                    g rW   rX   r	  s         r]   r	  r	  a"  r	  ra   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  r   r   rS  rf   )rZ   r  r  r  r  r  rg   s          r]   r	  r	  k"  sa    " #+3?u}JKKC0MM8U01##V94&99ra   c                    g rW   rX   rZ   r  r  r  r  r  s         r]   zrevrangebylex SortedSetCommands.zrevrangebylex"  r	  ra   c                    g rW   rX   r	  s         r]   r	  r	  "  r	  ra   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  r   r	  )rZ   r  r  r  r  r  rg   s          r]   r	  r	  "  sa    " #+3?u}JKK"Ds3MM7E/0##V94&99ra   c                    g rW   rX   rZ   r  r  r  r  r  r_	  r  s           r]   zrangebyscoreSortedSetCommands.zrangebyscore"  r  ra   c                    g rW   rX   r	  s           r]   r	  r	  "  r  ra   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  rd	  r	  r   r   rS  r   rf   )
rZ   r  r  r  r  r  r_	  r  rg   rb  s
             r]   r	  r	  "  s    0 #+3?u}JKK!4c2MM7E/0MM,'!+P&##V7w77ra   c                    g rW   rX   rZ   r  r  r  r  r  r_	  r  s           r]   zrevrangebyscore"SortedSetCommands.zrevrangebyscore"  r  ra   c                    g rW   rX   r	  s           r]   r	  r	  "  r  ra   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  rd	  r	  r   r	  )
rZ   r  r  r  r  r  r_	  r  rg   rb  s
             r]   r	  r	  #  s    0 #+3?u}JKK$d5MM7E/0MM,'!+P&##V7w77ra   c                    g rW   rX   rZ   r  r  	withscorer  s        r]   zrankSortedSetCommands.zrank%#       "%ra   c                    g rW   rX   r
  s        r]   r
  r
  .#       -0ra   c                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
  r  r  rZ   r  r  r
  r  rg   rb  s          r]   r
  r
  7#  s;    " 4'MM+& )N##V7w77ra   c                    g rW   rX   ru  s      r]   zremSortedSetCommands.zremP#  r   ra   c                    g rW   rX   ru  s      r]   r
  r
  S#  rx   ra   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
ZREMre   ru  s      r]   r
  r
  X#  r  ra   c                    g rW   rX   rW	  s       r]   zremrangebylex SortedSetCommands.zremrangebylex`#  r@  ra   c                    g rW   rX   rW	  s       r]   r
  r
  e#  rx   ra   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
ZREMRANGEBYLEXre   rW	  s       r]   r
  r
  j#  s     ##$4dEEra   c                    g rW   rX   rW	  s       r]   zremrangebyrank!SortedSetCommands.zremrangebyrankw#  r@  ra   c                    g rW   rX   rW	  s       r]   r
  r
  |#  rx   ra   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
ZREMRANGEBYRANKre   rW	  s       r]   r
  r
  #  s     ##$5t#FFra   c                    g rW   rX   rW	  s       r]   zremrangebyscore"SortedSetCommands.zremrangebyscore#  r@  ra   c                    g rW   rX   rW	  s       r]   r"
  r#
  #  rx   ra   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
ZREMRANGEBYSCOREre   rW	  s       r]   r"
  r#
  #  s     ##$63GGra   c                    g rW   rX   r
  s        r]   zrevrankSortedSetCommands.zrevrank#  r
  ra   c                    g rW   rX   r
  s        r]   r(
  r)
  #  r	
  ra   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]   r(
  r)
  #  s;    " d*MM+& )N##V7w77ra   c                    g rW   rX   r  s      r]   zscoreSortedSetCommands.zscore#  rq	  ra   c                    g rW   rX   r  s      r]   r.
  r/
  #  r/  ra   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  re   r  s      r]   r.
  r/
  #  s     ##Hd#GGra   c                    g rW   rX   rZ   r   rw	  r_	  r  s        r]   zunionSortedSetCommands.zunion#  s      ra   c                    g rW   rX   r4
  s        r]   r5
  r6
  #  s     (+ra   c           	     *    U R                  SSUUUUS9$ )u  
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.

Available aggregation modes:

- ``SUM`` (default): the score of an element is summed across the
  inputs where it exists.
  Score = SUM(score₁×weight₁, score₂×weight₂, ...)
- ``MIN``: the resulting set will contain the minimum score of an
  element across the inputs where it exists.
  Score = MIN(score₁×weight₁, score₂×weight₂, ...)
- ``MAX``: the resulting set will contain the maximum score of an
  element across the inputs where it exists.
  Score = MAX(score₁×weight₁, score₂×weight₂, ...)
- ``COUNT``: ignores the original scores and counts weighted set
  membership. Each element's score is the sum of the weights of
  the input sets that contain it.
  Score = SUM(weight₁, weight₂, ...) for sets containing the element.
  When all weights are 1 (default), the score equals the number
  of input sets containing the element.

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

For more information, see https://redis.io/commands/zunion
ZUNIONNr	  r}	  r4
  s        r]   r5
  r6
  #  s/    F !+   
 	
ra   c                    g rW   rX   r	  s       r]   zunionstoreSortedSetCommands.zunionstore$  r  ra   c                    g rW   rX   r	  s       r]   r;
  r<
  &$  r  ra   c                (    U R                  SXU5      $ )u^  
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.

Available aggregation modes:

- ``SUM`` (default): the score of an element is summed across the
  inputs where it exists.
  Score = SUM(score₁×weight₁, score₂×weight₂, ...)
- ``MIN``: the resulting set will contain the minimum score of an
  element across the inputs where it exists.
  Score = MIN(score₁×weight₁, score₂×weight₂, ...)
- ``MAX``: the resulting set will contain the maximum score of an
  element across the inputs where it exists.
  Score = MAX(score₁×weight₁, score₂×weight₂, ...)
- ``COUNT``: ignores the original scores and counts weighted set
  membership. Each element's score is the sum of the weights of
  the input sets that contain it.
  Score = SUM(weight₁, weight₂, ...) for sets containing the element.
  When all weights are 1 (default), the score equals the number
  of input sets containing the element.

For more information, see https://redis.io/commands/zunionstore
ZUNIONSTOREr}	  r	  s       r]   r;
  r<
  .$  r	  ra   c                    g rW   rX   rZ   r   memberss      r]   zmscoreSortedSetCommands.zmscoreO$  r(  ra   c                    g rW   rX   rA
  s      r]   rC
  rD
  T$  r  ra   c                `    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ZMSCOREr   r{  )rZ   r   rB
  rg   s       r]   rC
  rD
  Y$  s;     FGG##ICCcUCCra   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)r  r  r  ra  s	   AGGREGATEz(aggregate can be sum, min, max or count.r_	  Fr	  r   )r   r  r   rr  r   rv  rS  r  r   r'  rf   )rZ   r  r  r   rw	  rb  rg   weightss           r]   r~	  SortedSetCommands._zaggregatek$  s     %,9MM$c$i dD!! IIK'GdMM*%MM'" $BBl+i( JKK;;|U++MM-(##V7w77ra   rX   )FFFFFF)rZ   r=   r  r1   r  r
  re  r   rf  r   rI	  r   r  r   rg  r   rh  r   r   zint | float | None)rZ   r   r  r1   r  r
  re  r   rf  r   rI	  r   r  r   rg  r   rh  r   r   zAwaitable[int | float | None])r  r1   r  r
  re  r   rf  r   rI	  r   r  r   rg  r   rh  r   r   z2int | float | None | Awaitable[int | float | None]r  r  r  )
rZ   r=   r  r1   r  rF   r  rF   r   r   )
rZ   r   r  r1   r  rF   r  rF   r   r   )r  r1   r  rF   r  rF   r   r   r  )rZ   r=   r   r0   r_	  r   r   rG   )rZ   r   r   r0   r_	  r   r   Awaitable[ZSetRangeResponse])r   r0   r_	  r   r   0ZSetRangeResponse | Awaitable[ZSetRangeResponse])rZ   r=   r  r1   r   r0   r   r   )rZ   r   r  r1   r   r0   r   r   )r  r1   r   r0   r   r   )
rZ   r=   r  r1   r1  r  r  r'   r   float | None)
rZ   r   r  r1   r1  r  r  r'   r   Awaitable[float | None])r  r1   r1  r  r  r'   r   &float | None | Awaitable[float | None]r  )
rZ   r=   r   r0   rw	  r   r_	  r   r   rG   )
rZ   r   r   r0   rw	  r   r_	  r   r   rK
  )r   r0   rw	  r   r_	  r   r   rL
  rW   )r  r1   r   (Sequence[KeyT] | Mapping[AnyKeyT, float]rw	  r   r   r   )
rZ   r   r  r1   r   rP
  rw	  r   r   r   )r  r1   r   rP
  rw	  r   r   r   r  )
rZ   r=   rD  r   r   	List[str]r   r   r   r   )
rZ   r   rD  r   r   rQ
  r   r   r   r   )rD  r   r   rQ
  r   r   r   r   )
rZ   r=   r  r1   r  r'   r  r'   r   r   )
rZ   r   r  r1   r  r'   r  r'   r   r   )r  r1   r  r'   r  r'   r   r   )rZ   r=   r  r1   r   r   r   rG   )rZ   r   r  r1   r   r   r   rK
  )r  r1   r   r   r   rL
  )
rZ   r=   r   r1   r   r   r_	  r   r   rD   )
rZ   r   r   r1   r   r   r_	  r   r   zAwaitable[ZRandMemberResponse])r   r1   r   r   r_	  r   r   z4ZRandMemberResponse | Awaitable[ZRandMemberResponse])rZ   r=   r   r0   r  r>   r   r!   )rZ   r   r   r0   r  r>   r   z"Awaitable[BlockingZSetPopResponse])r   r0   r  r>   r   z<BlockingZSetPopResponse | Awaitable[BlockingZSetPopResponse])FFrP   )rZ   r=   rN  r   r   rQ
  r  r|  r  r|  r   r   r   rC   )rZ   r   rN  r   r   rQ
  r  r|  r  r|  r   r   r   Awaitable[ZMPopResponse])rN  r   r   rQ
  r  r|  r  r|  r   r   r   (ZMPopResponse | Awaitable[ZMPopResponse])rZ   r=   r  r  rD  r   r   rQ
  r  r|  r  r|  r   r   r   rC   )rZ   r   r  r  rD  r   r   rQ
  r  r|  r  r|  r   r   r   rR
  )r  r  rD  r   r   rQ
  r  r|  r  r|  r   r   r   rS
  )r  Union[KeyT, None]r  r1   r  r'   r  r'   r  r   r	  r   r	  r   r_	  r   r  zUnion[type, Callable, None]rf  r  r  r  r   r6   )rZ   r=   r  r1   r  r'   r  r'   r  r   r_	  r   r  r  r	  r   r	  r   rf  r   r  r   r   rG   )rZ   r   r  r1   r  r'   r  r'   r  r   r_	  r   r  r  r	  r   r	  r   rf  r   r  r   r   rK
  )r  r1   r  r'   r  r'   r  r   r_	  r   r  r  r	  r   r	  r   rf  r   r  r   r   rL
  )rZ   r=   r  r1   r  r   r  r   r_	  r   r  r  r   rG   )rZ   r   r  r1   r  r   r  r   r_	  r   r  r  r   rK
  )r  r1   r  r   r  r   r_	  r   r  r  r   rL
  )FFFNN)rZ   r=   r  r1   r  r1   r  r'   r  r'   r	  r   r	  r   r  r   rf  r   r  r   r   r   )rZ   r   r  r1   r  r1   r  r'   r  r'   r	  r   r	  r   r  r   rf  r   r  r   r   r   )r  r1   r  r1   r  r'   r  r'   r	  r   r	  r   r  r   rf  r   r  r   r   r   r  )rZ   r=   r  r1   r  r'   r  r'   r  r   r  r   r   r   )rZ   r   r  r1   r  r'   r  r'   r  r   r  r   r   r   )r  r1   r  r'   r  r'   r  r   r  r   r   r   )rZ   r=   r  r1   r  r'   r  r'   r  r   r  r   r   r   )rZ   r   r  r1   r  r'   r  r'   r  r   r  r   r   r   )r  r1   r  r'   r  r'   r  r   r  r   r   r   )rZ   r=   r  r1   r  rF   r  rF   r  r   r  r   r_	  r   r  r  r   rG   )rZ   r   r  r1   r  rF   r  rF   r  r   r  r   r_	  r   r  r  r   rK
  )r  r1   r  rF   r  rF   r  r   r  r   r_	  r   r  r  r   rL
  )rZ   r=   r  r1   r  rF   r  rF   r  r   r  r   r_	  r   r  r  r   rG   )rZ   r   r  r1   r  rF   r  rF   r  r   r  r   r_	  r   r  r  r   rK
  )r  r1   r  rF   r  rF   r  r   r  r   r_	  r   r  r  r   rL
  )rZ   r=   r  r1   r  r'   r
  r   r  r  r   zint | list[Any] | None)rZ   r   r  r1   r  r'   r
  r   r  r  r   z!Awaitable[int | list[Any] | None])
r  r1   r  r'   r
  r   r  r  r   z:int | list[Any] | None | Awaitable[int | list[Any] | None]r  r  r  )
rZ   r=   r  r1   r  r   r  r   r   r   )
rZ   r   r  r1   r  r   r  r   r   r   )r  r1   r  r   r  r   r   r   )rZ   r=   r  r1   r  r'   r   rM
  )rZ   r   r  r1   r  r'   r   rN
  )r  r1   r  r'   r   rO
  )rZ   r=   r   rP
  rw	  r   r_	  r   r  r  r   rG   )rZ   r   r   rP
  rw	  r   r_	  r   r  r  r   rK
  )
r   rP
  rw	  r   r_	  r   r  r  r   rL
  )
rZ   r=   r  r1   r   rP
  rw	  r   r   r   )rZ   r=   r   r1   rB
  rQ
  r   zlist[float | None])rZ   r   r   r1   rB
  rQ
  r   zAwaitable[list[float | None]])r   r1   rB
  rQ
  r   z2list[float | None] | Awaitable[list[float | None]])
r  r   r  rT
  r   z.Union[Sequence[KeyT], Mapping[AnyKeyT, float]]rw	  r  r   r6   ),r  r  r  r  r	  r   rJ	  rQ	  rX	  r`	  rh	  ro	  rx	  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.
  r5
  r;
  rC
  r~	  r
  rX   ra   r]   rF	  rF	    s/   
 
 
! 
!
! .
! 	
!
 
! 
! 
! 
! 
! 

! 
! 
 
,!
,
, .
, 	
,
 
, 
, 
, 
, 
, 
'
, 
,  KFKF .KF 	KF
 KF KF KF KF KF 
>KFZ ? ?K K@  (,3?FR	  !)-4@GS	 	K	K+	K2>	K		K BG   (- ;? 	    CH+!+).+<@+	%+ +
 /4XX'+X	9X Q Q!)-5:	 A  (,6;DN	  &!&)-&7<&EO&	 & &D  !% 	       	 
 
     !% 	+!++ + 	+
 
&+ + MRXX&0XEIX	9X< 
 !%	 7 	
 
  
 !%	! 7 	
 
  !%	FF 7F 	F
 
FB NO +.6?HK	  OP!,/7@IL	 
 ;<DD"+D47D	D  (,3=DN	  !)-4>EO	 	N	N)	N0:	N		N BF   (, 5? 	    CG+!+)-+6@+	%+ +
 /3GG!+G	9G BF   (, 5? 	    CG+!+)-+6@+	%+ +
 /3GG!+G	9G  ! 	" "" " 	"
 
" "  ! 	-!-- - 	-
 
(- - GLXX *X?CX	=X4 FG& &(-&8C&	 & & GH1!1).19D1	+1 1
 3477$/7	E7* FG& &(-&8C&	 & & GH1!1).19D1	+1 1
 3477$/7	E7* 
 !    	
   
  
 ! '!'' ' 	'
 ' ' 
"' ' ! 44 4 	4
 4 4 
242  !    	
    
   ! '!'' ' 	'
 ' ' ' 
"' ' ! 55 5 	5
 5 5 5 
25N  7< $!'8  '8 	'8
 '8 '8 '8 '8 '8 '8 5'8 '8 '8 
'8R   +0!       	 
     )          
      +0!+!++ + 	+
 + + )+ + + + + 
&+ +&  +0!;
;
 ;
 	;

 ;
 ;
 );
 ;
 ;
 ;
 ;
 
:;
z  !+0       	 
   )  
     !+0+!++ + 	+
 + )+ 
&+ + !+088 8 	8
 8 )8 
:88  !   	
       
   !!  	
       
 & !0
0
 0
 	0

 0
 0
 0
 0
 0
 0
 
0
d  !       	 
     
     !+!++ + 	+
 + + 
&+ + !:: : 	:
 : : 
::0  !       	 
     
     !+!++ + 	+
 + + 
&+ + !:: : 	:
 : : 
::0  ! +0	  	 	  	  		 
 	  	  	  )	  
	  	   ! +0	+!	+	+ 	+ 		+
 	+ 	+ 	+ )	+ 
&	+ 	+  ! +0!8!8 !8 	!8
 !8 !8 !8 )!8 
:!8F  ! +0	  	 	  	  		 
 	  	  	  )	  
	  	   ! +0	+!	+	+ 	+ 		+
 	+ 	+ 	+ )	+ 
&	+ 	+  ! +0!8!8 !8 	!8
 !8 !8 !8 )!8 
:!8F 
  +0% %% % 	%
 )% 
 % % 
  +00!00 0 	0
 )0 
+0 0  +088 8 	8
 )8 
F82 O O!)-8>	 ;  (,3=DN	  !)-4>EO	 FF)F0:F	F  (,36=@	  !)-47>A	 	G  (,3?FR	  !)-4@GS	 	H	H+	H2>	H		H 
  +0% %% % 	%
 )% 
 % % 
  +00!00 0 	0
 )0 
+0 0  +088 8 	8
 )8 
F82  (,5?	  &!&)-&6@&	 & &H  !% +0   6    	 
 )  
     !% +0+!+6+ + 	+
 )+ 
&+ + !% +0*
6*
 *
 	*

 )*
 
:*
X 
 !%	  7 	
 
  
 !%	! 7 	
 
  !%	FF 7F 	F
 
FB ! !'+!6?!	! ! ,!,(,,7@,	&, ,DD"+D	;D. $(88  8 =	8
 !8 
8 8ra   rF	  c                      \ rS rSrSr\SS j5       r\        SS j5       rSS jr\SS j5       r\SS j5       rSS jr\SS	 j5       r\        SS
 j5       rSS jrSr	g)HyperlogCommandsi$  zf
Redis commands of HyperLogLogs data type.
see: https://redis.io/topics/data-types-intro#hyperloglogs
c                    g rW   rX   ru  s      r]   pfaddHyperlogCommands.pfadd$  r  ra   c                    g rW   rX   ru  s      r]   rX
  rY
  $  rx   ra   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
PFADDre   ru  s      r]   rX
  rY
  $  r|  ra   c                    g rW   rX   rZ   sourcess     r]   pfcountHyperlogCommands.pfcount$  r  ra   c                    g rW   rX   r^
  s     r]   r`
  ra
  $  r  ra   c                (    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
PFCOUNTre   r^
  s     r]   r`
  ra
  $  s     ##I888ra   c                    g rW   rX   rZ   r  r_
  s      r]   pfmergeHyperlogCommands.pfmerge$  r   ra   c                    g rW   rX   rf
  s      r]   rg
  rh
  $  r  ra   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
PFMERGEre   rf
  s      r]   rg
  rh
  $  s     ##It>g>>ra   rX   Nr  r  r  )rZ   r=   r_
  r1   r   r   )rZ   r   r_
  r1   r   r   )r_
  r1   r   r   )rZ   r=   r  r1   r_
  r1   r   r   )rZ   r   r  r1   r_
  r1   r   r   )r  r1   r_
  r1   r   r   )
r  r  r  r  r	  r   rX
  r`
  rg
  r
  rX   ra   r]   rV
  rV
  $  s    
 P P!)-8>	 < E EQ Q9 R R!)-9=	 ?ra   rV
  c                      \ rS rSrSrSrSrg)HashDataPersistOptionsi$  FNXFXXrX   N)r  r  r  r  rn
  ro
  r
  rX   ra   r]   rm
  rm
  $  s     C Cra   rm
  c                     \ rS rSrSr\SZS j5       r\        S[S j5       rS\S jr\S]S j5       r\        S^S j5       rS_S jr\        S`S	 j5       r\        SaS
 j5       rSbS jr\      ScS j5       r	\      SdS j5       r	    SeS jr	\        SfS j5       r
\        SgS j5       r
      ShS jr
\SSSSSS.                 SiS jj5       r\SSSSSS.                 SjS jj5       rSSSSSS.               SkS jjr\ Sl         SmS jj5       r\ Sl         SnS jj5       rSlSoS jjr\ Sp         SqS jj5       r\ Sp         SrS jj5       r Sp       SsS jjr\StS j5       r\      SuS j5       rSvS  jr\SwS! j5       r\SxS" j5       rSyS# jr\    Sz             S{S$ jj5       r\    Sz             S|S% jj5       r    Sz           S}S& jjr\          S~                         SS' jj5       r\          S~                         SS( jj5       r          S~                       SS) jjr\          SS* j5       r\          SS+ j5       r        SS, jr\        SS- j5       r\        SS. j5       r\" S/S0S1S29      SS3 j5       r\          SS4 j5       r\          SS5 j5       r        SS6 jr\StS7 j5       r\      SuS8 j5       rSvS9 jr\SS: j5       r\        SS; j5       rSS< jr\SSSSS=.                 SS> jj5       r\SSSSS=.                 SS? jj5       rSSSSS=.               SS@ jjr\SSSSS=.                 SSA jj5       r\SSSSS=.                 SSB jj5       rSSSSS=.               SSC jjr\SSSSS=.                 SSD jj5       r\SSSSS=.                 SSE jj5       rSSSSS=.               SSF jjr\SSSSS=.                 SSG jj5       r\SSSSS=.                 SSH jj5       rSSSSS=.               SSI jjr\        SSJ j5       r\        SSK j5       rSSL jr\        SSM j5       r\        SSN j5       r      SSO jr\        SSP j5       r\        SSQ j5       r      SSR jr\SSS j5       r\        SST j5       rSSU jr\SSV j5       r \        SSW j5       r SSX jr SYr!g)HashCommandsi$  z_
Redis commands for Hash data type.
see: https://redis.io/topics/data-types-intro#redis-hashes
c                    g rW   rX   rZ   r  r   s      r]   hdelHashCommands.hdel$  r   ra   c                    g rW   rX   rs
  s      r]   rt
  ru
  $  rx   ra   c                *    U R                   " SU/UQ76 $ )z^
Delete ``keys`` from hash ``name``

For more information, see https://redis.io/commands/hdel
HDELre   rs
  s      r]   rt
  ru
  $  s     ##FD8488ra   c                    g rW   rX   rZ   r  r   s      r]   hexistsHashCommands.hexists$  r   ra   c                    g rW   rX   rz
  s      r]   r{
  r|
  $  r  ra   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  re   rz
  s      r]   r{
  r|
  $  s     ##Itv#FFra   c                    g rW   rX   rz
  s      r]   hgetHashCommands.hget$  r(  ra   c                    g rW   rX   rz
  s      r]   r
  r
  $  r  ra   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  re   rz
  s      r]   r
  r
  %  s     ##FDTF#CCra   c                    g rW   rX   rB  s     r]   hgetallHashCommands.hgetall%  r	  ra   c                    g rW   rX   rB  s     r]   r
  r
  %  r  ra   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  re   rB  s     r]   r
  r
  %  s     ##It&#AAra   c                    g rW   rX   rs
  s      r]   hgetdelHashCommands.hgetdel%  r  ra   c                    g rW   rX   rs
  s      r]   r
  r
  $%  r	  ra   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   rf   rs
  s      r]   r
  r
  )%  s;     t9>MNN##ItXs4yP4PPra   NF)r  r  r  r  r  c                   g rW   rX   rZ   r  r  r  r  r  r  r   s           r]   hgetexHashCommands.hgetex:%  s     $'ra   c                   g rW   rX   r
  s           r]   r
  r
  F%  s     /2ra   c                  U(       d  [        S5      e[        USLUSLUSLUSLU45      (       d  [        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 providedNr  r  HGETEXr
  )r   rQ   rK   r   rf   r  )	rZ   r  r  r  r  r  r  r   r  s	            r]   r
  r
  R%  s    : LMM$$$D D 
 
 : 
 )=RT(Py)##
 
 	

 I
 
 	
ra   c                    g rW   rX   rZ   r  r   r1  s       r]   hincrbyHashCommands.hincrby%  r@  ra   c                    g rW   rX   r
  s       r]   r
  r
  %  rx   ra   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
HINCRBYre   r
  s       r]   r
  r
  %  s     ##It&AAra   c                    g rW   rX   r
  s       r]   hincrbyfloatHashCommands.hincrbyfloat%  r  ra   c                    g rW   rX   r
  s       r]   r
  r
  %  rj  ra   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
HINCRBYFLOATre   r
  s       r]   r
  r
  %  s     ##NDvFFra   c                    g rW   rX   rB  s     r]   hkeysHashCommands.hkeys%  r   ra   c                    g rW   rX   rB  s     r]   r
  r
  %  rc   ra   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  re   rB  s     r]   r
  r
  %  r  ra   c                    g rW   rX   rB  s     r]   hlenHashCommands.hlen%  r.  ra   c                    g rW   rX   rB  s     r]   r
  r
  %  r   ra   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  re   rB  s     r]   r
  r
  %  r  ra   c                    g rW   rX   rZ   r  r   r  r  r
  s         r]   hsetHashCommands.hset%  r  ra   c                    g rW   rX   r
  s         r]   r
  r
  %  r!  ra   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   rS  r
  rf   )rZ   r  r   r  r  r
  rg   r  s           r]   r
  r
  %  sy    & ;wu<==MM% ?MM3,'d# ( ##FD:6::ra   c                    g rW   rX   rZ   r  r   r  r  r
  r  r  r  r  r  r  s               r]   hsetexHashCommands.hsetex&  s     ra   c                    g rW   rX   r
  s               r]   r
  r
  &  s     ra   c                x   Uc  U(       d  U(       d  [        S5      eU(       a  [        U5      S-  S:w  a  [        S5      e[        USLUSLUSLU	SLU45      (       d  [        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
Nz 'hsetex' with no key value pairsrM   r   zR'hsetex' with odd number of items. 'items' must contain a list of key/value pairs.r   r!  HSETEXr
  )
r   r  rQ   rK   r   r  rS  r
  rf   r   )rZ   r  r   r  r  r
  r  r  r  r  r  r  r  rg   r  s                  r]   r
  r
  '&  sL   ^ ;wu>??SZ!^q(B 
 %$$D D 
 
 : 
 )=RT(P2889y)MM% ?MM3,'d# ( ##d
(
*2
47Fa4H
KQ
 	
ra   c                    g rW   rX   rZ   r  r   r  s       r]   hsetnxHashCommands.hsetnx&  r@  ra   c                    g rW   rX   r
  s       r]   r
  r
  &  rx   ra   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
HSETNXre   r
  s       r]   r
  r
  &  s     ##Hd??ra   c                    g rW   rX   r  s      r]   hmsetHashCommands.hmset&  r  ra   c                    g rW   rX   r  s      r]   r
  r
  &  s    
 ra   z4.0.0zUse 'hset' instead.r
  r  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   r
  rS  rf   r	  s        r]   r
  r
  &  sL     @AAMMODLL $##GT:E::ra   c                    g rW   rX   rZ   r  r   rk   s       r]   hmgetHashCommands.hmget&  r	  ra   c                    g rW   rX   r
  s       r]   r
  r
  &  s     /2ra   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
HMGETr   r  r
  s       r]   r
  r
  &  s-     D'##GTFDFvFFra   c                    g rW   rX   rB  s     r]   hvalsHashCommands.hvals&  r   ra   c                    g rW   rX   rB  s     r]   r
  r
  &  rc   ra   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  re   rB  s     r]   r
  r
  &  r  ra   c                    g rW   rX   rz
  s      r]   hstrlenHashCommands.hstrlen&  r   ra   c                    g rW   rX   rz
  s      r]   r
  r
  &  rx   ra   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  re   rz
  s      r]   r
  r
  &  s     ##Itv#FFra   )re  rf  rg  rh  c                   g rW   rX   rZ   r  secondsre  rf  rg  rh  rc  s           r]   hexpireHashCommands.hexpire&  r  ra   c                   g rW   rX   r
  s           r]   r
  r
  &  r  ra   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.
rP   4Only one of 'nx', 'xx', 'gt', 'lt' can be specified.r  r  ro  rp  HEXPIREr
  
rT  r   r   rs  rt  r   ru  r   rf   r  )
rZ   r  r
  re  rf  rg  rh  rc  
conditionsrb  s
             r]   r
  r
  '  s    N b%
z?QSTTgx1122'//12GNN4 NN4 NN4 NN4 ##t
'.
08
:=f+
HN
 	
ra   c                   g rW   rX   rZ   r  millisecondsre  rf  rg  rh  rc  s           r]   hpexpireHashCommands.hpexpireG'  r  ra   c                   g rW   rX   r
  s           r]   r
  r
  S'  r  ra   c                  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.
rP   r
  r:  r  r  ro  rp  HPEXPIREr
  r
  )
rZ   r  r
  re  rf  rg  rh  rc  r
  rb  s
             r]   r
  r
  _'  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
 	
ra   c                   g rW   rX   rZ   r  unix_time_secondsre  rf  rg  rh  rc  s           r]   	hexpireatHashCommands.hexpireat'  r  ra   c                   g rW   rX   r
  s           r]   r
  r
  '  r  ra   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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.
rP   r
  r  r  ro  rp  	HEXPIREATr
  	rT  r   r   rs  r   r  r   rf   r  )
rZ   r  r
  re  rf  rg  rh  rc  r
  rb  s
             r]   r
  r
  '  s    N b%
z?QSTT'):):;; #$5$?$?$A BNN4 NN4 NN4 NN4 ##
 	

 
 K
 
 	
ra   c                   g rW   rX   rZ   r  unix_time_millisecondsre  rf  rg  rh  rc  s           r]   
hpexpireatHashCommands.hpexpireat'  r  ra   c                   g rW   rX   r
  s           r]   r   r  (  r  ra   c                  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.
rP   r
  r:  r  r  ro  rp  
HPEXPIREATr
  r
  )
rZ   r  r
  re  rf  rg  rh  rc  r
  rb  s
             r]   r   r  (  s    N b%
z?QSTT,h.?.?@@%()?)I)I)Kd)R%S"NN4 NN4 NN4 NN4 ##"
 	

 
 K
 
 	
ra   c                    g rW   rX   rZ   r  rc  s      r]   hpersistHashCommands.hpersistO(       ra   c                    g rW   rX   r  s      r]   r  r  T(  r"  ra   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
  rf   r  r  s      r]   r  r  Y(  s$    " ##JhFUfUUra   c                    g rW   rX   rZ   r   rc  s      r]   hexpiretimeHashCommands.hexpiretimel(  r	  ra   c                    g rW   rX   r  s      r]   r  r  q(  r"  ra   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
  r   r  r  s      r]   r  r  v(  s6    ( ##3#f+
8>
FIU
 	
ra   c                    g rW   rX   r  s      r]   hpexpiretimeHashCommands.hpexpiretime(  r	  ra   c                    g rW   rX   r  s      r]   r  r  (  r"  ra   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
  r   r  r  s      r]   r  r  (  s6    ( ##C3v;
9?
GJe
 	
ra   c                    g rW   rX   r  s      r]   httlHashCommands.httl(  rX  ra   c                    g rW   rX   r  s      r]   r  r  (  r"  ra   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
  r   r  r  s      r]   r  r  (  s6    $ ##C3v;
17
?Be
 	
ra   c                    g rW   rX   r  s      r]   hpttlHashCommands.hpttl(  rh  ra   c                    g rW   rX   r  s      r]   r"  r#  (  r"  ra   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
  r   r  r  s      r]   r"  r#  (  s6    $ ##S(CK
28
@Cu
 	
ra   rX   )rZ   r=   r  r1   r   r)   r   r   )rZ   r   r  r1   r   r)   r   r   )r  r1   r   r)   r   r   )rZ   r=   r  r1   r   r)   r   r   )rZ   r   r  r1   r   r)   r   r   )r  r1   r   r)   r   r   )rZ   r=   r  r1   r   r)   r   r  )rZ   r   r  r1   r   r)   r   r  )r  r1   r   r)   r   r  )rZ   r=   r  r1   r   zdict[bytes | str, bytes | str])rZ   r   r  r1   r   z)Awaitable[dict[bytes | str, bytes | str]])r  r1   r   zJdict[bytes | str, bytes | str] | Awaitable[dict[bytes | str, bytes | str]])rZ   r=   r  r1   r   r)   r   r  )rZ   r   r  r1   r   r)   r   r  )r  r1   r   r)   r   r	  )rZ   r=   r  r1   r   r)   r  r  r  r  r  r  r  r  r  r   r   r  )rZ   r   r  r1   r   r)   r  r  r  r  r  r  r  r  r  r   r   r  )r  r1   r   r)   r  r  r  r  r  r  r  r  r  r   r   r	  r  )
rZ   r=   r  r1   r   r)   r1  r   r   r   )
rZ   r   r  r1   r   r)   r1  r   r   r   )r  r1   r   r)   r1  r   r   r   r  )
rZ   r=   r  r1   r   r)   r1  r  r   r  )
rZ   r   r  r1   r   r)   r1  r  r   r  )r  r1   r   r)   r1  r  r   r   )rZ   r=   r  r1   r   r   )rZ   r   r  r1   r   r   )r  r1   r   r   r  r  r  r  )rZ   r=   r  r1   r   FieldT | Noner  r  r  "Mapping[FieldT, EncodableT] | Noner
  Sequence[EncodableT] | Noner   r   )rZ   r   r  r1   r   r'  r  r  r  r(  r
  r)  r   r   )r  r1   r   r'  r  r  r  r(  r
  r)  r   r   )
NNNNNNNNNF)rZ   r=   r  r1   r   r'  r  r  r  r(  r
  r)  r  r  r  r  r  r  r  r  r  HashDataPersistOptions | Noner  r   r   r   )rZ   r   r  r1   r   r'  r  r  r  r(  r
  r)  r  r  r  r  r  r  r  r  r  r*  r  r   r   r   )r  r1   r   r'  r  r  r  r(  r
  r)  r  r  r  r  r  r  r  r  r  r*  r  r   r   r   )
rZ   r=   r  r1   r   r)   r  r'   r   r   )
rZ   r   r  r1   r   r)   r  r'   r   r   )r  r1   r   r)   r  r'   r   r   )rZ   r=   r  r1   r  Mapping[FieldT, EncodableT]r   r   )rZ   r   r  r1   r  r+  r   r   )r  r1   r  r+  r   r   )
rZ   r=   r  r1   r   FieldT | Iterable[FieldT]rk   r)   r   r  )
rZ   r   r  r1   r   r,  rk   r)   r   r  )r  r1   r   r,  rk   r)   r   r	  )rZ   r=   r  r1   r   r)   r   r   )rZ   r   r  r1   r   r)   r   r   )r  r1   r   r)   r   r   )rZ   r=   r  r1   r
  r(   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r   r  r1   r
  r(   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )r  r1   r
  r(   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r=   r  r1   r
  r(   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r   r  r1   r
  r(   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )r  r1   r
  r(   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r=   r  r1   r
  r   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r   r  r1   r
  r   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )r  r1   r
  r   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r=   r  r1   r
  r   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r   r  r1   r
  r   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )r  r1   r
  r   rc  r)   re  r   rf  r   rg  r   rh  r   r   r  )rZ   r=   r  r1   rc  r)   r   r  )rZ   r   r  r1   rc  r)   r   r  )r  r1   rc  r)   r   r  )rZ   r=   r   r1   rc  r)   r   r  )rZ   r   r   r1   rc  r)   r   r  )r   r1   rc  r)   r   r  )"r  r  r  r  r	  r   rt
  r{
  r
  r
  r
  r
  r
  r
  r
  r
  r
  r
  r
  r
  rH   r
  r
  r
  r
  r
  r
  r   r  r  r  r  r"  r
  rX   ra   r]   rq
  rq
  $  s   
 M M!)-6<	 9 O O!)-4:	 G ! !(,!39!	! ! ,!,)-,4:,	&, ,D - -(,-	'- - 8!8)-8	28 8BB	SB ' '(,'5;'	!' ' 2!2)-26<2	,2 2QQ!'Q	GQ" 
 "!"&"&	' 	'	' 	' 		'
 	'  	'  	' 	' 
"	' 	' 
 "!"&"&	2!	2	2 	2 		2
 	2  	2  	2 	2 
-	2 	2 "!"&"&:
:
 :
 	:

 :
  :
  :
 :
 
H:
x IJ (,39CF	  JK!)-4:DG	 B KN (,39CH	  LO!)-4:DI	 
 8;GG%G/4G	!G M M+!+)-+	%+ +@ > >J J?  "#'6:-1   !	
 4 + 
   "#'6:-1!  !	
 4 + 
  "#'6:-1;; ; !	;
 4; +; 
;B  "#'6:-1!!"&"&=A   !	
 4 +       ;  
   "#'6:-1!!"&"&=A!  !	
 4 +       ;  
 $ "#'6:-1!!"&"&=AX
X
 X
 !	X

 4X
 +X
 X
 X
  X
  X
 ;X
 X
 
X
t  (,39BL	  !)-4:CM	 	@	@%	@.8	@		@  (,7R	  ! - 
	  $
;;#>;	;
;  ' '' (' 	'
 
"' ' 2!22 (2 	2
 
-2 2	G	G 9	GBH	G	G	G M M+!+)-+	%+ +@ N N!)-4:	 G  	 		 	 		
 	 	 	 	 
	 	  	#!	#	# 	# 		#
 	# 	# 	# 	# 
	# 	#  :
:
 :
 	:

 :
 :
 :
 :
 
*:
x  	 		 	 		
 	 	 	 	 
	 	  	#!	#	# 	# 		#
 	# 	# 	# 	# 
	# 	#  :
:
 :
 	:

 :
 :
 :
 :
 
*:
x  	 		 &	 		
 	 	 	 	 
	 	  	#!	#	# &	# 		#
 	# 	# 	# 	# 
	# 	#  @
@
 &@
 	@

 @
 @
 @
 @
 
*@
D  	 		 !+	 		
 	 	 	 	 
	 	  	#!	#	# !+	# 		#
 	# 	# 	# 	# 
	# 	#  @
@
 !+@
 	@

 @
 @
 @
 @
 
*@
D  (,7=	  #!#)-#8>#	# #V&  '+6<	  #!#(,#7=#	# #

"(
	)
0  '+6<	  #!#(,#7=#	# #

"(
	)
0 T T#!#(,#7=#	# #
, U U#!#(,#7=#	# #
ra   rq
  c                  N    \ rS rSrSr    SS jr   S	     S
S jjrS rSrg)Scripti(  A
An executable Lua script object returned by ``register_script``
c                    Xl         X l        [        U[        5      (       a!  U R	                  5       nUR                  U5      n[        R                  " U5      R                  5       U l	        g rW   )
registered_clientscriptr   r   r   r   hashlibsha1r  sharZ   r1  r2  r   s       r]   r  Script.__init__(  sU    
 "3 fc"" &&(G^^F+F<<'113ra   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)r1  rq  r`  r;  r   scriptsaddevalshar5  r  r   script_loadr2  rZ   r   rk   r  r;  s        r]   __call__Script.__call__)  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.)r1  r   AttributeErrorconnection_poolr.  s    r]   r   Script.get_encoder )  sK    	H))5577 	H ))99EEGG	Hs    .AAr1  r2  r5  )r1  9Union['redis.client.Redis', 'redis.cluster.RedisCluster']r2  r8   r  )r   Union[Sequence[KeyT], None]rk   !Union[Iterable[EncodableT], None]r  z?Union['redis.client.Redis', 'redis.cluster.RedisCluster', None])	r  r  r  r  r	  r  rA  r   r
  rX   ra   r]   r.  r.  (  sQ    4T4 4$ -126RV	>)> 0> P	>6Hra   r.  c                  H    \ rS rSrSr    SS jr   S     S	S jjrSrg)
AsyncScripti3)  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rW   )r1  r2  r   r   rE  r   rD  r   r3  r4  r  r5  r6  s       r]   r  AsyncScript.__init__8)  s     "3 fc"":+;;GGI ^^F+F<<'113	 " :+779:s   A8 8BB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)r9  Nr   r:  )r1  rq  redis.asyncio.clientr;  r   r<  r=  r>  r5  r  r   r?  r2  r@  s        r]   rA  AsyncScript.__call__N)  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rG  )r1  IUnion['redis.asyncio.client.Redis', 'redis.asyncio.cluster.RedisCluster']r2  r8   r  )r   rI  rk   rJ  r  zOUnion['redis.asyncio.client.Redis', 'redis.asyncio.cluster.RedisCluster', None])r  r  r  r  r	  r  rA  r
  rX   ra   r]   rL  rL  3)  sX    4
4
 40 -126 D)D 0D
	D Dra   rL  c                  f   \ rS rSrSr\        SS j5       r\        SS j5       r      SS jr\        SS j5       r\        SS j5       r      SS jr\ S      S!S	 jj5       r\ S      S"S
 jj5       r S    S#S jjr\ S      S!S jj5       r	\ S      S"S jj5       r	 S    S#S jjr	\S$S j5       r
\S%S j5       r
S&S jr
\      S'S j5       r\      S(S j5       r    S)S jr\      S'S j5       r\      S(S j5       r    S)S jrSrg)*PubSubCommandsil)  z;
Redis PubSub commands.
see https://redis.io/topics/pubsub
c                    g rW   rX   rZ   r   messager\   s       r]   publishPubSubCommands.publishr)  r@  ra   c                    g rW   rX   rV  s       r]   rX  rY  w)  rx   ra   c                p    U R                   " SX40 UD6n[        [        R                  [	        U5      S9  U$ )z
Publish ``message`` on ``channel``.
Returns the number of subscribers the message was delivered to.

For more information, see https://redis.io/commands/publish
PUBLISH)rE  r   rf   rO   rN   r\  rL   )rZ   r   rW  r\   r	  s        r]   rX  rY  |)  s;     ''	7NvN%-- )	
 ra   c                    g rW   rX   rZ   shard_channelrW  s      r]   spublishPubSubCommands.spublish)  r@  ra   c                    g rW   rX   r_  s      r]   ra  rb  )  rx   ra   c                n    U R                  SX5      n[        [        R                  [	        U5      SS9  U$ )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
SPUBLISHT)rE  r   shardedr]  )rZ   r`  rW  r	  s       r]   ra  rb  )  s9     ''
MK%-- /	

 ra   c                    g rW   rX   r  s      r]   pubsub_channelsPubSubCommands.pubsub_channels)  r`   ra   c                    g rW   rX   r  s      r]   rh  ri  )  rc   ra   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 CHANNELSre   r  s      r]   rh  ri  )  s     ##$5wI&IIra   c                    g rW   rX   r  s      r]   pubsub_shardchannels#PubSubCommands.pubsub_shardchannels)  r`   ra   c                    g rW   rX   r  s      r]   rm  rn  )  rc   ra   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 SHARDCHANNELSre   r  s      r]   rm  rn  )  s     ##$:GNvNNra   c                    g rW   rX   r   s     r]   pubsub_numpatPubSubCommands.pubsub_numpat)  r  ra   c                    g rW   rX   r   s     r]   rr  rs  )  r  ra   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 NUMPATre   r   s     r]   rr  rs  )  r3  ra   c                    g rW   rX   r  s      r]   pubsub_numsubPubSubCommands.pubsub_numsub)  r  ra   c                    g rW   rX   r  s      r]   rw  rx  )  r  ra   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 NUMSUBre   r  s      r]   rw  rx  )  s     ##OEdEfEEra   c                    g rW   rX   r  s      r]   pubsub_shardnumsub!PubSubCommands.pubsub_shardnumsub)  r  ra   c                    g rW   rX   r  s      r]   r|  r}  )  r  ra   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 SHARDNUMSUBre   r  s      r]   r|  r}  )  s      ##$8J4J6JJra   rX   N)rZ   r=   r   r"   rW  r'   r   r   )rZ   r   r   r"   rW  r'   r   r   )r   r"   rW  r'   r   r   )rZ   r=   r`  r"   rW  r'   r   r   )rZ   r   r`  r"   rW  r'   r   r   )r`  r"   rW  r'   r   r   r  r  r  r  r  r  r  )rZ   r=   rk   r"   r   zlist[tuple[bytes | str, int]])rZ   r   rk   r"   r   z(Awaitable[list[tuple[bytes | str, int]]])rk   r"   r   zHlist[tuple[bytes | str, int]] | Awaitable[list[tuple[bytes | str, int]]])r  r  r  r  r	  r   rX  ra  rh  rm  rr  rw  r|  r
  rX   ra   r]   rT  rT  l)  s
   
  +3>H	  !,4?I	 *4	   19DN	  !2:EO	 %0:	" 69   +3 	    7:+!+,4+	%+ +
 #&JJ	9J 69   +3 	    7:+!+,4+	%+ +
 #&OO	9O E EQ Q? , ,)1,	&, , 7!7*27	17 7	F	F	Q	F , ,)1,	&, , 7!7*27	17 7	K	K	Q	Kra   rT  c                  (   \ rS rSrSr          S!S jr\          S"S j5       r\          S#S j5       r        S$S jr\          S"S j5       r\          S#S j5       r        S$S	 jr          S%S
 jr	\          S&S j5       r
\          S'S j5       r
        S(S jr
\          S&S j5       r\          S'S j5       r        S(S jr\S)S j5       r\      S*S j5       rS+S jrS,S jr\ S-     S.S jj5       r\ S-     S/S jj5       r S-   S0S jjr\S1S j5       r\S2S j5       rS3S jr\S4S j5       r\      S5S j5       rS6S jr      S7S jrS rg)8ScriptCommandsi*  zo
Redis Lua script commands. see:
https://redis.io/ebook/part-3-next-steps/chapter-11-scripting-redis-with-lua/
c                *    U R                   " XU/UQ76 $ rW   re   )rZ   r  r2  rD  keys_and_argss        r]   _evalScriptCommands._eval*  s     ##GWM}MMra   c                    g rW   rX   rZ   r2  rD  r  s       r]   evalScriptCommands.eval*  r  ra   c                    g rW   rX   r  s       r]   r  r  "*  r  ra   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  r  s       r]   r  r  **  s     zz&&BMBBra   c                    g rW   rX   r  s       r]   eval_roScriptCommands.eval_ro9*  r  ra   c                    g rW   rX   r  s       r]   r  r  A*  r  ra   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]   r  r  I*  s     zz)VE}EEra   c                *    U R                   " XU/UQ76 $ rW   re   )rZ   r  r5  rD  r  s        r]   _evalshaScriptCommands._evalshaW*  s     ##G'JMJJra   c                    g rW   rX   rZ   r5  rD  r  s       r]   r>  ScriptCommands.evalsha`*  r  ra   c                    g rW   rX   r  s       r]   r>  r  h*  r  ra   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  r  s       r]   r>  r  p*  s     }}YE}EEra   c                    g rW   rX   r  s       r]   
evalsha_roScriptCommands.evalsha_ro*  r  ra   c                    g rW   rX   r  s       r]   r  r  *  r  ra   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]   r  r  *  s     }}\3H-HHra   c                    g rW   rX   r  s     r]   script_existsScriptCommands.script_exists*  r   ra   c                    g rW   rX   r  s     r]   r  r  *  r   ra   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 EXISTSre   r  s     r]   r  r  *  s     ##O;d;;ra   c                    [        S5      e)Nz<SCRIPT DEBUG is intentionally not implemented in the client.r  r  s     r]   script_debugScriptCommands.script_debug*  r  ra   Nc                    g rW   rX   rZ   	sync_types     r]   script_flushScriptCommands.script_flush*  s     ra   c                    g rW   rX   r  s     r]   r  r  *  s     ra   c                \    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
)r^  ASYNCNzpSCRIPT FLUSH defaults to SYNC in redis > 6.2, or accepts SYNC/ASYNC. For older versions, of redis leave as None.zSCRIPT FLUSHr{  )rZ   r  rg   s      r]   r  r  *  sI     33* 
 F[F##N<V<<ra   c                    g rW   rX   r.  s    r]   script_killScriptCommands.script_kill*  s    7:ra   c                    g rW   rX   r.  s    r]   r  r  *  r   ra   c                $    U R                  S5      $ )zj
Kill the currently executing Lua script

For more information, see https://redis.io/commands/script-kill
zSCRIPT KILLre   r.  s    r]   r  r  *  s     ##M22ra   c                    g rW   rX   rZ   r2  s     r]   r?  ScriptCommands.script_load*  r   ra   c                    g rW   rX   r  s     r]   r?  r  *  rx   ra   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 LOADre   r  s     r]   r?  r  *  s     ##M6::ra   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##ra   rX   )
r  r   r2  r   rD  r   r  r  r   r   )
rZ   r=   r2  r   rD  r   r  KeyT | EncodableTr   r   )
rZ   r   r2  r   rD  r   r  r  r   r  )r2  r   rD  r   r  r  r   r  )
r  r   r5  r   rD  r   r  r  r   r   )
rZ   r=   r5  r   rD  r   r  r  r   r   )
rZ   r   r5  r   rD  r   r  r  r   r  )r5  r   rD  r   r  r  r   r  )rZ   r=   rk   r   r   z
list[bool])rZ   r   rk   r   r   zAwaitable[list[bool]])rk   r   r   z"list[bool] | Awaitable[list[bool]]r  rW   )rZ   r=   r  )Literal['SYNC'] | Literal['ASYNC'] | Noner   r   )rZ   r   r  r  r   r   )r  r  r   r   r   r   r   )rZ   r=   r2  r8   r   r   )rZ   r   r2  r8   r   zAwaitable[str])r2  r8   r   zstr | Awaitable[str])rZ   rH  r2  r8   r   r.  )r  r  r  r  r	  r  r   r  r  r  r>  r  r  r  r  r  r?  r  r
  rX   ra   r]   r  r  *  s   
NN N 	N
 0N 
N    *	
 
  !  *	
 
 CC$'C9JC	C    *	
 
  !  *	
 
 FF$'F9JF	FKK K 	K
 0K 
K    *	
 
  !  *	
 
 FF!$F6GF	F     *	
 
  !  *	
 
 II!$I6GI	I N N$!$*-$	$ $<

  @D < 
 
  @D!< 
  FJ=B=	=0 : :F F3 N N!+6	 ;
$G
$
$ 

$ra   r  c                  B   ^  \ rS rSrSU 4S jjr      SS jrSrU =r$ )AsyncScriptCommandsi+  c                (   >#    [         TU ]  5       $ 7frW   )r  r  )rZ   rk   r  s     r]   r   AsyncScriptCommands.script_debug+       w#%%r(  c                    [        X5      $ r  )rL  r  s     r]   r  #AsyncScriptCommands.register_script	+  s     4((ra   rX   r  )rZ   rR  r2  r8   r   rL  )r  r  r  r  r  r  r
  r  r  s   @r]   r  r  +  s,    &
)W
)
) 

) 
)ra   r  c                     \ rS rSrSr\   S             S S jj5       r\   S             S!S jj5       r   S           S"S jjr\ S#           S$S jj5       r\ S#           S%S jj5       r S#         S&S	 jjr\        S'S
 j5       r\        S(S j5       r      S)S jr\        S*S j5       r	\        S+S j5       r	      S,S jr	\         S-                             S.S jj5       r
\         S-                             S/S jj5       r
         S-                           S0S jjr
\         S-                           S1S jj5       r\         S-                           S2S jj5       r         S-                         S3S jjr        S4S jr\             S5                               S6S jj5       r\             S5                               S7S jj5       r             S5                             S8S jjr\           S9                             S:S jj5       r\           S9                             S;S jj5       r           S9                           S<S jjr        S4S jrSrg)=GeoCommandsi+  zf
Redis Geospatial commands.
see: https://redis.com/redis-best-practices/indexing-patterns/geospatial/
c                    g rW   rX   rZ   r  rv  re  rf  rI	  s         r]   geoaddGeoCommands.geoadd+  r  ra   c                    g rW   rX   r  s         r]   r  r  &+  r!  ra   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  r   rS  rf   )rZ   r  rv  re  rf  rI	  rg   s          r]   r  r  0+  s    8 "IJJv;?aRSSMM$MM$MM$f##H6v66ra   Nc                    g rW   rX   rZ   r  place1place2units        r]   geodistGeoCommands.geodistZ+  r  ra   c                    g rW   rX   r  s        r]   r  r  c+  r  ra   c                    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
re  kmmiftzGEODIST invalid unitGEODISTr   r$  )rZ   r  r  r  r  rg   s         r]   r  r  l+  sQ     %)&#9D 77233MM$##IDDdVDDra   c                    g rW   rX   ru  s      r]   geohashGeoCommands.geohash~+  r  ra   c                    g rW   rX   ru  s      r]   r  r  +  r	  ra   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
GEOHASHr   re   ru  s      r]   r  r  +  s#     ##ItJfJD6JJra   c                    g rW   rX   ru  s      r]   geoposGeoCommands.geopos+  r  ra   c                    g rW   rX   ru  s      r]   r  r  +  r  ra   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
GEOPOSr   re   ru  s      r]   r  r  +  s#     ##HdIVI4&IIra   c                    g rW   rX   rZ   r  	longitudelatituderadiusr  withdist	withcoordwithhashr   r  r  
store_distanys                 r]   	georadiusGeoCommands.georadius+  s       ra   c                    g rW   rX   r  s                 r]   r  r  +  s      (+ra   c                :    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  r   r  r  r  r  _georadiusgenericr  s                 r]   r  r  +  sG    \ %%! & 
 	
ra   c                    g rW   rX   rZ   r  memberr  r  r  r  r  r   r  r  r  r  s                r]   georadiusbymemberGeoCommands.georadiusbymember,  s      ra   c                    g rW   rX   r  s                r]   r  r  ,  s     (+ra   c                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   r  s                r]   r  r  .,  sC    . %%! & 
 	
ra   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 unitre  r  r   z+``any`` can't be provided without ``count``))r  WITHDIST)r  	WITHCOORD)r  WITHHASHra  ANYr  ASCDESCzGEORADIUS invalid sortr  r  z4GEORADIUS store and store_dist can't be set togetherr  	   STOREDIST)rd  r   r   rS  rf   rZ   r  rk   r\   rg   arg_name	byte_reprs          r]   r  GeoCommands._georadiusgenericU,  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RSS'?MM8VG_56,MM<)=>?##G?f???ra   c                    g rW   rX   rZ   r  r  r  r  r  r  widthheightr  r   r  r  r  r  s                  r]   	geosearchGeoCommands.geosearch,  s    "  ra   c                    g rW   rX   r  s                  r]   r  r  ,  s    " (+ra   c                @    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  r   r  r  r  r  r  r  _geosearchgenericr  s                  r]   r  r  ,  sP    z %%# & 
 	
ra   c                    g rW   rX   rZ   r  r  r  r  r  r  r  r  r  r  r   r  	storedists                 r]   geosearchstoreGeoCommands.geosearchstore,  s      ra   c                    g rW   rX   r#  s                 r]   r%  r&  -  s      ra   c                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
GEOSEARCHSTORENr  r   r#  s                 r]   r%  r&  -  sR    4 %% % & 
 	
ra   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 can't be set togethers
   FROMMEMBERs
   FROMLONLATr  r  r  z.GEOSEARCH must have radius or width and heightr  zGEOSEARCH must have unitr  zGEOSEARCH invalid unitz:GEOSEARCH radius and width or height can't be set togethers   BYRADIUSs   BYBOXr  r  s   ASCr  r  zGEOSEARCH invalid sortr   r  r  s   ANYz1GEOSEARCH ``any`` can't be provided without count))r  s   WITHDIST)r  s	   WITHCOORD)r  s   WITHHASH)r  r  r  r   rP   r   )rd  r   rS  rR  r  r   rf   r  s          r]   r!  GeoCommands._geosearchgenericM-  s    d (#k"*fZ.@.H VWW(k"fZ&8V  MM=&*:;<+*vj/A/MMM=&*=vj?QRS (#g&&*:*B PQQ&>!677&>!)@@455(g&"2P  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???ra   rX   )FFF)rZ   r=   r  r1   rv  Sequence[EncodableT]re  r   rf  r   rI	  r   r   r   )rZ   r   r  r1   rv  r,  re  r   rf  r   rI	  r   r   r   )r  r1   rv  r,  re  r   rf  r   rI	  r   r   r   rW   )rZ   r=   r  r1   r  r)   r  r)   r  r   r   rM
  )rZ   r   r  r1   r  r)   r  r)   r  r   r   rN
  )
r  r1   r  r)   r  r)   r  r   r   rO
  )rZ   r=   r  r1   rv  r)   r   r  )rZ   r   r  r1   rv  r)   r   r  )r  r1   rv  r)   r   r	  )rZ   r=   r  r1   rv  r)   r   zlist[GeoCoordinate | None])rZ   r   r  r1   rv  r)   r   z%Awaitable[list[GeoCoordinate | None]])r  r1   rv  r)   r   zBlist[GeoCoordinate | None] | Awaitable[list[GeoCoordinate | None]])	NFFFNNNNF)rZ   r=   r  r1   r  r  r  r  r  r  r  r   r  r   r  r   r  r   r   r   r  r   r  KeyT | Noner  r-  r  r   r   r+   )rZ   r   r  r1   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   Awaitable[GeoRadiusResponse])r  r1   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   0GeoRadiusResponse | Awaitable[GeoRadiusResponse])rZ   r=   r  r1   r  r)   r  r  r  r   r  r   r  r   r  r   r   r   r  r   r  r-  r  r-  r  r   r   r+   )rZ   r   r  r1   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  r1   r  r)   r  r  r  r   r  r   r  r   r  r   r   r   r  r   r  rT
  r  rT
  r  r   r   r/  )r  r   rk   r'   r\   zUnion[EncodableT, None]r   r6   )NNNre  NNNNNFFFF) rZ   r=   r  r1   r  r'  r  rM
  r  rM
  r  r   r  rM
  r  rM
  r  rM
  r  r   r   r   r  r   r  r   r  r   r  r   r   r,   ) rZ   r   r  r1   r  r'  r  rM
  r  rM
  r  r   r  rM
  r  rM
  r  rM
  r  r   r   r   r  r   r  r   r  r   r  r   r   zAwaitable[GeoSearchResponse])r  r1   r  r'  r  rM
  r  rM
  r  r   r  rM
  r  rM
  r  rM
  r  r   r   r   r  r   r  r   r  r   r  r   r   z0GeoSearchResponse | Awaitable[GeoSearchResponse])NNNre  NNNNNFF)rZ   r=   r  r1   r  r1   r  r'  r  rM
  r  rM
  r  r   r  rM
  r  rM
  r  rM
  r  r   r   r   r  r   r$  r   r   r   )rZ   r   r  r1   r  r1   r  r'  r  rM
  r  rM
  r  r   r  rM
  r  rM
  r  rM
  r  r   r   r   r  r   r$  r   r   r   )r  r1   r  r1   r  r'  r  rM
  r  rM
  r  r   r  rM
  r  rM
  r  rM
  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
  rX   ra   r]   r  r  +  sn   
 
   % 	
   
  
 ! % 	
   
  (7(7 %(7 	(7
 (7 (7 
(7T      	
  
    &!&& & 	&
 & 
!& & NREE"(E28E@JE	1E$ ' '(,'7='	!' ' 2!2)-28>2	,2 2	K	K#)	K	G	K ) )(,)7=)	#) ) 4!4)-48>4	.4 4
J
J#)
J	K
J    !"&       	 
                      
   "    !"&+!++ + 	+
 + + + + + + + +  + + 
&+ +.   !"&=
=
 =
 	=

 =
 =
 =
 =
 =
 =
 =
 =
  =
 =
 
:=
~    !"&       	 
                    
        !"&+!++ + 	+
 + + + + + + +  + + 
&+ +*   #'(,%
%
 %
 	%

 %
 %
 %
 %
 %
 %
 !%
 &%
 %
 
:%
N,@,@#-,@9P,@	,@\  !%"&!%#"#         	 
                        
!   $  !%"&!%#"# +!++ +  	+
 + + + + + + + + + + +  
&!+ +* !%"&!%#"# O
O
 O
  	O

 O
 O
 O
 O
 O
 O
 O
 O
 O
 O
 O
  
:!O
b 
 !%"&!%#"#    	
            
 " 
 !%"&!%#"# !  	
            
 * !%"&!%#"# -
-
 -
 	-

  -
 -
 -
 -
 -
 -
 -
 -
 -
 -
 
-
^@@@@#-@@9P@@	@@ra   r  c                     \ rS rSrSr\SS j5       r\SS j5       rSS jr\  S         SS jj5       r\  S         S S jj5       r  S       S!S	 jjr\SS
 j5       r\SS j5       rSS jr\S"S j5       r	\S#S j5       r	S$S jr	S%S jr
\S&S j5       r\S'S j5       rS(S jr\S)S j5       r\    S*S j5       r  S+S jr\S,S j5       r\    S-S j5       r  S.S jrSrg)/ModuleCommandsi-  zC
Redis Module commands.
see: https://redis.io/topics/modules-intro
c                    g rW   rX   rZ   pathrk   s      r]   module_loadModuleCommands.module_load-  rn  ra   c                    g rW   rX   r3  s      r]   r5  r6  -  rv   ra   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 LOADre   r3  s      r]   r5  r6  -  s     ##M4?$??ra   Nc                    g rW   rX   rZ   r4  rb  rk   s       r]   module_loadexModuleCommands.module_loadex-  ry  ra   c                    g rW   rX   r:  s       r]   r;  r<  -  r{  ra   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  )rZ   r4  rb  rk   rg   s        r]   r;  r<  -  s]     MM(#MM'"MM&!MM$##OTCFCCra   c                    g rW   rX   rB  s     r]   module_unloadModuleCommands.module_unload-  r=  ra   c                    g rW   rX   rB  s     r]   rB  rC  -  r   ra   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 UNLOADre   rB  s     r]   rB  rC  -  s     ##OT::ra   c                    g rW   rX   r.  s    r]   module_listModuleCommands.module_list-  r   ra   c                    g rW   rX   r.  s    r]   rG  rH  -  r   ra   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 LISTre   r.  s    r]   rG  rH  -  s     ##M22ra   c                    [        S5      er  r  r.  s    r]   r  ModuleCommands.command_info-  r  ra   c                    g rW   rX   r.  s    r]   r  ModuleCommands.command_count-  r  ra   c                    g rW   rX   r.  s    r]   r  rN  -  rn  ra   c                $    U R                  S5      $ )Nr  re   r.  s    r]   r  rN  -  s    ##O44ra   c                    g rW   rX   r  s     r]   command_getkeysModuleCommands.command_getkeys-  r   ra   c                    g rW   rX   r  s     r]   rR  rS  -  rc   ra   c                (    U R                   " S/UQ76 $ )NzCOMMAND GETKEYSre   r  s     r]   rR  rS  .  s     ##$5===ra   c                    g rW   rX   r.  s    r]   r  ModuleCommands.command.  r{  ra   c                    g rW   rX   r.  s    r]   r  rW  
.  r  ra   c                $    U R                  S5      $ )Nr  re   r.  s    r]   r  rW  .  s     ##I..ra   rX   r   r   r   r  )
rZ   r=   r4  r   rb  List[str] | Nonerk   rZ  r   r   )
rZ   r   r4  r   rb  rZ  rk   rZ  r   r   )r4  r   rb  rZ  rk   rZ  r   r   )rZ   r=   r   zlist[dict[Any, Any]])rZ   r   r   zAwaitable[list[dict[Any, Any]]])r   z6list[dict[Any, Any]] | Awaitable[list[dict[Any, Any]]]r  r  r  r  r   r   r   r  r  r  )r  r  r  r  r	  r   r5  r;  rB  rG  r  r  rR  r  r
  rX   ra   r]   r1  r1  -  s   
 G GS S@  %)!%	  " 	
 
   %)!%	%!%% "% 	%
 
 % % %)!%	DD "D 	D
 
0D* B BN N; J JV V3

 ; ;G G5 R R+!+	%+ +>	9>
 K K3!3	-3 3/	I/ra   r1  c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )AsyncModuleCommandsi.  c                (   >#    [         TU ]  5       $ 7frW   r  r&  s    r]   r   AsyncModuleCommands.command_info.  r  r(  rX   r  )r  r  r  r  r  r
  r  r  s   @r]   r\  r\  .  s    & &ra   r\  c                      \ rS rSrSr\SS j5       r\    SS j5       rSS jr\SS j5       r\SS j5       rSS jr\SS	 j5       r\SS
 j5       rSS jrSr	g)ClusterCommandsi.  z"
Class for Redis Cluster commands
c                    g rW   rX   rZ   cluster_argrk   r\   s       r]   clusterClusterCommands.cluster.  rv   ra   c                    g rW   rX   rb  s       r]   rd  re  ".  rx   ra   c                P    U R                   " SUR                  5        3/UQ70 UD6$ )NzCLUSTER )rf   r  rb  s       r]   rd  re  '.  s.    ##h{/@/@/B.C$DVtVvVVra   c                    g rW   rX   r   s     r]   	readwriteClusterCommands.readwrite*.  r=  ra   c                    g rW   rX   r   s     r]   ri  rj  -.  r   ra   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
)	READWRITEre   r   s     r]   ri  rj  0.  r  ra   c                    g rW   rX   r   s     r]   readonlyClusterCommands.readonly8.  r   ra   c                    g rW   rX   r   s     r]   ro  rp  ;.  r   ra   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
)READONLYre   r   s     r]   ro  rp  >.  r   ra   rX   NrZ   r=   r   r   rZ   r   r   r  r   r  r   r   r   )
r  r  r  r  r	  r   rd  ri  ro  r
  rX   ra   r]   r`  r`  .  s     S S!	 W B BN N; A AM M:ra   r`  c                  &   \ rS rSrSr\ S$       S%S jj5       r\ S$       S&S jj5       rS$S'S jjr\S(S j5       r\S)S j5       rS*S jr\S+S,S	 jj5       r\ S+     S-S
 jj5       rS+S.S jjr\  S/       S0S jj5       r	\  S/       S1S jj5       r	 S/     S2S jjr	S3S jr
\        S4S j5       r\        S5S j5       r      S6S jr\        S4S j5       r\        S5S j5       r      S6S jr\S7S j5       r\S8S j5       rS9S jr\ S:       S;S jj5       r\ S:       S<S jj5       r S:     S=S jjr\S>S j5       r\S?S j5       rS@S jr\SAS j5       r\SBS  j5       rSCS! jrS"rg#)DFunctionCommandsiJ.  z
Redis Function commands
c                    g rW   rX   rZ   coder  s      r]   function_loadFunctionCommands.function_loadO.  rn   ra   c                    g rW   rX   rz  s      r]   r|  r}  T.  rp   ra   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  )rZ   r{  r  rg   s       r]   r|  r}  Y.  s1     !()Rd##O=f==ra   c                    g rW   rX   rZ   librarys     r]   function_delete FunctionCommands.function_deletej.  ri  ra   c                    g rW   rX   r  s     r]   r  r  m.  r9  ra   c                &    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 DELETEre   r  s     r]   r  r  p.  s     ##$5w??ra   c                    g rW   rX   r  s     r]   function_flushFunctionCommands.function_flushx.  r  ra   c                    g rW   rX   r  s     r]   r  r  {.  r  ra   c                &    U R                  SU5      $ )z`
Deletes all the libraries.

For more information, see https://redis.io/commands/function-flush
zFUNCTION FLUSHre   r  s     r]   r  r  .  s     ##$4d;;ra   c                    g rW   rX   rZ   r  withcodes      r]   function_listFunctionCommands.function_list.  s    
 ra   c                    g rW   rX   r  s      r]   r  r  .  s    
  #ra   c                `    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  )rZ   r  r  rk   s       r]   r  r  .  s3     w'KK
###O;d;;ra   c                *    U R                   " XU/UQ76 $ rW   re   )rZ   r  functionrD  r  s        r]   _fcallFunctionCommands._fcall.  s    ##GwOOOra   c                    g rW   rX   rZ   r  rD  r  s       r]   fcallFunctionCommands.fcall.  r@  ra   c                    g rW   rX   r  s       r]   r  r  .  rx   ra   c                *    U R                   " SX/UQ76 $ )zO
Invoke a function.

For more information, see https://redis.io/commands/fcall
FCALLr  r  s       r]   r  r  .  s     {{7HFFFra   c                    g rW   rX   r  s       r]   fcall_roFunctionCommands.fcall_ro.  r@  ra   c                    g rW   rX   r  s       r]   r  r  .  rx   ra   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]   r  r  .  s     {{:xI=IIra   c                    g rW   rX   r.  s    r]   function_dumpFunctionCommands.function_dump.  r  ra   c                    g rW   rX   r.  s    r]   r  r  .  r#  ra   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   r[  )zFUNCTION DUMPr_  ra  s      r]   r  r  .  s(     	. "##?w??ra   c                    g rW   rX   rZ   payloadpolicys      r]   function_restore!FunctionCommands.function_restore.  r  ra   c                    g rW   rX   r  s      r]   r  r  .  r  ra   c                &    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 RESTOREre   r  s      r]   r  r  .  s     ##$6HHra   c                    g rW   rX   r.  s    r]   function_killFunctionCommands.function_kill.  r+  ra   c                    g rW   rX   r.  s    r]   r  r  .  r   ra   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 KILLre   r.  s    r]   r  r  /  s     ##O44ra   c                    g rW   rX   r.  s    r]   function_statsFunctionCommands.function_stats
/  s    9<ra   c                    g rW   rX   r.  s    r]   r  r  /  r7  ra   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 STATSre   r.  s    r]   r  r  /  s     ##$455ra   rX   Nr  )rZ   r=   r{  r   r  r|  r   r   )rZ   r   r{  r   r  r|  r   r   )r{  r   r  r|  r   r   )rZ   r=   r  r   r   r   )rZ   r   r  r   r   r   )r  r   r   r   r]  )rZ   r=   r  r   r   r   )rZ   r   r  r   r   r   )r  r   r   r   )r  F)rZ   r=   r  r   r  r|  r   ry  )rZ   r   r  r   r  r|  r   rz  )r  r   r  r|  r   r{  )r  r   rD  r   r  r   r   r   )rZ   r=   rD  r   r  r   r   r   )rZ   r   rD  r   r  r   r   r  )rD  r   r  r   r   r  r  r  r  )r  )rZ   r=   r  r   r  r   r   r   )rZ   r   r  r   r  r   r   r   )r  r   r  r   r   r   r  r  r  rt  ru  rv  )r  r  r  r  r	  r   r|  r  r  r  r  r  r  r  r  r  r  r
  rX   ra   r]   rx  rx  J.  s    DI (+6A	  EJ%!%),%7B%	% %>" L LX X@ Q Q/5!),	 <  " %   
	   " %#!## # 
	# # BG<!<3><	)<"P  58JM	  !69KN	 G!$G69G	G  58JM	  !69KN	 	J!$	J69	J		J = =I I@ EM +.8B	  FN!,/9C	 
 2:
I
I$.
I	
I C CO O5 < <H H6ra   rx  c                      \ rS rSrSrSrg)DataAccessCommandsi/  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.
rX   Nr  r  r  r  r	  r
  rX   ra   r]   r  r  /      ra   r  c                      \ rS rSrSrSrg)AsyncDataAccessCommandsi//  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.
rX   Nr  rX   ra   r]   r  r  //  r  ra   r  c                      \ rS rSrSrSrg)CoreCommandsiA/  z~
A class containing all of the implemented redis commands. This class is
to be used as a mixin for synchronous Redis clients.
rX   Nr  rX   ra   r]   r  r  A/      ra   r  c                      \ rS rSrSrSrg)AsyncCoreCommandsiQ/  z
A class containing all of the implemented redis commands. This class is
to be used as a mixin for asynchronous Redis clients.
rX   Nr  rX   ra   r]   r  r  Q/  r  ra   r  )
__future__r   rs  r3  r	  r  r  ImportErrorr  enumr   typingr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   $redis.asyncio.observability.recorderr   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,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   redis.utilsrH   rI   rJ   rK   rL   observability.attributesrN   observability.recorderrO   helpersrQ   rR   rP  redisredis.asyncio.clusterr`  redis.clusterrT   AsyncACLCommandsr  r  r  r  r  r  r  r*  AsyncListCommandsr  r  r  r  AsyncArrayCommandsr  r  r  AsyncSetCommandsrI  AsyncStreamCommandsrF	  AsyncSortedSetCommandsrV
  AsyncHyperlogCommandsrm
  rq
  AsyncHashCommandsr.  rL  rT  AsyncPubSubCommandsr  r  r  AsyncGeoCommandsr1  r\  r`  AsyncClusterCommandsrx  AsyncFunctionCommandsr  r  r  r  rX   ra   r]   <module>r     s   "   J      & S R/ / / / / / / / / / / /`  7 9 g<" g<T  $ 
[=) [=|80;0 0;fm5 m5` K G' K G\@!, !(t

# t

n ! t  t 
t5$ t5n # j# jZ	l l^B@" B@J
  <% <D( % G8( G8T, + 3?' 3?l ) T Y
# Y
x  ! @H @HF6D 6DrYK% YKx % w$% w$t). )"w	@" w	@t  /% /D&. &
*:& *:Z ' M6 M6` ) $$ Kz  Js   J+ +J76J7