def METHOD_NAME(self) -> None:
    # if any buffered items exist, flush them
    self._flush_items()
    # if writer exists then close it
    if self._writer:
        # write the footer of a file
        self._writer.write_footer()
        self._file.close()
        # add file written to the list so we can commit all the files later
        self.closed_files.append(self._file_name)
        self._writer = None
        self._file = None