<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):
 """Close all active poll instances and remove all callbacks."""

        if self._mpoll is None:
            return
        for mpoll in self._mpoll.values():
            mpoll.close()
        self._mpoll.clear()
        self._mpoll = None