o
    e                     @   sl   d dl mZ d dlmZ ddlmZmZ ddlmZmZ ddl	m
Z
mZmZmZ dd Zd	d
 Zdd ZdS )    )getfullargspec)assert_raises   )asarray_elementwise_functions)bitwise_left_shiftbitwise_right_shift)_dtype_categories_boolean_dtypes_floating_dtypes_integer_dtypesc                 C   s   t t| jS N)lenr   args)func r   c/var/www/html/venv/lib/python3.10/site-packages/numpy/array_api/tests/test_elementwise_functions.pynargs   s   r   c               
      s  i ddddddddddddd	dd
dddddddddddddddddddi ddddddddddddd dd!dd"dd#dd$dd%dd&dd'dd(dd)dd*di d+dd,dd-dd.dd/d0d1d0d2d0d3d0d4dd5dd6dd7dd8dd9dd:dd;dd<dddddddddd=} d>d? }| D ]E|   D ]>\}}t| }tt| t d@kr| D ]j|vsوj|vrtt fdAdB qqj|vrtt fdCdB qqd S )DNabsnumericacoszfloating-pointacoshaddasinasinhatanatan2zreal floating-pointatanhbitwise_andzinteger or booleanbitwise_invertr   integer
bitwise_orr   bitwise_xorceilzreal numericconjzcomplex floating-pointcoscoshdivideequalallexpexpm1floorfloor_dividegreatergreater_equalimagisfiniteisinfisnanless
less_equallog	logaddexplog10log1plog2logical_andbooleanlogical_not
logical_orlogical_xormultiplynegative	not_equalpositivepowreal	remainderroundsign)sinsinhsqrtsquaresubtracttantanhtruncc                  s   sN    t D ]	} td| dV  qtD ]	} td| dV  qtD ]	} td| dV  qd S )N   )dtypeFg      ?)r   r   r
   r   )dr   r   r   _array_valsV   s   z(test_function_types.<locals>._array_valsr   c                      s
    S r   r   r   r   xyr   r   <lambda>e   s   
 z%test_function_types.<locals>.<lambda>c                      s    S r   r   r   )r   rV   r   r   rX   h   s    )itemsr	   getattrr   r   rR   r   	TypeError) elementwise_function_input_typesrT   	func_nametypesdtypesr   rU   r   test_function_types   s   	
 !"#$%&'()*+,-./01234>



r`   c                   C   s    t tdd  t tdd  d S )Nc                   S      t tddgtddgS NrQ   )r   r   r   r   r   r   rX   n       z*test_bitwise_shift_error.<locals>.<lambda>c                   S   ra   rb   )r   r   r   r   r   r   rX   q   rd   )r   
ValueErrorr   r   r   r   test_bitwise_shift_errork   s   rf   N)inspectr   numpy.testingr    r   r   r   r   _dtypesr	   r
   r   r   r   r`   rf   r   r   r   r   <module>   s    X