def convert_list_to_dict(data_list, key):
    """Convert list of dictionaries to a dictionary of dictionaries

    :param data_list: List of dictionaries.
    :type data_list: list
    :param key: key in each dictionary to become the returned dictionary key.
    :type key: str
    :returns:
        Dictionary of all dictionaries. Returns an empty dictionary if
        all intended keys are not unique.
    :rtype: dict
    """
    data_dict = {}
    for element_dict in data_list:
        if element_dict[key] not in data_dict.keys():
            data_dict[element_dict[key]] = element_dict
    diff = len(data_list) - len(data_dict)
    if diff != 0:
        print(
            '\nUnable to create dictionary since some intended keys are duplicated.'
            )
        data_dict = {}
    return data_dict
