Control the drones LED.

    Parameters:
    seq -- sequence number
    anim -- Integer: animation to play
    f -- Float: frequency in HZ of the animation
    d -- Integer: total duration in seconds of the animation
423577
def led(host, seq, anim, f, d):
    
    at(host, 'LED', seq, [anim, float(f), d])
1088885
def subseq(cls, fasta, start=None, stop=None, strand=None):
        
        start = start - 1 if start is not None else 0
        stop = stop if stop is not None else len(fasta)

        if start < 0:
            msg = "start ({0}) must > 0 of `{1}`. Reset to 1".\
                        format(start + 1, fasta.id)
            logging.error(msg)
            start = 0

        if stop > len(fasta):
            msg = "stop ({0}) must be <= length of `{1}` ({2}). Reset to {2}.".\
                        format(stop, fasta.id, len(fasta))
            logging.error(msg)
            stop = len(fasta)

        seq = fasta.seq[start:stop]

        if strand in (-1, '-1', '-'):
            seq = seq.reverse_complement()

        return seq
852559
def highlightSubsequence(sequence, x1, x2, start=' [', stop = '] ') :
	"""'"""

	seq = list(sequence)
	print x1, x2-1, len(seq)
	seq[x1] = start + seq[x1]
	seq[x2-1] = seq[x2-1] + stop
	return ''.join(seq)
293284
def build_sequence(self, xs, masks, init, is_left_to_right):
        '''
        
        '''
        states = []
        last = init
        if is_left_to_right:
            for i, xs_i in enumerate(xs):
                h = self.build(xs_i, last, masks[i])
                states.append(h)
                last = h
        else:
            for i in range(len(xs) - 1, -1, -1):
                h = self.build(xs[i], last, masks[i])
                states.insert(0, h)
                last = h
        return states
611285
function flyToPosition(scene, position, durationMilliseconds) {
  var camera = scene.camera;
  var startPosition = camera.position;
  var endPosition = position;

  durationMilliseconds = defaultValue(durationMilliseconds, 200);

  var initialEnuToFixed = Transforms.eastNorthUpToFixedFrame(
    startPosition,
    Ellipsoid.WGS84
  );

  var initialEnuToFixedRotation = new Matrix4();
  Matrix4.getRotation(initialEnuToFixed, initialEnuToFixedRotation);

  var initialFixedToEnuRotation = new Matrix3();
  Matrix3.transpose(initialEnuToFixedRotation, initialFixedToEnuRotation);

  var initialEnuUp = new Matrix3();
  Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.up, initialEnuUp);

  var initialEnuRight = new Matrix3();
  Matrix3.multiplyByVector(
    initialFixedToEnuRotation,
    camera.right,
    initialEnuRight
  );

  var initialEnuDirection = new Matrix3();
  Matrix3.multiplyByVector(
    initialFixedToEnuRotation,
    camera.direction,
    initialEnuDirection
  );

  var controller = scene.screenSpaceCameraController;
  controller.enableInputs = false;

  scene.tweens.add({
    duration: durationMilliseconds / 1000.0,
    easingFunction: Tween.Easing.Sinusoidal.InOut,
    startObject: {
      time: 0.0
    },
    stopObject: {
      time: 1.0
    },
    update: function(value) {
      scene.camera.position.x = CesiumMath.lerp(
        startPosition.x,
        endPosition.x,
        value.time
      );
      scene.camera.position.y = CesiumMath.lerp(
        startPosition.y,
        endPosition.y,
        value.time
      );
      scene.camera.position.z = CesiumMath.lerp(
        startPosition.z,
        endPosition.z,
        value.time
      );

      var enuToFixed = Transforms.eastNorthUpToFixedFrame(
        camera.position,
        Ellipsoid.WGS84
      );

      var enuToFixedRotation = new Matrix3();
      Matrix4.getRotation(enuToFixed, enuToFixedRotation);

      camera.up = Matrix3.multiplyByVector(
        enuToFixedRotation,
        initialEnuUp,
        camera.up
      );
      camera.right = Matrix3.multiplyByVector(
        enuToFixedRotation,
        initialEnuRight,
        camera.right
      );
      camera.direction = Matrix3.multiplyByVector(
        enuToFixedRotation,
        initialEnuDirection,
        camera.direction
      );
    },
    complete: function() {
      controller.enableInputs = true;
    },
    cancel: function() {
      controller.enableInputs = true;
    }
  });
}
59367
def set_query_sequence(self,seq):
    
    self._options = self._options.replace(query_sequence = seq)
325315
def iosequence(seq):
        
        lines = Lines()
        lines.add(1, 'cdef public bint _%s_diskflag' % seq.name)
        lines.add(1, 'cdef public str _%s_path' % seq.name)
        lines.add(1, 'cdef FILE *_%s_file' % seq.name)
        lines.add(1, 'cdef public bint _%s_ramflag' % seq.name)
        ctype = 'double' + NDIM2STR[seq.NDIM+1]
        lines.add(1, 'cdef public %s _%s_array' % (ctype, seq.name))
        return lines
318600
def _transition(self, duration, hue=None, brightness=None):
        
        # Calculate brightness steps.
        b_steps = 0
        if brightness is not None:
            b_steps = steps(self.brightness,
                            brightness, self.command_set.brightness_steps)
            b_start = self.brightness
        # Calculate hue steps.
        h_steps = 0
        if hue is not None:
            h_steps = steps(self.hue,
                            hue, self.command_set.hue_steps)
            h_start = self.hue
        # Compute ideal step amount (at least one).
        total_steps = max(b_steps, h_steps, 1)
        total_commands = b_steps + h_steps
        # Calculate wait.
        wait = self._wait(duration, total_steps, total_commands)
        # Scale down steps if no wait time.
        if wait == 0:
            b_steps, h_steps = self._scale_steps(duration, total_commands,
                                                 b_steps, h_steps)
            total_steps = max(b_steps, h_steps, 1)
        # Perform transition.
        for i in range(total_steps):
            # Brightness.
            if b_steps > 0 and i % math.ceil(total_steps/b_steps) == 0:
                self.brightness = util.transition(i, total_steps,
                                                  b_start, brightness)
            # Hue.
            if h_steps > 0 and i % math.ceil(total_steps/h_steps) == 0:
                self.hue = util.transition(i, total_steps,
                                           h_start, hue)
            # Wait.
            time.sleep(wait)
932131
def arpeggio(pattern, point):
    
    point['sequence'] = HSeq(point['sequence'][i] for i in pattern)
    return point
600767
def colorate(sequence, colormap="", start=0, length=None):
    
    n = start
    colors = color_space(colormap, sequence, start=0.1, stop=0.9, length=length)
    for elem in sequence:
        yield n, colors[n-start], elem
        n += 1
244709
def _run_sequence(self, sequence):
        '''
        
        '''
        self._check_pause()
        self._pre_test()
        session_data = self.target.get_session_data()
        self._test_info()
        resp = None
        for edge in sequence:
            if edge.callback:
                edge.callback(self, edge, resp)
            session_data = self.target.get_session_data()
            node = edge.dst
            node.set_session_data(session_data)
            resp = self._transmit(node)
        return self._post_test()
884997
def visualise(seq, sort=lambda x: x[0]):
    """"""
    frmt = "{:6} {:8,d} {}"
    if isinstance(seq, dict):
        seq = seq.items()
    if sort:
        seq = sorted(seq, key=sort)
    mx, mn = max([i[1] for i in seq]), min([i[1] for i in seq])  
    range = mx - mn
    for i in seq:
        v = int((i[1] * 100) / range)
        print (frmt.format(i[0], i[1], "*" * v))
315133
def forward(self, sequence):
        
        data = self.input_block(sequence)

        for idx in range(len(self.recurrent_layers)):
            data, _ = self.recurrent_layers[idx](data)

            if self.dropout_layers:
                data = self.dropout_layers[idx](data)

        data = self.output_layer(data)

        return self.output_activation(data)
104393
public static void animate(View imageView, int durationMillis) {
		if (imageView != null) {
			AlphaAnimation fadeImage = new AlphaAnimation(0, 1);
			fadeImage.setDuration(durationMillis);
			fadeImage.setInterpolator(new DecelerateInterpolator());
			imageView.startAnimation(fadeImage);
		}
	}
1266284
def view_seq(self, seq):
        
        log.debug('Viewing sequence %s', seq.name)
        self.cur_seq = None
        self.pages_tabw.setCurrentIndex(2)
        self.seq_name_le.setText(seq.name)
        self.seq_prj_le.setText(seq.project.name)
        self.seq_desc_pte.setPlainText(seq.description)

        shotrootdata = treemodel.ListItemData(['Name', "Description", "Duration", "Start", "End"])
        shotrootitem = treemodel.TreeItem(shotrootdata)
        for shot in seq.shot_set.all():
            shotdata = djitemdata.ShotItemData(shot)
            treemodel.TreeItem(shotdata, shotrootitem)
        self.seq_shot_model = treemodel.TreeModel(shotrootitem)
        self.seq_shot_tablev.setModel(self.seq_shot_model)
        self.cur_seq = seq
1252211
def seqs_to_stream(seqs, ih):
    
    if ih == '_input_as_multiline_string':
        recs = FastaFinder(seqs.split('\n'))
    elif ih == '_input_as_string':
        recs = FastaFinder(open(seqs))
    elif ih == '_input_as_seqs':
        recs = [['>'+str(i), s] for i, s in enumerate(seqs)]
    elif ih == '_input_as_lines':
        recs = FastaFinder(seqs)
    else:
        raise TypeError, "Unknown input handler %s" % ih
    return recs
897400
public final static float PID(String seq1, String seq2) {
		return PID(seq1, seq2, 0, seq1.length());
	}