a
    yn„f.
  ã                   @  sŠ   d dl mZ d dlZd dlmZ d dlmZmZ d dl	m
Z
 d dlmZmZ d dlmZ dZe
 ¡ Zeƒ dd	ddd
œdd„ƒZdd„ ZdS )é    )ÚannotationsN)Úhigh_level_function)ÚHighLevelContextÚmaybe_posaxis)ÚNumpyMetadata)Ú
is_integerÚregularize_axis)Ú	AxisError)Úis_noneT)Ú	highlevelÚbehaviorÚattrsc                c  s   | fV  t | ||||ƒS )a2  
    Args:
        array: Array-like data (anything #ak.to_layout recognizes).
        axis (int): The dimension at which this operation is applied. The
            outermost dimension is `0`, followed by `1`, etc., and negative
            values count backward from the innermost: `-1` is the innermost
            dimension, `-2` is the next level up, etc.
        highlevel (bool): 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 an array whose value is True where an element of `array` is None;
    False otherwise (at a given `axis` depth).
    )Ú_impl)ÚarrayÚaxisr   r   r   © r   ú`/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/awkward/operations/ak_is_none.pyr
      s    r
   c           	        s†   t ˆ ƒ‰ t||d�� }|j| ddd�}W d   ƒ n1 s:0    Y  tˆ ƒsZtdˆ ›�ƒ‚‡ fdd„}tjj||dd	�}|j||d
�S )N)r   r   FÚerror)Zallow_recordZprimitive_policyz'axis' must be an integer, not c                   sˆ   t | ˆ |ƒ}|d urh|d |krh| js,| jr0d S | jrJtj | jdd�¡S tj |jj	| j
tjd�¡S n| jr„tdˆ › d|› d�ƒ‚d S )Né   F)Z
valid_when)Zdtypezaxis=z" exceeds the depth of this array (ú))r   Zis_unionZ	is_recordZ	is_optionÚakÚcontentsZ
NumpyArrayZmask_as_boolZnplikeZzerosÚlengthÚnpZbool_Zis_leafr	   )ÚlayoutÚdepthÚbackendZlateral_contextÚkwargsZposaxis©r   r   r   Úaction3   s    ÿz_impl.<locals>.actionT)Znumpy_to_regular)r   )	r   r   Úunwrapr   Ú	TypeErrorr   Z_doZrecursively_applyÚwrap)	r   r   r   r   r   Úctxr   r   Úoutr   r   r   r   +   s    .r   )r   )Ú
__future__r   Zawkwardr   Zawkward._dispatchr   Zawkward._layoutr   r   Zawkward._nplikes.numpy_liker   Zawkward._regularizer   r   Zawkward.errorsr	   Ú__all__Úinstancer   r
   r   r   r   r   r   Ú<module>   s   