code: def get_regression_scenario() -> (
      Tuple[config_pb2.EvalConfig, _ExampleGeneratorType]
  ):
      """Returns an EvalConfig and example generator for regression."""
      eval_config = text_format.Parse(
          """
        model_specs {
           label_key: "label"
           prediction_key: "prediction"
        }
        slicing_specs: {}
        metrics_specs {
          metrics { class_name: "MeanSquaredError" }
          metrics { class_name: "Calibration" }
        }
        """,
          config_pb2.EvalConfig(),
      )
  
      def generate_regression_examples(
          num_examples,
      ) -> Iterator[example_pb2.Example]:
          for _ in range(num_examples):
              yield util.make_example(
                  label=float(np.random.random()),
                  prediction=float(np.random.uniform()),
              )
  
      return eval_config, generate_regression_examples
  
imports: import collections
  import os
  from typing import Callable, Dict, Iterable, Iterator, List, Sequence, Tuple
  from absl import app
  from absl import flags
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from tfx_bsl.tfxio import tf_example_record
  from google.protobuf import text_format
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: get_regression_scenario() and returns: eval_config,  generate_regression_examples