'return the key of dictionary dic given the value'

def _find_key(self, dict, value):

    search = [k for (k, v) in dict.items() if (v == value)]
    if (len(search) == 0):
        return None
    else:
        return search[0]
