code: def test_ensure_frozen_constraint_first():
      class Net(ModelSpace, label_prefix="model"):
          def __init__(self, s: int = 4):
              super().__init__()
              discrete1 = Categorical([1, 2, 3])
              discrete2 = Categorical([1, 2, 3])
              self.add_mutable(
                  ExpressionConstraint(discrete1 + discrete2 == s)
              )
              self.add_mutable(discrete1)
              self.add_mutable(discrete2)
              self.a = ensure_frozen(discrete1)
              self.b = ensure_frozen(discrete2)
  
      model = Net()
  
      # assert 'Using the default' in caplog.text
      assert model.a + model.b == 4
  
      model = Net(5)
      assert model.a + model.b == 5
  
      with pytest.raises(
          ValueError,
          match=r"Cannot find a valid",
      ):
          model = Net(10)
  
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 7 for calling a global function with example usage: test_ensure_frozen_constraint_first() without return types