from typing import Iterable


def get_key(table,lookup_value):
    """Finds they key given a value for single values and list of values """

    value_list = list(table.values())

    # If each key only have one value, to see if lookup_value is in the dictionary
    if isinstance(value_list[0], Iterable) == False:
        if lookup_value in value_list:
            return list(table.keys())[value_list.index(lookup_value)]
        return None
   
    # Each key has a list of associate values, check to see if the lookup_value matches value for the key.
    # Note this assumes each list Value is unique to each key.
    for key in table:
        for value in table[key]:
            if (value == lookup_value):
               return key