class_docstr: Bucket for calibration histogram.
class_docstr_tok: ["Bucket","for","calibration","histogram","."]
docstr: Add a bucket with the same bucket_id, updating self in place.
docstr_tok: ["Add","a","bucket","with","the","same","bucket_id",",","updating","self","in","place","."]
code: def merge(self, other: "Bucket") -> None:
      """Add a bucket with the same bucket_id, updating self in place."""
      if self.bucket_id != other.bucket_id:
          raise ValueError("attempted to merge mismatched bucket_id")
      self.weighted_labels += other.weighted_labels
      self.weighted_predictions += other.weighted_predictions
      self.weighted_examples += other.weighted_examples
  
file_path: model-analysis/tensorflow_model_analysis/metrics/calibration_histogram.py
imports: import dataclasses
  import operator
  from typing import Dict, Iterable, List, Optional
  import apache_beam
  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 the Bucket obj's underlying member method code with example usage: obj.merge(other) without return types