?PNG  IHDR ? f ??C1 sRGB ?? gAMA ? a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/user1137782/www/china1.by/classwithtostring.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
]Kc@sdZddkZddkZddkZddkZddkZddkZddklZdddddd d d d d dddddddddddddgZ dZ ddZ dZ dZ d Zd!Zeid" d#jo3d$eigd%Zd$eid&Zngd'Zd(Zeid)jo<eid* d+jo(ddddd,Zd-dd.Znd/edPd2Zded3Zd4Zd5ded6Zd5ded7Zdedd8Zded9Zd:ded;Z ded<Z!d=Z"d>Z#ded?Z$d@Z%dAZ&ddBZ'dCddDZ(dEZ)dCdFZ*dCddGZ+ddHZ,dIZ-dJZ.dKe/fdLYZ0dMdQdNYZ1dOZ2dS(Rs) Utility function to facilitate testing. iN(t import_noset assert_equaltassert_almost_equaltassert_approx_equaltassert_array_equaltassert_array_lesstassert_string_equaltassert_array_almost_equalt assert_raisest build_err_msgtdecorate_methodstjiffiestmemusagetprint_assert_equaltraisestrandtrundocst runstringtverbosetmeasuretassert_tassert_array_almost_equal_nulptassert_array_max_ulpt assert_warnsitcCs|pt|ndS(s Assert that works in release mode. 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. N(tAssertionError(tvaltmsg((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs cCsCddkl}||}t|tiotdn|S(slike isnan, but always raise an error if type not supported instead of returning a TypeError object. Notes ----- isnan and other ufunc sometimes return a NotImplementedType object instead of raising any exception. This function is a wrapper to make sure an exception is always raised. This should be removed once this problem is solved at the Ufunc level.i(tisnans!isnan not supported for this type(t numpy.coreRt isinstancettypestNotImplementedTypet TypeError(txRtst((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytgisnan$s  cCsCddkl}||}t|tiotdn|S(slike isfinite, but always raise an error if type not supported instead of returning a TypeError object. Notes ----- isfinite and other ufunc sometimes return a NotImplementedType object instead of raising any exception. This function is a wrapper to make sure an exception is always raised. This should be removed once this problem is solved at the Ufunc level.i(tisfinites$isfinite not supported for this type(RR%RRR R!(R"R%R#((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyt gisfinite5s  cCsCddkl}||}t|tiotdn|S(slike isinf, but always raise an error if type not supported instead of returning a TypeError object. Notes ----- isinf and other ufunc sometimes return a NotImplementedType object instead of raising any exception. This function is a wrapper to make sure an exception is always raised. This should be removed once this problem is solved at the Ufunc level.i(tisinfs!isinf not supported for this type(RR'RRR R!(R"R'R#((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytgisinfFs  cGskddk}ddkl}l}|||}|i}x*tt|D]}|i||R6((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR s cCs tdS(s9 Return memory usage of running python. [Not implemented]N(tNotImplementedError(((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR stntis2.3c Csddk}|djo |i}n|i|||d||f}|i}zT|i||} z-|i||i| |\} } | SWd|i| XWd|i |XdS(Ni( twin32pdhtNonet PDH_FMT_LONGtMakeCounterPatht OpenQueryt AddCountertCollectQueryDatatGetFormattedCounterValuet RemoveCountert CloseQuery( tobjecttcountertinstancetinumtformattmachineRBtpaththqthcttypeR((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytGetPerformanceAttributess  !  tpythoncCs(ddk}tdd|||idS(NitProcesss Virtual Bytes(RBRVRDRC(t processNameRNRB((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR s  sItems are not equal:tACTUALtDESIREDc Csd|g}|o]|iddjo6t|dt|jo|dd|g}qq|i|n|oxt|D]\}}yt|}Wn d}nX|iddjo'di|id }|d7}n|id |||fqWndi|S( Ns iiOiR5s [repr failed]is...s %s: %s(tfindR.R7t enumeratetreprtcounttjoint splitlines( tarraysterr_msgtheaderRtnamesRR2taR4((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR s" 3  #cCs#t|tot|tpttt|ntt|t|||xb|iD]T\}}||jott|nt||||d||f|qhWdSt|tt fo|t|tt foftt|t|||x?t t|D]+}t||||d||f|q#WdSddk l }l }l}ddkl} l} l} t||pt||ot||||St||g|d|} y| |p | |} Wntj o t} nX| o| |o| |}| |}n |}d}| |o| |}| |}n |}d}yt||t||Wqtj o)td t|t|fqXny||||jot| nt|o t|pjt|}t|}|p|o"|o|pt| qn||jpt| ndS|djo:|djo-||||jpt| qnWn%tj ontj onX||jot| ndS( s[ Raise an assertion if two objects are not equal. Given two objects (lists, tuples, dictionaries or numpy arrays), check that all elements of these objects are equal. An exception is raised at the first conflicting values. Parameters ---------- actual : list, tuple, dict or ndarray The object to check. desired : list, tuple, dict or ndarray The expected object. err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal. Examples -------- >>> np.testing.assert_equal([4,5], [4,6]) ... : Items are not equal: item=1 ACTUAL: 5 DESIRED: 6 s key=%r %sNs item=%r %si(tndarraytisscalartsignbit(t iscomplexobjtrealtimagRis,Items are not equal: ACTUAL: %s DESIRED: %s (RtdictRR^RURR.titemstlistttupleR-RRgRhRit numpy.libRjRkRlRR t ValueErrortFalsetstrR&R$R!(tactualtdesiredRcRtkR2RgRhRiRjRkRlRt usecomplextactualrtactualitdesiredrtdesireditisdesnantisactnan((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs~#  ),)       %    cCsddk}yWntj oxddk}|i}|i||id|i|||id|i||t|inXdS(s Test if two objects are equal, and print an error message if test fails. The test is performed with ``actual == desired``. Parameters ---------- test_string : str The message supplied to AssertionError. actual : object The object to test for equality against `desired`. desired : object The expected result. Examples -------- >>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 1]) >>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 2]) Traceback (most recent call last): ... AssertionError: Test XYZ of func xyz failed ACTUAL: [0, 1] DESIRED: [0, 2] iNs failed ACTUAL: s DESIRED: (tpprintRt cStringIOtStringIOtwritetgetvalue(t test_stringRuRvRRR((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR 7s      icCsuddkl}ddkl}l}l}y||p ||} Wntj o t} nX| o||o||} ||} n |} d} ||o||} ||} n |} d} y*t| | d|t| | d|Wq<t j o)t dt |t |fq<Xnt ||t t fpt ||t t fot||||St||g|d|dd }yt|o t|pjt|p t|o.t|o t|pt |q%n||jpt |nd SWntj onXtt|||djot |nd S( sC Raise an assertion if two items are not equal up to desired precision. The test is equivalent to abs(desired-actual) < 0.5 * 10**(-decimal) Given two objects (numbers or ndarrays), check that all elements of these objects are almost equal. An exception is raised at conflicting values. For ndarrays this delegates to assert_array_almost_equal Parameters ---------- actual : number or ndarray The object to check. desired : number or ndarray The expected object. decimal : integer (decimal=7) desired precision err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_array_almost_equal: compares array_like objects assert_equal: tests objects for equality Examples -------- >>> npt.assert_almost_equal(2.3333333333333, 2.33333334) >>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10) ... : Items are not equal: ACTUAL: 2.3333333333333002 DESIRED: 2.3333333399999998 >>> npt.assert_almost_equal(np.array([1.0,2.3333333333333]), np.array([1.0,2.33333334]), decimal=9) ... : Arrays are not almost equal (mismatch 50.0%) x: array([ 1. , 2.33333333]) y: array([ 1. , 2.33333334]) i(Rg(RjRkRlitdecimals,Items are not equal: ACTUAL: %s DESIRED: %s RRdsArrays are not almost equalN(RRgRqRjRkRlRrRsRRRtRRpRoRR R&R$R!troundtabs(RuRvRRcRRgRjRkRlRxRyRzR{R|R((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR`sP7     %    c Csddk}tt||f\}}||jodSd|i||i|}|id|i|i|}y||}Wntj o d}nXy||}Wntj o d}nXt||g|dd|d|} yt |o t |pjt |p t |o.t |o t |pt | qxn||jpt | ndSWnt j onX|i|||id |d  jot | ndS( s Raise an assertion if two items are not equal up to significant digits. Given two numbers, check that they are approximately equal. Approximately equal is defined as the number of significant digits that agree. Parameters ---------- actual : number The object to check. desired : number The expected object. significant : integer (significant=7) desired precision err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_almost_equal: compares objects by decimals assert_array_almost_equal: compares array_like objects by decimals assert_equal: tests objects for equality Examples -------- >>> np.testing.assert_approx_equal(0.12345677777777e-20, 0.1234567e-20) >>> np.testing.assert_approx_equal(0.12345670e-20, 0.12345671e-20, significant=8) >>> np.testing.assert_approx_equal(0.12345670e-20, 0.12345672e-20, significant=8) ... : Items are not equal to 8 significant digits: ACTUAL: 1.234567e-021 DESIRED: 1.2345672000000001e-021 the evaluated condition that raises the exception is >>> abs(0.12345670e-20/1e-21 - 0.12345672e-20/1e-21) >= 10**-(8-1) True iNg?i gRds-Items are not equal to %d significant digits:Rg$@i( tnumpytmaptfloatRtpowertfloortlog10tZeroDivisionErrorR R&R$RR!( RuRvt significantRcRtnptscalet sc_desiredt sc_actualR((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs<4   $     +cCsddkl}l}l}||dtdt}||dtdt}d} yd|idjp |idjp|i|ij} | pVt||g|d|i|ifd|d|d d} | pt| qn| |o0| |o|||p|||o||} ||} yt | | WnTtj oHt||g|d | | fd|d|d d} t| nX|i |i jo d jnodS||| || }n|||}t |t o|} dg}n%|i }|i} |i}| pndd|id t|}t||g|d|fd|d|d d} | pt| qnWnFtj o:t||g|d|d|d d} t| nXdS(Ni(tarrayRtanytcopytsubokcSs|iidjS(Ns?bhilqpBHILQPfdgFDG(tdtypetchar(R"((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytisnumber-ss (shapes %s, %s mismatch)RRdReR"tys0 (x and y nan location mismatch %s, %s mismatch)iiidgY@s (mismatch %s%%)(((R"R(R"R(R"R(R"R(RRRRRstTruetshapeR RRtsizeRtbooltraveltallttolistR_R.Rr(t comparisonR"RRcRRdRRRRtcondRtxnanidtynanidRtreducedtmatch((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytassert_array_compare'sf 2    @     $    !    c Cs)tti||d|d|dddS(s Raise an assertion if two array_like objects are not equal. Given two array_like objects, check that the shape is equal and all elements of these objects are equal. An exception is raised at shape mismatch or conflicting values. In contrast to the standard usage in numpy, NaNs are compared like numbers, no assertion is raised if both objects have NaNs in the same positions. The usual caution for verifying equality with floating point numbers is advised. Parameters ---------- x : array_like The actual object to check. y : array_like The desired, expected object. err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired objects are not equal. See Also -------- assert_array_almost_equal: test objects for equality up to precision assert_equal: tests objects for equality Examples -------- the first assert does not raise an exception >>> np.testing.assert_array_equal([1.0,2.33333,np.nan], [np.exp(0),2.33333, np.nan]) assert fails with numerical inprecision with floats >>> np.testing.assert_array_equal([1.0,np.pi,np.nan], [1, np.sqrt(np.pi)**2, np.nan]) ... : AssertionError: Arrays are not equal (mismatch 50.0%) x: array([ 1. , 3.14159265, NaN]) y: array([ 1. , 3.14159265, NaN]) use assert_array_almost_equal for these cases instead >>> np.testing.assert_array_almost_equal([1.0,np.pi,np.nan], [1, np.sqrt(np.pi)**2, np.nan], decimal=15) RcRRdsArrays are not equalN(Rtoperatort__eq__(R"RRcR((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRgs=icsddklllddklddklfd}t|||d|d|dd d S( s Raise an assertion if two objects are not equal up to desired precision. The test verifies identical shapes and verifies values with abs(desired-actual) < 0.5 * 10**(-decimal) Given two array_like objects, check that the shape is equal and all elements of these objects are almost equal. An exception is raised at shape mismatch or conflicting values. In contrast to the standard usage in numpy, NaNs are compared like numbers, no assertion is raised if both objects have NaNs in the same positions. Parameters ---------- x : array_like The actual object to check. y : array_like The desired, expected object. decimal : integer (decimal=6) desired precision err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_almost_equal: simple version for comparing numbers assert_array_equal: tests objects for equality Examples -------- the first assert does not raise an exception >>> np.testing.assert_array_almost_equal([1.0,2.333,np.nan], [1.0,2.333,np.nan]) >>> np.testing.assert_array_almost_equal([1.0,2.33333,np.nan], [1.0,2.33339,np.nan], decimal=5) ... : AssertionError: Arrays are not almost equal (mismatch 50.0%) x: array([ 1. , 2.33333, NaN]) y: array([ 1. , 2.33339, NaN]) >>> np.testing.assert_array_almost_equal([1.0,2.33333,np.nan], [1.0,2.33333, 5], decimal=5) : ValueError: Arrays are not almost equal x: array([ 1. , 2.33333, NaN]) y: array([ 1. , 2.33333, 5. ]) i(taroundtnumbertfloat_(t issubdtype(Rcsyt|pt|ost|}t|}||jptS|i|ijo djno ||jS||}||}nWntj onXt||}|ip|i}n|d jS(Nig$@(R(RsRR!RRtastype(R"Rtxinfidtyinfidtz(RRRRRtnpany(s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytcompares &   $  RcRRdsArrays are not almost equalN( RRRRtnumpy.core.numerictypesRtnumpy.core.fromnumericRR(R"RRRcRR((RRRRRRs9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs @c Cs)tti||d|d|dddS(s< Raise an assertion if two array_like objects are not ordered by less than. Given two array_like objects, check that the shape is equal and all elements of the first object are strictly smaller than those of the second object. An exception is raised at shape mismatch or incorrectly ordered values. Shape mismatch does not raise if an object has zero dimension. In contrast to the standard usage in numpy, NaNs are compared, no assertion is raised if both objects have NaNs in the same positions. Parameters ---------- x : array_like The smaller object to check. y : array_like The larger object to compare. err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired objects are not equal. See Also -------- assert_array_equal: tests objects for equality assert_array_almost_equal: test objects for equality up to precision Examples -------- >>> np.testing.assert_array_less([1.0, 1.0, np.nan], [1.1, 2.0, np.nan]) >>> np.testing.assert_array_less([1.0, 1.0, np.nan], [1, 2.0, np.nan]) ... : Arrays are not less-ordered (mismatch 50.0%) x: array([ 1., 1., NaN]) y: array([ 1., 2., NaN]) >>> np.testing.assert_array_less([1.0, 4.0], 3) ... : Arrays are not less-ordered (mismatch 50.0%) x: array([ 1., 4.]) y: array(3) >>> np.testing.assert_array_less([1.0, 2.0, 3.0], [4]) ... : Arrays are not less-ordered (shapes (3,), (1,) mismatch) x: array([ 1., 2., 3.]) y: array([4]) RcRRdsArrays are not less-orderedN(RRt__lt__(R"RRcR((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRsAcBs ||UdS(N((tastrRm((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRDsc CsBddk}t|tptt| nt|tptt| ntid|d|tiodSt|i i |i d|i d}g}xC|o;|i d}|i doqn|i do|g}|i d}|i d o |i||i d}n|i d pt| n|i||i d}|i d o|i|n|id|tid|d d|d oqn|i|qnt| qW|pdSd d i|i} ||jot| ndS(s Test if two strings are equal. If the given strings are equal, `assert_string_equal` does nothing. If they are not equal, an AssertionError is raised, and the diff between the strings is shown. Parameters ---------- actual : str The string to test for equality against the expected string. desired : str The expected string. Examples -------- >>> np.testing.assert_string_equal('abc', 'abc') >>> np.testing.assert_string_equal('abc', 'abcd') Traceback (most recent call last): File "", line 1, in ... AssertionError: Differences in strings: - abc+ abcd? + iNs\As\Ziis s- s? s+ isDifferences in strings: %sR(tdifflibRRtRRUtreRtMRotDifferRRatpopt startswithR7tinserttextendR`trstrip( RuRvRtdifft diff_listtd1R?td2td3R((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRGsJ !0   #  c sjddk}ddk}|djo tid}|id}ntiitii |d}tii |g}|i ||\}}} z|i |||| } Wd|i X|ii| } |idt} g|ofd} nd} x!| D]}| i|d| qW| idjo$|otd d indS( sH Run doctests found in the given file. By default `rundocs` raises an AssertionError on failure. Parameters ---------- filename : str The path to the file for which the doctests are run. raise_on_error : bool Whether to raise an AssertionError when a doctest fails. Default is True. Notes ----- The doctests can be run by the user/developer by adding the ``doctests`` argument to the ``test()`` call. For example, to run all tests (including doctests) for `numpy.lib`:: >>> np.lib.test(doctests=True) iNit__file__iRcs i|S((R7(ts(R(s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytstoutsSome doctests failed: %ss (tdoctesttimpRCtsyst _getframet f_globalstosRRtsplitexttbasenametdirnamet find_modulet load_moduleR;t DocTestFinderR\t DocTestRunnerRstruntfailuresRR`(tfilenametraise_on_errorRRR1tnameRRtfiletpathnamet descriptiontmtteststrunnerRttest((Rs9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs* " cOst}|ii||S(N(RttoolsR(R/tkwargstnose((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs cOst}|ii||S(s assert_raises(exception_class, callable, *args, **kwargs) Fail unless an exception of class exception_class is thrown by callable when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception. (RRR(R/RR((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs c Cs|djotidti}nti|}|i}ddkl}t||i }x|D]}y*t |do |i }n |i }Wnt j o qknX|i|o+|id ot||||qkqkWdS(s  Apply a decorator to all methods in a class matching a regular expression. The given decorator is applied to all public methods of `cls` that are matched by the regular expression `testmatch` (``testmatch.search(methodname)``). Methods that are private, i.e. start with an underscore, are ignored. Parameters ---------- cls : class Class whose methods to decorate. decorator : function Decorator to apply to methods testmatch : compiled regexp or str, optional The regular expression. Default value is None, in which case the nose default (``re.compile(r'(?:^|[\b_\.%s-])[Tt]est' % os.sep)``) is used. If `testmatch` is a string, it is compiled to a regular expression first. s(?:^|[\\b_\\.%s-])[Tt]esti(t isfunctiontcompat_func_namet_N(RCRtcompileRtsept__dict__tinspectRtfiltertvaluesthasattrRt__name__tAttributeErrortsearchRtsetattr(tclst decoratort testmatchtcls_attrRtmethodstfunctiontfuncname((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR s"    !ic Bseid}|i|i}}e|d|d}d}e}x&||jo|d7}|||UqJWe|}d|S(sD Return elapsed time for executing code in the namespace of the caller. The supplied code string is compiled with the Python builtin ``compile``. The precision of the timing is 10 milli-seconds. If the code will execute fast on this timescale, it can be executed many times to get reasonable timing accuracy. Parameters ---------- code_str : str The code to be timed. times : int, optional The number of times the code is executed. Default is 1. The code is only compiled once. label : str, optional A label to identify `code_str` with. This is passed into ``compile`` as the second argument (for run-time error messages). Returns ------- elapsed : float Total elapsed time in seconds for executing `code_str` `times` times. Examples -------- >>> etime = np.testing.measure('for i in range(1000): np.sqrt(i**2)', ... times=times) >>> print "Time for a single execution : ", etime / times, "s" Time for a single execution : 0.005 s isTest name: %s texecig{Gz?(RRtf_localsRRR ( tcode_strttimestlabeltframetlocstglobstcodeR2telapsed((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs!     c Cs{ddk}|id}|ididd}|}d}ti|}x#tdD]}|||}q^WdS(sg Check that ufuncs don't mishandle refcount of object `1`. Used in a few regression tests. iNidiii'i'(RtarangetreshapeRt getrefcountR-( topRRftbtcR2trctjtd((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyt_assert_valid_refcount-s  c Csddk}|i|}|i|}||i|i||j||}|i|i|||jpf|i|p|i|od|}n)|it||}d||f}t|ndS(sCompare two arrays relatively to their spacing. It is a relatively robust method to compare two arrays whose amplitude is variable. Note ---- An assertion is raised if the following condition is not met: abs(x - y) <= nulps * spacing(max(abs(x), abs(y))) Parameters ---------- x: array_like first input array y: array_like second input array nulp: int max number of unit in the last place for tolerance (see Note) iNsX and Y are not equal to %d ULPs+X and Y are not equal to %d ULP (max is %g)( RRtspacingtwhereRRjtmaxt nulp_diffR( R"RtnulpRtaxtaytrefRtmax_nulp((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR?s (# cCsLddk}t|||}|i||jptd|n|S(s`Given two arrays a and b, check that every item differs in at most N Unit in the Last Place.iNs(Arrays are not almost equal up to %g ULP(RRRR(RfR tmaxulpRRtret((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyR^s  cs5ddk|o.i|d|}i|d|}ni|}i|}i||}i|pi|otdni|d|}i|d|}|i|ijp td|i|ifnfd}t|}t|}||||S(sDFor each item in x and y, eeturn the number of representable floating points between them. Parameters ---------- x : array_like first input array y : array_like second input array Returns ------- nulp: array_like number of representable floating point numbers between each item in x and y. Examples -------- # By definition, epsilon is the smallest number such as 1 + eps != 1, so # there should be exactly one ULP between 1 and 1 + eps >>> nulp_diff(1, 1 + np.finfo(x.dtype).eps) 1.0 iNRs'_nulp not implemented for complex arrays+x and y do not have the same shape: %s - %scs&i||d|}i|S(NR(RR(trxtrytvdtR(R(s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyt_diffs(RRt common_typeRjR@RRrt integer_repr(R"RRttRRR((Rs9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRhs$    cCs`|i|}|idjp"|||dj||djtalwaysis!No warning raised when calling %ss(First warning for %s is not a %s( is %s)N( R8RRFR9t simplefilterR.RRR+RG(t warning_classtfuncR/tkwtctxR?((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pyRs    "(RZR[((3R7RRRRRR9t nosetesterRt__all__RRR$R&R(RtplatformtgetpidR R RtversionRCRVRR RR RRRRRRRRRRRR RRRRRR%R!RLR)R8R(((s9/usr/lib64/python2.6/site-packages/numpy/testing/utils.pytst                   $ s )nY ?@XE  B3   //   3  4