code: def group_measure_specs_by_additiveness(
      measure_specs: Sequence[MeasureSpec],
  ) -> GroupedMeasureSpecsByAdditiveness:
      """Bucket the provided measure specs by.
  
      - Additive Measures
      - Semi-additive measures containing the same non-additive dimension attributes
      """
      bucket = collections.defaultdict(list)
      additive_bucket = []
      for spec in measure_specs:
          non_additive_dimension_spec = spec.non_additive_dimension_spec
          if non_additive_dimension_spec:
              bucket[non_additive_dimension_spec.bucket_hash].append(
                  spec
              )
          else:
              additive_bucket.append(spec)
      return GroupedMeasureSpecsByAdditiveness(
          grouped_semi_additive_measures=tuple(
              tuple(measures) for measures in bucket.values()
          ),
          additive_measures=tuple(additive_bucket),
      )
  
file_path: metricflow/metricflow/dataflow/builder/measure_additiveness.py
imports: from __future__ import annotations
  import collections
  from dataclasses import dataclass
  from typing import Dict, Optional, Sequence, Tuple
  from metricflow.specs.specs import MeasureSpec, NonAdditiveDimensionSpec
label_desc: Use image node_id 1 for calling a global function with example usage: group_measure_specs_by_additiveness(measure_specs) and returns: GroupedMeasureSpecsByAdditiveness