code: def build_parsing_eval_input_receiver_fn(
      feature_spec, label_key: Optional[str]
  ) -> Callable[[], EvalInputReceiverType]:
      """Build a eval_input_receiver_fn expecting fed tf.Examples.
  
      Creates a eval_input_receiver_fn that expects a serialized tf.Example fed
      into a string placeholder.  The function parses the tf.Example according to
      the provided feature_spec, and returns all parsed Tensors as features.
  
      Args:
        feature_spec: A dict of string to `VarLenFeature`/`FixedLenFeature`.
        label_key: The key for the label column in the feature_spec. Note that the
          label must be part of the feature_spec. If None, does not pass a label to
          the EvalInputReceiver (note that label_key must be None and not simply the
          empty string for this case).
  
      Returns:
        A eval_input_receiver_fn suitable for use with TensorFlow model analysis.
      """
  
      def eval_input_receiver_fn():
          """An input_fn that expects a serialized tf.Example."""
          # Note it's *required* that the batch size should be variable for TFMA.
          serialized_tf_example = tf.compat.v1.placeholder(
              dtype=tf.string, shape=[None], name="input_example_tensor"
          )
          features = tf.io.parse_example(
              serialized=serialized_tf_example, features=feature_spec
          )
          labels = None if label_key is None else features[label_key]
          return EvalInputReceiver(
              features=features,
              labels=labels,
              receiver_tensors={"examples": serialized_tf_example},
          )
  
      return eval_input_receiver_fn
  
file_path: model-analysis/tensorflow_model_analysis/eval_saved_model/export.py
imports: from typing import Any, Callable, Dict, Optional, Union
  import tensorflow
  from tensorflow import estimator
  from tensorflow_model_analysis import version
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.utils import util
  from tensorflow.python.estimator.export import export
label_desc: Use image node_id 5 for calling a global function with example usage: build_parsing_eval_input_receiver_fn(feature_spec, label_key) and returns: eval_input_receiver_fn, EvalInputReceiver