code: def create_error_estimator(
      histograms: hist.DatasetHistograms,
      base_std: float,
      metric: pipeline_dp.Metric,
      noise: pipeline_dp.NoiseKind,
  ) -> CountErrorEstimator:
      """Creates histogram based error estimator for COUNT or PRIVACY_ID_COUNT.
  
      Args:
          histograms: dataset histograms.
          base_std: what's standard deviation of the noise, when l0 and linf
           bounds equal to 1.
          metric: DP aggregation, COUNT or PRIVACY_ID_COUNT.
          noise: type of DP noise.
      Returns:
          Error estimator.
      """
      if metric not in [
          pipeline_dp.Metrics.COUNT,
          pipeline_dp.Metrics.PRIVACY_ID_COUNT,
      ]:
          raise ValueError(
              f"Only COUNT and PRIVACY_ID_COUNT are supported, but metric={metric}"
          )
      l0_ratios_dropped = hist.compute_ratio_dropped(
          histograms.l0_contributions_histogram
      )
      linf_ratios_dropped = hist.compute_ratio_dropped(
          histograms.linf_contributions_histogram
      )
      if metric == pipeline_dp.Metrics.COUNT:
          partition_histogram = histograms.count_per_partition_histogram
      else:
          partition_histogram = (
              histograms.count_privacy_id_per_partition
          )
      return CountErrorEstimator(
          base_std,
          metric,
          noise,
          l0_ratios_dropped,
          linf_ratios_dropped,
          partition_histogram,
      )
  
file_path: pipelinedp/pipeline_dp/dataset_histograms/histogram_error_estimator.py
imports: import pipeline_dp
  from pipeline_dp.dataset_histograms import histograms
  from typing import Optional, Sequence, Tuple
  import math
  import bisect
label_desc: Use image node_id 1 for calling a global function with example usage: create_error_estimator(histograms, base_std, metric, noise) and returns: CountErrorEstimator