def METHOD_NAME(shape) -> nk.hilbert.DiscreteHilbert:
    n_tls = shape.count(2)
    tls_hilbert = ["spin", "qubit"]
    for tlss in combinations_with_replacement(tls_hilbert, n_tls):
        hilberts = []
        m = 0
        for n in shape:
            if n == 2:
                hilberts.append(_get_tls_hilbert_space(tlss[m]))
                m += 1
            else:
                hilberts.append(nk.hilbert.Fock(n_max=n - 1, N=1))
        yield reduce(operator.mul, hilberts[1:], hilberts[0])