code: def test_iterator():
      array = MutableDenseNDimArray(range(4), (2, 2))
      assert array[0] == MutableDenseNDimArray([0, 1])
      assert array[1] == MutableDenseNDimArray([2, 3])
  
      array = array.reshape(4)
      j = 0
      for i in array:
          assert i == j
          j += 1
  
imports: from copy import copy
  from sympy.tensor.array.dense_ndim_array import MutableDenseNDimArray
  from sympy.core.function import diff
  from sympy.core.numbers import Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.core.sympify import sympify
  from sympy.matrices import SparseMatrix
  from sympy.matrices import Matrix
  from sympy.tensor.array.sparse_ndim_array import MutableSparseNDimArray
  from sympy.testing.pytest import raises
label_desc: Use image node_id 4 for calling a global function with example usage: test_iterator() without return types