code: def test_dummy_ndarray(xp, device, shape, dtype, pattern, padding):
      a = array_utils.create_dummy_ndarray(
          xp,
          shape,
          dtype,
          device=device,
          pattern=pattern,
          padding=padding,
      )
  
      assert isinstance(a, xp.ndarray)
      assert a.dtype == xp.dtype(dtype)
      assert a.shape == shape
  
      # Check values
      if xp is chainerx:
          a_np = chainerx.to_numpy(a)
      else:
          a_np = a
      if pattern == 1:
          if a.dtype.name == "bool":
              expected_data = [i % 2 == 1 for i in range(a.size)]
          elif a.dtype.name in chainerx.testing.unsigned_dtypes:
              expected_data = list(range(a.size))
          else:
              expected_data = list(range(-1, a.size - 1))
      else:
          if a.dtype.name == "bool":
              expected_data = [i % 3 == 0 for i in range(a.size)]
          elif a.dtype.name in chainerx.testing.unsigned_dtypes:
              expected_data = list(range(1, a.size + 1))
          else:
              expected_data = list(range(-2, a.size - 2))
      numpy.testing.assert_equal(a_np.ravel(), expected_data)
  
      # Check strides
      if xp is chainerx:
          assert a.device is device
      if not padding:
          if xp is chainerx:
              assert a.is_contiguous
          else:
              assert a.flags.c_contiguous
  
file_path: chainer/tests/chainerx_tests/test_array_utils.py
imports: import numpy
  import pytest
  import chainerx
  from chainerx_tests import array_utils
label_desc: Use image node_id 2 for calling a global function with example usage: test_dummy_ndarray(xp, device, shape, dtype, pattern, padding) without return types