code: def test_repeat_complex(
      space_format: Type[ExecutableModelSpace], nn: ModuleType
  ):
      class Net(ModelSpace, label_prefix="model"):
          def __init__(self):
              super().__init__()
              self.block = Repeat(
                  LayerChoice([AddOne(), nn.Identity()], label="lc"),
                  (3, 5),
                  label="rep",
              )
  
          def forward(self, x):
              return self.block(x)
  
      model = space_format.from_model(Net())
      simplified = model.simplify()
      assert len(simplified) == 2
  
      model1 = model.freeze(
          {"model/lc": simplified["model/lc"].values[0], "model/rep": 3}
      ).executable_model()
      model2 = model.freeze(
          {"model/lc": simplified["model/lc"].values[1], "model/rep": 4}
      ).executable_model()
      model3 = model.freeze(
          {"model/lc": simplified["model/lc"].values[0], "model/rep": 5}
      ).executable_model()
  
      assert model1(torch.zeros(1, 1)).item() == 3
      assert model2(torch.zeros(1, 1)).item() == 0
      assert model3(torch.zeros(1, 1)).item() == 5
  
file_path: nni/test/ut/nas/nn/test_repeat.py
imports: from typing import Type
  from types import ModuleType
  import pytest
  import torch
  import torch.nn
  from nni.mutable import Categorical
  from nni.nas.space import ExecutableModelSpace, GraphModelSpace
  from nni.nas.nn.pytorch import Repeat, ModelSpace, LayerChoice
  from .test_choice import space_format, nn
label_desc: Use image node_id 3 for calling a global function with example usage: test_repeat_complex(space_format, nn) and returns: self