def to_list_of_dict(in_dict):
    """
    Convert a dict of lists to a list of dicts.

    Args:
        in_dict (dict): the dict of lists to be converted.

    Returns:
        list: The converted list of dicts.
    """
    values = in_dict.values()
    for i in range(len(in_dict) - 1):
        if len(values[i]) != len(values[i + 1]):
            raise ValueError('lengths of lists are not consistent')

    out_list = []
    for i in range(len(in_dict)):
        out_list.append({k: v[i] for k, v in in_dict.items()})

    return out_list