<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tempfilename(**kwargs):
 """ Reserve a temporary file for future use. This is useful if you want to get a temporary file name, write to it in the future and ensure that if an exception is thrown the temporary file is removed. """

    kwargs.update(delete=False)
    try:
        f = NamedTemporaryFile(**kwargs)
        f.close()
        yield f.name
    except Exception:
        if os.path.exists(f.name):
            # Ensure we clean up after ourself
            os.unlink(f.name)
        raise