class_docstr: A DoFn that loads the model and predicts.
code: def _get_example_weights(
      self, model_name: str, features: Dict[str, Any]
  ) -> Any:
      spec = model_util.get_model_spec(self._eval_config, model_name)
      if not spec:
          raise ValueError(
              'Missing model_spec for model_name "{}"'.format(
                  model_name
              )
          )
      if spec.example_weight_key:
          if spec.example_weight_key not in features:
              raise ValueError(
                  'Missing feature for example_weight_key "{}": features={}'.format(
                      spec.example_weight_key, features
                  )
              )
          return features[spec.example_weight_key]
      elif spec.example_weight_keys:
          example_weights = {}
          for k, v in spec.example_weight_keys.items():
              if v not in features:
                  raise ValueError(
                      'Missing feature for example_weight_key "{}": features={}'.format(
                          k, features
                      )
                  )
              example_weights[k] = features[v]
          return example_weights
      else:
          return np.array([1.0])
  
imports: import collections
  import copy
  from typing import Any, Dict, List, Optional, Sequence
  import apache_beam
  import numpy
  import pyarrow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.extractors import legacy_feature_extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
label_desc: Use image node_id 2 for calling the _TFMAPredictionDoFn obj's underlying member method code with example usage: obj._get_example_weights(model_name, features) and returns: features, example_weights, np