<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_connected(self, attempts=3):
 """Try to reconnect if neccessary. :param attempts: The amount of tries to reconnect if neccessary. :type attempts: ``int`` """

        if self.gce is None:
            while attempts > 0:
                self.logger.info("Attempting to connect ...")
                try:
                    self.connect()
                except ComputeEngineManagerException:
                    attempts -= 1
                    continue
                self.logger.info("Connection established.")
                return True
            self.logger.error("Unable to connect to Google Compute Engine.")
            return False

        return True