code: def named_temporary_file(*args, **kwargs):
    
    assert 'delete' not in kwargs
    kwargs['delete'] = False
    fp = tempfile.NamedTemporaryFile(*args, **kwargs)
    try:
      with fp:
        yield fp
    finally:
      os.remove(fp.name)
docs: Due to a bug in python (https://bugs.python.org/issue14243), we need
    this to be able to use the temporary file without deleting it.