code: def test_combinations():
      net = LayerChoice(
          [nn.Linear(3, 3, bias=False), nn.Linear(3, 3, bias=True)],
          label="x",
      )
      shape = (
          MutableShape(3),
          MutableShape(2, nni.choice("y", [3, 4])),
          MutableShape(nni.choice("x", [0, 1]) + 1),
      )
  
      counter = 0
      bias_true = 0
      shape_four = 0
      for condition, n, inp in combinations(net, shape):
          if counter == 0:
              assert condition.evaluate({"x": 0, "y": 3})
              assert not condition.evaluate({"x": 1, "y": 3})
          if counter == 3:
              assert condition.evaluate({"x": 1, "y": 4})
              assert not condition.evaluate({"x": 1, "y": 3})
          bias_true += n.bias is not None
  
          assert len(inp) == 3
          if inp[1].size(1) == 4:
              shape_four += 1
          assert inp[2].size(0) == int(n.bias is not None) + 1
          counter += 1
      assert counter == 4
      assert bias_true == 2
      assert shape_four == 2
  
      class Net(nn.Module):
          def __init__(self):
              super().__init__()
              self.conv = Repeat(
                  lambda d: LayerChoice(
                      [
                          nn.Linear(3, 3, bias=False),
                          nn.Linear(3, 3, bias=True),
                      ],
                      label=f"d{d}",
                  ),
                  (1, 2),
                  label="rep",
              )
  
      net = Net()
      shape = MutableShape(2, nni.choice("rep", [1, 2]))
      assert len(list(combinations(net, shape))) == 8
  
      assert (
          len(list(combinations(nni.choice("d1", [0, 1]), shape))) == 4
      )
      assert (
          len(list(combinations(nni.choice("rep", [1, 2]), shape))) == 2
      )
  
imports: import pytest
  import torch
  from torch import nn
  import nni
  from nni.mutable import Categorical
  from nni.nas.hub.pytorch import *
  from nni.nas.hub.pytorch.mobilenetv3 import SqueezeExcite
  from nni.nas.hub.pytorch.proxylessnas import ConvBNReLU, DepthwiseSeparableConv, InvertedResidual
  from nni.nas.nn.pytorch import MutableConv2d, MutableLinear, LayerChoice, Repeat
  from nni.nas.profiler.pytorch.nn_meter import NnMeterProfiler, to_onnx, combinations
  from nni.nas.profiler.pytorch.utils import MutableShape
  from nn_meter import load_latency_predictor
  from ut.nas.nn.models import MODELS
label_desc: Use image node_id 2 for calling a global function with example usage: test_combinations() without return types