a
    Oªf¢  ã                   @  sF   d dl mZ d dlmZ d dlZd dlmZ ddœdd„Zd	d
„ Z	dS )é    )Úannotations)ÚreduceN)Ú
get_optionÚstr)Úreturnc                 C  s"   t | tjtfƒr|  tdƒ¡} | S )z3
    If we have bytes, decode them to unicode.
    zdisplay.encoding)Ú
isinstanceÚnpÚbytes_ÚbytesÚdecoder   )Ús© r   úW/var/www/ai-form-bot/venv/lib/python3.9/site-packages/pandas/core/computation/common.pyÚensure_decoded
   s    r   c                  G  sÞ   zt j| Ž W S  ty*   tt j| ƒ Y S  tyØ   ddlm} ddlm} t	| ƒ}g g  }}|D ]"}||ƒr|| 
|¡ qd| 
|¡ qd|rÌzt j|Ž }W n ty¸   tt j| ƒ}Y n0 |||g ƒ Y S ||ƒ Y S 0 dS )zc
    Wrapper around numpy.result_type which overcomes the NPY_MAXARGS (32)
    argument limit.
    r   )Úfind_common_type)Úis_extension_array_dtypeN)r   Zresult_typeÚ
ValueErrorr   Ú	TypeErrorZpandas.core.dtypes.castr   Zpandas.core.dtypes.commonr   ÚlistÚappend)Zarrays_and_dtypesr   r   Zarr_and_dtypesZ	ea_dtypesZnon_ea_dtypesZarr_or_dtypeZnp_dtyper   r   r   Úresult_type_many   s(    
r   )
Ú
__future__r   Ú	functoolsr   Únumpyr   Zpandas._configr   r   r   r   r   r   r   Ú<module>   s
   	