code: def test_spec_from_gym_space_dtype_map(self):
      class Box(gym.spaces.Box):
          """Box space without the dtype property."""
  
          def __init__(self, *args, **kwargs):
              super(Box, self).__init__(*args, **kwargs)
              del self.dtype
  
      tuple_space = gym.spaces.Tuple(
          (
              gym.spaces.Discrete(2),
              Box(0, 1, (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),
                              Box(0, 1, (3, 4)),
                          )
                      ),
                  }
              ),
          )
      )
  
      dtype_map = {
          gym.spaces.Discrete: np.uint8,
          gym.spaces.Box: np.uint16,
      }
      spec = gym_wrapper.spec_from_gym_space(
          tuple_space, dtype_map=dtype_map
      )  # pytype: disable=wrong-arg-types  # numpy-scalars
      self.assertEqual(np.uint8, spec[0].dtype)
      self.assertEqual(np.uint16, spec[1].dtype)
      self.assertEqual(np.uint8, spec[2][0].dtype)
      self.assertEqual(np.uint8, spec[2][1].dtype)
      self.assertEqual(np.uint8, spec[3]["spec_1"].dtype)
      self.assertEqual(np.uint8, spec[3]["spec_2"][0].dtype)
      self.assertEqual(np.uint16, spec[3]["spec_2"][1].dtype)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl.testing.absltest import mock
  import gym
  import gym.spaces
  import numpy
  from tf_agents.environments import gym_wrapper
  from tf_agents.utils import test_utils
label_desc: Use image node_id 14 for calling the GymWrapperSpecTest obj's underlying member method code with example usage: obj.test_spec_from_gym_space_dtype_map() without return types