Set toggle baudrate mask.

        The baudrate mask values are:
          1: 17.241 kbps
          2 : 9.579 kbps
          4 : 8.842 kbps
        These values can be or'ed.
510736
def set_toggle_mask(self, mode_mask, rfm=1):
        
        cmds = {1: 'm', 2: 'M'}
        self._write_cmd('{}{}'.format(mode_mask, cmds[rfm]))
85959
def avg_rate(self):
        
        if not self._has_data or 'sum' not in self.result['end']:
            return None
        bps = self.result['end']['sum']['bits_per_second']
        return bps / 8 / 1024 / 1024
275793
def set_estimate(self, bitrate: int, now_ms: int):
        
        self.current_bitrate = self._clamp_bitrate(bitrate, bitrate)
        self.current_bitrate_initialized = True
        self.last_change_ms = now_ms
557593
private boolean setRangeMask(String ipString, String maskBitsString) {
		byte[] tmpMask = maskBits(maskBitsString);
		if(tmpMask != null) {
			if(setRangeIP(ipString)) {
				mask = tmpMask;
				ip = and(ip,mask);
				return true;
			}
		}
		return false;
	}
1329796
def __vCmdSetCamShutterSpeed(self, args):
        ''''''
        if len(args) == 1:
            for cam in self.camera_list:
                cam.boSetShutterSpeed(int(args[0]))
        elif len(args) == 2:
            cam = self.camera_list[int(args[1])]
            cam.boSetShutterSpeed(int(args[0]))
        else:
            print ("Usage: setCamShutterSpeed SHUTTERVALUE [CAMNUMBER], Shutter value is the devisor in 1/x (only works for values smaller than 1)")
1125236
def channelModeModify(VgcsTargetModeIdentication_presence=0,
                      MultiRateConfiguration_presence=0):
    """"""
    a = TpPd(pd=0x6)
    b = MessageType(mesType=0x8)  # 0001000
    c = ChannelDescription2()
    d = ChannelMode()
    packet = a / b / c / d
    if VgcsTargetModeIdentication is 1:
        e = VgcsTargetModeIdenticationHdr(ieiVTMI=0x01, eightBitVTMI=0x0)
        packet = packet / e
    if MultiRateConfiguration is 1:
        f = MultiRateConfigurationHdr(ieiMRC=0x03, eightBitMRC=0x0)
        packet = packet / f
    return packet
569938
def slice_to_percent_mask(slice_value):
  """"""
  if slice_value is None:
    slice_value = slice(None)
  # Select only the elements of the slice
  selected = set(list(range(100))[slice_value])
  # Create the binary mask
  return [i in selected for i in range(100)]
1246393
def _mask_to_bytes(self, mask):
        
        chunks = []
        shiftmask = (2 ** 64) - 1
        for x in range(16):
            chunks.append(struct.pack('<Q', mask & shiftmask))
            mask >>= 64
        return mitogen.core.b('').join(chunks)
1142645
def setup(self):
        
        # get start and end of the mask and set a start_limit
        if not self.mask_source.start:
            raise SystemExit("Can't parse format of %s. Is this a log file or "
                             "system.profile collection?"
                             % self.mlogfilter.args['mask'])

        self.mask_half_td = timedelta(seconds=self.mlogfilter.args
                                      ['mask_size'] / 2)

        # load filter mask file
        logevent_list = list(self.mask_source)

        # define start and end of total mask
        self.mask_start = self.mask_source.start - self.mask_half_td
        self.mask_end = self.mask_source.end + self.mask_half_td

        # consider --mask-center
        if self.mlogfilter.args['mask_center'] in ['start', 'both']:
            if logevent_list[0].duration:
                self.mask_start -= timedelta(milliseconds=logevent_list[0]
                                             .duration)

        if self.mlogfilter.args['mask_center'] == 'start':
            if logevent_list[-1].duration:
                self.mask_end -= timedelta(milliseconds=logevent_list[-1]
                                           .duration)

        self.start_limit = self.mask_start

        # different center points
        if 'mask_center' in self.mlogfilter.args:
            if self.mlogfilter.args['mask_center'] in ['start', 'both']:
                starts = ([(le.datetime - timedelta(milliseconds=le.duration))
                          if le.duration is not None else le.datetime
                          for le in logevent_list if le.datetime])

            if self.mlogfilter.args['mask_center'] in ['end', 'both']:
                ends = [le.datetime for le in logevent_list if le.datetime]

            if self.mlogfilter.args['mask_center'] == 'start':
                event_list = sorted(starts)
            elif self.mlogfilter.args['mask_center'] == 'end':
                event_list = sorted(ends)
            elif self.mlogfilter.args['mask_center'] == 'both':
                event_list = sorted(zip(starts, ends))

        mask_list = []

        if len(event_list) == 0:
            return

        start_point = end_point = None

        for e in event_list:
            if start_point is None:
                start_point, end_point = self._pad_event(e)
                continue

            next_start = (e[0] if type(e) == tuple else e) - self.mask_half_td
            if next_start <= end_point:
                end_point = ((e[1] if type(e) == tuple else e) +
                             self.mask_half_td)
            else:
                mask_list.append((start_point, end_point))
                start_point, end_point = self._pad_event(e)

        if start_point:
            mask_list.append((start_point, end_point))

        self.mask_list = mask_list
1189190
def get_baudrate_ex_message(baudrate_ex):
        
        baudrate_ex_msgs = {
            Baudrate.BAUDEX_AUTO: "auto baudrate",
            Baudrate.BAUDEX_10kBit: "10 kBit/sec",
            Baudrate.BAUDEX_SP2_10kBit: "10 kBit/sec",
            Baudrate.BAUDEX_20kBit: "20 kBit/sec",
            Baudrate.BAUDEX_SP2_20kBit: "20 kBit/sec",
            Baudrate.BAUDEX_50kBit: "50 kBit/sec",
            Baudrate.BAUDEX_SP2_50kBit: "50 kBit/sec",
            Baudrate.BAUDEX_100kBit: "100 kBit/sec",
            Baudrate.BAUDEX_SP2_100kBit: "100 kBit/sec",
            Baudrate.BAUDEX_125kBit: "125 kBit/sec",
            Baudrate.BAUDEX_SP2_125kBit: "125 kBit/sec",
            Baudrate.BAUDEX_250kBit: "250 kBit/sec",
            Baudrate.BAUDEX_SP2_250kBit: "250 kBit/sec",
            Baudrate.BAUDEX_500kBit: "500 kBit/sec",
            Baudrate.BAUDEX_SP2_500kBit: "500 kBit/sec",
            Baudrate.BAUDEX_800kBit: "800 kBit/sec",
            Baudrate.BAUDEX_SP2_800kBit: "800 kBit/sec",
            Baudrate.BAUDEX_1MBit: "1 MBit/s",
            Baudrate.BAUDEX_SP2_1MBit: "1 MBit/s",
            Baudrate.BAUDEX_USE_BTR01: "BTR0/BTR1 is used",
        }
        return baudrate_ex_msgs.get(baudrate_ex, "BTR is unknown (user specific)")
339369
def toggle_freq(self):
        """"""
        freq = self.frequency

        export_full_on = freq['export_full'].get_value()
        export_band_on = freq['export_band'].get_value()
        freq_on = asarray([export_full_on,
                           export_band_on,
                           freq['plot_on'].get_value(),
                           freq['fooof_on'].get_value()]).any()
        freq['box_param'].setEnabled(freq_on)
        freq['box_output'].setEnabled(freq_on)
        freq['box_nfft'].setEnabled(freq_on)
        freq['box_band'].setEnabled(export_band_on)

        welch_on = freq['welch_on'].get_value() and freq_on
        freq['box_welch'].setEnabled(welch_on)

        if welch_on:
            overlap_on = freq['overlap'].isChecked()
            freq['overlap_val'].setEnabled(overlap_on)
            freq['step_val'].setEnabled(not overlap_on)
            freq['box_output'].setEnabled(not welch_on)
            freq['box_nfft'].setEnabled(not welch_on)
            freq['spectrald'].setChecked(True)

        nfft_fixed_on = freq['nfft_fixed'].isChecked()
        zeropad_on = freq['nfft_zeropad'].isChecked()
        freq['nfft_fixed_val'].setEnabled(nfft_fixed_on)

        epoch_on = self.chunk['epoch'].isChecked()
        rectangular = welch_on or epoch_on or zeropad_on or nfft_fixed_on or \
                        (self.nseg == 1)
        freq['prep'].setEnabled(freq_on)
        if not freq_on:
            freq['prep'].set_value(False)
        freq['export_full'].setEnabled(rectangular)
        freq['plot_on'].setEnabled(rectangular)
        freq['fooof_on'].setEnabled(rectangular)
        freq['box_norm'].setEnabled(freq_on and \
            ((welch_on or nfft_fixed_on or zeropad_on) or \
             (export_band_on and not export_full_on)))
        if not freq['plot_on'].isEnabled():
            freq['plot_on'].set_value(False)
        if not freq['box_norm'].isEnabled():
            freq['norm'].set_value('none')

        dpss_on = freq['taper'].get_value() == 'dpss'
        freq['box_mtap'].setEnabled(dpss_on)

        if dpss_on:
            nhbw_on = freq['nhbw'].get_value()
            freq['nhbw_val'].setEnabled(nhbw_on)

        complex_on = freq['complex'].isChecked()
        freq['sides'].setEnabled(complex_on)
        if complex_on:
            freq['welch_on'].setEnabled(False)
            freq['welch_on'].set_value(False)
        else:
            freq['welch_on'].setEnabled(True)

        norm_evt = freq['norm'].get_value() == 'by mean of event type(s)'
        norm_stage = freq['norm'].get_value() == 'by mean of stage(s)'
        freq['norm_evt_type'].setEnabled(norm_evt)
        freq['norm_stage'].setEnabled(norm_stage)
        freq['norm_concat'].setEnabled(norm_evt or norm_stage)

        nchan = len(self.idx_chan.selectedItems())
        #s2 = (self.nseg == 1 and nchan == 2) or (self.nseg == 2 and nchan == 1)
        freq['box_cross'].setEnabled(nchan == 2 and freq_on)
        if not nchan == 2:
            freq['csd'].set_value(False)
            freq['gainphase'].set_value(False)
            #freq['phaseshift'].set_value(False)
            freq['coh'].set_value(False)

        if True in [freq[x].get_value() for x in ['csd', 'gainphase', 'coh']]:
            freq['spectrald'].setChecked(True)
            freq['box_output'].setEnabled(False)
            #freq['norm'].set_value('none')
            #freq['box_norm'].setEnabled(False)

        fooof_on = freq['fooof_on'].get_value()
        freq['box_fooof'].setEnabled(fooof_on)
139872
public int bitrate_instant(){
    int _link=(seekable ? current_link : 0);
    if(samptrack==0)
      return (-1);
    int ret=(int)(bittrack/samptrack*vi[_link].rate+.5);
    bittrack=0.f;
    samptrack=0.f;
    return (ret);
  }
114218
def set_on_mask(self, mask):
        """"""
        set_cmd = self._create_set_property_msg('_on_mask', 0x02, mask)
        self._send_method(set_cmd, self._property_set)
760491
public void set(ByteBitMask mask, boolean value) {
        this.flag = LogicUtil.setBit(this.flag, mask.getMask(), value);
    }
155155
def set_bit(bitmask, bit, is_on):
    
    bitshift = bit - 1
    if is_on:
        return bitmask | (1 << bitshift)
    return bitmask & (0xff & ~(1 << bitshift))
660519
def refresh_rate(self, value):
        """"""
        if isinstance(value, (int, float)):
            self._refresh_rate = value
502468
def maskQuality(self, umi, umi_quals):
        ''''''
        masked_umi = mask_umi(umi, umi_quals,
                              self.quality_encoding,
                              self.quality_filter_mask)
        if masked_umi != umi:
            self.read_counts['UMI masked'] += 1
            return masked_umi
        else:
            return umi