code: def partition_size_weight_fn(
      per_partition_metrics: metrics.PerPartitionMetrics,
  ) -> float:
      """Weights partitions according to their size."""
      # Only one metric is calculated as of now.
      return per_partition_metrics.metric_errors[0].sum
  
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 14 for calling a global function with example usage: partition_size_weight_fn(per_partition_metrics) and returns: per_partition_metrics