관리-도구
편집 파일: utils.cpython-37.pyc
B ��Fd' � # @ s� d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddl mZmZ ddl Z ddlZddlmZmZ ddlmZ ddlmZmZmZmZmZmZmZ ddlmZ ejd d kr�dd lm Z ndd l m Z ddd ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-g#Z!G d.d(� d(e"�Z#e#Z$dZ%d/ej&kZ'e(ed0d�dk Z)d1d2� Z*d�d4d�Z+d5d6� Z,d7d8� Z-d9d:� Z.ed;d<�d=d� �Z/ej0d>k�r�d�d@dA�Z1d�dCd�Z2n2ej3ddD� dEk�r�dFe�4� fdGd�Z2ndHd� Z2ej3ddD� dEk�rdFe�4� g fdId�Z5ng fdJd�Z5d�dOd�Z6d�dPd�Z7dQd� Z8d�dSd�Z9d�dTd �Z:d�dVdW�Z;d�dXd�Z<d�dYd�Z=d�dZd�Z>d[d� Z?d\d� Z@d�d]d�ZAd^d� ZBd_d� ZCd`d � ZDd�dad�ZEd�dcd�ZFddde� ZGd�dgd$�ZHd�dhd�ZId�did!�ZJd�djdk�ZKdldm� ZLdndo� ZMG dpdq� dqeN�ZOG drds� dseN�ZPejQd�dtdu��ZRdvd"� ZSejQd�dwdx��ZTdyd#� ZUedzd{fd|d}�ZVG d~d%� d%e"�ZWejQdd*� �ZXejQd�d)� �ZYG d�d&� d&e jZ�Z[G d�d-� d-eN�Z\dS )�z* Utility function to facilitate testing. � )�division�absolute_import�print_functionN)�partial�wraps)�mkdtemp�mkstemp)�SkipTest)�float32�empty�arange� array_repr�ndarray�isnat�array)� deprecate� )�StringIO�assert_equal�assert_almost_equal�assert_approx_equal�assert_array_equal�assert_array_less�assert_string_equal�assert_array_almost_equal� assert_raises� build_err_msg�decorate_methods�jiffies�memusage�print_assert_equal�raises�rand�rundocs� runstring�verbose�measure�assert_�assert_array_almost_equal_nulp�assert_raises_regex�assert_array_max_ulp�assert_warns�assert_no_warnings�assert_allclose�IgnoreException�clear_and_catch_warningsr �KnownFailureException�temppath�tempdir�IS_PYPY�HAS_REFCOUNT�suppress_warningsc @ s e Zd ZdZdS )r0 z<Raise this exception to mark a test as a known failing test.N)�__name__� __module__�__qualname__�__doc__� r: r: �F/opt/alt/python37/lib64/python3.7/site-packages/numpy/testing/utils.pyr0 ) s �__pypy__�getrefcountc C sT d} d}yddl }W n tk r, d} Y nX |j|k r<d} | sPd| }t|��|S )z# Import nose only when needed. T)� r r r NFz@Need nose >= %d.%d.%d for tests - see http://nose.readthedocs.io)�nose�ImportErrorZ__versioninfo__)Znose_is_goodZminimum_nose_versionr? �msgr: r: r; �import_nose5 s rB � c C s8 d}| s4y |� }W n t k r* |}Y nX t|��dS )aI Assert that works in release mode. Accepts callable msg to allow deferring evaluation until failure. The Python built-in ``assert`` does not work when executing code in optimized mode (the ``-O`` flag) - no byte-code is generated for it. For documentation on usage, refer to the Python documentation. TN)� TypeError�AssertionError)�valrA �__tracebackhide__Zsmsgr: r: r; r'