code: def create_evaluator(n_models=None, accelerator="gpu"):
      transform = transforms.Compose(
          [
              transforms.ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
      train_dataset = nni.trace(MNIST)(
          root="data/mnist",
          train=True,
          download=False,
          transform=transform,
      )
      test_dataset = nni.trace(MNIST)(
          root="data/mnist",
          train=False,
          download=False,
          transform=transform,
      )
  
      multi_module = MultiModelLightningModule(
          nn.CrossEntropyLoss(),
          torchmetrics.Accuracy("multiclass", num_classes=10),
          n_models=n_models,
      )
  
      lightning = Lightning(
          multi_module,
          MultiModelTrainer(
              max_epochs=1,
              limit_train_batches=0.25,
              enable_progress_bar=True,
              accelerator=accelerator,
          ),
          train_dataloaders=DataLoader(train_dataset, batch_size=100),
          val_dataloaders=DataLoader(test_dataset, batch_size=100),
      )
      return lightning
  
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 1 for calling a global function with example usage: create_evaluator(n_models, accelerator) and returns: lightning