code: def group(logical_plan, available_devices):
      # TODO: Packing multiple model in one GPU
      # Currently, we only support one model per GPU
      all_grouped_models = []
      group_model = {}
      assert (
          len(available_devices) > 0
      )  # There should be at least 1 device, set in CGO_DEVICES
      for idx, m in enumerate(logical_plan.models):
          # models in one group should
          # (1) not use more GPUs than available_devices
          # (2) be connected in the logical plan (independent models should be assembled in multiple groups)
          # (3) use same MultiModelSupervisedLearningModule
          if len(group_model) > 0 and (
              AssemblePolicy._check_graph_connectivity(
                  m, group_model, logical_plan
              )
              == False
              or AssemblePolicy._check_evaluator(m, group_model)
              == False
          ):
              all_grouped_models.append(group_model)
              group_model = {}
          group_model[m] = available_devices[
              idx % len(available_devices)
          ]
          if (
              len(group_model) == len(available_devices)
              or idx == len(logical_plan.models) - 1
          ):
              all_grouped_models.append(group_model)
              group_model = {}
      return all_grouped_models
  
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 4 for calling the AssemblePolicy obj's underlying member method code with example usage: obj.group(logical_plan, available_devices) and returns: all_grouped_models