<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def entry_dict_from_list(all_slab_entries):
 """ Converts a list of SlabEntry to an appropriate dictionary. It is assumed that if there is no adsorbate, then it is a clean SlabEntry and that adsorbed SlabEntry has the clean_entry parameter set. Args: all_slab_entries (list):
 List of SlabEntry objects Returns: (dict):
 Dictionary of SlabEntry with the Miller index as the main key to a dictionary with a clean SlabEntry as the key to a list of adsorbed SlabEntry. """


    entry_dict = {}

    for entry in all_slab_entries:
        hkl = tuple(entry.miller_index)
        if hkl not in entry_dict.keys():
            entry_dict[hkl] = {}
        if entry.clean_entry:
            clean = entry.clean_entry
        else:
            clean = entry
        if clean not in entry_dict[hkl].keys():
            entry_dict[hkl][clean] = []
        if entry.adsorbates:
            entry_dict[hkl][clean].append(entry)

    return entry_dict