class_docstr: A set that includes all instance types.
  
  Generally used to help represent that data that is flowing between nodes in the metric dataflow plan.
class_docstr_tok: ["A","set","that","includes","all","instance","types",".","Generally","used","to","help","represent","that","data","that","is","flowing","between","nodes","in","the","metric","dataflow","plan","."]
docstr: Combine all instances from all instances into a single instance set.
  
  Instances will be de-duped based on their spec.
code: def merge(instance_sets: List[InstanceSet]) -> InstanceSet:
      """Combine all instances from all instances into a single instance set.
  
      Instances will be de-duped based on their spec.
      """
      measure_instances: List[MeasureInstance] = []
      dimension_instances: List[DimensionInstance] = []
      time_dimension_instances: List[TimeDimensionInstance] = []
      entity_instances: List[EntityInstance] = []
      metric_instances: List[MetricInstance] = []
      metadata_instances: List[MetadataInstance] = []
  
      for instance_set in instance_sets:
          for measure_instance in instance_set.measure_instances:
              if measure_instance.spec not in {
                  x.spec for x in measure_instances
              }:
                  measure_instances.append(measure_instance)
          for dimension_instance in instance_set.dimension_instances:
              if dimension_instance.spec not in {
                  x.spec for x in dimension_instances
              }:
                  dimension_instances.append(dimension_instance)
          for (
              time_dimension_instance
          ) in instance_set.time_dimension_instances:
              if time_dimension_instance.spec not in {
                  x.spec for x in time_dimension_instances
              }:
                  time_dimension_instances.append(
                      time_dimension_instance
                  )
          for entity_instance in instance_set.entity_instances:
              if entity_instance.spec not in {
                  x.spec for x in entity_instances
              }:
                  entity_instances.append(entity_instance)
          for metric_instance in instance_set.metric_instances:
              if metric_instance.spec not in {
                  x.spec for x in metric_instances
              }:
                  metric_instances.append(metric_instance)
          for metadata_instance in instance_set.metadata_instances:
              if metadata_instance.spec not in {
                  x.spec for x in metadata_instances
              }:
                  metadata_instances.append(metadata_instance)
  
      return InstanceSet(
          measure_instances=tuple(measure_instances),
          dimension_instances=tuple(dimension_instances),
          time_dimension_instances=tuple(time_dimension_instances),
          entity_instances=tuple(entity_instances),
          metric_instances=tuple(metric_instances),
          metadata_instances=tuple(metadata_instances),
      )
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Generic, List, Tuple, TypeVar
  from dbt_semantic_interfaces.dataclass_serialization import SerializableDataclass
  from dbt_semantic_interfaces.references import MetricModelReference, SemanticModelElementReference
  from metricflow.aggregation_properties import AggregationState
  from metricflow.specs.column_assoc import ColumnAssociation
  from metricflow.specs.specs import DimensionSpec, EntitySpec, InstanceSpec, InstanceSpecSet, MeasureSpec, MetadataSpec, MetricSpec, TimeDimensionSpec
label_desc: Use image node_id 2 for calling the InstanceSet obj's underlying member method code with example usage: obj.merge(instance_sets) and returns: InstanceSet