code: def testStringOpsWithAutomaticControlDependencies(self):
      def preprocessing_fn(inputs):
          month_str = tf.strings.substr(
              inputs["date"], pos=5, len=3, unit="UTF8_CHAR"
          )
  
          # The table created here will add an automatic control dependency.
          month_int = tft.compute_and_apply_vocabulary(month_str)
          return {"month_int": month_int}
  
      input_data = [{"date": "2021-May-31"}, {"date": "2021-Jun-01"}]
      input_metadata = tft.DatasetMetadata.from_feature_spec(
          {"date": tf.io.FixedLenFeature([], tf.string)}
      )
      expected_data = [{"month_int": 0}, {"month_int": 1}]
      max_index = len(expected_data) - 1
      expected_metadata = tft.DatasetMetadata.from_feature_spec(
          {
              "month_int": tf.io.FixedLenFeature([], tf.int64),
          },
          {
              "month_int": schema_pb2.IntDomain(
                  min=-1, max=max_index, is_categorical=True
              ),
          },
      )
  
      self.assertAnalyzeAndTransformResults(
          input_data,
          input_metadata,
          preprocessing_fn,
          expected_data,
          expected_metadata,
      )
  
imports: import os
  import apache_beam
  import tensorflow
  import tensorflow_transform
  from tensorflow_transform.beam import analyzer_impls
  from tensorflow_transform.beam import impl
  from tensorflow_transform.beam.tft_beam_io import transform_fn_io
  from tensorflow_transform.beam import tft_unit
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 18 for calling the VocabularyIntegrationTest obj's underlying member method code with example usage: obj.testStringOpsWithAutomaticControlDependencies() and returns: dict