code: def test_multidiscrete_as_tuple():
      # 1D multi-discrete
      space = MultiDiscrete([3, 4, 5])
  
      assert space.shape == (3,)
      assert space[0] == Discrete(3)
      assert space[0:1] == MultiDiscrete([3])
      assert space[0:2] == MultiDiscrete([3, 4])
      assert space[:] == space and space[:] is not space
  
      # 2D multi-discrete
      space = MultiDiscrete([[3, 4, 5], [6, 7, 8]])
  
      assert space.shape == (2, 3)
      assert space[0, 1] == Discrete(4)
      assert space[0] == MultiDiscrete([3, 4, 5])
      assert space[0:1] == MultiDiscrete([[3, 4, 5]])
      assert space[0:2, :] == MultiDiscrete([[3, 4, 5], [6, 7, 8]])
      assert space[:, 0:1] == MultiDiscrete([[3], [6]])
      assert space[0:2, 0:2] == MultiDiscrete([[3, 4], [6, 7]])
      assert space[:] == space and space[:] is not space
      assert space[:, :] == space and space[:, :] is not space
  
imports: import pytest
  from gym.spaces import Discrete, MultiDiscrete
  from gym.utils.env_checker import data_equivalence
label_desc: Use image node_id 1 for calling a global function with example usage: test_multidiscrete_as_tuple() without return types