U
    ?h#                     @   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   b/var/www/html/venv/lib/python3.8/site-packages/numpy/array_api/tests/test_elementwise_functions.pynargs   s    r   c               9      s  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ddddddddddddddddddddddd8} dd	 }| D ]|   D ]|\}}t| }tt| t d
kr| D ].j|ksԈj|krtt fdd qqj|krtt fdd qqd S )Nnumericzfloating-pointzinteger or booleanintegerallboolean)8absacosacoshaddasinasinhatanatan2atanhZbitwise_andZbitwise_invertr   Z
bitwise_orr   Zbitwise_xorceilcoscoshdivideequalexpexpm1floorZfloor_divideZgreaterZgreater_equalisfiniteisinfisnanlessZ
less_equallogZ	logaddexplog10log1plog2logical_andZlogical_not
logical_orlogical_xormultiplynegative	not_equalZpositivepow	remainderroundsignsinsinhsqrtZsquaresubtracttantanhtruncc                  s   sL   t D ]} td| dV  qtD ]} td| dV  qtD ]} td| dV  q4d S )N   )dtypeFg      ?)r   r   r
   r   )dr   r   r   _array_valsS   s    z(test_function_types.<locals>._array_valsr   c                      s
    S r   r   r   r   xyr   r   <lambda>b       z%test_function_types.<locals>.<lambda>c                      s    S r   r   r   )r   rG   r   r   rI   e   rJ   )itemsr	   getattrr   r   rC   r   	TypeError)Z elementwise_function_input_typesrE   	func_nametypesZdtypesr   rF   r   test_function_types   s    ;



rP   c                   C   s    t tdd  t tdd  d S )Nc                   S   s   t tddgtddgS NrB   )r   r   r   r   r   r   rI   k   rJ   z*test_bitwise_shift_error.<locals>.<lambda>c                   S   s   t tddgtddgS rQ   )r   r   r   r   r   r   rI   n   rJ   )r   
ValueErrorr   r   r   r   test_bitwise_shift_errorh   s      rT   N)inspectr   Znumpy.testingr    r   r   r   r   Z_dtypesr	   r
   r   r   r   rP   rT   r   r   r   r   <module>   s   U