Tests if an alert is present

        @return: True if alert is present, False otherwise
1317
def is_alert_present(self):
        
        current_frame = None
        try:
            current_frame = self.driver.current_window_handle
            a = self.driver.switch_to_alert()
            a.text
        except NoAlertPresentException:
            # No alert
            return False
        except UnexpectedAlertPresentException:
            # Alert exists
            return True
        finally:
            if current_frame:
                self.driver.switch_to_window(current_frame)
        return True
909365
def check_alert(self, text):
    

    try:
        alert = Alert(world.browser)
        if alert.text != text:
            raise AssertionError(
                "Alert text expected to be {!r}, got {!r}.".format(
                    text, alert.text))
    except WebDriverException:
        # PhantomJS is kinda poor
        pass
313717
def has_event_handler(self, handler, event_name=None):
        
        if event_name is not None:
            if event_name not in self._event_handlers:
                return False
            events = [event_name]
        else:
            events = self._event_handlers
        for e in events:
            for h, _, _ in self._event_handlers[e]:
                if h == handler:
                    return True
        return False
1004607
def set_alert_callback(self, callback):
        
        if callable(callable):
            self.http.alert_callback = functools.partial(callback, self)
        else:
            self.http.alert_callback = None
713664
def assert_element_absent(self, selector, by=By.CSS_SELECTOR,
                              timeout=settings.SMALL_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        self.wait_for_element_absent(selector, by=by, timeout=timeout)
        return True
1083863
def has_error(self):
        
        self.get_info()

        if 'status' not in self.info:
            return False
        if 'hasError' not in self.info['status']:
            return False

        return self.info['status']['hasError']
638616
def verify_element_present(self, locator, msg=None):
        
        try:
            self.asset_element_present(locator, msg)
        except AssertionError, e:
            if msg:
                m = "%s:\n%s" % (msg, str(e))
            else:
                m = str(e)
            self.verification_erorrs.append(m)
184227
def alerts(self):
        
        if self._alerts is None:
            self._alerts = AlertList(self)
        return self._alerts
1283723
def click_exists(self, timeout=0):
        
        e = self.get(timeout=timeout, raise_error=False)
        if e is None:
            return False
        e.click()
        return True
167815
def has_active_condition(self, conditions, instances):
        
        return_value = None
        for instance in itertools.chain(instances, [None]):
            if not self.can_execute(instance):
                continue
            result = self.is_active(instance, conditions)
            if result is False:
                return False
            elif result is True:
                return_value = True
        return return_value
746235
def hascurrent(self, allowempty=False):
        """"""
        for e in self.select(Current,None,False, False):
            if not allowempty and len(e) == 0: continue
            return True
        return False
312486
def has_active_condition(self, condition, instances):
        
        return_value = None
        for instance in instances + [None]:
            if not self.can_execute(instance):
                continue
            result = self.is_active(instance, condition)
            if result is False:
                return False
            elif result is True:
                return_value = True
        return return_value
380352
def wait_for_and_dismiss_alert(driver, timeout=settings.LARGE_TIMEOUT):
    
    alert = wait_for_and_switch_to_alert(driver, timeout)
    alert_text = alert.text
    alert.dismiss()
    return alert_text
181120
private boolean _shouldEvaluateAlert(Alert alert, BigInteger alertId) {
		if (alert == null) {
			_logger.warn(MessageFormat.format("Could not find alert ID {0}", alertId));
			return false;
		}
		if(!alert.isEnabled()) {
			_logger.warn(MessageFormat.format("Alert {0} has been disabled. Will not evaluate.", alert.getId().intValue()));
			return false;
		}

		return true;
	}
1008177
def close_alert(self, ignore_exception=False):
        
        try:
            alert = self.get_alert()
            alert.accept()
        except:
            if not ignore_exception:
                raise
1296922
def is_alive(self):
        
        response = self.get_monitoring_heartbeat()
        if response.status_code == 200 and response.content == 'alive':
            return True

        return False
1133834
def has_callbacks(self, name):
        
        r = self.event_listeners.get(name)
        if not r:
            return False
        return len(r) > 0