code: def get_bucket_scores(
      y_score: List[float], buckets: int = 10
  ) -> Tuple[List[List[float]], List[int]]:
      """
      Organizes real-valued posterior probabilities into buckets. For example, if
      we have 10 buckets, the probabilities 0.0, 0.1, 0.2 are placed into buckets
      0 (0.0 <= p < 0.1), 1 (0.1 <= p < 0.2), and 2 (0.2 <= p < 0.3), respectively.
      """
  
      bucket_values = [[] for _ in range(buckets)]
      bucket_indices = [[] for _ in range(buckets)]
      for i, score in enumerate(y_score):
          for j in range(buckets):
              if score < float((j + 1) / buckets):
                  break
          bucket_values[j].append(score)
          bucket_indices[j].append(i)
      return (bucket_values, bucket_indices)
  
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 1 for calling a global function with example usage: get_bucket_scores(y_score, buckets) and returns: bucket_values,  bucket_indices