def rename_dict_keys(dict, to_backend=True):
    attrs = [('_id', 'id')]
    if to_backend:
        for backend, frontend in attrs:
            if frontend in dict:
                dict[backend] = dict[frontend]
                del dict[frontend]
    else:
        for backend, frontend in attrs:
            if backend in dict:
                dict[frontend] = dict[backend]
                del dict[backend]

## Classes
dataset/ETHPy150Open ebroder/anygit/anygit/backends/mongodb.py/rename_dict_keys/original