from typing import List
from typing import Dict
from typing import Any


def _list_of_dicts_to_dict_of_lists(list_of_dicts: List[Dict[str, Any]]) -> Dict[str, List[Any]]:
    """A utility function that given a list of dictionaries converts them into a dictionary of named
    (by a key) lists. """
    return {k: [dic[k] for dic in list_of_dicts] for k in list_of_dicts[0]}