code: def convert_to_measure_spec(measure: Measure) -> MeasureSpec:
      """Converts a Measure to a MeasureSpec, and properly handles non-additive dimension properties."""
      non_additive_dimension_spec = (
          NonAdditiveDimensionSpec(
              name=measure.non_additive_dimension.name,
              window_choice=measure.non_additive_dimension.window_choice,
              window_groupings=tuple(
                  measure.non_additive_dimension.window_groupings
              ),
          )
          if measure.non_additive_dimension is not None
          else None
      )
  
      return MeasureSpec(
          element_name=measure.name,
          non_additive_dimension_spec=non_additive_dimension_spec,
      )
  
imports: from __future__ import annotations
  from dbt_semantic_interfaces.protocols.measure import Measure
  from metricflow.specs.specs import MeasureSpec, NonAdditiveDimensionSpec
label_desc: Use image node_id 1 for calling the MeasureConverter obj's underlying member method code with example usage: obj.convert_to_measure_spec(measure) and returns: MeasureSpec