a
    yn„f]  ã                   @  sv   d dl mZ d dlZd dlmZ d dlmZ d dlm	Z	 dZ
e	 ¡ Zejj d¡eƒ dd	d„ƒƒZd
d„ Zdd„ ZdS )é    )ÚannotationsN)Úhigh_level_function)ÚHighLevelContext)ÚNumpyMetadata)Úrealr   Tc                 c  s   | fV  t | |||ƒS )a!  
    Args:
        val : array_like
            Input array.
        highlevel (bool, default is True): If True, return an #ak.Array;
            otherwise, return a low-level #ak.contents.Content subclass.
        behavior (None or dict): Custom #ak.behavior for the output array, if
            high-level.
        attrs (None or dict): Custom attributes for the output array, if
            high-level.

    Returns the real components of the given array elements.
    If the arrays have complex elements, the returned arrays are floats.
    )Ú
_impl_real)ÚvalÚ	highlevelÚbehaviorÚattrs© r   ú]/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/awkward/operations/ak_real.pyr      s    c                 C  sX   t ||d�� }|j| ddd�}W d   ƒ n1 s20    Y  tj |t¡}|j||d�S )N)r
   r   FÚerror)Zallow_recordZprimitive_policy)r	   )r   ÚunwrapÚakZ_doZrecursively_applyÚ_action_realÚwrap)r   r	   r
   r   ÚctxÚlayoutÚoutr   r   r   r   '   s    .r   c                 K  s,   t | tjjƒr$tj |j | j¡¡S d S d S )N)Ú
isinstancer   ÚcontentsZ
NumpyArrayZnpliker   Údata)r   ÚbackendÚkwargsr   r   r   r   /   s    r   )TNN)Ú
__future__r   Zawkwardr   Zawkward._dispatchr   Zawkward._layoutr   Zawkward._nplikes.numpy_liker   Ú__all__ÚinstanceÚnpÚ_connectÚnumpyZ
implementsr   r   r   r   r   r   r   Ú<module>   s   