code: def test_repeat_complex_independent(
      space_format: Type[ExecutableModelSpace], nn: ModuleType
  ):
      class Net(ModelSpace, label_prefix="model"):
          def __init__(self):
              super().__init__()
              self.block = Repeat(
                  lambda index: LayerChoice([AddOne(), nn.Identity()]),
                  (2, 3),
                  label="rep",
              )
  
          def forward(self, x):
              return self.block(x)
  
      model = space_format.from_model(Net())
      assert len(model.simplify()) == 4
  
      result = []
      for selected_model in model.grid():
          selected_model = selected_model.executable_model()
          result.append(selected_model(torch.zeros(1, 1)).item())
      assert sorted(result) == sorted(
          [0, 1, 1, 1, 2, 2, 2, 3] + [0, 0, 1, 1, 1, 1, 2, 2]
      )
  
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 4 for calling a global function with example usage: test_repeat_complex_independent(space_format, nn) and returns: self