code: def test_spec_pattern(
      metric_naming_scheme: MetricNamingScheme,
  ) -> None:  # noqa: D
      spec_pattern = metric_naming_scheme.spec_pattern("metric_0")
  
      specs: Sequence[InstanceSpec] = (
          MetricSpec(element_name="metric_0"),
          MetricSpec(element_name="metric_1"),
          # Shouldn't happen in practice, but checks to see that only metric specs are matched.
          DimensionSpec(element_name="metric_0", entity_links=()),
      )
  
      assert (MetricSpec(element_name="metric_0"),) == tuple(
          spec_pattern.match(specs)
      )
  
file_path: metricflow/metricflow/test/naming/test_metric_name_scheme.py
imports: from __future__ import annotations
  from typing import Sequence
  import pytest
  from metricflow.naming.metric_scheme import MetricNamingScheme
  from metricflow.specs.specs import DimensionSpec, InstanceSpec, MetricSpec
label_desc: Use image node_id 4 for calling a global function with example usage: test_spec_pattern(metric_naming_scheme) without return types