class_docstr: Processes source nodes before other nodes are joined.
  
  Generally, the source nodes will be combined with other dataflow plan nodes to produce a new set of nodes to realize
  a condition of the query. For example, to realize a time range constraint, a ConstrainTimeRangeNode will be added
  to the source nodes.
  
  e.g.
  
  <SomeDataflowPlanNode/>
  
  ->
  
  <ConstrainTimeRangeNode>
      <SomeDataflowPlanNode/>
  </ConstrainTimeRangeNode>
docstr: Returns true if the output of the node contains an entity of the given types.
docstr_tok: ["Returns","true","if","the","output","of","the","node","contains","an","entity","of","the","given","types","."]
code: def _node_contains_entity(
      self,
      node: BaseOutput,
      entity_reference: EntityReference,
  ) -> bool:
      """Returns true if the output of the node contains an entity of the given types."""
      data_set = self._node_data_set_resolver.get_output_data_set(node)
  
      for (
          entity_instance_in_first_node
      ) in data_set.instance_set.entity_instances:
          entity_spec_in_first_node = entity_instance_in_first_node.spec
  
          if entity_spec_in_first_node.reference != entity_reference:
              continue
  
          if len(entity_spec_in_first_node.entity_links) > 0:
              continue
  
          assert (
              len(entity_instance_in_first_node.defined_from) == 1
          ), "Multiple items in defined_from not yet supported"
  
          entity = (
              self._semantic_model_lookup.get_entity_in_semantic_model(
                  entity_instance_in_first_node.defined_from[0]
              )
          )
          if entity is None:
              raise RuntimeError(
                  f"Invalid SemanticModelElementReference {entity_instance_in_first_node.defined_from[0]}"
              )
  
          return True
  
      return False
  
imports: from __future__ import annotations
  import logging
  from dataclasses import dataclass
  from typing import List, Optional, Sequence, Set
  from dbt_semantic_interfaces.pretty_print import pformat_big_objects
  from dbt_semantic_interfaces.references import EntityReference, TimeDimensionReference
  from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver
  from metricflow.dataflow.builder.partitions import PartitionJoinResolver
  from metricflow.dataflow.dataflow_plan import BaseOutput, ConstrainTimeRangeNode, FilterElementsNode, JoinDescription, JoinToBaseOutputNode
  from metricflow.filters.time_constraint import TimeRangeConstraint
  from metricflow.model.semantics.semantic_model_join_evaluator import MAX_JOIN_HOPS, SemanticModelJoinEvaluator
  from metricflow.protocols.semantics import SemanticModelAccessor
  from metricflow.specs.spec_set_transforms import ToElementNameSet
  from metricflow.specs.specs import InstanceSpecSet, LinkableInstanceSpec, LinklessEntitySpec
  from metricflow.sql.sql_plan import SqlJoinType
label_desc: Use image node_id 3 for calling the PreJoinNodeProcessor obj's underlying member method code with example usage: obj._node_contains_entity(node, entity_reference) and returns: False, True