code: def test_diff():
      from sympy.abc import x, y, z
  
      md = MutableDenseNDimArray([[x, y], [x * z, x * y * z]])
      assert md.diff(x) == MutableDenseNDimArray([[1, 0], [z, y * z]])
      assert diff(md, x) == MutableDenseNDimArray([[1, 0], [z, y * z]])
  
      sd = MutableSparseNDimArray(md)
      assert sd == MutableSparseNDimArray(
          [x, y, x * z, x * y * z], (2, 2)
      )
      assert sd.diff(x) == MutableSparseNDimArray([[1, 0], [z, y * z]])
      assert diff(sd, x) == MutableSparseNDimArray([[1, 0], [z, y * z]])
  
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 15 for calling a global function with example usage: test_diff() without return types