code: async def disconnect(self, expected=True):
          
          if self.connected:
              # Unschedule ping checker.
              if self._ping_checker_handle:
                  self._ping_checker_handle.cancel()
  
              # Schedule disconnect.
              await self._disconnect(expected)
docs: Disconnect from server.