def get_states(
    state: List,
    sweep_config: Dict,
    sweep_keys: List,
):
    """
    Standard recursive procedure for generating all possible configurations.
    """

    ans = []
    if len(state) < len(sweep_config):
        for i in range(len(sweep_config[sweep_keys[len(state)]])):
            for s in get_states(state + [i], sweep_config, sweep_keys):
                ans.append(s)
    else:
        ans.append(state)
    return ans

    Standard recursive procedure for generating all possible configurations.
    
experiments/sweep.py