code: def mean_prediction(y_true, y_pred, sample_weight=None) -> float:
      r"""Calculate the (weighted) mean prediction.
  
      The true values are ignored, but required as an argument in order
      to maintain a consistent interface
  
      Parameters
      ----------
      y_true : array_like
          The true labels (ignored)
  
      y_pred : array_like
          The predicted labels
  
      sample_weight : array_like
          Optional array of sample weights
      """
      y_p = _convert_to_ndarray_and_squeeze(y_pred)
      s_w = np.ones(len(y_p))
      if sample_weight is not None:
          s_w = _convert_to_ndarray_and_squeeze(sample_weight)
  
      return np.dot(y_p, s_w) / s_w.sum()
  
file_path: fairlearn/fairlearn/metrics/_base_metrics.py
imports: import numpy
  import sklearn.metrics
  from typing import Any
  from ._metric_frame import check_consistent_length
  from fairlearn.utils._input_manipulations import _convert_to_ndarray_and_squeeze
label_desc: Use image node_id 7 for calling a global function with example usage: mean_prediction(y_true, y_pred, sample_weight) and returns: unknown