def METHOD_NAME(self):
    class N(np.ndarray):
        pass
    np.random.seed(1)
    orig = np.arange(3).view(N)
    perm = np.random.permutation(orig)
    assert_array_equal(perm, np.array([0, 2, 1]))
    assert_array_equal(orig, np.arange(3).view(N))
    class M:
        a = np.arange(5)
        def __array__(self):
            return self.a
    np.random.seed(1)
    m = M()
    perm = np.random.permutation(m)
    assert_array_equal(perm, np.array([2, 1, 4, 0, 3]))
    assert_array_equal(m.__array__(), np.arange(5))