class_docstr: A mutable class that allows us to aggregate values and report mean/stddev.
class_docstr_tok: ["A","mutable","class","that","allows","us","to","aggregate","values","and","report","mean\/stddev","."]
code: def merge(self, other: "Stat") -> "Stat":
      # Note: don't look at other.name
      self.sum += other.sum
      self.sum_squared += other.sum_squared
      if other.min is not None:
          self.min = (
              min(self.min, other.min)
              if self.min is not None
              else other.min
          )
      if other.max is not None:
          self.max = (
              max(self.max, other.max)
              if self.max is not None
              else other.max
          )
      self.count += other.count
      self._update_mean_variance_stddev()
      return self
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/metrics/statistic.py
imports: from dataclasses import dataclass, replace
  import math
  from typing import Dict, Optional
  from .metric_name import MetricName
label_desc: Use image node_id 2 for calling the Stat obj's underlying member method code with example usage: obj.merge(other) and returns: self