code: def test_functional_mutate(capsys, trace_decorator):
      if trace_decorator:
          # The evaluator works with or without trace decorator.
          cls = nni.trace(FunctionalEvaluator)
      else:
          cls = FunctionalEvaluator
      evaluator = cls(
          _print_params,
          a=Categorical([1, 2], label="x"),
          b=Categorical([3, 4], label="y"),
      )
      assert _mutable_equal(
          evaluator.simplify(),
          {
              "x": Categorical([1, 2], label="x"),
              "y": Categorical([3, 4], label="y"),
          },
      )
      _dump_result = {
          "a": Categorical([1, 2], label="x"),
          "b": Categorical([3, 4], label="y"),
          "function": _print_params,
      }
      assert evaluator.is_mutable()
      if not trace_decorator:
          assert re.match(
              r"FunctionalEvaluator\(<.*>, arguments={'a': Categorical.*, 'b': Categorical.*",
              repr(evaluator),
          )
      assert _mutable_equal(evaluator._dump(), _dump_result)
      assert cls._load(**_dump_result) == evaluator
  
      evaluator = evaluator.freeze({"x": 1, "y": 3})
      assert isinstance(evaluator, FrozenEvaluator)
      _dump_result = {
          "trace_symbol": FunctionalEvaluator,
          "trace_kwargs": {"function": _print_params, "a": 1, "b": 3},
          "trace_args": [],
      }
      assert evaluator._dump() == _dump_result
      FrozenEvaluator._load(**_dump_result) == evaluator
  
      evaluator.evaluate(None)
      assert capsys.readouterr().out == "1 3\n"
      assert evaluator.get() is evaluator.get()
      assert not evaluator.get().is_mutable()
  
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 4 for calling a global function with example usage: test_functional_mutate(capsys, trace_decorator) without return types