code: def _serialize_feature_metadata_for_model(
      cols_to_output_tensors: Dict[
          tf.__internal__.feature_column.FeatureColumn, tf.Tensor
      ],
      features: Dict[str, types.TensorType],
  ) -> Dict[str, Any]:
      """Serialize feature metadata for a single model into a dictionary."""
      feature_columns = []
      associated_tensors = []
      for k, v in cols_to_output_tensors.items():
          feature_columns.append(_serialize_feature_column(k))
          associated_tensors.append(
              tf.compat.v1.saved_model.utils.build_tensor_info(v)
          )
  
      serialized_features_dict = {
          k: tf.compat.v1.saved_model.utils.build_tensor_info(v)
          for k, v in features.items()
      }
  
      return {
          "feature_columns": feature_columns,
          "associated_tensors": associated_tensors,
          "features": serialized_features_dict,
      }
  
imports: import contextlib
  import inspect
  import os
  import pickle
  from typing import Any, Callable, Dict, Optional
  import six
  import tensorflow
  from tensorflow import estimator
  import tensorflow_model_analysis
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.utils import util
  from tensorflow.python.feature_column import feature_column_v2
  from tensorflow_estimator.python.estimator.canned import dnn
label_desc: Use image node_id 6 for calling a global function with example usage: _serialize_feature_metadata_for_model(cols_to_output_tensors, features) and returns: dict