
    phz                        S SK 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  S SKJr  S SKJrJr  S SKJrJrJrJrJrJrJr  SSKJrJrJrJr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-  \(       a  S S
K.J/r/  \0" / SQ5      r1 " S S\5      r2 " S S\25      r3 " S S\%5      r4 " S S\4\ 5      r5 " S S\#5      r6 " S S\6\5      r7 " S S\2\4\\'\6\(\$\&\-5      r8 " S S\3\5\\7\"\\!\,5
      r9g)    N)TYPE_CHECKINGAnyAsyncIteratorDictIterableIteratorListLiteralMappingNoReturnOptionalUnion)key_slot)RedisClusterException
RedisError)AnyKeyTClusterCommandsProtocol
EncodableTKeysTKeyTPatternT	ResponseT   )ACLCommandsAsyncACLCommandsAsyncDataAccessCommandsAsyncFunctionCommandsAsyncManagementCommandsAsyncModuleCommandsAsyncScriptCommandsDataAccessCommandsFunctionCommandsManagementCommandsModuleCommandsPubSubCommandsScriptCommands)list_or_args)AsyncRedisModuleCommandsRedisModuleCommands)TargetNodesT))BITCOUNTBITPOSEVAL_RO
EVALSHA_ROEXISTSGEODISTGEOHASHGEOPOS	GEORADIUSGEORADIUSBYMEMBERGETGETBITGETRANGEHEXISTSHGETHGETALLHKEYSHLENHMGETHSTRLENHVALSKEYSLINDEXLLENLRANGEMGETPTTL	RANDOMKEYSCARDSDIFFSINTER	SISMEMBERSMEMBERSSRANDMEMBERSTRLENSUNIONTTLZCARDZCOUNTZRANGEZSCOREc            	       v   \ rS rSrSrS\\   S\\\	\   4   4S jr
S\\\4   S\\\	\   4   4S jrS\S	\\\\   4   S\	\   4S
 jrS\\   S	\\\\   4   S\\   S\	\   4S jrS\S\S\	\\      4S jrS\\\4   S\	\   4S jrS\S\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrSrg)ClusterMultiKeyCommandsc   ;
A class containing commands that handle more than one key
keysreturnc                     0 nU HH  n[        U R                  R                  U5      5      nUR                  U/ 5      R	                  U5        MJ     U$ )z@Split keys into a dictionary that maps a slot to a list of keys.)r   encoderencode
setdefaultappend)selfrX   slots_to_keyskeyslots        P/home/james-whalen/.local/lib/python3.13/site-packages/redis/commands/cluster.py_partition_keys_by_slot/ClusterMultiKeyCommands._partition_keys_by_sloth   sO     CDLL//45D$$T2.55c:      mappingc                     0 nUR                  5        HK  n[        U R                  R                  US   5      5      nUR	                  U/ 5      R                  U5        MM     U$ )zBSplit pairs into a dictionary that maps a slot to a list of pairs.r   )itemsr   r[   r\   r]   extend)r_   rg   slots_to_pairspairrb   s        rc   _partition_pairs_by_slot0ClusterMultiKeyCommands._partition_pairs_by_slotr   sY    
 MMODDLL//Q89D%%dB/66t< $ rf   commandslots_to_argsc                 *   U R                   =(       a	    U[        ;   nU R                  5       nUR                  5        VVs/ s H5  u  pVUR                  " U/UQ7SU R
                  R                  XS5      /06PM7       nnUR                  5       $ s  snnf Ntarget_nodes)read_from_replicasREAD_COMMANDSpipelineri   execute_commandnodes_managerget_node_from_slotexecuter_   ro   rp   rt   piperb   	slot_argss          rc   _execute_pipeline_by_slot1ClusterMultiKeyCommands._execute_pipeline_by_slot~   s     "44QM9Q}} $1#6#6#8		
 $9    &&99$S $9		
 ||~		
s    <B	responsesc           
          [        UR                  5       U5       VVVVs0 s H  u  pE[        XE5        H  u  pgXg_M	     M     nnnnnU V	s/ s H  oU	   PM	     sn	$ s  snnnnf s  sn	f N)zipvalues)
r_   rX   rp   r   slot_valuesresponsekvresultsra   s
             rc   _reorder_keys_by_command0ClusterMultiKeyCommands._reorder_keys_by_command   sp     *-]-A-A-CY)O
)O%K2 D2 )O 	 

 )----

 .s   #A
A%argsc                     [        X5      nU R                  U5      nU R                  SU5      nU R                  XU5      $ )  
Splits the keys into different slots and then calls MGET
for the keys of every slot. This operation will not be atomic
if keys belong to more than one slot.

Returns a list of values ordered identically to ``keys``

For more information see https://redis.io/commands/mget
rD   r'   rd   r~   r   r_   rX   r   r`   ress        rc   mget_nonatomic&ClusterMultiKeyCommands.mget_nonatomic   sI     D' 44T: ,,V]C ,,T#FFrf   c                 H    U R                  U5      nU R                  SU5      $ )  
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().

Splits the keys into different slots and then calls MSET
for the keys of every slot. This operation will not be atomic
if keys belong to more than one slot.

For more information see https://redis.io/commands/mset
MSETrm   r~   r_   rg   rk   s      rc   mset_nonatomic&ClusterMultiKeyCommands.mset_nonatomic   s)     66w? --fnEErf   c                 X    U R                  U5      n[        U R                  X5      5      $ )^
Runs the given command once for the keys
of each slot. Returns the sum of the return values.
rd   sumr~   r_   ro   rX   r`   s       rc   _split_command_across_slots3ClusterMultiKeyCommands._split_command_across_slots   s,     44T: 411'IJJrf   c                 (    U R                   " S/UQ76 $ )z
Returns the number of ``names`` that exist in the
whole cluster. The keys are first split up into slots
and then an EXISTS command is sent for every slot

For more information see https://redis.io/commands/exists
r/   r   r_   rX   s     rc   existsClusterMultiKeyCommands.exists   s     //@4@@rf   c                 (    U R                   " S/UQ76 $ )a  
Deletes the given keys in the cluster.
The keys are first split up into slots
and then an DEL command is sent for every slot

Non-existent keys are ignored.
Returns the number of keys that were deleted.

For more information see https://redis.io/commands/del
DELr   r   s     rc   deleteClusterMultiKeyCommands.delete   s     //===rf   c                 (    U R                   " S/UQ76 $ )a!  
Updates the last access time of given keys across the
cluster.

The keys are first split up into slots
and then an TOUCH command is sent for every slot

Non-existent keys are ignored.
Returns the number of keys that were touched.

For more information see https://redis.io/commands/touch
TOUCHr   r   s     rc   touchClusterMultiKeyCommands.touch   s     //?$??rf   c                 (    U R                   " S/UQ76 $ )a  
Remove the specified keys in a different thread.

The keys are first split up into slots
and then an TOUCH command is sent for every slot

Non-existent keys are ignored.
Returns the number of keys that were unlinked.

For more information see https://redis.io/commands/unlink
UNLINKr   r   s     rc   unlinkClusterMultiKeyCommands.unlink   s     //@4@@rf    N)__name__
__module____qualname____firstlineno____doc__r   r   r   intr	   rd   r   r   r   rm   strr   r~   r   r   r   r   boolr   r   r   r   r   r   r   __static_attributes__r   rf   rc   rU   rU   c   s   HTN tCdO?T 
w
23
	c4
##	$
+238L3L+M	c".tn. sHZ$889. C=	.
 
c.G5 G G$x}:M G.Fggz.A&B FtDz F&
K3 
Kt 
K 
KAD AY A>D >Y >@4 @I @AD AY Arf   rU   c                       \ rS rSrSrS\S\S\\\	      4S jr
S\\\4   S\\   4S jrS	\S\S\4S
 jrS	\S\\\\   4   S\\	   4S jrSrg)AsyncClusterMultiKeyCommandsi  rW   rX   r   rY   c                    #    [        X5      nU R                  U5      nU R                  SU5      I Sh  vN nU R                  XU5      $  N7f)r   rD   Nr   r   s        rc   r   +AsyncClusterMultiKeyCommands.mget_nonatomic  sU      D' 44T: 226=II ,,T#FF Js   2AAArg   c                 d   #    U R                  U5      nU R                  SU5      I Sh  vN $  N7f)r   r   Nr   r   s      rc   r   +AsyncClusterMultiKeyCommands.mset_nonatomic#  s2      66w? 33FNKKKKs   '0.0ro   c                 t   #    U R                  U5      n[        U R                  X5      I Sh  vN 5      $  N7f)r   Nr   r   s       rc   r   8AsyncClusterMultiKeyCommands._split_command_across_slots6  s5      44T: 77OOPPOs   +86	8rp   c                   #    U R                   (       a  U R                  5       I S h  vN   U R                  =(       a	    U[        ;   nU R	                  5       nUR                  5        VVs/ s H5  u  pVUR                  " U/UQ7SU R                  R                  XS5      /06PM7       nnUR                  5       I S h  vN $  Ns  snnf  N7frr   )
_initialize
initializert   ru   rv   ri   rw   rx   ry   rz   r{   s          rc   r~   6AsyncClusterMultiKeyCommands._execute_pipeline_by_slotB  s      //###!44QM9Q}} $1#6#6#8		
 $9    &&99$S $9		
 \\^## $		
 $s.   %CCAC+<C'C=C
>CCr   N)r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   r   r~   r   r   rf   rc   r   r     s    G Gt GXc]@S G.LGGZ4G,H LTRVZ L&
Q 
QT 
Qc 
Q$$+238L3L+M$	c$rf   r   c            
          \ rS rSrSrS\4S jrS\4S jrS\4S jrSSS\	4S	 jr
SSS
\S\	4S jrSSS
\S\	4S jrS\S\	4S jrS\S\	4S jrS
\S\\   4S jrS
\S\	4S jr S4SSS\\   S\	4S jjrS4S\S   S\	4S jjrS\S\	4S jr S4S\S\S\S   S\	4S jjrS\	4S jrSSS\S\	4S jr S5S\S\S   S\	4S  jjr S4S\S   S\	4S! jjrS"\S#\S\	4S$ jr S4S%\S\S   S\	4S& jjr SSS\S\S'\S\	4
S( jr!S\S\	4S) jr" S4S\S\S   S\	4S* jjr#S4S\S   S\	4S+ jjr$S4S, jr%S4S- jr&SSS\	4S. jr'S4S\S   SS4S/ jjr(S4S\S   SS4S0 jjr)S4S\S   S\	4S1 jjr*S4S\S   S\	4S2 jjr+S3r,g)6ClusterManagementCommandsiV  
A class for Redis Cluster management commands

The class inherits from Redis's core ManagementCommands class and do the
required adjustments to work with cluster mode
rY   c                     [        S5      e)z
Make the server a replica of another instance, or promote it as master.

For more information see https://redis.io/commands/slaveof
z(SLAVEOF is not supported in cluster moder   r_   r   kwargss      rc   slaveof!ClusterManagementCommands.slaveof^  s     $$NOOrf   c                     [        S5      e)z
Make the server a replica of another instance, or promote it as master.

For more information see https://redis.io/commands/replicaof
z*REPLICAOF is not supported in cluster moder   r   s      rc   	replicaof#ClusterManagementCommands.replicaoff  s     $$PQQrf   c                     [        S5      e)zW
Swaps two Redis databases.

For more information see https://redis.io/commands/swapdb
z'SWAPDB is not supported in cluster moder   r   s      rc   swapdb ClusterManagementCommands.swapdbn  s     $$MNNrf   target_noder*   c                 "    U R                  SUS9$ )z
Returns the node's id.

:target_node: 'ClusterNode'
    The node to execute the command on

For more information check https://redis.io/commands/cluster-myid/
zCLUSTER MYIDrs   rw   r_   r   s     rc   cluster_myid&ClusterManagementCommands.cluster_myidv  s     ##N#MMrf   slotsc                 .    U R                   " S/UQ7SU06$ )z
Assign new hash slots to receiving node. Sends to specified node.

:target_node: 'ClusterNode'
    The node to execute the command on

For more information see https://redis.io/commands/cluster-addslots
zCLUSTER ADDSLOTSrs   r   r_   r   r   s      rc   cluster_addslots*ClusterManagementCommands.cluster_addslots  s*     ##
!&
5@
 	
rf   c                 .    U R                   " S/UQ7SU06$ )a  
Similar to the CLUSTER ADDSLOTS command.
The difference between the two commands is that ADDSLOTS takes a list of slots
to assign to the node, while ADDSLOTSRANGE takes a list of slot ranges
(specified by start and end slots) to assign to the node.

:target_node: 'ClusterNode'
    The node to execute the command on

For more information see https://redis.io/commands/cluster-addslotsrange
zCLUSTER ADDSLOTSRANGErs   r   r   s      rc   cluster_addslotsrange/ClusterManagementCommands.cluster_addslotsrange  s*     ###
&+
:E
 	
rf   slot_idc                 &    U R                  SU5      $ )z
Return the number of local keys in the specified hash slot
Send to node based on specified slot_id

For more information see https://redis.io/commands/cluster-countkeysinslot
zCLUSTER COUNTKEYSINSLOTr   r_   r   s     rc   cluster_countkeysinslot1ClusterManagementCommands.cluster_countkeysinslot  s     ##$=wGGrf   node_idc                 &    U R                  SU5      $ )z
Return the number of failure reports active for a given node
Sends to a random node

For more information see https://redis.io/commands/cluster-count-failure-reports
zCLUSTER COUNT-FAILURE-REPORTSr   )r_   r   s     rc   cluster_count_failure_report6ClusterManagementCommands.cluster_count_failure_report  s     ##$CWMMrf   c                 P    U Vs/ s H  o R                  SU5      PM     sn$ s  snf )
Set hash slots as unbound in the cluster.
It determines by it self what node the slot is in and sends it there

Returns a list of the results for each processed slot.

For more information see https://redis.io/commands/cluster-delslots
CLUSTER DELSLOTSr   )r_   r   rb   s      rc   cluster_delslots*ClusterManagementCommands.cluster_delslots  s*     LQQ54$$%7>5QQQs   #c                 (    U R                   " S/UQ76 $ )a!  
Similar to the CLUSTER DELSLOTS command.
The difference is that CLUSTER DELSLOTS takes a list of hash slots to remove
from the node, while CLUSTER DELSLOTSRANGE takes a list of slot ranges to remove
from the node.

For more information see https://redis.io/commands/cluster-delslotsrange
zCLUSTER DELSLOTSRANGEr   r_   r   s     rc   cluster_delslotsrange/ClusterManagementCommands.cluster_delslotsrange  s     ##$;DeDDrf   Noptionc                     U(       a2  UR                  5       S;  a  [        SU 35      eU R                  SX!S9$ U R                  SUS9$ )z
Forces a slave to perform a manual failover of its master
Sends to specified node

:target_node: 'ClusterNode'
    The node to execute the command on

For more information see https://redis.io/commands/cluster-failover
)FORCETAKEOVERz-Invalid option for CLUSTER FAILOVER command: zCLUSTER FAILOVERr   )upperr   rw   )r_   r   r   s      rc   cluster_failover*ClusterManagementCommands.cluster_failover  se     ||~%:: CF8L  ++& ,   ''(:'UUrf   rs   c                 "    U R                  SUS9$ )z
Provides info about Redis Cluster node state.
The command will be sent to a random node in the cluster if no target
node is specified.

For more information see https://redis.io/commands/cluster-info
zCLUSTER INFOr   r   r_   rs   s     rc   cluster_info&ClusterManagementCommands.cluster_info  s     ##N#NNrf   ra   c                 &    U R                  SU5      $ )z
Returns the hash slot of the specified key
Sends to random node in the cluster

For more information see https://redis.io/commands/cluster-keyslot
zCLUSTER KEYSLOTr   )r_   ra   s     rc   cluster_keyslot)ClusterManagementCommands.cluster_keyslot  s     ##$5s;;rf   hostportc                 $    U R                  SXUS9$ )z
Force a node cluster to handshake with another node.
Sends to specified node.

For more information see https://redis.io/commands/cluster-meet
zCLUSTER MEETr   r   )r_   r  r  rs   s       rc   cluster_meet&ClusterManagementCommands.cluster_meet  s#     ##D\ $ 
 	
rf   c                 $    U R                  S5      $ )z
Get Cluster config for the node.
Sends to random node in the cluster

For more information see https://redis.io/commands/cluster-nodes
zCLUSTER NODESr   )r_   s    rc   cluster_nodes'ClusterManagementCommands.cluster_nodes  s     ##O44rf   c                 "    U R                  SX!S9$ )z
Reconfigure a node as a slave of the specified master node

For more information see https://redis.io/commands/cluster-replicate
zCLUSTER REPLICATEr   r   )r_   rs   r   s      rc   cluster_replicate+ClusterManagementCommands.cluster_replicate  s!     ## $ 
 	
rf   softc                 <    U R                  SU(       a  SUS9$ SUS9$ )z
Reset a Redis Cluster node

If 'soft' is True then it will send 'SOFT' argument
If 'soft' is False then it will send 'HARD' argument

For more information see https://redis.io/commands/cluster-reset
zCLUSTER RESETs   SOFTs   HARDr   r   )r_   r  rs   s      rc   cluster_reset'ClusterManagementCommands.cluster_reset  s9     ##W $ 
 	
29 $ 
 	
rf   c                 "    U R                  SUS9$ )zv
Forces the node to save cluster state on disk

For more information see https://redis.io/commands/cluster-saveconfig
zCLUSTER SAVECONFIGr   r   r  s     rc   cluster_save_config-ClusterManagementCommands.cluster_save_config&  s     ##$8|#TTrf   rb   num_keysc                 &    U R                  SX5      $ )z
Returns the number of keys in the specified cluster slot

For more information see https://redis.io/commands/cluster-getkeysinslot
zCLUSTER GETKEYSINSLOTr   )r_   rb   r  s      rc   cluster_get_keys_in_slot2ClusterManagementCommands.cluster_get_keys_in_slot0  s     ##$;TLLrf   epochc                 "    U R                  SXS9$ )zx
Set the configuration epoch in a new node

For more information see https://redis.io/commands/cluster-set-config-epoch
zCLUSTER SET-CONFIG-EPOCHr   r   )r_   r  rs   s      rc   cluster_set_config_epoch2ClusterManagementCommands.cluster_set_config_epoch8  s!     ##& $ 
 	
rf   statec                     UR                  5       S;   a  U R                  SX4X!S9$ UR                  5       S:X  a  [        S5      e[        SU 35      e)z
Bind an hash slot to a specific node

:target_node: 'ClusterNode'
    The node to execute the command on

For more information see https://redis.io/commands/cluster-setslot
)	IMPORTINGNODE	MIGRATINGCLUSTER SETSLOTr   STABLEz4For "stable" state please use cluster_setslot_stablezInvalid slot state: )r   rw   r   )r_   r   r   r   r!  s        rc   cluster_setslot)ClusterManagementCommands.cluster_setslotD  sa     ;;=>>''!77 (   [[]h&STT3E7;<<rf   c                 (    U R                  SUS5      $ )z
Clears migrating / importing state from the slot.
It determines by it self what node the slot is in and sends it there.

For more information see https://redis.io/commands/cluster-setslot
r&  r'  r   r   s     rc   cluster_setslot_stable0ClusterManagementCommands.cluster_setslot_stableX  s     ##$5wIIrf   c                 "    U R                  SXS9$ )z
Provides a list of replica nodes replicating from the specified primary
target node.

For more information see https://redis.io/commands/cluster-replicas
zCLUSTER REPLICASr   r   )r_   r   rs   s      rc   cluster_replicas*ClusterManagementCommands.cluster_replicasa  s!     ## $ 
 	
rf   c                 "    U R                  SUS9$ )zn
Get array of Cluster slot to node mappings

For more information see https://redis.io/commands/cluster-slots
zCLUSTER SLOTSr   r   r  s     rc   cluster_slots'ClusterManagementCommands.cluster_slotsn  s     ##O,#OOrf   c                 "    U R                  SUS9$ )zu
Returns details about the shards of the cluster.

For more information see https://redis.io/commands/cluster-shards
zCLUSTER SHARDSr   r   r  s     rc   cluster_shards(ClusterManagementCommands.cluster_shardsv  s     ##$4<#PPrf   c                 "    U R                  SUS9$ )zj
Returns the shard ID of the node.

For more information see https://redis.io/commands/cluster-myshardid/
zCLUSTER MYSHARDIDr   r   r  s     rc   cluster_myshardid+ClusterManagementCommands.cluster_myshardid~  s     ##$7l#SSrf   c                 "    U R                  SUS9$ )aV  
Each node in a Redis Cluster maintains a pair of long-lived TCP link with each
peer in the cluster: One for sending outbound messages towards the peer and one
for receiving inbound messages from the peer.

This command outputs information of all such peer links as an array.

For more information see https://redis.io/commands/cluster-links
zCLUSTER LINKSr   r   r   s     rc   cluster_links'ClusterManagementCommands.cluster_links  s     ##O+#NNrf   c                     [        S5      e)NzBCLUSTER FLUSHSLOTS is intentionally not implemented in the client.NotImplementedErrorr  s     rc   cluster_flushslots,ClusterManagementCommands.cluster_flushslots  s    !P
 	
rf   c                     [        S5      e)NzACLUSTER BUMPEPOCH is intentionally not implemented in the client.r=  r  s     rc   cluster_bumpepoch+ClusterManagementCommands.cluster_bumpepoch  s    !O
 	
rf   c                 H    US:X  d  US:X  a  SU l         U R                  SUS9$ )z
Enables read queries.
The command will be sent to the default cluster node if target_nodes is
not specified.

For more information see https://redis.io/commands/readonly
replicasallTREADONLYr   rt   rw   r  s     rc   readonly"ClusterManagementCommands.readonly  s3     :%)> '+D###J\#JJrf   c                 0    SU l         U R                  SUS9$ )z
Disables read queries.
The command will be sent to the default cluster node if target_nodes is
not specified.

For more information see https://redis.io/commands/readwrite
F	READWRITEr   rH  r  s     rc   	readwrite#ClusterManagementCommands.readwrite  s"     #(##Kl#KKrf   )rt   r   )TN)-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.  r1  r4  r7  r:  r?  rB  rI  rM  r   r   rf   rc   r   r   V  s:   P( PRH RO O	N 	N9 	N
)
3=
	

)
3=
	
$Hs Hy HNC NI N	Rz 	Rd4j 	R	EJ 	E9 	E DHV)V3;C=V	V0O.)A OY O<3 <9 < NR

"
2:>2J
	
5y 5

*

58

	

 KO

/7/G
	
  8<U$^4U	UMS MC MI M DH



(0(@

	

=)=47=BE=NQ=	=(Jc Ji J FJ

*2>*B
	
P(>*B Pi PQT
O 
OI 
O
x/G 
SW 


h~.F 
RV 

KXn%= K K
Lh~&> 
L) 
L 
Lrf   r   c                   0    \ rS rSrSrS\S\\   4S jrSr	g)AsyncClusterManagementCommandsi  r   r   rY   c                 Z   ^ #    [         R                  " U 4S jU 5       6 I Sh  vN $  N7f)r   c              3   p   >#    U  H+  n[         R                  " TR                  S U5      5      v   M-     g7f)r   N)asynciocreate_taskrw   ).0rb   r_   s     rc   	<genexpr>BAsyncClusterManagementCommands.cluster_delslots.<locals>.<genexpr>  s4      !D ##D$8$89KT$RSS!s   36N)rS  gatherr   s   ` rc   r   /AsyncClusterManagementCommands.cluster_delslots  s0      ^^!
 
 	
 
s   !+)+r   N)
r   r   r   r   r   r   r	   r   r   r   r   rf   rc   rP  rP    s    
Z 
DJ 
rf   rP  c                      ^  \ rS rSrSr     SS\S   S\S\S\\S   \S	   4   S
\S\S\	\
   S\S\4U 4S jjjr   SS\	\   S\	\
   S\	\   S\4S jjrSrU =r$ )ClusterDataAccessCommandsi  
A class for Redis Cluster Data Access Commands

The class inherits from Redis's core DataAccessCommand class and do the
required adjustments to work with cluster mode
stringsalgoLCSvalue1value2specific_argumentrX   lenidxminmatchlenwithmatchlenrY   c	           
         > U	R                  SS5      n
US:X  a  U
c  Sn
U	R                  SU
05        [        TU ]  " UUUUUUUU40 U	D6$ )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
rs   Nr]  zdefault-node)popupdatesuperstralgo)r_   r^  r`  ra  rb  rc  rd  re  rf  r   rs   	__class__s              rc   rk  !ClusterDataAccessCommands.stralgo  sk    > zz.$7	)l.B)L~|45w

 

 
	
rf   matchcount_typec           
   +   b  #    U R                   " SXUS.UD6u  pVU S h  vN   UR                  5        VVs0 s H  u  pxUS:w  d  M  Xx_M     nnnU(       a  UR                  5        Vs0 s H  owU R                  US9_M     n	nUR	                  SS 5        U(       a{  UR                  5        H1  u  pxU R                   " SUUUUX   S.UD6u  pU S h  vN   X   XW'   M3     UR                  5        VVs0 s H  u  pxUS:w  d  M  Xx_M     nnnU(       a  Mz  g g g  Ns  snnf s  snf  NSs  snnf 7fN)rn  ro  rp  r   )	node_namers   )cursorrn  ro  rp  rs   r   scanri   rX   get_noderh  )r_   rn  ro  rp  r   cursorsdatanamert  nodescurs              rc   	scan_iter#ClusterDataAccessCommands.scan_iter	  s6     		R%R6R4;MMOSOLDvQR{<4<OSEL\\^T^T4==4=88^ET JJ~t,$+MMOLD $		 !%###%*[! !!IC  $OO$'IGM %4 6=]]_5D\TRSLDL_   '  	S U $s]   D/DD/DDD/)D"AD/D'!D/5D)D)
D/D/D/)D/r   )r]  FFNFNNN)r   r   r   r   r   r
   r   r   r   r   r   r   rk  r   r   r   r}  r   __classcell__)rl  s   @rc   r[  r[    s     IR%)"-
en-
 -
 	-

 !!3WV_!DE-
 -
 -
 c]-
 -
 
-
 -
b %)##	!!! }! }	! 
! !rf   r[  c            	       N    \ rS rSrSr   S
S\\   S\\   S\\   S\	4S jjr
S	rg)AsyncClusterDataAccessCommandsi-  r\  Nrn  ro  rp  rY   c           
       #    U R                   " SXUS.UD6I S h  vN u  pVU H  nU7v   M
     UR                  5        VV	s0 s H  u  pU	S:w  d  M  X_M     nnn	U(       a  UR                  5        Vs0 s H  oU R                  US9_M     n
nUR	                  SS 5        U(       a  UR                  5        H=  u  pU R                   " SU	UUUX   S.UD6I S h  vN u  pU H  nU7v   M
     X   XX'   M?     UR                  5        VV	s0 s H  u  pU	S:w  d  M  X_M     nnn	U(       a  M  g g g  GNs  sn	nf s  snf  Nds  sn	nf 7frr  ru  )r_   rn  ro  rp  r   rx  ry  valuerz  rt  r{  r|  s               rc   r}  (AsyncClusterDataAccessCommands.scan_iter7  sU     #iiXeXQWXXEK  5<MMOSOLDvQR{<4<OSEL\\^T^T4==4=88^ET JJ~t,$+MMOLD&*ii '%###%*[' !' !IC "&# "&$'IGM %4 6=]]_5D\TRSLDL_   '  Y T U!s^   ED2'ED5D5E5D;AEE 1EEE#
E/E5EEr   r  )r   r   r   r   r   r   r   r   r   r   r}  r   r   rf   rc   r  r  -  sO     %)##	#!# }# }	# 
# #rf   r  c                       \ rS rSrSrSrg)RedisClusterCommandsi]  [  
A class for all Redis Cluster commands

For key-based commands, the target node(s) will be internally determined
by the keys' hash slot.
Non-key-based commands can be executed with the 'target_nodes' argument to
target specific nodes. By default, if target_nodes is not specified, the
command will be executed on the default cluster node.

:param :target_nodes: type can be one of the followings:
    - nodes flag: ALL_NODES, PRIMARIES, REPLICAS, RANDOM
    - 'ClusterNode'
    - 'list(ClusterNodes)'
    - 'dict(any:clusterNodes)'

for example:
    r.cluster_info(target_nodes=RedisCluster.ALL_NODES)
r   Nr   r   r   r   r   r   r   rf   rc   r  r  ]  s    rf   r  c                       \ rS rSrSrSrg)AsyncRedisClusterCommandsi|  r  r   Nr  r   rf   rc   r  r  |  s    rf   r  ):rS  typingr   r   r   r   r   r   r	   r
   r   r   r   r   	redis.crcr   redis.exceptionsr   r   redis.typingr   r   r   r   r   r   r   corer   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   helpersr'   redismodulesr(   r)   redis.asyncio.clusterr*   	frozensetru   rU   r   r   rP  r[  r  r  r  r   rf   rc   <module>r     s        >      " G2 *,^aA5 aAHL$#: L$^^L 2 ^LB
6
6X 2 Xv-6-`> ""rf   