class_docstr: Describes the location of input metric of a derived metric.
class_docstr_tok: ["Describes","the","location","of","input","metric","of","a","derived","metric","."]
docstr: Get the associated MetricInput object that this describes.
docstr_tok: ["Get","the","associated","MetricInput","object","that","this","describes","."]
code: def get_metric_input(
      self, metric_lookup: MetricLookup
  ) -> MetricInput:
      """Get the associated MetricInput object that this describes."""
      metric = metric_lookup.get_metric(self.derived_metric_reference)
      if (
          metric.input_metrics is None
          or self.input_metric_list_index >= len(metric.input_metrics)
      ):
          raise ValueError(
              f"The metric input index is invalid for metric: {metric}"
          )
  
      return metric.input_metrics[self.input_metric_list_index]
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from dbt_semantic_interfaces.protocols import MetricInput
  from dbt_semantic_interfaces.references import MetricReference
  from metricflow.model.semantics.metric_lookup import MetricLookup
label_desc: Use image node_id 1 for calling the InputMetricDefinitionLocation obj's underlying member method code with example usage: obj.get_metric_input(metric_lookup) and returns: metric