def METHOD_NAME(self, suffix="", prefix=tempfile.gettempprefix(),
                   dir=None, **kwargs):
    '''Return the temporary file to use.'''
    if dir is None:
        dir = os.path.normpath(os.path.dirname(self._path))
    descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
                                        dir=dir)
    # io.open() will take either the descriptor or the name, but we need
    # the name later for commit()/replace_atomic() and couldn't find a way
    # to get the filename from the descriptor.
    os.close(descriptor)
    kwargs['mode'] = self._mode
    kwargs['file'] = name
    return io.open(**kwargs)