code: def _test_strategy(strategy, model, evaluator, expect_success):
      engine = SequentialExecutionEngine()
      if expect_success:
          # Sanity check
          strategy(RawFormatModelSpace(model, evaluator), engine)
          assert len(list(strategy.list_models())) == 1
          assert strategy.state_dict().get("ckpt_path")
      else:
          with pytest.raises(TypeError, match="not supported"):
              strategy(RawFormatModelSpace(model, evaluator), engine)
  
imports: import pytest
  import numpy
  import torch
  import pytorch_lightning
  from pytorch_lightning import LightningModule, Trainer
  from torchvision import transforms
  from torchvision.datasets import MNIST
  from torch import nn
  from torch.utils.data import Dataset, RandomSampler, Subset
  import nni
  from nni.nas import strategy
  from nni.nas.execution import SequentialExecutionEngine
  from nni.nas.space import RawFormatModelSpace, model_context
  from nni.nas.evaluator.pytorch.lightning import Classification, Regression, ClassificationModule, DataLoader
  from nni.nas.nn.pytorch import LayerChoice, ModelSpace
  from nni.nas.oneshot.pytorch import DartsLightningModule
  from ut.nas.nn.models import MODELS
  from .test_utils import RandomDataset
label_desc: Use image node_id 5 for calling a global function with example usage: _test_strategy(strategy, model, evaluator, expect_success) without return types