def replace_builtins():
    if sys.version_info[0] == 2:
        __builtin__.file = file
    __builtin__.open = open
replace file and open in the builtin module
dataset/ETHPy150Open mockfs/mockfs/mockfs/storage.py/replace_builtins