def get_asset_annotations(graph: tf.Graph):
  """Obtains the asset annotations in the specified graph.

  Args:
    graph: A `tf.Graph` object.

  Returns:
    A dict that maps asset_keys to asset_filenames. Note that if multiple
    entries for the same key exist, later ones will override earlier ones.
  """
  asset_key_collection = graph.get_collection(_ASSET_KEY_COLLECTION)
  asset_filename_collection = graph.get_collection(_ASSET_FILENAME_COLLECTION)
  assert len(asset_key_collection) == len(
      asset_filename_collection
  ), 'Length of asset key and filename collections must match.'
  # Remove scope.
  annotations = {
      os.path.basename(key): os.path.basename(filename)
      for key, filename in zip(asset_key_collection, asset_filename_collection)
  }
  return annotations
Obtains the asset annotations in the specified graph.

  Args:
    graph: A `tf.Graph` object.

  Returns:
    A dict that maps asset_keys to asset_filenames. Note that if multiple
    entries for the same key exist, later ones will override earlier ones.
  
tensorflow_transform/annotators.py