def dict_copy_keys(to_dict, from_dict):
    for key, value in to_dict.items():
        if key not in from_dict:
            del to_dict[key]
        elif type(value) is dict:
            dict_copy_keys(value, from_dict[key])
        else:
            to_dict[key] = copy.deepcopy(from_dict[key])
Copy the values from from_dict to to_dict but only the keys
dataset/ETHPy150Open YelpArchive/pushmanager/pushmanager/core/util.py/dict_copy_keys