code: def example_nested_spec(dtype):
      """Return an example nested array spec."""
      low = -10
      high = 10
      if dtype in (np.uint8, np.uint16):
          low += -low
      return {
          "array_spec_1": array_spec.ArraySpec((2, 3), dtype),
          "bounded_spec_1": array_spec.BoundedArraySpec(
              (2, 3), dtype, low, high
          ),
          "empty_shape": array_spec.BoundedArraySpec(
              (), dtype, low, high
          ),
          "dict_spec": {
              "array_spec_2": array_spec.ArraySpec((2, 3), dtype),
              "bounded_spec_2": array_spec.BoundedArraySpec(
                  (2, 3), dtype, low, high
              ),
          },
          "tuple_spec": (
              array_spec.ArraySpec((2, 3), dtype),
              array_spec.BoundedArraySpec((2, 3), dtype, low, high),
          ),
          "list_spec": [
              array_spec.ArraySpec((2, 3), dtype),
              (
                  array_spec.ArraySpec((2, 3), dtype),
                  array_spec.BoundedArraySpec((2, 3), dtype, low, high),
              ),
          ],
      }
  
file_path: agents/tf_agents/utils/example_encoding_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import gin
  import numpy
  import tensorflow
  from tf_agents.specs import array_spec
  from tf_agents.utils import common
  from tf_agents.utils import example_encoding
label_desc: Use image node_id 1 for calling a global function with example usage: example_nested_spec(dtype) and returns: dict