<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def commit(self):
 """ Commit recorded changes, turn off recording, return changes. """

        assert self.record
        result = self.files_written, self.dirs_created
        self._init_record()
        return result