channel count or 0 for unknown
555290
def channels(self):
        """"""

        # from ProgramConfigElement()
        if hasattr(self, "pce_channels"):
            return self.pce_channels

        conf = getattr(
            self, "extensionChannelConfiguration", self.channelConfiguration)

        if conf == 1:
            if self.psPresentFlag == -1:
                return 0
            elif self.psPresentFlag == 1:
                return 2
            else:
                return 1
        elif conf == 7:
            return 8
        elif conf > 7:
            return 0
        else:
            return conf
1192576
def set(self, channel, state):
        """"""
        checked_val = self._check_dac_val(channel, state)
        self._dac_enabled = 0x40
        self.i2c.write8(self._dac_enabled, checked_val * 255)
199190
def channel(layer, n_channel, batch=None):
  """"""
  if batch is None:
    return lambda T: tf.reduce_mean(T(layer)[..., n_channel])
  else:
    return lambda T: tf.reduce_mean(T(layer)[batch, ..., n_channel])
1137024
def get_num_filters(layer):
    
    # Handle layers with no channels.
    if K.ndim(layer.output) == 2:
        return K.int_shape(layer.output)[-1]

    channel_idx = 1 if K.image_data_format() == 'channels_first' else -1
    return K.int_shape(layer.output)[channel_idx]
88684
def determine_band_channel(kal_out):
    """"""
    band = ""
    channel = ""
    tgt_freq = ""
    while band == "":
        for line in kal_out.splitlines():
            if "Using " in line and " channel " in line:
                band = str(line.split()[1])
                channel = str(line.split()[3])
                tgt_freq = str(line.split()[4]).replace(
                    "(", "").replace(")", "")
        if band == "":
            band = None
    return(band, channel, tgt_freq)
257831
public int minChannel() {
		int c = 0;
		if(getValue(c) > getValue(1)) c=1;
		if(getValue(c) > getValue(2)) c=2;
		return c;
	}
158118
def get_channel_max_user_count(self, channel=None):
        
        if channel is None:
            channel = self.get_network_channel()
        access = self.get_user_access(channel=channel, uid=1)
        return access['channel_info']['max_user_count']
307861
def set_current_limit(self, value, channel=1):
        
        cmd = "I%d %f" % (channel, value)
        self.write(cmd)
1181041
def get_channel(self):
        '''
        
        '''
        c = pygame.mixer.find_channel(not self.dynamic)
        while c is None:
            self.channels += 1
            pygame.mixer.set_num_channels(self.channels)
            c = pygame.mixer.find_channel()
        return c
1303480
def _is_vis(channel):
        """"""
        if isinstance(channel, str):
            return channel == '00_7'
        elif isinstance(channel, int):
            return channel == 1
        else:
            raise ValueError('Invalid channel')
1304183
def broadcast_channel(message, channel):
    
    try:
        socket = CLIENTS[CHANNELS.get(channel, [])[0]][1]
    except (IndexError, KeyError):
        raise NoSocket("There are no clients on the channel: " + channel)
    socket.send_and_broadcast_channel(message, channel)
779771
def distance(self, channel=1):
        
        self._ensure_mode(self.MODE_IR_SEEK)
        channel = self._normalize_channel(channel)
        ret_value = self.value((channel * 2) + 1)

        # The value will be -128 if no beacon is found, return None instead
        return None if ret_value == -128 else ret_value
627705
def packet_get_nb_channels(data):
    """"""

    data_pointer = ctypes.c_char_p(data)

    result = _packet_get_nb_channels(data_pointer)
    if result < 0:
        raise OpusError(result)

    return result
1086776
def set_current_limit(self, channel, value, unit='A'):
        '''
        '''
        # TODO: add units / calibration
        if unit == 'raw':
            value = value
        elif unit == 'A':
            value = int(value * 1000 * self.CURRENT_LIMIT_GAIN)
        elif unit == 'mA':
            value = int(value * self.CURRENT_LIMIT_GAIN)
        elif unit == 'uA':
            value = int(value / 1000 * self.CURRENT_LIMIT_GAIN)
        else:
            raise TypeError("Invalid unit type.")

        I2cAnalogChannel._set_dac_value(self, address=self.CURRENT_LIMIT_DAC_SLAVE_ADD, dac_ch=self.CURRENT_LIMIT_DAC_CH, value=value)
31423
public void getChannelSamples(int channel, double[] interleavedSamples,
                                  double[] channelSamples) {
        int nbChannels = getFormat().getChannels();
        for (int i = 0; i < channelSamples.length; i++) {
            channelSamples[i] = interleavedSamples[nbChannels * i + channel];
        }
    }
960124
def channels_info(self, room_id=None, channel=None, **kwargs):
        """"""
        if room_id:
            return self.__call_api_get('channels.info', roomId=room_id, kwargs=kwargs)
        elif channel:
            return self.__call_api_get('channels.info', roomName=channel, kwargs=kwargs)
        else:
            raise RocketMissingParamException('roomId or channel required')
818142
def update_channels(self):
        ''''''
        self.interlock_channel = -1
        self.override_channel = -1
        self.zero_I_channel = -1
        self.no_vtol_channel = -1

        # output channels
        self.rsc_out_channel = 9
        self.fwd_thr_channel = 10

        for ch in range(1,16):
            option = self.get_mav_param("RC%u_OPTION" % ch, 0)
            if option == 32:
                self.interlock_channel = ch;
            elif option == 63:
                self.override_channel = ch;
            elif option == 64:
                self.zero_I_channel = ch;
            elif option == 65:
                self.override_channel = ch;
            elif option == 66:
                self.no_vtol_channel = ch;

            function = self.get_mav_param("SERVO%u_FUNCTION" % ch, 0)
            if function == 32:
                self.rsc_out_channel = ch
            if function == 70:
                self.fwd_thr_channel = ch