Add a pulse for a specific GPIO to a dma channel subcycle. `start` and
    `width` are multiples of the pulse-width increment granularity.
493748
def add_channel_pulse(dma_channel, gpio, start, width):
    
    return _PWM.add_channel_pulse(dma_channel, gpio, start, width)
1224393
def set_start(self,time,pad = None):
    
    if pad:
      self.add_var_opt('gps-start-time', int(time)-int(pad))
    else:
      self.add_var_opt('gps-start-time', int(time))
    self.__start = time
    self.__set_output()
244360
def insert(self, n=1, interval=0, pre_dl=None, post_dl=None):
        
        self.delay(pre_dl)
        self.k.tap_key(self.k.insert_key, n, interval)
        self.delay(post_dl)
736958
def write(self, pin, value):
        
        port, pin = self.pin_to_port(pin)
        portname = 'A'
        if port == 1:
            portname = 'B'
        self._update_register('GPIO' + portname, pin, value)
        self.sync()
3064
def subscribe(self, receiver):
        ""
        log.debug('{0}.{1} subscribe to {2}'
                  .format(receiver.__module__, receiver.__name__, self))
        self.signal.connect(receiver)
632012
def cmd_part(self, connection, sender, target, payload):
        
        if payload:
            connection.part(payload)
        else:
            raise ValueError("No channel given")
92675
def set_servo(self, channel, pwm):
        ''''''
        self.mav.command_long_send(self.target_system, self.target_component,
                                   mavlink.MAV_CMD_DO_SET_SERVO, 0,
                                   channel, pwm,
                                   0, 0, 0, 0, 0)
1277327
def _add_delta_tdi(self, other):
        
        assert isinstance(self.freq, Tick)  # checked by calling function

        delta = self._check_timedeltalike_freq_compat(other)
        return self._addsub_int_array(delta, operator.add).asi8
903123
def startMultiple(self, zones):
        """"""
        path = 'zone/start_multiple'
        payload = {'zones': zones}
        return self.rachio.put(path, payload)
1326258
def connect_input(self, wire):
        """"""
        self._input = wire
        wire.sinks.append(self)
1117089
def set_continuous(self, freq, amplitude, offset, phase, channel=2):
        """"""
        commands = [':SOUR{0}:APPL:SIN '.format(channel),
                    '{0},'.format(freq),
                    '{0},'.format(amplitude),
                    '{0},'.format(offset),
                    '{0}'.format(phase),
                    ]

        command_string = ''.join(commands)
        logging.info(command_string)
        self.instr.write(command_string)
1137120
def _add_flow_v1_2(self, src, port, timeout, datapath):
        """"""
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        match = parser.OFPMatch(
            in_port=port, eth_src=src, eth_type=ether.ETH_TYPE_SLOW)
        actions = [parser.OFPActionOutput(
            ofproto.OFPP_CONTROLLER, ofproto.OFPCML_MAX)]
        inst = [parser.OFPInstructionActions(
            ofproto.OFPIT_APPLY_ACTIONS, actions)]
        mod = parser.OFPFlowMod(
            datapath=datapath, command=ofproto.OFPFC_ADD,
            idle_timeout=timeout, priority=65535,
            flags=ofproto.OFPFF_SEND_FLOW_REM, match=match,
            instructions=inst)
        datapath.send_msg(mod)
842936
def add_transient(d, data, u, v, w, l1, m1, i, s, dm=0, dt=1):
    

    ang = lambda ch: l1 * u * d['freq'][ch]/d['freq_orig'][0] + m1 * v * d['freq'][ch]/d['freq_orig'][0]
    delay = lambda ch: n.round(4.1488e-3 * dm * (d['freq'][ch]**(-2) - d['freq'][-1]**(-2))/d['inttime'], 0).astype(int)

    #snr_ideal = s/(data[i].real.std()/n.sqrt(d['npol']*d['nbl']*d['nchan']))
    #logger.info('SNR of source with system brightness %.1f = %d (idealized; ok at low SNR)' % (s, int(snr_ideal)))

    for ch in range(d['nchan']):
        data[i+delay(ch):i+delay(ch)+dt, :, ch] += s * n.exp(2j*n.pi*ang(ch)[None,:,None])
105726
def cmd_join(self, connection, sender, target, payload):
        
        if payload:
            connection.join(payload)
        else:
            raise ValueError("No channel given")
519782
def set_all_pwm(self, on, off):
        """"""
        self.i2c.write8(ALL_LED_ON_L, on & 0xFF)
        self.i2c.write8(ALL_LED_ON_H, on >> 8)
        self.i2c.write8(ALL_LED_OFF_L, off & 0xFF)
        self.i2c.write8(ALL_LED_OFF_H, off >> 8)
1331317
def set_current(self, channel, value, unit='A'):
        '''
        '''
        dac_offset = self._ch_cal[channel]['DAC']['offset']
        dac_gain = self._ch_cal[channel]['DAC']['gain']
        if unit == 'raw':
            value = value
        elif unit == 'A':
            value = int((-value * 1000000 - dac_offset) / dac_gain)  # fix sign of output
        elif unit == 'mA':
            value = int((-value * 1000 - dac_offset) / dac_gain)  # fix sign of output
        elif unit == 'uA':
            value = int((-value - dac_offset) / dac_gain)  # fix sign of output
        else:
            raise TypeError("Invalid unit type.")

        self._set_dac_value(channel=channel, value=value)
243632
def _set_pwm(self, raw_values):
        
        for i in range(len(self._pins)):
            self._pi.set_PWM_dutycycle(self._pins[i], raw_values[i])