code: def test_discrete_in_evaluator(
      space_format: Type[ExecutableModelSpace], nn: ModuleType
  ):
      class Net(ModelSpace, label_prefix=None):
          def __init__(self):
              super().__init__()
              self.conv = MutableConv2d(
                  3, 5, kernel_size=Categorical([3, 5], label="ks")
              )
  
          def forward(self, x):
              return self.conv(x)
  
      def foo():
          pass
  
      evaluator = FunctionalEvaluator(
          foo,
          t=1,
          x=Categorical([1, 2], label="x"),
          y=Categorical([3, 4], label="y"),
      )
      model = space_format.from_model(Net(), evaluator=evaluator)
      assert len(model.simplify()) == 3
  
      model1 = model.freeze({"ks": 3, "x": 1, "y": 3})
      assert model1.evaluator.get().arguments == {
          "t": 1,
          "x": 1,
          "y": 3,
      }
      model2 = model.freeze({"ks": 5, "x": 2, "y": 4})
      assert model2.evaluator.get().arguments == {
          "t": 1,
          "x": 2,
          "y": 4,
      }
      assert model2.executable_model()(
          torch.randn(1, 3, 5, 5)
      ).size() == torch.Size([1, 5, 1, 1])
  
imports: import copy
  import random
  from types import ModuleType
  from typing import Type
  import pytest
  import nni
  import nni.nas.nn.pytorch.layers
  import nni.nas.evaluator.pytorch.lightning
  import torch
  import torch.nn.functional
  from nni.mutable import Categorical, ensure_frozen, label_scope, SampleValidationError
  from nni.nas.evaluator import FunctionalEvaluator
  from nni.nas.space import RawFormatModelSpace, SimplifiedModelSpace, ExecutableModelSpace, GraphModelSpace, model_context
  from nni.nas.space.pytorch import PytorchGraphModelSpace
  from nni.nas.nn.pytorch import ParametrizedModule, MutableModule, ModelSpace, LayerChoice, InputChoice, Cell, ChosenInputs, MutableConv2d, MutableLinear
label_desc: Use image node_id 22 for calling a global function with example usage: test_discrete_in_evaluator(space_format, nn) and returns: self