<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def pause_writing(self):
 """Pause writing."""

        self._restart_writer = False
        if self._writer_task:
            self._writer_task.remove_done_callback(self.restart_writing)
            self._writer_task.cancel()
            await self._writer_task
            await asyncio.sleep(0, loop=self._loop)