def rand_indices(x, rand_attr):
    loop = True
    indices = range(len(x[0]))

    while loop:
        loop = False
        # randomly selected features without replacement
        rand_list = random.sample(indices, rand_attr)
        for i in rand_list:
            if len(np.unique(x[:, i])) == 1:
                loop = True
                indices.remove(i)
                if len(indices) == rand_attr - 1:
                    return -1  # all features in dataset have one distinct value
                break
    return rand_list
inspects hardware and gets additional capabilities.
dataset/ETHPy150Open romanorac/discomll/discomll/ensemble/core/decision_tree.py/rand_indices--crossover with--dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/ilo/inspect.py/_get_capabilities