code: def test_tensor_spec(self, image_dtype, metadata_dtype, warning_mock):
      logging.warning = warning_mock
      feature = features_lib.FeaturesDict(
          {
              "input": AnInputConnector(),
              "output": AnOutputConnector(),
              "img": {
                  "size": {
                      "height": features_lib.Tensor(
                          shape=(2, 3), dtype=image_dtype
                      ),
                      "width": features_lib.Tensor(
                          shape=[None, 3], dtype=image_dtype
                      ),
                  },
                  "image": features_lib.Image(shape=(28, 28, 1)),
                  "metadata/path": metadata_dtype,
              },
          }
      )
      self.assertAllEqualNested(
          feature.get_tensor_spec(),
          {
              "input": tf.TensorSpec(shape=[], dtype=np.int64),
              "output": tf.TensorSpec(shape=[], dtype=np.float32),
              "img": {
                  "size": {
                      "height": tf.TensorSpec(
                          shape=[2, 3], dtype=np.int64
                      ),
                      "width": tf.TensorSpec(
                          shape=[None, 3], dtype=np.int64
                      ),
                  },
                  "image": tf.TensorSpec(
                      shape=[28, 28, 1], dtype=np.uint8
                  ),
                  "metadata/path": tf.TensorSpec(
                      shape=[], dtype=np.object_
                  ),
              },
          },
      )
  
imports: import pathlib
  import sys
  import textwrap
  from unittest import mock
  from absl import logging
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import features
label_desc: Use image node_id 2 for calling the FeatureDictTest obj's underlying member method code with example usage: obj.test_tensor_spec(image_dtype, metadata_dtype, warning_mock) without return types