rpc_ping
    Returns {'alive': True} on succcess
    Returns {'error': ...} on error
16607
def ping(proxy=None, hostport=None):
    
    schema = {
        'type': 'object',
        'properties': {
            'status': {
                'type': 'string'
            },
        },
        'required': [
            'status'
        ]
    }

    assert proxy or hostport, 'Need either proxy handle or hostport string'
    if proxy is None:
        proxy = connect_hostport(hostport)

    resp = {}

    try:
        resp = proxy.ping()
        resp = json_validate( schema, resp )
        if json_is_error(resp):
            return resp

        assert resp['status'] == 'alive'

    except ValidationError as e:
        if BLOCKSTACK_DEBUG:
            log.exception(e)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return resp
654110
function getServerStatus(cb) {
  async.parallel({
      live: (cb) => {
        request('http://live.albiononline.com/status.txt', (error, response, body) => {
          if(error) {
            return cb(error);
          }
          cb(null, JSON.parse(body.trim()));
        });
      },
      staging: (cb) => {
        request('http://staging.albiononline.com/status.txt', (error, response, body) => {
          if(error) {
            return cb(error);
          }
          cb(null, JSON.parse(body.trim()));
        });
      }
    }, (e, rs) => {
      if(e) {
        return cb(e);
      }

      cb(null, {
        live: {
          status: rs.live.status,
          message: rs.live.message,
        },
        staging: {
          status: rs.staging.status,
          message: rs.staging.message,
        }
      });
    });
}
821372
def process_is_alive?(pid)
      begin
        Process.kill(0, pid)
        return true
      rescue Errno::ESRCH
        return false
      rescue SystemCallError => e
        return true
      end
    end
559983
def ping(host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    try:
        return server.ping()
    except redis.ConnectionError:
        return False
373822
def execute_ping(host_list, remote_user, remote_pass,
                 sudo=False, sudo_user=None, sudo_pass=None):
    '''
    
    '''
    runner = spam.ansirunner.AnsibleRunner()
    result, failed_hosts = runner.ansible_perform_operation(
        host_list=host_list,
        remote_user=remote_user,
        remote_pass=remote_pass,
        sudo=sudo,
        sudo_pass=sudo_pass,
        sudo_user=sudo_user,
        module="ping")

    print result, failed_hosts
    dark_hosts = runner.ansible_get_dark_hosts(result)
    print "dark hosts: ", dark_hosts
141759
async def check_ping_timeout(self):
        
        if self.closed:
            raise exceptions.SocketIsClosedError()
        if time.time() - self.last_ping > self.server.ping_interval + 5:
            self.server.logger.info('%s: Client is gone, closing socket',
                                    self.sid)
            # Passing abort=False here will cause close() to write a
            # CLOSE packet. This has the effect of updating half-open sockets
            # to their correct state of disconnected
            await self.close(wait=False, abort=False)
            return False
        return True
1329110
async def _heartbeat_callback(self):
        """"""
        query = {
            "MPRPC": self.VERSION,
            "HEARTBEAT": "ping"
        }
        queryb = self.encoder(query)
        while True:
            await asyncio.sleep(self.heart_beat)
            self.writer.write(queryb)
            if self.debug is True:
                print("ping")
592937
def is_running(self, port):
        """"""
        try:
            con = self.client('localhost:%s' % port)
            con.admin.command('ping')
            return True
        except (AutoReconnect, ConnectionFailure, OperationFailure):
            # Catch OperationFailure to work around SERVER-31916.
            return False
514251
def ping():
    '''
    
    '''
    if _worker_name() not in DETAILS:
        init()
    try:
        return DETAILS[_worker_name()].conn.isalive()
    except TerminalException as e:
        log.error(e)
        return False
361002
def getProcessStatus(self):
        
        info_dict = {}
        cur = self._conn.cursor()
        cur.execute("""SHOW FULL PROCESSLIST;""")
        rows = cur.fetchall()
        if rows:
            for row in rows:
                if row[6] == '':
                    state = 'idle'
                elif row[6] is None:
                    state = 'other'
                else:
                    state = str(row[6]).replace(' ', '_').lower()
                info_dict[state] = info_dict.get(state, 0) + 1
        return info_dict
912917
def _pid_is_alive(cls, pid, timeout):
        """"""
        try:
            proc = psutil.Process(pid)
        except psutil.NoSuchProcess:
            return False

        try:
            proc.wait(timeout=timeout)
        except psutil.TimeoutExpired:
            return True

        return False
612869
def atlas_peer_ping( peer_hostport, timeout=None, peer_table=None ):
    
    
    if timeout is None:
        timeout = atlas_ping_timeout()

    assert not atlas_peer_table_is_locked_by_me()

    host, port = url_to_host_port( peer_hostport )
    RPC = get_rpc_client_class()
    rpc = RPC( host, port, timeout=timeout )

    log.debug("Ping %s" % peer_hostport)

    ret = False
    try:
        res = blockstack_ping( proxy=rpc ) 
        if 'error' not in res:
            ret = True

    except (socket.timeout, socket.gaierror, socket.herror, socket.error), se:
        atlas_log_socket_error( "ping(%s)" % peer_hostport, peer_hostport, se )
        pass

    except Exception, e:
        log.exception(e)
        pass

    # update health
    with AtlasPeerTableLocked(peer_table) as ptbl:
        atlas_peer_update_health( peer_hostport, ret, peer_table=ptbl )

    return ret
525523
async def ping(self) -> dict:
        
        if not self._session:
            await self.create_session()
        async with self._session.get(self.url.format(endpoint='ping')) as resp:
            logger.debug(f'{resp.status}: {resp.reason}')
            return dict(resp.headers.items())
1184631
def ping(self):
        
        uri = "%s/%s" % (self.base_uri, "ping")
        resp, data = self.request("GET", uri)
        return data
319468
def _get_proc_status(proc):
    '''
    
    '''
    try:
        return salt.utils.data.decode(proc.status() if PSUTIL2 else proc.status)
    except (psutil.NoSuchProcess, psutil.AccessDenied):
        return None
186063
def ping(self, *args, **kwargs):
        

        return self._makeApiCall(self.funcinfo["ping"], *args, **kwargs)
1272218
def ping(**kwargs):
    '''
    
    '''
    status = True
    try:
        nodes(**kwargs)
    except CommandExecutionError:
        status = False

    return status