// Up tells the drone to ascend. Pass in an int from 0-100.
519345
func (d *Driver) Up(val int) error {
	d.cmdMutex.Lock()
	defer d.cmdMutex.Unlock()

	d.ly = float32(val) / 100.0
	return nil
}
434642
func (t *LLRB) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) {
	t.ascendRange(t.root, greaterOrEqual, lessThan, iterator)
}
1278251
func (c *Cursor) Up(n int) {
	fmt.Fprintf(c.Out, "\x1b[%dA", n)
}
1010739
func (srv *Instance) UpTime() int64 {
	return int64(time.Now().Sub(srv.startTime).Seconds())
}
120493
func (m *postgresMigrator) Up(migrations map[int]MigrationFunc) (int, error) {
	return m.UpTo(len(migrations), migrations)
}
100163
func (api *LoadBalancerAPI) IsUp(id int64) (bool, error) {
	lb, err := api.Read(id)
	if err != nil {
		return false, err
	}
	return lb.Instance.IsUp(), nil
}
1291288
func (v *TreeVertex) AddDescendant(u *TreeVertex) *TreeVertex {
	v.Descendants = append(v.Descendants, u)
	return u
}
1233656
func (mr *MockUpgraderMockRecorder) PerformUpgrade() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PerformUpgrade", reflect.TypeOf((*MockUpgrader)(nil).PerformUpgrade))
}
963042
func (s *NodesStatsService) Level(level string) *NodesStatsService {
	s.level = level
	return s
}
1284245
func (mc *MyCounter) Down(max int64, w io.Writer) error {
	if max == 11 {
		return fmt.Errorf("we don't *do* elevensies")
	}
	e := json.NewEncoder(w)
	for ix := int64(0); ix <= max; ix++ {
		r := max - ix
		fmt.Printf("Iteration %d\n", r)
		_ = e.Encode(models.Mark{Remains: &r})
		if ix != max {
			time.Sleep(1 * time.Second)
		}
	}
	return nil
}
924148
func UpValue(l *State, function, index int) (name string, ok bool) {
	if c, isClosure := l.indexToValue(function).(closure); isClosure {
		if ok = 1 <= index && index <= c.upValueCount(); ok {
			if c, isLua := c.(*luaClosure); isLua {
				name = c.prototype.upValues[index-1].name
			}
			l.apiPush(c.upValue(index - 1))
		}
	}
	return
}
447947
func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) {
	if t.root == nil {
		return
	}
	t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator)
}
456683
func (d *BMP085) Altitude() (float64, error) {
	if err := d.calibrate(); err != nil {
		return 0, err
	}

	select {
	case altitude := <-d.altitudes:
		return altitude, nil
	default:
		glog.V(1).Info("bcm085: no altitudes available... measuring")
		_, altitude, err := d.measurePressureAndAltitude()
		if err != nil {
			return 0, err
		}
		return altitude, nil
	}
}
1195267
func (v *vserver) up(ip seesaw.IP) {
	ncc := v.engine.ncc
	if err := ncc.Dial(); err != nil {
		log.Fatalf("%v: failed to connect to NCC: %v", v, err)
	}
	defer ncc.Close()

	v.active[ip] = true
	v.updateServices(ip)

	// If this is an anycast VIP, start advertising a BGP route.
	nip := ip.IP()
	if seesaw.IsAnycast(nip) {
		// TODO(jsing): Create an LBVserver that only encapsulates
		// the necessary state, rather than storing a full vserver
		// snapshot.
		lbVserver := v.snapshot()
		lbVserver.Services = nil
		lbVserver.Warnings = nil
		if err := v.engine.lbInterface.AddVserver(lbVserver, ip.AF()); err != nil {
			log.Fatalf("%v: failed to add Vserver: %v", v, err)
		}
		v.lbVservers[ip] = lbVserver

		vip := seesaw.NewVIP(nip, nil)
		if err := v.engine.lbInterface.AddVIP(vip); err != nil {
			log.Fatalf("%v: failed to add VIP %v: %v", v, ip, err)
		}
		// TODO(angusc): Filter out anycast VIPs for non-anycast clusters further
		// upstream.
		if v.engine.config.AnycastEnabled {
			log.Infof("%v: advertising BGP route for %v", v, ip)
			if err := ncc.BGPAdvertiseVIP(nip); err != nil {
				log.Fatalf("%v: failed to advertise VIP %v: %v", v, ip, err)
			}
		} else {
			log.Warningf("%v: %v is an anycast VIP, but anycast is not enabled", v, ip)
		}
	}

	log.Infof("%v: VIP %v up", v, ip)
}
751192
func (s *Status) Height() uint32 {
	s.RLock()
	defer s.RUnlock()
	return s.height
}
576253
func (kva *KvAlert) Raise(a *api.Alert) error {
	var subscriptions []api.Alert
	kv := kva.GetKvdbInstance()
	if _, err := kv.GetVal(getSubscriptionsKey(a.AlertType), &subscriptions); err != nil {
		if err != kvdb.ErrNotFound {
			return err
		}
	} else {
		for _, alert := range subscriptions {
			if err := kva.Raise(&alert); err != nil {
				return ErrSubscribedRaise
			}
		}
	}
	return kva.raise(a)
}
475334
func DecodeUvarintAscending(b []byte) ([]byte, uint64, error) {
	if len(b) == 0 {
		return nil, 0, fmt.Errorf("insufficient bytes to decode uvarint value")
	}
	length := int(b[0]) - intZero
	b = b[1:] // skip length byte
	if length <= intSmall {
		return b, uint64(length), nil
	}
	length -= intSmall
	if length < 0 || length > 8 {
		return nil, 0, fmt.Errorf("invalid uvarint length of %d", length)
	} else if len(b) < length {
		return nil, 0, fmt.Errorf("insufficient bytes to decode uvarint value: %q", b)
	}
	var v uint64
	// It is faster to range over the elements in a slice than to index
	// into the slice on each loop iteration.
	for _, t := range b[:length] {
		v = (v << 8) | uint64(t)
	}
	return b[length:], v, nil
}