Checks that all channels associated with an integration belong to a valid
 network.

 @param integration [Integration] the integration to check
17984
def check_channels!(integration)
      integration.channels.map(&:network).map(&:name).each do |network|
        find_network!(network)
      end
    end
972883
def find_integration!(name)
      integration = find_integration(name)
      return integration unless integration.nil?

      raise CommandError, "an integration with the name #{name.inspect} " \
                          'does not exist'
    end
109720
def validate
      target_proxies = @proxies.dup
      target_proxies_lock = Mutex.new
      connectable_proxies = []
      connectable_proxies_lock = Mutex.new
      threads = []

      ProxyFetcher.config.pool_size.times do
        threads << Thread.new do
          loop do
            proxy = target_proxies_lock.synchronize { target_proxies.shift }
            break unless proxy

            connectable_proxies_lock.synchronize { connectable_proxies << proxy } if proxy.connectable?
          end
        end
      end

      threads.each(&:join)

      @valid_proxies = connectable_proxies
    end
1163036
function verifyImplementations(interfaces, target) {
    for (var
      current,
      key,
      i = 0; i < interfaces.length; i++
    ) {
      current = interfaces[i];
      for (key in current) {
        if (hOP.call(current, key) && !hOP.call(target, key)) {
          warn(key.toString() + ' is not implemented');
        }
      }
    }
  }
953615
def _on_namreply(self, connection, event):
        

        ch_type, channel, nick_list = event.arguments

        if channel == '*':
            # User is not in any visible channel
            # http://tools.ietf.org/html/rfc2812#section-3.2.5
            return

        for nick in nick_list.split():
            nick_modes = []

            if nick[0] in self.connection.features.prefix:
                nick_modes.append(self.connection.features.prefix[nick[0]])
                nick = nick[1:]

            for mode in nick_modes:
                self.channels[channel].set_mode(mode, nick)

            self.channels[channel].add_user(nick)
586282
def part(self, channel):
        
        
        if channel in self.channels:
            channel.users.remove(self.nick)
            self.channels.remove(channel)
457953
def interconnect_all(self):
        """"""
        for dep in topologically_sorted(self._provides):
            if hasattr(dep, '__injections__') and not hasattr(dep, '__injections_source__'):
                self.inject(dep)
746284
def isConnected(self, signal, slot):
        
        sig_calls = self._callbacks.get(signal, [])
        for callback in sig_calls:
            if callback == slot:
                return True
        return False
630209
private boolean checkRingLink(IRingSet ringSet, IAtomContainer ac, IAtom atom) {
        List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
        if (ringSet.contains(atom)) {
            return true;
        }
        for (IAtom neighbour : neighbours) {
            if (ringSet.contains(neighbour)) {
                return true;
            }
        }
        return false;
    }
101408
def validate_network_topology(network_id,**kwargs):
    

    user_id = kwargs.get('user_id')
    try:
        net_i = db.DBSession.query(Network).filter(Network.id == network_id).one()
        net_i.check_write_permission(user_id=user_id)
    except NoResultFound:
        raise ResourceNotFoundError("Network %s not found"%(network_id))

    nodes = []
    for node_i in net_i.nodes:
        if node_i.status == 'A':
            nodes.append(node_i.node_id)

    link_nodes = []
    for link_i in net_i.links:
        if link_i.status != 'A':
            continue
        if link_i.node_1_id not in link_nodes:
            link_nodes.append(link_i.node_1_id)

        if link_i.node_2_id not in link_nodes:
            link_nodes.append(link_i.node_2_id)

    nodes = set(nodes)
    link_nodes = set(link_nodes)

    isolated_nodes = nodes - link_nodes

    return isolated_nodes
628884
def hasChannelType(self, chan):
        
        if self._chantypes is None:
            self._initChannelTypesList()
        return chan in self._chantypes
240144
def is_connected(self):
        
        nids = set(self._nodeids)  # the nids left to find
        if len(nids) == 0:
            raise XmrsError('Cannot compute connectedness of an empty Xmrs.')
        # build a basic dict graph of relations
        edges = []
        # label connections
        for lbl in self.labels():
            lblset = self.labelset(lbl)
            edges.extend((x, y) for x in lblset for y in lblset if x != y)
        # argument connections
        _vars = self._vars
        for nid in nids:
            for rarg, tgt in self.args(nid).items():
                if tgt not in _vars:
                    continue
                if IVARG_ROLE in _vars[tgt]['refs']:
                    tgtnids = list(_vars[tgt]['refs'][IVARG_ROLE])
                elif tgt in self._hcons:
                    tgtnids = list(self.labelset(self.hcon(tgt)[2]))
                elif 'LBL' in _vars[tgt]['refs']:
                    tgtnids = list(_vars[tgt]['refs']['LBL'])
                else:
                    tgtnids = []
                # connections are bidirectional
                edges.extend((nid, t) for t in tgtnids if nid != t)
                edges.extend((t, nid) for t in tgtnids if nid != t)
        g = {nid: set() for nid in nids}
        for x, y in edges:
            g[x].add(y)
        connected_nids = _bfs(g)
        if connected_nids == nids:
            return True
        elif connected_nids.difference(nids):
            raise XmrsError(
                'Possibly bogus nodeids: {}'
                .format(', '.join(connected_nids.difference(nids)))
            )
        return False
756713
private boolean checkForActiveConnections(int value) {
        /*
         * Check for active connections in the SharedPool
         */
        boolean activeConnections = false;

        /*
         * We have active connections or active pool requests if active requests
         * > 0 or the pool state is not = 1. In either case, we will consider the
         * pool active if statement is true.
         */
        if (value == 0) {
            mcToMCWMapWrite.lock();
            try {
                Collection<MCWrapper> mcWrappers = mcToMCWMap.values();
                Iterator<MCWrapper> mcWrapperIt = mcWrappers.iterator();
                while (mcWrapperIt.hasNext()) {
                    MCWrapper mcw = mcWrapperIt.next();
                    /*
                     * We have atleast one active connection.
                     */
                    /*
                     * If the value is zero, both tests are used.
                     */
                    if (activeRequest.get() > 0) {
                        activeConnections = true;
                        break;
                    } else {
                        int poolState = mcw.getPoolState();
                        if ((poolState != 1) && (poolState != 9)) {
                            activeConnections = true;
                            break;
                        }
                    }
                }
            } finally {
                mcToMCWMapWrite.unlock();
            }
        } else {
            /*
             * Only activeRequest is used.
             */
            if (activeRequest.get() > 0) {
                activeConnections = true;
            }
        }

        return activeConnections;
    }
1152586
def included(plugin_receiver)
      return if plugin_receiver.include?(self.much_plugin_included_detector)
      plugin_receiver.send(:include, self.much_plugin_included_detector)

      self.much_plugin_included_hooks.each do |hook|
        plugin_receiver.class_eval(&hook)
      end
    end
1207475
def _ensure_channel_connected(self, destination_id):
        
        if destination_id not in self._open_channels:
            self._open_channels.append(destination_id)

            self.send_message(
                destination_id, NS_CONNECTION,
                {MESSAGE_TYPE: TYPE_CONNECT,
                 'origin': {},
                 'userAgent': 'PyChromecast',
                 'senderInfo': {
                     'sdkType': 2,
                     'version': '15.605.1.3',
                     'browserVersion': "44.0.2403.30",
                     'platform': 4,
                     'systemVersion': 'Macintosh; Intel Mac OS X10_10_3',
                     'connectionType': 1}},
                no_add_request_id=True)
1082854
def channel_is_settled(
            self,
            participant1: Address,
            participant2: Address,
            block_identifier: BlockSpecification,
            channel_identifier: ChannelID,
    ) -> bool:
        
        try:
            channel_state = self._get_channel_state(
                participant1=participant1,
                participant2=participant2,
                block_identifier=block_identifier,
                channel_identifier=channel_identifier,
            )
        except RaidenRecoverableError:
            return False
        return channel_state >= ChannelState.SETTLED
1117056
def isdisjoint(self, other):
        
        def isdisjoint_trans_pure(pipe):
            return not pipe.sinter(self.key, other.key)

        def isdisjoint_trans_mixed(pipe):
            self_values = set(self.__iter__(pipe))
            if use_redis:
                other_values = set(other.__iter__(pipe))
            else:
                other_values = set(other)

            return self_values.isdisjoint(other_values)

        if self._same_redis(other):
            return self._transaction(isdisjoint_trans_pure, other.key)
        if self._same_redis(other, RedisCollection):
            use_redis = True
            return self._transaction(isdisjoint_trans_mixed, other.key)

        use_redis = False
        return self._transaction(isdisjoint_trans_mixed)