code: def test_spec_from_gym_space_tuple_mixed(self):
      tuple_space = gym.spaces.Tuple(
          (
              gym.spaces.Discrete(2),
              gym.spaces.Box(-1.0, 1.0, (3, 4)),
              gym.spaces.Tuple(
                  (gym.spaces.Discrete(2), gym.spaces.Discrete(3))
              ),
              gym.spaces.Dict(
                  {
                      "spec_1": gym.spaces.Discrete(2),
                      "spec_2": gym.spaces.Tuple(
                          (
                              gym.spaces.Discrete(2),
                              gym.spaces.Discrete(3),
                          )
                      ),
                  }
              ),
          )
      )
      spec = gym_wrapper.spec_from_gym_space(tuple_space)
  
      self.assertEqual(4, len(spec))
      # Test Discrete
      self.assertEqual((), spec[0].shape)
      self.assertEqual(np.int64, spec[0].dtype)
      self.assertEqual(0, spec[0].minimum)
      self.assertEqual(1, spec[0].maximum)
  
      # Test Box
      self.assertEqual((3, 4), spec[1].shape)
      self.assertEqual(np.float32, spec[1].dtype)
      np.testing.assert_array_almost_equal(
          -np.ones((3, 4)), spec[1].minimum
      )
      np.testing.assert_array_almost_equal(
          np.ones((3, 4)), spec[1].maximum
      )
  
      # Test Tuple
      self.assertEqual(2, len(spec[2]))
      self.assertEqual((), spec[2][0].shape)
      self.assertEqual(np.int64, spec[2][0].dtype)
      self.assertEqual(0, spec[2][0].minimum)
      self.assertEqual(1, spec[2][0].maximum)
      self.assertEqual((), spec[2][1].shape)
      self.assertEqual(np.int64, spec[2][1].dtype)
      self.assertEqual(0, spec[2][1].minimum)
      self.assertEqual(2, spec[2][1].maximum)
  
      # Test Dict
      # Test Discrete in Dict
      discrete_in_dict = spec[3]["spec_1"]
      self.assertEqual((), discrete_in_dict.shape)
      self.assertEqual(np.int64, discrete_in_dict.dtype)
      self.assertEqual(0, discrete_in_dict.minimum)
      self.assertEqual(1, discrete_in_dict.maximum)
  
      # Test Tuple in Dict
      tuple_in_dict = spec[3]["spec_2"]
      self.assertEqual(2, len(tuple_in_dict))
      self.assertEqual((), tuple_in_dict[0].shape)
      self.assertEqual(np.int64, tuple_in_dict[0].dtype)
      self.assertEqual(0, tuple_in_dict[0].minimum)
      self.assertEqual(1, tuple_in_dict[0].maximum)
      self.assertEqual((), tuple_in_dict[1].shape)
      self.assertEqual(np.int64, tuple_in_dict[1].dtype)
      self.assertEqual(0, tuple_in_dict[1].minimum)
      self.assertEqual(2, tuple_in_dict[1].maximum)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl.testing.absltest import mock
  import gymnasium
  import numpy
  from tf_agents.environments import gymnasium_wrapper
  from tf_agents.utils import test_utils
label_desc: Use image node_id 12 for calling the GymnasiumWrapperSpecTest obj's underlying member method code with example usage: obj.test_spec_from_gym_space_tuple_mixed() without return types