code: def _check_graph_connectivity(
      model: GraphModelSpace,
      group_model: Dict[GraphModelSpace, Device],
      logical_plan: LogicalPlan,
  ) -> bool:
      for edge in logical_plan.logical_graph.edges:
          if AssemblePolicy._is_related_node(
              model, edge.head
          ) or AssemblePolicy._is_related_node(model, edge.tail):
              for grouped_model in group_model:
                  if AssemblePolicy._is_related_node(
                      grouped_model, edge.head
                  ) or AssemblePolicy._is_related_node(
                      grouped_model, edge.tail
                  ):
                      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 2 for calling the AssemblePolicy obj's underlying member method code with example usage: obj._check_graph_connectivity(model, group_model, logical_plan) and returns: False, True