Return True iff the node_id is connected.
333467
def connected(self, node_id):
        """"""
        conn = self._conns.get(node_id)
        if conn is None:
            return False
        return conn.connected()
125582
def get_connection_by_id(self, id):
        ''''''
        with self._mutex:
            for conn in self.connections:
                if conn.id == id:
                    return conn
            return None
1065050
public function isConnected($which_connection='')
    {
        if ($which_connection == '') {
            $which_connection=$this->default_db;
        }
        if (isset($this->connections[$which_connection]) && 
            is_object($this->connections[$which_connection])) {
            return true;
        } else {
            return false;
        }
    }
861043
def connected?(klass)
      return false if Process.pid != @process_pid.get
      conn = self.retrieve_connection_pool(klass)
      conn && conn.connected?
    end
1320995
private void connected(final MemcachedNode node) {
    assert node.getChannel().isConnected() : "Not connected.";
    int rt = node.getReconnectCount();
    node.connected();

    for (ConnectionObserver observer : connObservers) {
      observer.connectionEstablished(node.getSocketAddress(), rt);
    }
  }
572792
def find_connection(id)
      connections.each do |_, conn|
        return (conn.connected? ? conn : false) if conn && conn.id == id
      end
      false
    end
441549
def _check_kafka_disconnect(self):
        """"""
        for node_id in self.consumer._client._conns:
            conn = self.consumer._client._conns[node_id]
            if conn.state == ConnectionStates.DISCONNECTED or \
                    conn.state == ConnectionStates.DISCONNECTING:
                self._spawn_kafka_connection_thread()
                break
513833
public static boolean isConnected(Context context) {
    if (!hasPermission(context, ACCESS_NETWORK_STATE)) {
      return true; // Assume we have a connection and try to upload.
    }
    ConnectivityManager cm = getSystemService(context, CONNECTIVITY_SERVICE);
    @SuppressLint("MissingPermission")
    NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
    return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
  }
723610
public function isConnected()
    {
        $result = false;
        if($entity = $this->getIterator()->current()) {
            $result = $entity->isConnected();
        }

        return $result;
    }
1200341
function(name) {
    for(var id in this.nodes) {
      var n = this.nodes[id];
      if(n.name == name) return n;
    }
    return false;
  }
390924
function(node) {
            var parent = node.getParent();
            while(parent) {
                if(parent._id === this._id) {
                    return true;
                }
                parent = parent.getParent();
            }

            return false;
        }
747178
def after_connect(self):
        """"""
        # TODO: check if this works.
        show_users = self.device.send("show users", timeout=120)
        result = re.search(pattern_manager.pattern(self.platform, 'connected_locally'), show_users)
        if result:
            self.log('Locally connected to Calvados. Exiting.')
            self.device.send('exit')
            return True
        return False
679263
def close(self, node_id=None):
        
        with self._lock:
            if node_id is None:
                self._close()
                conns = list(self._conns.values())
                self._conns.clear()
                for conn in conns:
                    conn.close()
            elif node_id in self._conns:
                self._conns.pop(node_id).close()
            else:
                log.warning("Node %s not found in current connection list; skipping", node_id)
                return
95410
def find_node_by_id(self, node_list_pyxb, node_id):
        
        for node_pyxb in node_list_pyxb.node:
            # if node_pyxb.baseURL == base_url:
            if d1_common.xml.get_req_val(node_pyxb.identifier) == node_id:
                return node_pyxb
1242805
def _connected(self, link_uri):
        
        print('Connected to %s' % link_uri)
        self._is_link_open = True
        self._connect_event.set()
487569
def visit_Name(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        return node.id
1174115
public function isConnected()
    {
        if ($this->connected === false) {
            return false;
        }

        // Check if the socket is still connected
        if ($this->socket->isConnected() === false) {
            $this->connected = false;

            return false;
        }

        return true;
    }