<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def close(self) -> None: """ Close the server and terminate connections with close code 1001. This method is idempotent. """

        if self.close_task is None:
            self.close_task = self.loop.create_task(self._close())