code: def test_fit_api(mocked_model):
      transform = transforms.Compose(
          [
              transforms.ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
      train_dataset = nni.trace(MNIST)(
          root="data/mnist",
          train=True,
          download=True,
          transform=transform,
      )
      test_dataset = nni.trace(MNIST)(
          root="data/mnist",
          train=False,
          download=True,
          transform=transform,
      )
  
      def lightning():
          return pl.Classification(
              train_dataloader=pl.DataLoader(
                  train_dataset, batch_size=100
              ),
              val_dataloaders=pl.DataLoader(
                  test_dataset, batch_size=100
              ),
              max_epochs=1,
              limit_train_batches=0.1,  # for faster training
              enable_progress_bar=enable_progress_bar,
              num_classes=10,
          )
  
      # Lightning will have some cache in models / trainers,
      # which is problematic if we call fit multiple times.
      lightning().evaluate(MNISTModel())
  
imports: import pytest
  import pytorch_lightning
  import torch
  import torch.nn
  import torch.nn.functional
  from sklearn.datasets import load_diabetes
  from torch.utils.data import Dataset
  from torchvision import transforms
  from torchvision.datasets import MNIST
  import nni
  import nni.nas.evaluator.pytorch.lightning
  from nni.nas.evaluator import FunctionalEvaluator, Evaluator
  from nni.nas.space import RawFormatModelSpace
label_desc: Use image node_id 6 for calling a global function with example usage: test_fit_api(mocked_model) and returns: pl