/*
Returns Channel.merge for `this`, `...channels`.
481062
function merge() {
            for (var _len2 = arguments.length, channels = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
                channels[_key2] = arguments[_key2];
            }

            return Channel.merge.apply(Channel, [this].concat(channels));
        }
860012
function merge() {
		var i,j,args,arg,key,result=[].splice.call(arguments, 0, 1)[0] || {};
		for (i=0; args=arguments[i]; i++) {
			if (! Array.isArray(args)) {args = [args];}
			for (j=0; arg=args[j]; j++) {
				for (key in arg) {result[key] = arg[key];}
			}
		}
		return result;
	}
72609
@Override
    public Channel join(String channelName) {
        if (!connected) {
            throw new NotConnectedException();
        }

        ChannelImpl channel = new ChannelImpl(this, channelName);

        /* Attempt to join */
        if (channel.join()) {
            return channel;
        }

        /* Error while joining */
        return null;
    }
230130
private final int[] robin(int numberOfChannels) {
		if (this.channels == null || this.channels.length != 1) {
			this.channels = new int[1];
		}
		
		int nextChannel = nextChannelToSendTo + 1;
		nextChannel = nextChannel < numberOfChannels ? nextChannel : 0;
		
		this.nextChannelToSendTo = nextChannel;
		this.channels[0] = nextChannel;
		return this.channels;
	}
222571
synchronized public boolean addChannel(final Channel channel)
    {
        boolean newChannel = false;
        if (!this.channels.contains(channel))
        {
            this.channels.add(channel);
            this.channelCount++;
            newChannel = true;
        }
        else
            MeetmeRoom.logger.error("rejecting " + channel + " already in meetme."); //$NON-NLS-1$ //$NON-NLS-2$
        return newChannel;
    }
1205872
function parseChannels(){
        if(_.isArray(channels)) {
            _.each(channels, function(channel) {
                parseChannel(channel);
            });
        }
        else {
            parseChannel(channels);
        }
    }
125593
public function addChannels($channels)
    {
        foreach ($channels as $k => $v) {
            if (preg_match('/^[0-9]+$/', $k)) {
                $this->addChannel($v);
            } else {
                $this->addChannel($k, $v);
            }
        }
        return $this;
    }
1272574
private final int[] robin(int numberOfChannels) {
		final int channel = this.nextChannelToSendTo;
		this.nextChannelToSendTo = channel > 0 ? channel - 1 : numberOfChannels - 1;
		this.channels[0] = channel;
		return this.channels;
	}
816875
public static ConfigurableChannel of(Channel channel) {
    Assert.isTrue(channel instanceof ConfigurableChannel, "The channel {} was not created by Lyra", channel);
    return (ConfigurableChannel) channel;
  }
740299
function merge() {
    assert.object(arguments[0]);
    var obj = {};
    for (var i = 0; i < arguments.length; ++i) {
        _merge(obj, arguments[i]);
    }
    return (obj);
}
25889
def get_channels(self):
        
        selectedItems = self.idx_chan.selectedItems()
        selected_chan = [x.text() for x in selectedItems]
        chan_in_order = []
        for chan in self.chan:
            if chan in selected_chan:
                chan_in_order.append(chan)

        return chan_in_order
477702
public function addChannel(Channel $channel): self
    {
        $channelName = $channel->getName();

        if (!isset($this->channels[$channelName])) {
            $this->channels[$channelName] = $channel;
        }

        return $this;
    }
210969
private ManagedChannel getNextChannel() {
    int currentRequestNum = requestCount.getAndIncrement();
    int index = Math.abs(currentRequestNum % channels.size());
    return channels.get(index);
  }
707947
public Set<String> getChannelNames() {
        Set<String> ret = Collections.EMPTY_SET;

        JsonObject channels = getJsonObject(jsonConfig, "channels");
        if (channels != null) {
            final Set<String> channelNames = channels.keySet();
            if (channelNames != null && !channelNames.isEmpty()) {
                ret = new HashSet<>(channelNames);
            }
        }
        return ret;
    }
311731
def channels(config, network)
      config.integrations.map(&:channels).flatten.select do |channel|
        network == channel.network
      end
    end
333792
function(channel, subscription, context, once) {
      if (!channels[channel]) channels[channel] = [];
      channels[channel].push({fn: subscription, context: context || this, once: once});
    }
645246
public static ChannelUDT channelUDT(final Channel channel) {
        // bytes
        if (channel instanceof NioUdtByteAcceptorChannel) {
            return ((NioUdtByteAcceptorChannel) channel).javaChannel();
        }
        if (channel instanceof NioUdtByteRendezvousChannel) {
            return ((NioUdtByteRendezvousChannel) channel).javaChannel();
        }
        if (channel instanceof NioUdtByteConnectorChannel) {
            return ((NioUdtByteConnectorChannel) channel).javaChannel();
        }

        // message
        if (channel instanceof NioUdtMessageAcceptorChannel) {
            return ((NioUdtMessageAcceptorChannel) channel).javaChannel();
        }
        if (channel instanceof NioUdtMessageRendezvousChannel) {
            return ((NioUdtMessageRendezvousChannel) channel).javaChannel();
        }
        if (channel instanceof NioUdtMessageConnectorChannel) {
            return ((NioUdtMessageConnectorChannel) channel).javaChannel();
        }

        return null;
    }