def _index_spec_params(spec_params):
    """
    Makes an index of the spec parameters. It dict-ifies the list of spec params
    provided by the SpecManager, and also returns the set of param ids that are
    used in groups.
    This gets returned as a tuple (indexed params, group param ids)
    """
    spec_params_dict = dict()
    grouped_parents = dict()
    for p in spec_params:
        spec_params_dict[p["id"]] = p
        # groupify the parameters - identify params that are part of groups, and don't include
        # them in the list separately.
        children = p.get("parameter_ids")
        if children:
            for child in children:
                grouped_parents[child] = p["id"]
    return (spec_params_dict, grouped_parents)