SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > > site-packages > numpy > lib > tests > >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib64/python3.11//site-packages/numpy/lib/tests//

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
data Directory - -
__init__.py File 0 bytes April 17 2025 13:10:58.
test__datasource.py File 10571 bytes April 17 2025 13:10:58.
test__iotools.py File 13743 bytes April 17 2025 13:10:58.
test__version.py File 1999 bytes April 17 2025 13:10:58.
test_arraypad.py File 54830 bytes April 17 2025 13:10:58.
test_arraysetops.py File 35912 bytes April 17 2025 13:10:58.
test_arrayterator.py File 1291 bytes April 17 2025 13:10:58.
test_financial_expired.py File 247 bytes April 17 2025 13:10:58.
test_format.py File 40956 bytes April 17 2025 13:10:58.
test_function_base.py File 157726 bytes April 17 2025 13:10:58.
test_histograms.py File 32452 bytes April 17 2025 13:10:58.
test_index_tricks.py File 20256 bytes April 17 2025 13:10:58.
test_io.py File 107891 bytes April 17 2025 13:10:58.
test_loadtxt.py File 38560 bytes April 17 2025 13:10:58.
test_mixins.py File 7030 bytes April 17 2025 13:10:58.
test_nanfunctions.py File 47609 bytes April 17 2025 13:10:58.
test_packbits.py File 17546 bytes April 17 2025 13:10:58.
test_polynomial.py File 11395 bytes April 17 2025 13:10:58.
test_recfunctions.py File 44001 bytes April 17 2025 13:10:58.
test_regression.py File 8257 bytes April 17 2025 13:10:58.
test_shape_base.py File 26817 bytes April 17 2025 13:10:58.
test_stride_tricks.py File 22849 bytes April 17 2025 13:10:58.
test_twodim_base.py File 18841 bytes April 17 2025 13:10:58.
test_type_check.py File 15114 bytes April 17 2025 13:10:58.
test_ufunclike.py File 2982 bytes April 17 2025 13:10:58.
test_utils.py File 6218 bytes April 17 2025 13:10:58.

Reading File: //opt/cloudlinux/venv/lib64/python3.11//site-packages/numpy/lib/tests///test_arrayterator.py

from operator import mul
from functools import reduce

import numpy as np
from numpy.random import randint
from numpy.lib import Arrayterator
from numpy.testing import assert_


def test():
    np.random.seed(np.arange(10))

    # Create a random array
    ndims = randint(5)+1
    shape = tuple(randint(10)+1 for dim in range(ndims))
    els = reduce(mul, shape)
    a = np.arange(els)
    a.shape = shape

    buf_size = randint(2*els)
    b = Arrayterator(a, buf_size)

    # Check that each block has at most ``buf_size`` elements
    for block in b:
        assert_(len(block.flat) <= (buf_size or els))

    # Check that all elements are iterated correctly
    assert_(list(b.flat) == list(a.flat))

    # Slice arrayterator
    start = [randint(dim) for dim in shape]
    stop = [randint(dim)+1 for dim in shape]
    step = [randint(dim)+1 for dim in shape]
    slice_ = tuple(slice(*t) for t in zip(start, stop, step))
    c = b[slice_]
    d = a[slice_]

    # Check that each block has at most ``buf_size`` elements
    for block in c:
        assert_(len(block.flat) <= (buf_size or els))

    # Check that the arrayterator is sliced correctly
    assert_(np.all(c.__array__() == d))

    # Check that all elements are iterated correctly
    assert_(list(c.flat) == list(d.flat))

SILENT KILLER Tool