def _lookup_keys(keys, d):
    if isinstance(keys, str) or not hasattr(keys, "__iter__"):
        keys = [keys]
    try:
        for key in keys:
            d = d[key]
    except __HOLE__:
        raise KeyError(keys)
    return d
dataset/ETHPy150Open wiki-ai/revscoring/revscoring/extractors/api/util.py/_lookup_keys