Ë
    *�£j\  ã                  óÚ  — U d dl mZ d dlZd dlmZmZ erd dlmZ d dlm	Z	 d dl
Zd dlmZ d dlmZ ej                   dd„«       Zej                   d	„ «       Z ej&                  d
«      ej(                   ej&                  d«      ej(                   ej&                  d«      ej(                   ej&                  d«      ej(                   ej&                  d«      ej*                   ej&                  d«      ej*                   ej&                  d«      ej*                   ej&                  d«      ej*                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej.                   ej&                  d«      ej.                  iZded<    ej&                  d
«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                   ej&                  d«      ej,                  iZded<    ej&                  d
«      ej6                   ej&                  d«      ej8                   ej&                  d«      ej:                   ej&                  d«      ej(                   ej&                  d«      ej<                   ej&                  d«      ej>                   ej&                  d«      ej@                   ej&                  d«      ej*                   ej&                  d«      ejB                   ej&                  d«      ej,                   ej&                  d«      ejD                   ej&                  d«      ej.                  iZ#ded<   	 	 	 	 	 	 	 	 	 	 	 	 dd„Z$y)é    )ÚannotationsN)ÚTYPE_CHECKINGÚAny)ÚCallable)ÚScalar)Úimport_optional_dependency)Újit_user_functionc                ó†   ‡‡— t         rdd lŠnt        d«      Št        | «      Š‰j	                  |||¬«      ˆˆfd„«       }|S )Nr   Únumba©ÚnopythonÚnogilÚparallelc                ó4  •— |dk(  r| d d …df   }| j                   d   }n| d   }| j                   d   } ‰
|g|¢­Ž }|ft        j                  t        j                  |«      «      j                   z   }|dk(  r|d d d…   }t        j                  |«      }|dk(  r:||d<   ‰j                  d| j                   d   «      D ]  } ‰
| |   g|¢­Ž ||<   Œ |S ||d d …df<   ‰j                  d| j                   d   «      D ]  }	 ‰
| d d …|	f   g|¢­Ž |d d …|	f<   Œ |S )Nr   é   éÿÿÿÿ)ÚshapeÚnpÚ
atleast_1dÚasarrayÚemptyÚprange)ÚvaluesÚaxisÚargsÚ
first_elemÚdim0Úres0Ú	buf_shapeÚbuffÚiÚjÚnb_compat_funcr   s             €€ú=C:\FundamentalWorkbench\vendor\pandas\core\_numba\executor.pyÚ	nb_looperz(generate_apply_looper.<locals>.nb_looper   s.  ø€ ð �1Š9Ø¢ 1 ™ˆJØ—<‘< ‘?‰Dà ™ˆJØ—<‘< ‘?ˆDÙ˜jÐ0¨4Ò0ˆð �GœbŸm™m¬B¯J©J°tÓ,<Ó=×CÑCÑCˆ	Ø�1Š9Ø!¡$ B $™ˆIÜ�x‰x˜	Ó"ˆà�1Š9ØˆD�‰GØ—\‘\ ! V§\¡\°!¡_Ö5�Ù(¨°©Ð:°TÒ:��Q’ð 6ð ˆð ˆD’�A�‰JØ—\‘\ ! V§\¡\°!¡_Ö5�Ù+¨F²1°a°4©LÐ@¸4Ò@�’Q˜�T’
ð 6àˆó    )r   r   r   r	   Újit)Úfuncr   r   r   r%   r#   r   s        @@r$   Úgenerate_apply_looperr)      sG   ù€ åÜä*¨7Ó3ˆÜ& tÓ,€Nà
‡Y�Y˜¨¸€YÓAôó Bðð8 Ðr&   c                óÜ   ‡ ‡‡— t         rdd lŠnt        d«      Š|r)‰j                  |||¬«      	 	 	 	 	 	 	 	 dˆ ˆˆfd„«       }|S ‰j                  |||¬«      	 	 	 	 	 	 	 	 dˆ ˆˆfd„«       }|S )Nr   r   r   c                ó   •— t        j                  | j                  d   |f‰¬«      }i }‰j                  | j                  d   «      D ]A  } ‰
| |   ‰|||g|¢­Ž \  }}	|||<   t	        |	«      dkD  sŒ*t        j
                  |	«      ||<   ŒC ||fS ©Nr   )Údtype)r   r   r   r   ÚlenÚarray)r   ÚlabelsÚngroupsÚmin_periodsr   ÚresultÚna_positionsr!   ÚoutputÚna_posr(   r   Úresult_dtypes             €€€r$   Úcolumn_looperz"make_looper.<locals>.column_looperE   sœ   ø€ ô —X‘X˜vŸ|™|¨A™°Ð8ÀÔMˆFØˆLØ—\‘\ &§,¡,¨q¡/Ö2�Ù!%Ø˜1‘I˜|¨V°W¸kð"ØLPò"‘�˜ð #��q‘	Ü�v“; “?Ü&(§h¡h¨vÓ&6�L ’Oð 3ð ˜<Ð'Ð'r&   c                ó2  •— t        j                  | j                  d   t        |«      f‰¬«      }i }‰j	                  | j                  d   «      D ]A  } ‰
| |   ‰|||g|¢­Ž \  }}	|||<   t        |	«      dkD  sŒ*t        j
                  |	«      ||<   ŒC ||fS r,   )r   r   r   r.   r   r/   )r   ÚstartÚendr2   r   r3   r4   r!   r5   r6   r(   r   r7   s             €€€r$   r8   z"make_looper.<locals>.column_looperZ   s    ø€ ô —X‘X˜vŸ|™|¨A™´°E³
Ð;À<ÔPˆFØˆLØ—\‘\ &§,¡,¨q¡/Ö2�Ù!%Ø˜1‘I˜|¨U°C¸ð"ØGKò"‘�˜ð #��q‘	Ü�v“; “?Ü&(§h¡h¨vÓ&6�L ’Oð 3ð ˜<Ð'Ð'r&   )r   ú
np.ndarrayr0   r<   r1   Úintr2   r=   )r   r<   r:   r<   r;   r<   r2   r=   )r   r   r   r'   )r(   r7   Úis_grouped_kernelr   r   r   r8   r   s   ``     @r$   Úmake_looperr?   <   sµ   ú€ åÜä*¨7Ó3ˆáà	�‰˜H¨E¸HˆÓ	Eð	(Øð	(àð	(ð ð	(ð ö		(ó 
Fð	(ðV Ðð/ 
�‰˜H¨E¸HˆÓ	Eð
	(Øð	(àð	(ð ð	(ð ö		(ó 
Fð
	(ð$ Ðr&   Úint8Úint16Úint32Úint64Úuint8Úuint16Úuint32Úuint64Úfloat32Úfloat64Ú	complex64Ú
complex128zdict[np.dtype, Any]Údefault_dtype_mappingÚfloat_dtype_mappingÚidentity_dtype_mappingc                ó6   ‡ ‡‡‡‡‡— 	 	 	 	 	 d	 dˆˆ ˆˆˆˆfd„}|S )a7  
    Generate a Numba function that loops over the columns 2D object and applies
    a 1D numba kernel over each column.

    Parameters
    ----------
    func : function
        aggregation function to be applied to each column
    dtype_mapping: dict or None
        If not None, maps a dtype to a result dtype.
        Otherwise, will fall back to default mapping.
    is_grouped_kernel: bool, default False
        Whether func operates using the group labels (True)
        or using starts/ends arrays

        If true, you also need to pass the number of groups to this function
    nopython : bool
        nopython to be passed into numba.jit
    nogil : bool
        nogil to be passed into numba.jit
    parallel : bool
        parallel to be passed into numba.jit

    Returns
    -------
    Numba function
    c                óÖ  •— ‰| j                      }t        ‰|‰‰‰‰«      }‰r || |||g|j                  «       ¢­Ž \  }	}
n || |||g|j                  «       ¢­Ž \  }	}
|	j                   j                  dk(  r6|
j                  «       D ]#  }t	        |«      dkD  sŒ|	j                  d«      }	 n |
j                  «       D ])  \  }}t	        |«      dkD  sŒt        j                  |	||f<   Œ+ |	S )Nr!   r   rI   )	r-   r?   r   Úkindr.   ÚastypeÚitemsr   Únan)r   r:   r;   r0   r1   r2   Úkwargsr7   r8   r3   r4   r6   r!   Údtype_mappingr(   r>   r   r   r   s                €€€€€€r$   Úlooper_wrapperz2generate_shared_aggregator.<locals>.looper_wrapperÐ   s   ø€ ð % V§\¡\Ñ2ˆÜ#Ø�,Ð 1°8¸UÀHó
ˆñ Ù#0Ø˜ ¨ð$Ø7=·}±}³ò$Ñ ˆF‘Lñ $1Ø˜˜s Kð$Ø28·-±-³/ò$Ñ ˆF�Lð �<‰<×Ñ Ò#ð '×-Ñ-Ö/�Ü�v“; “?Ø#Ÿ]™]¨9Ó5�FÙð 0ð
 &×+Ñ+Ö-‰IˆAˆvÜ�6‹{˜Q‹Ü$&§F¡F��q˜&�yÒ!ð .ð ˆr&   )NNNNr   )r2   r=   © )r(   rV   r>   r   r   r   rW   s   `````` r$   Úgenerate_shared_aggregatorrY   ¥   s2   ý€ ðZ ØØØØð$ð ÷$ò $ðL Ðr&   )TTF)r(   zCallable[..., Scalar]rV   zdict[np.dtype, np.dtype]r>   Úboolr   rZ   r   rZ   r   rZ   )%Ú
__future__r   Ú	functoolsÚtypingr   r   Úcollections.abcr   Úpandas._typingr   Únumpyr   Úpandas.compat._optionalr   Úpandas.core.util.numba_r	   Úcacher)   r?   r-   rC   rG   rI   rK   rL   Ú__annotations__rM   r@   rA   rB   rD   rE   rF   rH   rJ   rN   rY   rX   r&   r$   Ú<module>re      s   ðÞ "ã ÷ñ
 Ý(Ý%ã å >å 5ð ‡�ò$ó ð$ðN ‡�ñ4ó ð4ðp €B‡H�HˆVÓ�b—h‘hØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆWÓ�r—y‘yØ€B‡H�HˆXÓ˜Ÿ	™	Ø€B‡H�HˆXÓ˜Ÿ	™	Ø€B‡H�HˆXÓ˜Ÿ	™	Ø€B‡H�HˆYÓ˜Ÿ™Ø€B‡H�HˆYÓ˜Ÿ™Ø€B‡H�Hˆ[Ó˜2Ÿ=™=Ø€B‡H�Hˆ\Ó˜BŸM™Mð.Ð Ð*ó ð& €B‡H�HˆVÓ�b—j‘jØ€B‡H�HˆWÓ�r—z‘zØ€B‡H�HˆWÓ�r—z‘zØ€B‡H�HˆWÓ�r—z‘zØ€B‡H�HˆWÓ�r—z‘zØ€B‡H�HˆXÓ˜Ÿ
™
Ø€B‡H�HˆXÓ˜Ÿ
™
Ø€B‡H�HˆXÓ˜Ÿ
™
Ø€B‡H�HˆYÓ˜Ÿ™Ø€B‡H�HˆYÓ˜Ÿ™Ø€B‡H�Hˆ[Ó˜2Ÿ:™:Ø€B‡H�Hˆ\Ó˜BŸJ™Jð,Ð Ð(ó ð  €B‡H�HˆVÓ�b—g‘gØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆWÓ�r—x‘xØ€B‡H�HˆXÓ˜Ÿ	™	Ø€B‡H�HˆXÓ˜Ÿ	™	Ø€B‡H�HˆXÓ˜Ÿ	™	Ø€B‡H�HˆYÓ˜Ÿ™Ø€B‡H�HˆYÓ˜Ÿ™Ø€B‡H�Hˆ[Ó˜2Ÿ<™<Ø€B‡H�Hˆ\Ó˜BŸM™Mð/Ð Ð+ó ð QØ
ðQà+ðQð ðQð ð	Qð
 ðQð ôQr&   