code: def test_mutable_expression_in_evaluator():
      def foo():
          pass
  
      evaluator = FunctionalEvaluator(foo, t=1, x=2)
      assert len(evaluator.simplify()) == 0
  
      evaluator = FunctionalEvaluator(
          foo,
          t=1,
          x=Categorical([1, 2], label="x"),
          y=Categorical([3, 4], label="y"),
      )
      assert len(evaluator.simplify()) == 2
  
      evaluator1 = evaluator.freeze({"x": 1, "y": 3})
      evaluator2 = evaluator.freeze({"x": 2, "y": 4})
  
      with pytest.raises(SampleValidationError):
          evaluator.freeze({"x": 3, "y": 4})
  
      assert evaluator1.get().arguments == {"t": 1, "x": 1, "y": 3}
      assert evaluator2.get().arguments == {"t": 1, "x": 2, "y": 4}
  
      # share label
      evaluator = FunctionalEvaluator(
          foo,
          t=Categorical([1, 2], label="x"),
          x=Categorical([1, 2], label="x"),
      )
      assert len(evaluator.simplify()) == 1
  
      # getitem
      choice = Categorical([{"a": 1, "b": 2}, {"a": 3, "b": 4}])
      evaluator = FunctionalEvaluator(
          foo, t=1, x=choice["a"], y=choice["b"]
      )
      assert len(evaluator.simplify()) == 1
      for _ in range(10):
          evaluator1 = evaluator.random()
          assert (
              evaluator1.trace_kwargs["x"],
              evaluator1.trace_kwargs["y"],
          ) in [(1, 2), (3, 4)]
  
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 7 for calling a global function with example usage: test_mutable_expression_in_evaluator() without return types