o
    Je                     @   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   ~/home/seandotau/au.memorygallery.club/gallery/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atanhZbitwise_andzinteger or booleanZbitwise_invertr   integerZ
bitwise_orr   Zbitwise_xorceilzreal numericZconjzcomplex floating-pointcoscoshdivideequalallexpexpm1floorZfloor_divideZgreaterZgreater_equalimagisfiniteisinfisnanlessZ
less_equallogZ	logaddexplog10log1plog2logical_andbooleanZlogical_not
logical_orlogical_xormultiplynegative	not_equalZpositivepowreal	remainderroundsign)sinsinhsqrtZ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   rI   r   r   rK   h   s    )itemsr	   getattrr   r   rE   r   	TypeError)Z elementwise_function_input_typesrG   	func_nametypesZdtypesr   rH   r   test_function_types   s   	
 !"#$%&'()*+,-./01234>



rQ   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 NrD   )r   r   r   r   r   r   rK   n       z*test_bitwise_shift_error.<locals>.<lambda>c                   S   rR   rS   )r   r   r   r   r   r   rK   q   rU   )r   
ValueErrorr   r   r   r   test_bitwise_shift_errork   s   rW   N)inspectr   Znumpy.testingr    r   r   r   r   Z_dtypesr	   r
   r   r   r   rQ   rW   r   r   r   r   <module>   s    X