code: def test_classification_mutate():
      evaluator = Classification(
          criterion=nn.CrossEntropyLoss,
          learning_rate=Categorical([0.1, 0.01], label="lr"),
          train_dataloaders=DataLoader(
              TensorDataset(
                  torch.randn(10, 3), torch.randint(0, 2, (10,))
              ),
              batch_size=Categorical([2, 4], label="bs"),
          ),
          val_dataloaders=DataLoader(
              TensorDataset(
                  torch.randn(10, 3), torch.randint(0, 2, (10,))
              ),
              batch_size=2,
          ),
          max_epochs=Categorical([1, 2], label="epoch"),
          num_classes=2,
      )
      with pytest.raises(RuntimeError, match="freeze()"):
          evaluator.evaluate(nn.Linear(3, 2))
      evaluator = evaluator.freeze({"lr": 0.1, "bs": 2, "epoch": 2})
      assert isinstance(evaluator, FrozenEvaluator)
      assert evaluator.trace_kwargs["learning_rate"] == 0.1
      assert (
          evaluator.trace_kwargs["train_dataloaders"].trace_kwargs[
              "batch_size"
          ]
          == 2
      )
      assert evaluator.trace_kwargs["max_epochs"] == 2
      assert not isinstance(
          evaluator.trace_kwargs["train_dataloaders"], DataLoader
      )
      assert isinstance(
          evaluator.trace_kwargs["val_dataloaders"], DataLoader
      )
  
      evaluator.evaluate(nn.Linear(3, 2))
      evaluator = evaluator.get()
      assert isinstance(evaluator, Lightning)
      assert evaluator.trainer.max_epochs == 2
  
imports: import re
  import sys
  import pytest
  import nni
  import nni.trial
  import torch
  import pytorch_lightning
  from nni.mutable import Categorical, Numerical, SampleValidationError
  from nni.mutable.mutable import _mutable_equal
  from nni.nas.evaluator import FunctionalEvaluator
  from nni.nas.evaluator.pytorch import Classification, Lightning, DataLoader, Trainer, LightningModule
  from nni.nas.evaluator.evaluator import FrozenEvaluator
  from torch import nn
  from torch.utils.data import TensorDataset
label_desc: Use image node_id 6 for calling a global function with example usage: test_classification_mutate() without return types