code: def test_submit_models(cgo):
      import logging
  
      logging.getLogger("nni.nas.execution.sequential").setLevel(
          logging.DEBUG
      )
  
      models = _load_mnist(2)
  
      engine = SequentialExecutionEngine(continue_on_failure=True)
  
      cgo.set_engine(engine)
      cgo.submit_models(*models)
  
      cgo.wait_models()
  
      return  # FIXME: status check skipped due to bugs in evaluator copy. It's sort of critical. Fix ASAP.
  
      if not torch.cuda.is_available():
          for model in models:  # can't be trained without gpu.
              assert model.status == ModelStatus.Failed
          if len(cgo.available_devices) == 1:
              assert engine._model_count == 2  # 2  single
          else:
              assert engine._model_count == 3  # 1 + retry 2
      elif (
          torch.cuda.device_count() == 1
          and len(cgo.available_devices) == 1
      ):
          # Should be the case on pipeline.
          assert engine._model_count == 2  # No merge at all.
          for model in models:
              assert model.status == ModelStatus.Trained
              assert model.metrics.final > 0.8
  
imports: from pathlib import Path
  import pytest
  import torch
  import torch.nn
  import torchmetrics
  from torchvision.datasets import MNIST
  from torchvision import transforms
  from pytorch_lightning import seed_everything
  import nni
  from nni.experiment.config import RemoteConfig, RemoteMachineConfig
  from nni.nas.evaluator.pytorch import Lightning, DataLoader
  from nni.nas.execution import SequentialExecutionEngine
  from nni.nas.execution.cgo import CrossGraphOptimization
  from nni.nas.execution.cgo.evaluator import MultiModelLightningModule, MultiModelTrainer
  from nni.nas.execution.cgo.logical_optimizer.logical_plan import LogicalPlan
  from nni.nas.execution.cgo.logical_optimizer.opt_dedup_input import DedupInputOptimizer
  from nni.nas.space import Node, ModelStatus
  from nni.nas.space.pytorch import PytorchGraphModelSpace
  from nni.runtime.trial_command_channel import get_default_trial_command_channel, set_default_trial_command_channel
  from ut.sdk.helper.trial_command_channel import TestHelperTrialCommandChannel
label_desc: Use image node_id 11 for calling a global function with example usage: test_submit_models(cgo) without return types