code: def test_distinct_target_instance_set_join_validation(
      consistent_id_object_repository: ConsistentIdObjectRepository,
      simple_semantic_manifest_lookup: SemanticManifestLookup,
  ) -> None:
      """Tests instance set join validation to a PRIMARY or UNIQUE entity."""
      foreign_user_instance_set = (
          consistent_id_object_repository.simple_model_data_sets[
              "listings_latest"
          ].instance_set
      )
      primary_user_instance_set = (
          consistent_id_object_repository.simple_model_data_sets[
              "users_latest"
          ].instance_set
      )
      unique_user_instance_set = (
          consistent_id_object_repository.simple_model_data_sets[
              "companies"
          ].instance_set
      )
      user_entity_reference = EntityReference(element_name="user")
      join_evaluator = SemanticModelJoinEvaluator(
          semantic_model_lookup=simple_semantic_manifest_lookup.semantic_model_lookup
      )
  
      foreign_primary = join_evaluator.is_valid_instance_set_join(
          left_instance_set=foreign_user_instance_set,
          right_instance_set=primary_user_instance_set,
          on_entity_reference=user_entity_reference,
      )
      primary_primary = join_evaluator.is_valid_instance_set_join(
          left_instance_set=primary_user_instance_set,
          right_instance_set=primary_user_instance_set,
          on_entity_reference=user_entity_reference,
      )
      unique_primary = join_evaluator.is_valid_instance_set_join(
          left_instance_set=unique_user_instance_set,
          right_instance_set=primary_user_instance_set,
          on_entity_reference=user_entity_reference,
      )
      foreign_unique = join_evaluator.is_valid_instance_set_join(
          left_instance_set=foreign_user_instance_set,
          right_instance_set=unique_user_instance_set,
          on_entity_reference=user_entity_reference,
      )
      primary_unique = join_evaluator.is_valid_instance_set_join(
          left_instance_set=primary_user_instance_set,
          right_instance_set=unique_user_instance_set,
          on_entity_reference=user_entity_reference,
      )
      unique_unique = join_evaluator.is_valid_instance_set_join(
          left_instance_set=unique_user_instance_set,
          right_instance_set=unique_user_instance_set,
          on_entity_reference=user_entity_reference,
      )
  
      results = {
          "foreign to primary": foreign_primary,
          "primary to primary": primary_primary,
          "unique to primary": unique_primary,
          "foreign to unique": foreign_unique,
          "primary to unique": primary_unique,
          "unique to unique": unique_unique,
      }
      assert all(results.values()), (
          f"All instance set level join types for primary and unique targets should be valid, but we found "
          f"at least one that was not! Incorrectly failing types: {[k for k,v in results.items() if not v]}."
      )
  
file_path: metricflow/metricflow/test/model/semantics/test_semantic_model_join_evaluator.py
imports: from __future__ import annotations
  from typing import Dict, Sequence
  from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
  from dbt_semantic_interfaces.protocols.entity import EntityType
  from dbt_semantic_interfaces.references import EntityReference, SemanticModelReference
  from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
  from metricflow.model.semantics.semantic_model_join_evaluator import SemanticModelEntityJoin, SemanticModelEntityJoinType, SemanticModelJoinEvaluator, SemanticModelLink
  from metricflow.test.fixtures.model_fixtures import ConsistentIdObjectRepository
label_desc: Use image node_id 7 for calling a global function with example usage: test_distinct_target_instance_set_join_validation(consistent_id_object_repository, simple_semantic_manifest_lookup) without return types