code: def _sum_metrics_to_value_error(
      sum_metrics: metrics.SumMetrics, keep_prob: float, weight: float
  ) -> metrics.ValueErrors:
      """Creates ValueErrors from per-partition metrics."""
      value = sum_metrics.sum
      bounding_errors = _create_contribution_bounding_errors(
          sum_metrics
      )
      mean = (
          bounding_errors.l0.mean
          + bounding_errors.linf_min
          + bounding_errors.linf_max
      )
      variance = (
          sum_metrics.std_l0_bounding_error**2
          + sum_metrics.std_noise**2
      )
  
      rmse = math.sqrt(mean**2 + variance)
      l1 = 0  # TODO(dvadym) compute it.
      rmse_with_dropped_partitions = keep_prob * rmse + (
          1 - keep_prob
      ) * abs(value)
      l1_with_dropped_partitions = 0  # TODO(dvadym) compute it.
      result = metrics.ValueErrors(
          bounding_errors=bounding_errors,
          mean=mean,
          variance=variance,
          rmse=rmse,
          l1=l1,
          rmse_with_dropped_partitions=rmse_with_dropped_partitions,
          l1_with_dropped_partitions=l1_with_dropped_partitions,
      )
      if weight != 1:
          # Weight per-partition result for computing weighted sum.
          _multiply_float_dataclasses_field(
              result, weight, fields_to_ignore=["noise_std"]
          )
      return result
  
imports: import copy
  import pipeline_dp
  from analysis import metrics
  import dataclasses
  from typing import List, Tuple, Callable
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: _sum_metrics_to_value_error(sum_metrics, keep_prob, weight) and returns: result