Check whether we are connected to VC in this guild.
480142
async def connected_check(ctx: commands.Context):
    

    voice = ctx.guild.voice_client

    if not voice or not voice.is_connected():
        raise commands.CheckFailure("Not connected to VC in this guild")

    return True
631631
function isConnected(remote) {
  if (isNaN(remote._ledger_current_index)) {
    // Remote is missing the index of last ledger closed. Unprepared to submit
    // transactions
    return false;
  }

  var server = remote.getServer();
  if (!server) {
    return false;
  }

  if (remote._stand_alone) {
    // If rippled is in standalone mode we can assume there will not be a
    // ledger close within 30 seconds.
    return true;
  }

  return (Date.now() - server._lastLedgerClose) <= CONNECTION_TIMEOUT;
}
758374
def is_connected(self):
        
        if self._client is not None:
            try:
                self._client.server_info()
            except ConnectionFailure:
                return False
            return True
        else:
            return False
857809
private boolean checkVmIsOnline() {

		String zoneName = OpenstackIaasHandler.findZoneName( this.novaApi, this.targetProperties );
		Server server = this.novaApi.getServerApiForZone( zoneName ).get(this.machineId);
		return Status.ACTIVE.equals(server.getStatus());
	}
620019
def is_connected(self, attempts=3):
        
        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
183694
def connected(self, *, presence=structs.PresenceState(False), **kwargs):
        
        return UseConnected(self, presence=presence, **kwargs)
37766
def detect_vcs():
    """"""
    location = os.path.abspath('.')
    while True:
        for vcs in Git, Mercurial, Bazaar, Subversion:
            if vcs.detect(location):
                return vcs
        parent = os.path.dirname(location)
        if parent == location:
            raise Failure("Couldn't find version control data"
                          " (git/hg/bzr/svn supported)")
        location = parent
1045849
public function is_connected() {
		$retval = false;
		if(isset($this->dbh) && count($this->dbh->getAvailableDrivers())) {
			$retval = true;
		}
		return($retval);
	}
579934
def is_connected(self):
        """"""
        return all([r.is_connected() for r in dict.values(self.children)])
1185686
def verify_state(self):
        """"""
        if self.state == CONNECTING:
            self.state = OPEN

            self.conn.on_open(self.conn_info)
1129427
def check_password(self, passwd, group):
        # This provides authentication via CADC.
        """"""
        return gms.isMember(self.login, passwd, group)
349556
protected synchronized boolean checkConnection()
    {
        if (_connection==null)
        {
            try{
                _connection=_url.openConnection();
            }
            catch(IOException e)
            {
                LogSupport.ignore(log,e);
            }
        }
        return _connection!=null;
    }
124835
def check_status(self):
        
        log = logging.getLogger("%s.%s" % (self.log_name,
                                           inspect.stack()[0][3]))
        log.setLevel(self.log_level)

        if self.url:
            return True
        try:
            result = requests.get(self.ext_url)
            self.url = self.ext_url
            return True
        except requests.exceptions.ConnectionError:
            pass
        try:
            result = requests.get(self.local_url)
            log.warning("Url '%s' not connecting. Using local_url '%s'" % \
                     (self.ext_url, self.local_url))
            self.url = self.local_url
            return True
        except requests.exceptions.ConnectionError:
            self.url = None
            log.warning("Unable to connect using urls: %s" % set([self.ext_url,
                                                               self.local_url]))
            return False
780631
def has_membership(self, user, role):
        
        targetRecord = AuthMembership.objects(creator=self.client, user=user).first()
        if targetRecord:
            return role in [i.role for i in targetRecord.groups]
        return False
530360
def _check_Vn(self):
        
        if hasattr(self, 'bus') and hasattr(self, 'Vn'):
            bus_Vn = self.read_data_ext('Bus', field='Vn', idx=self.bus)
            for name, bus, Vn, Vn0 in zip(self.name, self.bus, self.Vn,
                                          bus_Vn):
                if Vn != Vn0:
                    self.log(
                        '<{}> has Vn={} different from bus <{}> Vn={}.'.format(
                            name, Vn, bus, Vn0), WARNING)

        if hasattr(self, 'node') and hasattr(self, 'Vdcn'):
            node_Vdcn = self.read_data_ext('Node', field='Vdcn', idx=self.node)
            for name, node, Vdcn, Vdcn0 in zip(self.name, self.node, self.Vdcn,
                                               node_Vdcn):
                if Vdcn != Vdcn0:
                    self.log(
                        '<{}> has Vdcn={} different from node <{}> Vdcn={}.'
                        .format(name, Vdcn, node, Vdcn0), WARNING)
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
1119936
def check_membership(self, groups):
        '''  '''
        if not groups or groups == ['']:
            return True
        if self.request.user.is_superuser:
            return True
        user_groups = self.request.user.groups.values_list("name", flat=True)
        return set(groups).intersection(set(user_groups))