+
    Ŝi                    n    R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RI	H
t
Ht ^ RIHt RR R lltR	 tR
 tR# )z/Common utility functions for rolling operations)annotations)defaultdict)castN)ABCDataFrame	ABCSeries)
MultiIndexc                   V ^8  d   QhRR/# )   pairwisebool )formats   "b/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/pandas/core/window/common.py__annotate__r      s     C1 C1 C1    c                  aaa \        V \        4      '       d-   \        S\        4      '       d   \        V S4      w  rEV! WE4      # \        V \        4      '       Ed   ^ RIHo R V3R llp/ p\        S\        4      '       EdO   VRJ Ed>   V SJ d_   \        \        V P                  4      4       F4  pV! V P                  RV3,          SP                  RV3,          4      Wx&   K6  	  V! Wp4      # V P                  P                  '       g   \        R4      hSP                  P                  '       g   \        R4      hV P                  SRR	7      w  rE\        WE4      w  rEV P                  P                  SP                  4      p	V	 F*  p
W9   g   K  W9   g   K  V! WJ,          WZ,          4      Wz&   K,  	  S! WtP                  V	R
7      # VRJ Ed   \        \         4      p\        \        V P                  4      4       F  p\        \        SP                  4      4       Fh  pW8  d!   SV J d   W{,          V,          Wx,          V&   K)  V! \        V P                  RV3,          SP                  RV3,          4      !  Wx,          V&   Kj  	  K  	  ^ RIHp V P                  P                  SP                  4      p\        V4      '       EdT   T! \        \        V P                  4      4       UUu. uFF  pT! \        \        SP                  4      4       Uu. uF  qV,          V,          NK  	  upRR7      NKH  	  uppR^R7      oV P                  Sn        SP                  P$                  ^8  Ed   \'        \(        SP                  4      Sn        \*        P,                  ! V\        S4      \        V4      ,          4      pVV3R l\        SP                  P$                  4       4       p. SP                  P.                  OVP0                  Np\(        P2                  ! . VOVNVR7      Sn        \        SP                  P4                  4      pV^,
          .\        V^,
          4      OpSP7                  V4      P9                  4       oM\(        P:                  ! \        \        SP                  4      4      \        \        V4      4      .4      Sn        SP=                  ^^ 4      P9                  4       o\(        P:                  ! VSP                  .4      Sn        M8S! \)        V P                  SP                  .. . .R7      SP                  RR7      oSP                  P?                  V P                  P.                  4      Sn        SP                  P?                  VP.                  SP                  P.                  ,           4      Sn        S# R# \        \        V P                  4      4       Uu/ uF&  pW! \        V P                  RV3,          S4      !  bK(  	  ppV! Wp4      # \A        SW4      # u upi u uppi u upi )    )	DataFramec                   V ^8  d   QhRR/# )r	   returnr   r   )r   s   "r   r   (flex_binary_moment.<locals>.__annotate__   s     	 	Y 	r   c                   < S! WP                   R 7      p\        VP                  4      ^ 8  d%   VP                  VP                  ,          Vn        V# VP                  P                  4       Vn        V# ))index)r   lencolumnscopy)dataframe_templateresultr   s   && r   dataframe_from_int_dict3flex_binary_moment.<locals>.dataframe_from_int_dict   s^    t+?+?@F6>>"Q&!/!7!7!G M "0!7!7!<!<!>Mr   F:NNNz'arg1' columns are not uniquez'arg2' columns are not uniqueouter)join)r   r   T)concat)ignore_index)r$   axisc              3     <"   T FX  p\         P                  ! SP                  P                  V4      \	        S4      \	        SP                  4      ,          4      x  KZ  	  R # 5i)N)nprepeatr   get_level_valuesr   ).0iarg2r   s   & r   	<genexpr>%flex_binary_moment.<locals>.<genexpr>a   sS      '
 &A	 II $ = =a @ #Fs4<</@ @  &As   A A#)names)levelscodesfloat64)r   r   dtypeN)!
isinstancer   prep_binaryr   pandasr   ranger   r   iloc	is_unique
ValueErroralignunionr   r   dictr#   nlevelsr   r   r'   tiler/   namefrom_arraysr0   reorder_levels
sort_indexfrom_product	swaplevel	set_namesflex_binary_moment)arg1r,   fr
   XYr   resultsr+   res_columnscoljr#   result_indexresult_levelarg2_levelsresult_names
num_levels	new_orderr   r   s   &f&&               @@r   rG   rG      s   $	""z$	'B'B4&w	D,	'	'$	 	 dL))5 4<"3t||#45%&tyyA		!Q$%H
 627AA<<111()HII<<111()HII::d:9DA&q,DA"&,,"4"4T\\"BK*8+,QVQV+<GL  + %WGG[QQT!%d+s4<<01A"3t||#455TT\,3JqMGJqM,-!,TYYq!t_dii1o!N-GJqM 6 2 *#zz//

;|$$# &+3t||+<%=
 &>	 #8=c$,,>O8P Q8P1A8P Q-1 &> &*
F &*\\FN ||++a/ (,J'E (*ww(#f+\9J*J('
 &+4<<+?+?%@' (P););'O\=N=N'O'1'='=8k8<8( &)"LL//&
 &0!^$LeJN6K$L	!'!6!6y!A!L!L!N'1'>'>"3t||#45uS=N7OP( "(!1!1!Q!7!B!B!D'1'>'>)4<<8(
 '($(JJ#=b"X !%'F "(!9!9$,,:L:L!M%||55 &&););;  m "t s4<<011A 1k$))AqD/48991   +799 "$00W !RLs   .'X:
X5-X:
3,Y 5X:
c                b   \         P                  ! R R7      ;_uu_ 4        \         P                  ! V 4      pV ^ 8  pRRR4       \        V \        4      '       d(   XP
                  P                  4       '       d   ^ XV&   X# XP                  4       '       d   ^ XV&   X#   + '       g   i     Lj; i)ignore)allN)r'   errstatesqrtr4   r   _valuesany)xr   masks   &  r   zsqrtr_      s    		"	"1u 
# !\""<<F4L M 
tM 
#	"s   BB.	c                H    V ^ V,          ,           pV^ V ,          ,           pW#3# )r   r   )rH   r,   rJ   rK   s   &&  r   r5   r5      s#    q4xAq4xA4Kr   )F)__doc__
__future__r   collectionsr   typingr   numpyr'   pandas.core.dtypes.genericr   r   pandas.core.indexes.apir   rG   r_   r5   r   r   r   <module>rh      s/    5 " #  
 /C1Lr   