code: def equal_weight_fn(
      per_partition_metrics: metrics.PerPartitionMetrics,
  ) -> float:
      """Weights partitions according to their probability to be kept."""
      # For the public partitions weights will be 1, and we will do normal
      # averaging because total weight will equal to the total number of
      # partitions. The function assumes that
      # partition_selection_probability_to_keep for public partitions is 1 and all
      # public partitions including empty are processed in CrossPartitionCombiner.
      # For private partitions we will do weighted average and
      # total weight will equal to mean number of kept partitions
      # (`partitions.kept_partitions.mean`).
      return (
          per_partition_metrics.partition_selection_probability_to_keep
      )
  
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 15 for calling a global function with example usage: equal_weight_fn(per_partition_metrics) and returns: per_partition_metrics