code: def test_nested_parametrized_module():
      class MyModule(ParametrizedModule):
          def __init__(self, x):
              if x == 0:
                  self.mutable = self.add_mutable(
                      nni.choice("a", [1, 2, 3])
                  )
              else:
                  self.mutable = self.add_mutable(
                      nni.choice("b", [4, 5, 6])
                  )
              self.flag = ensure_frozen(self.mutable)
  
      with frozen_context():
          module = MyModule(nni.choice("x", [0, 1]))
      module1 = module.freeze({"x": 0, "a": 1})
      assert module1.flag == 1
      module2 = module.freeze({"x": 1, "b": 5})
      assert module2.mutable.label == "b"
      assert module2.flag == 5
      with pytest.raises(SampleMissingError):
          module.freeze({"x": 1, "a": 2})
  
imports: import copy
  import pytest
  import torch
  import nni
  from torch import nn
  from nni.common.serializer import is_traceable
  from nni.mutable import Categorical, ExpressionConstraint, ensure_frozen, frozen_context, label_scope, auto_label, SampleMissingError
  from nni.mutable.mutable import _mutable_equal
  from nni.nas.nn.pytorch import ModelSpace, MutableModule, ParametrizedModule
  from nni.nas.space import model_context
label_desc: Use image node_id 22 for calling a global function with example usage: test_nested_parametrized_module() without return types