code: def _is_related_node(model: GraphModelSpace, node: Node):
      if isinstance(node, AbstractLogicalNode):
          if model in node.related_models:
              return True
      else:
          if model == node.graph.model:
              return True
      return False
  
imports: from __future__ import annotations
  import logging
  import time
  import threading
  from collections.abc import Iterable
  from typing import List, Dict, Tuple, cast
  from nni.common.device import GPUDevice, Device
  from nni.experiment.config.training_services import RemoteConfig
  from nni.nas.space import GraphModelSpace, Node, ModelStatus
  from nni.nas.execution.engine import Middleware, ExecutionEngine
  from nni.nas.execution.event import ModelEventType, IntermediateMetricEvent, FinalMetricEvent, TrainingEndEvent
  from nni.typehint import TrialMetric
  from .logical_optimizer.logical_plan import LogicalPlan, AbstractLogicalNode
  from .logical_optimizer.opt_dedup_input import DedupInputOptimizer
label_desc: Use image node_id 1 for calling the AssemblePolicy obj's underlying member method code with example usage: obj._is_related_node(model, node) and returns: False, True, True