def response_to_dictionary(response):
    """
    Converts the response obtained from UniProt mapping tool to a dictionary.
    Output: Dictionary with Uniprot IDs as keys and a lists of PDB ids as values (single UniProt IDs may map to different PDB ids).
    """
    list = response.decode('utf-8').split(sep="\n") # output: ['From\tTo', uniprot1\tpdb1, uniprot2\tpdb2, ... ]
    split = [a.split('\t') for a in list[1:]] # output: [ [uniprot1, pdb1], [uniprot2, pdb2], ... ]
   
    mapping_dict = {}
    for id in split: 
        if len(id) == 2:
            if id[0] not in mapping_dict.keys():
                mapping_dict[id[0]] = [id[1]]
            else:
                mapping_dict[id[0]].append(id[1])

    return mapping_dict