code: def test_slicing():
      assert IM[1, :] == ImmutableDenseMatrix([[4, 5, 6]])
      assert IM[:2, :2] == ImmutableDenseMatrix([[1, 2], [4, 5]])
      assert ISM[1, :] == ImmutableSparseMatrix([[4, 5, 6]])
      assert ISM[:2, :2] == ImmutableSparseMatrix([[1, 2], [4, 5]])
  
imports: from itertools import product
  from sympy.core.relational import Equality, Unequality
  from sympy.core.singleton import S
  from sympy.core.sympify import sympify
  from sympy.integrals.integrals import integrate
  from sympy.matrices.dense import Matrix, eye, zeros
  from sympy.matrices.immutable import ImmutableMatrix
  from sympy.matrices import SparseMatrix
  from sympy.matrices.immutable import ImmutableDenseMatrix, ImmutableSparseMatrix
  from sympy.abc import x, y
  from sympy.testing.pytest import raises
label_desc: Use image node_id 3 for calling a global function with example usage: test_slicing() without return types