Test the status of requested Telnet options.
341418
def _check_reply_pending(self, option):
        """"""
        if not self.telnet_opt_dict.has_key(option):
            self.telnet_opt_dict[option] = TelnetOption()
        return self.telnet_opt_dict[option].reply_pending
54606
def _error_msg_network(option, expected):
    '''
    
    '''
    msg = 'Invalid network setting -- Setting: {0}, Expected: [{1}]'
    return msg.format(option, '|'.join(str(e) for e in expected))
361238
def _note_local_option(self, option, state):
        """"""
        if not self.telnet_opt_dict.has_key(option):
            self.telnet_opt_dict[option] = TelnetOption()
        self.telnet_opt_dict[option].local_option = state
1291920
def _check_if_url_valid(url):
        
        r = requests.head(url)
        if r.status_code == 200:
            return True
        else:
            return False
1299345
def vpn_status(self):
        """"""

        # Start signal handler thread if it should be running
        if not self.check_pid and not self.thread_started:
            self._start_handler_thread()

        # Set color_bad as default output. Replaced if VPN active.
        name = None
        color = self.py3.COLOR_BAD

        # If we are acting like the default i3status module
        if self.check_pid:
            if self._check_pid():
                name = "yes"
                color = self.py3.COLOR_GOOD

        # Otherwise, find the VPN name, if it is active
        else:
            vpn = self._get_vpn_status()
            if vpn:
                name = ", ".join(vpn)
                color = self.py3.COLOR_GOOD

        # Format and create the response dict
        full_text = self.py3.safe_format(self.format, {"name": name})
        response = {
            "full_text": full_text,
            "color": color,
            "cached_until": self.py3.CACHE_FOREVER,
        }

        # Cache forever unless in check_pid mode
        if self.check_pid:
            response["cached_until"] = self.py3.time_in(self.cache_timeout)
        return response
519402
def get_status(self):
        """"""
        url = URL.status.format(**locals())
        return self.get_request(url)
251580
def _remote_status(session, service_id, uuid, url, interval=3):
    """"""
    _LOGGER.info('polling for status')
    resp = session.get(url, params={
        'remoteServiceRequestID':service_id,
        'uuid':uuid
    }).json()
    if resp['status'] == 'SUCCESS':
        return 'completed'
    time.sleep(interval)
    return _remote_status(session, service_id, uuid, url)
983801
private void checkStatus(MtasSolrStatus status) throws IOException {
		if (!status.finished()) {
			if (status.error()) {
				status.setFinished();
				if (requestHandler != null) {
					requestHandler.finishStatus(status);
				}
				throw new IOException(status.errorMessage());
			} else if (status.abort()) {
				status.setFinished();
				if (requestHandler != null) {
					requestHandler.finishStatus(status);
				}
				throw new IOException(status.abortMessage());
			}
		}
	}
1073408
def check_status_code(response, codes=None):
    
    codes = codes or [200]
    if response.status_code not in codes:
        raise StatusCodeError(response.status_code)
328444
def status
      return true unless config.managed?
      return false if pid.nil?

      begin
        Process.getpgid(pid)
      rescue Errno::ESRCH
        return false
      end

      begin
        TCPSocket.new(host, port).close

        Net::HTTP.start(host, port) do |http|
          http.request(Net::HTTP::Get.new('/'))
        end

        true
      rescue Errno::ECONNREFUSED, Errno::EINVAL
        false
      end
    end
1121628
def check_status_code(response, codes=None):
    
    codes = codes or [httplib.OK]
    checker = (
        codes
        if callable(codes)
        else lambda resp: resp.status_code in codes
    )
    if not checker(response):
        raise exceptions.ApiError(response, response.json())
816888
def status(host=None, port=None):
    """"""
    app.config['HOST'] = first_value(host, app.config.get('HOST',None), '0.0.0.0')
    app.config['PORT'] = int(first_value(port, app.config.get('PORT',None), 5001))
    if app.config['HOST'] == "0.0.0.0": 
        host="127.0.0.1"
    else:
        host = app.config['HOST']
    port = app.config['PORT']    
    try:
        rep = requests.get('http://%s:%s/api/status' % (host,port))
        if rep.status_code == 200:
            try:
                rep = json.loads(rep.text)
                for k in rep:
                    print('%s\t: %s' % (k, rep[k]))
            except:
                print('web server is not flaskserver', file=sys.stderr)
        else:
            print('web server is not flaskserver', file=sys.stderr)
    except:
        print('web server is not started', file=sys.stderr)
285480
def check_status(self):
        """"""
        # Recompute the status of the tasks
        # Ignore OK and LOCKED tasks.
        for task in self:
            if task.status in (task.S_OK, task.S_LOCKED): continue
            task.check_status()

        # Take into account possible dependencies. Use a list instead of generators
        for task in self:
            if task.status == task.S_LOCKED: continue
            if task.status < task.S_SUB and all(status == task.S_OK for status in task.deps_status):
                task.set_status(task.S_READY, "Status set to Ready")
760866
def check_status_logfile(self, checker_func):
        """"""
        self.status = checker_func(self.logfile)
        return self.status
737763
def check_status(self, **kwargs):
        
        for work in self:
            work.check_status()

        if kwargs.pop("show", False):
            self.show_status(**kwargs)
696850
def call_ping(*args, **kwargs):
    '''
    
    '''
    errors = dict()
    for dev_id, dev_status in call_blink().items():
        if not dev_status['result']:
            errors[dev_id] = False

    return errors or True
1018886
def _check_connection(self):
        """"""
        try:
            super()._check_connection()
        except OSError as exc:
            _LOGGER.error(exc)
            self.protocol.transport.close()
            self.protocol.conn_lost_callback()
            return
        task = self.loop.call_later(
            self.reconnect_timeout + 0.1, self._check_connection)
        self.cancel_check_conn = task.cancel