code: def testNestSample(self, dtype):
      if dtype == tf.string or dtype == tf.bool:
          self.skipTest("Not compatible with string or bool type.")
      nested_spec = example_nested_tensor_spec(dtype)
      sample = tensor_spec.sample_spec_nest(nested_spec)
      spec_1 = tensor_spec.BoundedTensorSpec.from_spec(
          nested_spec["spec_1"]
      )
      bounded_spec_1 = nested_spec["bounded_spec_1"]
      sample_ = self.evaluate(sample)
      self.assertTrue(np.all(sample_["spec_1"] >= spec_1.minimum))
      self.assertTrue(np.all(sample_["spec_1"] <= spec_1.maximum))
  
      self.assertTrue(
          np.all(sample_["bounded_spec_1"] >= bounded_spec_1.minimum)
      )
      self.assertTrue(
          np.all(sample_["bounded_spec_1"] <= bounded_spec_1.maximum)
      )
  
      self.assertIn("spec_2", sample_["dict_spec"])
      tensor_spec_2 = sample_["dict_spec"]["spec_2"]
      self.assertTrue(np.all(tensor_spec_2 >= spec_1.minimum))
      self.assertTrue(np.all(tensor_spec_2 <= spec_1.maximum))
      self.assertIn("bounded_spec_2", sample_["dict_spec"])
      sampled_bounded_spec_2 = sample_["dict_spec"]["bounded_spec_2"]
      self.assertTrue(np.all(sampled_bounded_spec_2 >= spec_1.minimum))
      self.assertTrue(np.all(sampled_bounded_spec_2 <= spec_1.maximum))
  
      self.assertIn("tuple_spec", sample_)
      self.assertTrue(
          np.all(sample_["tuple_spec"][0] >= spec_1.minimum)
      )
      self.assertTrue(
          np.all(sample_["tuple_spec"][0] <= spec_1.maximum)
      )
      self.assertTrue(
          np.all(sample_["tuple_spec"][1] >= bounded_spec_1.minimum)
      )
      self.assertTrue(
          np.all(sample_["tuple_spec"][1] <= bounded_spec_1.maximum)
      )
  
      self.assertIn("list_spec", sample_)
      self.assertTrue(np.all(sample_["list_spec"][0] >= spec_1.minimum))
      self.assertTrue(np.all(sample_["list_spec"][0] <= spec_1.maximum))
      self.assertTrue(
          np.all(sample_["list_spec"][1][0] >= spec_1.minimum)
      )
      self.assertTrue(
          np.all(sample_["list_spec"][1][0] <= spec_1.maximum)
      )
      self.assertTrue(
          np.all(sample_["list_spec"][1][1] >= bounded_spec_1.minimum)
      )
      self.assertTrue(
          np.all(sample_["list_spec"][1][1] <= bounded_spec_1.maximum)
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.specs import array_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
label_desc: Use image node_id 12 for calling the BoundedTensorSpecSampleTest obj's underlying member method code with example usage: obj.testNestSample(dtype) without return types