class_docstr: A wrapper around the output of the tf.Transform.
docstr: If vocabulary size is present in annotations return it, else None.
docstr_tok: ["If","vocabulary","size","is","present","in","annotations","return","it",",","else","None","."]
code: def _vocabulary_size_from_annotations(
      self, vocab_filename: str
  ) -> Optional[int]:
      """If vocabulary size is present in annotations return it, else None."""
      if not common.IS_ANNOTATIONS_PB_AVAILABLE:
          return None
  
      try:
          schema = self.transformed_metadata.schema
      except IOError:
          return None
  
      from tensorflow_transform import (
          annotations_pb2,
      )  # pylint: disable=g-import-not-at-top
  
      for annotation in schema.annotation.extra_metadata:
          message = annotations_pb2.VocabularyMetadata()
          annotation.Unpack(message)
          # Check message.filtered_vocabulary_size is not 0 for backwards
          # compatibility.
          if (
              message.file_name == vocab_filename
              and message.filtered_vocabulary_size != 0
          ):
              return message.filtered_vocabulary_size
  
      return None
  
imports: import json
  import os
  from typing import Any, Dict, List, Mapping, Optional
  import numpy
  import tensorflow
  from tensorflow_transform import common
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform.analyzers import sanitized_vocab_filename
  from tensorflow_transform.keras_lib import tf_keras
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow_transform.saved import saved_transform_io_v2
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tensorflow_transform.tf_metadata import metadata_io
  from tensorflow_transform.tf_metadata import schema_utils
  from tensorflow.python.framework import ops
  from tensorflow.tools.docs import doc_controls
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 9 for calling the TFTransformOutput obj's underlying member method code with example usage: obj._vocabulary_size_from_annotations(vocab_filename) and returns: None, None, None, message