Run Kalibrate.

        Supported keyword arguments:
        gain    -- Gain in dB
        device  -- Index of device to be used
        error   -- Initial frequency error in ppm
343443
def scan_channel(self, channel, **kwargs):
        

        kal_run_line = fn.build_kal_scan_channel_string(self.kal_bin,
                                                        channel, kwargs)
        raw_output = subprocess.check_output(kal_run_line.split(' '),
                                             stderr=subprocess.STDOUT)
        kal_normalized = fn.parse_kal_channel(raw_output)
        return kal_normalized
451945
def apply(self, data):
        

        # flag bad ants
        if self.flagants:
            badants = self.calc_flag()
        else:
            badants = n.array([[]])

        # apply gain correction
        if hasattr(self, 'bandpass'):
            corr = n.ones_like(data)
            flag = n.ones_like(data.real).astype('int')
            chans_uncal = range(len(self.freqs))
            for spwi in range(len(self.spwind)):
                chsize = n.round(self.bpfreq[1]-self.bpfreq[0], 0)
                ww = n.where( (self.freqs >= self.bpfreq[self.spwind[spwi]*1000]) & (self.freqs <= self.bpfreq[(self.spwind[spwi]+1)*1000-1]+chsize) )[0]
                if len(ww) == 0:
                    self.logger.info('Gain solution frequencies not found in data for spw %d.' % (self.spwind[spwi]))
                firstch = ww[0]
                lastch = ww[-1]+1
                for ch in ww:
                    chans_uncal.remove(ch)
                self.logger.info('Combining gain sol from spw=%d with BW chans from %d-%d' % (self.spwind[spwi], firstch, lastch))
                for badant in n.transpose(badants):
                    if badant[1] == spwi:
                        badbl = n.where((badant[0] == n.array(self.ant1ind)) | (badant[0] == n.array(self.ant2ind)))[0]
                        flag[:, badbl, firstch:lastch, badant[2]] = 0

                corr1 = self.gain[self.ant1ind, spwi, :][None, :, None, :] * self.bandpass[self.ant1ind, firstch:lastch, :][None, :, :, :]
                corr2 = (self.gain[self.ant2ind, spwi, :][None, :, None, :] * self.bandpass[self.ant2ind, firstch:lastch, :][None, :, :, :]).conj()

                corr[:, :, firstch:lastch, :] = corr1 * corr2
            if len(chans_uncal):
                self.logger.info('Setting data without bp solution to zero for chans %s.' % (chans_uncal))
                flag[:, :, chans_uncal,:] = 0
            data[:] *= flag/corr
        else:
            for spw in range(len(self.gain[0,0])):
                pass
1268944
def run(signals=Signal.list.keys)
            if mounted?
                begin
                    traps = trap_signals(*signals)
                    self.loop()
                ensure
                    traps.each { |t| Signal.trap(t,"DEFAULT") }
                    unmount()
                end
            end
        end
581274
def highshelf(self, gain=-20.0, frequency=3000, slope=0.5):
        
        self.command.append('treble')
        self.command.append(gain)
        self.command.append(frequency)
        self.command.append(slope)
        return self
54853
def run(self, out, model_inputs, X):
        
        feed_dict = dict(zip(model_inputs, X))
        for t in self.learning_phase_flags:
            feed_dict[t] = False
        return self.session.run(out, feed_dict)
951944
public synchronized void setVolume(float gain)
	{
		if (currentVolume != gain)
		{
			currentVolume = gain;
		    if (sourceLine!=null && sourceLine.isControlSupported(FloatControl.Type.MASTER_GAIN))
		    {
		    	FloatControl gainControl = (FloatControl)sourceLine.getControl(FloatControl.Type.MASTER_GAIN);
		        float dB = (float)(Helpers.getDBValueFrom(gain));
		        if (dB > gainControl.getMaximum()) dB = gainControl.getMaximum();
		        else
		        if (dB < gainControl.getMinimum()) dB = gainControl.getMinimum();
	        	gainControl.setValue(dB);
		    }
		}
	}
97177
def read_gain_from_frames(frame_filenames, gain_channel_name, start_time, end_time):
    '''
    
    '''

    # get timeseries from frame
    gain = frame.read_frame(frame_filenames, gain_channel_name,
                      start_time=start_time, end_time=end_time)

    return gain[0]
3671
function gain(options) {
	// gain()
	if (options == null) options = {volume: 1};

	// gain(Function)
	// gain(Number)
	else if (typeof options === 'function' || typeof options === 'number')  options = {volume: options};

	var volume;
	if (options.mode === 'tan') {
		volume = Math.tan(options.volume);
	} else {
		volume = options.volume;
	}

	//in case if volume is fn
	if (typeof volume === 'function') return buf => util.fill(buf, (v, x, channels) => v * volume(x, channels, v));

	return buf => util.fill(buf, v => v * volume);
}
456661
def run(self, args):
        
        kwargs = {}
        kwargs['path'] = args.file[0]
        kwargs['addr'] = args.addr
        kwargs['on_progress'] = pylink.util.flash_progress_callback

        jlink = self.create_jlink(args)
        _ = jlink.flash_file(**kwargs)
        print('Flashed device successfully.')
1265475
def run(self):
        ''''''
        out = nl.run(self.command_list(),products=self.prefix)
        if out and out.output:
            sds_list = re.findall(r'Stimulus: (.*?) *\n +h\[ 0\] norm\. std\. dev\. = +(\d+\.\d+)',out.output)
            self.stim_sds = {}
            for s in sds_list:
                self.stim_sds[s[0]] = float(s[1])
61080
def run_fib_with_stats(r):
    
    for i in range(r):
        res = fib(PythonInt(FIB))
        if RESULT != res:
            raise ValueError("Expected %d, Got %d" % (RESULT, res))
135037
def run_mace_smothr(x, y, bass_enhancement=0.0):  # pylint: disable=unused-argument
    """"""
    N = len(x)
    weight = numpy.ones(N)
    results = numpy.zeros(N)
    flags = numpy.zeros((N, 7))
    mace.smothr(1, x, y, weight, results, flags)
    return results
484452
def call(self, params, _context, **kwargs):
        ''''''

        assert len(params) == self.paramCount
        # using setattr because '=' is not allowed inside of lambdas
        return evaluate_impl(self.body, params).then(lambda value: setattr(_context.results, 'value', value))
765193
def build_kal_scan_channel_string(kal_bin, channel, args):
    """"""
    option_mapping = {"gain": "-g",
                      "device": "-d",
                      "error": "-e"}
    base_string = "%s -v -c %s" % (kal_bin, channel)
    base_string += options_string_builder(option_mapping, args)
    return(base_string)
574050
def run(self, n_iter=-1, bg=False):
        
        if n_iter == -1:
            if not self.eval_at:
                raise ValueError('Set n_iter or define evaluate_at.')

            n_iter = self.eval_at[-1] + 1

        self._running.set()

        if bg:
            self._t = threading.Thread(target=lambda: self._run(n_iter))
            self._t.start()
        else:
            self._run(n_iter)
1177331
def lowshelf(self, gain=-20.0, frequency=100, slope=0.5):
        
        self.command.append('bass')
        self.command.append(gain)
        self.command.append(frequency)
        self.command.append(slope)
        return self
819064
public void tryVibrate() {
        if (mVibrator != null && mIsGloballyEnabled) {
            long now = SystemClock.uptimeMillis();
            // We want to try to vibrate each individual tick discretely.
            if (now - mLastVibrate >= VIBRATE_DELAY_MS) {
                mVibrator.vibrate(VIBRATE_LENGTH_MS);
                mLastVibrate = now;
            }
        }
    }