code: def get_bucket_confidence(
      bucket_values: List[List[float]],
  ) -> List[float]:
      """
      Computes average confidence for each bucket. If a bucket does not have any
      predictions, uses -1 as a placeholder.
      """
  
      return [
          np.mean(bucket) if len(bucket) > 0 else -1.0
          for bucket in bucket_values
      ]
  
file_path: pytext/pytext/metrics/calibration_metrics.py
imports: import math
  from typing import Dict, List, NamedTuple, Tuple
  import numpy
  from pytext.metrics import LabelPrediction
label_desc: Use image node_id 2 for calling a global function with example usage: get_bucket_confidence(bucket_values) and returns: unknown