def sub_dict(d, keys):
    if d is None:
        return None
    else:
        return {k: d[k] for k in keys if k in d}
dataset/ETHPy150Open wiki-ai/revscoring/revscoring/score_processor.py/sub_dict/original