code: def _extract_prediction_and_weight(
      inputs: metric_types.StandardMetricInputs, **kwargs
  ) -> Iterator[Tuple[np.ndarray, np.ndarray, np.ndarray]]:
      if "predictions" in inputs:
          modified_inputs = copy.deepcopy(inputs)
          modified_inputs["labels"] = modified_inputs["predictions"]
      else:
          modified_inputs = inputs
      return metric_util.to_label_prediction_example_weight(
          modified_inputs, **kwargs
      )
  
file_path: model-analysis/tensorflow_model_analysis/metrics/score_distribution_plot.py
imports: import copy
  from typing import Any, Dict, Iterator, Optional, Tuple
  import numpy
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _extract_prediction_and_weight(inputs) and returns: metric_util