code: def ModelAgnosticGetFPLFeedConfig(
      model_agnostic_config: agnostic_predict.ModelAgnosticConfig,
  ) -> eval_metrics_graph.FPLFeedConfig:
      """Creates an FPLFeedConfig from the input ModelAgnosticConfig.
  
      Creates the placeholder ops based on the input ModelAgnosticConfig. The
      feature_spec is used to determine Tensor vs SparseTensor and dtype for the
      placeholder op.
  
      Args:
        model_agnostic_config: The config to use to generate the placeholder ops.
  
      Returns:
        An eval_metrics_graph.FPLFeedConfig which can be used to instantiate the
        infeed on a metric graph.
  
      Raises:
        ValueError: Supplied ModelAgnosticConfig is invalid.
      """
      features = {}
      predictions = {}
      labels = {}
  
      for key, value in model_agnostic_config.feature_spec.items():
          placeholder = None
          if isinstance(value, tf.io.FixedLenFeature):
              placeholder = (constants.PLACEHOLDER, value.dtype)
          elif isinstance(value, tf.io.VarLenFeature):
              placeholder = (constants.SPARSE_PLACEHOLDER, value.dtype)
          else:
              raise ValueError(
                  "Unsupported type %s in feature_spec." % value
              )
  
          if key in model_agnostic_config.prediction_keys:
              predictions[key] = placeholder
          elif key in model_agnostic_config.label_keys:
              labels[key] = placeholder
          else:
              features[key] = placeholder
      return eval_metrics_graph.FPLFeedConfig(
          features=features, predictions=predictions, labels=labels
      )
  
imports: import copy
  import datetime
  from typing import Generator, List, Optional
  import apache_beam
  from apache_beam.utils import shared
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_metrics_graph import eval_metrics_graph
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.model_agnostic_eval import model_agnostic_predict
label_desc: Use image node_id 1 for calling a global function with example usage: ModelAgnosticGetFPLFeedConfig(model_agnostic_config) and returns: eval_metrics_graph