+
    Ŝi(                    &   R t ^ RIHt ^ RIt^ RIHt ^ RIt^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHtHtHtHtHt ]'       d   ^ RIHtHtHt ^ R	IHtHt ^ R
IHtHtHtHt Rt R R lt!RR] R3R R llt"R] 3R R llt#R] R3R R llt$R] R3R R llt%R# )z"
data hash pandas / numpy objects
)annotationsN)TYPE_CHECKING)hash_object_array)is_list_like)CategoricalDtype)ABCDataFrameABCExtensionArrayABCIndexABCMultiIndex	ABCSeries)HashableIterableIterator)	ArrayLikenpt)	DataFrameIndex
MultiIndexSeries0123456789123456c               $    V ^8  d   QhRRRRRR/# )   arrayszIterator[np.ndarray]	num_itemsintreturnnpt.NDArray[np.uint64] )formats   "a/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/pandas/core/util/hashing.py__annotate__r    0   s$     ! ! !-0!!    c                d    \        V 4      p\
        P                  ! T.T 4      p \        P                  ! R4      p\        P                  ! T4      \        P                  ! R4      ,           p^ p\        T 4       FJ  w  rgY,
          pYG,          pYC,          pT\        P                  ! RT,           T,           4      ,          pTpKL  	  T^,           T8X  g   Q R4       hT\        P                  ! R4      ,          pT#   \         d*    \        P                  ! . \        P                  R7      u # i ; i)z
Parameters
----------
arrays : Iterator[np.ndarray]
num_items : int

Returns
-------
np.ndarray[uint64]

Should be the same as CPython's tupleobject.c
)dtypeiCB ixV4 iXB zFed in wrong num_itemsi| )	nextStopIterationnparrayuint64	itertoolschain
zeros_like	enumerate)	r   r   firstmultoutlast_iia	inverse_is	   &&       r   combine_hash_arraysr4   0   s    -V __eWf-F99WD
--
8!4
4CF&!M			%)+i788 " A:"<$<<"299UCJ!  -xx")),,-s   C; ;1D/.D/Tutf8c               0    V ^8  d   QhRRRRRRRRR	RR
R/# )r   objzIndex | DataFrame | Seriesindexboolencodingstrhash_keyz
str | None
categorizer   r   r   )r   s   "r   r    r    T   sL     k k	#kk k 	k
 k kr!   c                  a aaa ^ RI Hp Sf   \        o\        S \        4      '       d   V! \        S SS4      RRR7      # \        S \        4      '       d8   \        S P                  SSS4      P                  RRR7      pV! VS RRR7      pV# \        S \        4      '       d}   \        S P                  SSS4      P                  RRR7      pV'       d4   VVVV 3R lR 4       p\        P                  ! V.V4      p	\        V	^4      pV! VS P                  RRR7      pV# \        S \        4      '       d   VVV3R lS P!                  4        4       p
\#        S P$                  4      pV'       d8   VVVV 3R	 lR 4       pV^,          p\        P                  ! W4      pR
 V 4       p
\        W4      pV! VS P                  RRR7      pV# \'        R\)        S 4       24      h)a  
Return a data hash of the Index/Series/DataFrame.

The hash is computed element-wise using the underlying data values,
and optionally includes the index when hashing a Series or DataFrame.

Parameters
----------
obj : Index, Series, or DataFrame
    The pandas object to hash.
index : bool, default True
    Include the index in the hash (if Series/DataFrame).
encoding : str, default 'utf8'
    Encoding for data & key when strings.
hash_key : str, default _default_hash_key
    Hash_key for string key to encode.
categorize : bool, default True
    Whether to first categorize object arrays before hashing. This is more
    efficient when the array contains duplicate values.

Returns
-------
Series of uint64
    Same length as the object.

See Also
--------
util.hash_array : Return a hash of the given array.
util.hash_tuples : Hash a MultiIndex or listlike-of-tuples efficiently.

Examples
--------
>>> pd.util.hash_pandas_object(pd.Series([1, 2, 3]))
0    14639053686158035780
1     3869563279212530728
2      393322362522515241
dtype: uint64
)r   r(   F)r#   copyr?   )r8   r#   r?   c           	   3  l   <"   T F)  p\        SP                  R SSSR7      P                  x  K+  	  R# 5iF)r8   r:   r<   r=   Nhash_pandas_objectr8   _values.0_r=   r:   r<   r7   s   & r   	<genexpr>%hash_pandas_object.<locals>.<genexpr>   s@      	  A #II%%) '     14c              3  X   <"   T F  w  r\        VP                  SSS4      x  K!  	  R # 5iN)
hash_arrayrE   )rG   rH   seriesr=   r:   r<   s   &  r   rI   rJ      s,      
(	 v~~x:FF(s   '*c           	   3  l   <"   T F)  p\        SP                  R SSSR7      P                  x  K+  	  R# 5irB   rC   rF   s   & r   rI   rJ      s@      	$  A #II%%) '  rK   c              3  $   "   T F  qx  K  	  R # 5irM   r   )rG   xs   & r   rI   rJ      s     )Aas   zUnexpected type for hashing rM   )pandasr   _default_hash_key
isinstancer
   hash_tuplesr	   rN   rE   astyper   r)   r*   r4   r8   r   itemslencolumns	TypeErrortype)r7   r8   r:   r<   r=   r   hser
index_iterr   hashesr   index_hash_generator_hashess   f&fff         r   rD   rD   T   s   Z $#}%%k#x:(QVWW	C	"	"s{{Hh
CJJ5 K 
 Qc>d Ja 
C	#	#s{{Hh
CJJ5 K 
 	  	J __aS*5F#FA.AQciixeD< J9 
C	&	&
 YY[
 $		$  	$  NI  oofCG))F2QciixeD J 6tCykBCCr!   c               (    V ^8  d   QhRRRRRRRR/# )r   valsz+MultiIndex | Iterable[tuple[Hashable, ...]]r:   r;   r<   r   r   r   )r   s   "r   r    r       s0     / /
5// / 	/r!   c                  aa \        V 4      '       g   \        R4      h^ RIHpHp \        V \        4      '       g   VP                  ! V 4      pMT p\        VP                  4       Uu. uFB  pVP                  VP                  V,          \        VP                  V,          RR7      4      NKD  	  ppVV3R lV 4       p\        V\        V4      4      p	V	# u upi )z
Hash a MultiIndex / listlike-of-tuples efficiently.

Parameters
----------
vals : MultiIndex or listlike-of-tuples
encoding : str, default 'utf8'
hash_key : str, default _default_hash_key

Returns
-------
ndarray[np.uint64] of hashed values
z'must be convertible to a list-of-tuples)Categoricalr   F
categoriesorderedc              3  L   <"   T F  pVP                  SSR R7      x  K  	  R# 5i)Fr:   r<   r=   N)_hash_pandas_object)rG   catr:   r<   s   & r   rI   hash_tuples.<locals>.<genexpr>   s.      C 	HQVWWs   !$)r   r[   rS   rf   r   rU   r
   from_tuplesrangenlevels_simple_newcodesr   levelsr4   rY   )
rd   r:   r<   rf   r   milevelcat_valsr`   r]   s
   &ff       r   rV   rV      s    $ ABB
 dM**##D) 2::&
 'E	 	HHUO		%(8%H	
 '  F 	FCM2AHs   )ACc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   rd   r   r:   r;   r<   r=   r9   r   r   r   )r   s   "r   r    r       s:     4? 4?
4?4? 4? 	4?
 4?r!   c                *   \        V R4      '       g   \        R4      h\        V \        4      '       d   V P	                  WVR7      # \        V \
        P                  4      '       g#   \        R\        V 4      P                   R24      h\        WW#4      # )ag  
Given a 1d array, return an array of deterministic integers.

Parameters
----------
vals : ndarray or ExtensionArray
    The input array to hash.
encoding : str, default 'utf8'
    Encoding for data & key when strings.
hash_key : str, default _default_hash_key
    Hash_key for string key to encode.
categorize : bool, default True
    Whether to first categorize object arrays before hashing. This is more
    efficient when the array contains duplicate values.

Returns
-------
ndarray[np.uint64, ndim=1]
    Hashed values, same length as the vals.

See Also
--------
util.hash_pandas_object : Return a data hash of the Index/Series/DataFrame.
util.hash_tuples : Hash a MultiIndex / listlike-of-tuples efficiently.

Examples
--------
>>> pd.util.hash_array(np.array([1, 2, 3]))
array([ 6238072747940578789, 15839785061582574730,  2185194620014831856],
  dtype=uint64)
r#   zmust pass an ndarray-likerk   z6hash_array requires np.ndarray or ExtensionArray, not z!. Use hash_pandas_object instead.)
hasattrr[   rU   r   rl   r&   ndarrayr\   __name___hash_ndarray)rd   r:   r<   r=   s   &&&&r   rN   rN      s    J 4!!344$)**''Z ( 
 	
 dBJJ''DDz""##DF
 	

 >>r!   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   rd   z
np.ndarrayr:   r;   r<   r=   r9   r   r   r   )r   s   "r   r    r    +  s:     > >
>> > 	>
 >r!   c                   V P                   p\        P                  ! V\        P                  4      '       d?   \	        V P
                  WV4      p\	        V P                  WV4      pV^V,          ,           # V\        8X  d   V P                  R4      p EM4\        VP                  \        P                  \        P                  34      '       d$   V P                  R4      P                  RRR7      p M\        VP                  \        P                  4      '       dJ   VP                  ^8:  d9   V P                  RV P                   P                   24      P                  R4      p MdV'       dP   ^ RIHpHpHp	 V	! V RR7      w  r\)        V! VRR7      RR7      pVP+                  W4      pVP-                  WRR	7      #  \/        WV4      p W ^,	          ,          p V \        P6                  ! R
4      ,          p W ^,	          ,          p V \        P6                  ! R4      ,          p W ^,	          ,          p V #   \0         d6    \/        T P                  \2        4      P                  \4        4      Y!4      p  Li ; i)z
See hash_array.__doc__.
u8i8Fr@   u)rf   r   	factorize)sortrg   rk   l   e9z l   b&&&	 )r#   r&   
issubdtype
complex128r}   realimagr9   rW   
issubclassr\   
datetime64timedelta64viewnumberitemsizerS   rf   r   r   r   rr   rl   r   r[   r;   objectr(   )rd   r:   r<   r=   r#   	hash_real	hash_imagrf   r   r   rs   rh   tdtyperm   s   &&&&          r   r}   r}   +  s    JJE 
}}UBMM**!$))XL	!$))XL	2	>)) }{{4 	EJJ ?	@	@yy%%d%7	EJJ			*	*u~~/Byy1TZZ00123::4@
   !*$U ;E% %8%F ))%8C**! +  	$TX>D 	BJDBII())DBJDBII())DBJD K  	$C ''/D	s   <H1 1=I10I1)&__doc__
__future__r   r)   typingr   numpyr&   pandas._libs.hashingr   pandas.core.dtypes.commonr   pandas.core.dtypes.dtypesr   pandas.core.dtypes.genericr   r   r	   r
   r   collections.abcr   r   r   pandas._typingr   r   rS   r   r   r   r   rT   r4   rD   rV   rN   r}   r   r!   r   <module>r      s    #     2 2 6   
  ' !L ,k` %/h %	4?r %	> >r!   