def to_dict_of_list(in_list):
    """
    Convert a list of dicts to a dict of lists.

    Args:
        in_list (list): The list of dicts to be converted.

    Returns:
        dict: The converted dict of lists.
    """
    for i in range(len(in_list) - 1):
        if in_list[i].keys() != in_list[i + 1].keys():
            raise ValueError('dict keys are not consistent')

    out_dict = dict()
    for key in in_list[0]:
        out_dict[key] = [item[key] for item in in_list]

    return out_dict