def METHOD_NAME(file, mode, *args, **kwargs):
    for line in contents.split():
        if "b" in mode:
            return io.BytesIO(contents.encode())
        elif "w" in mode:
            return fake_output_shadow_file
        else:
            return io.StringIO(contents)