def lookup(list_dicts, key, val):
    """ Find key by value in list of dicts and return dict """
    if val == "":
        return None
    r = next((d for d in list_dicts if d[key] == val), None)
    if r is None:
        raise(ValueError(val + " not found"))
    return r