'Check a shuffle()-like function for 1D arrays.'

def _check_shuffle(self, func, ptr):

    a = np.arange(20)
    if (sys.version_info >= (3,)):
        r = self._follow_cpython(ptr)
        for i in range(3):
            got = a.copy()
            expected = a.copy()
            func(got)
            r.shuffle(expected)
            self.assertPreciseEqual(got, expected)
    else:
        for i in range(3):
            b = a.copy()
            func(b)
            self.assertNotEqual(list(a), list(b))
            self.assertEqual(sorted(a), sorted(b))
            a = b
    b = a.copy()
    func(memoryview(b))
    self.assertNotEqual(list(a), list(b))
    self.assertEqual(sorted(a), sorted(b))
    with self.assertTypingError():
        func(memoryview('xyz'))
