// nBtcToMSat converts the given amount in nanoBTC to millisatoshis.
777183
func nBtcToMSat(n uint64) (lnwire.MilliSatoshi, error) {
	return lnwire.MilliSatoshi(n * 100), nil
}
255351
func (mc *CCacheMetric) nextTs(ts uint32) uint32 {
	chunk := mc.chunks[ts]
	return mc.nextTsCore(chunk.Itgen, chunk.Prev, chunk.Next)
}
882646
func (b *SimulatedBackend) StorageAt(ctx context.Context, contract common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) {
	b.mu.Lock()
	defer b.mu.Unlock()

	if blockNumber != nil && blockNumber.Cmp(b.blockchain.CurrentBlock().Number()) != 0 {
		return nil, errBlockNumberUnsupported
	}
	statedb, _ := b.blockchain.State()
	val := statedb.GetState(contract, key)
	return val[:], nil
}
1139171
func (s *children) removeAt(index int) *node {
	n := (*s)[index]
	copy((*s)[index:], (*s)[index+1:])
	(*s)[len(*s)-1] = nil
	*s = (*s)[:len(*s)-1]
	return n
}
122579
func (d *Deployment) GetCreatedAt() Timestamp {
	if d == nil || d.CreatedAt == nil {
		return Timestamp{}
	}
	return *d.CreatedAt
}
841981
func (b *MemFile) ReadAt(p []byte, off int64) (n int, err error) {
	b.mutex.RLock()
	n, err = b.Buffer.ReadAt(p, off)
	b.mutex.RUnlock()
	return
}
601184
func (t Term) DeleteAt(args ...interface{}) Term {
	return constructMethodTerm(t, "DeleteAt", p.Term_DELETE_AT, args, map[string]interface{}{})
}
1248679
func (m *MCP3008) AnalogValueAt(chanNum int) (int, error) {
	var data [3]uint8
	data[0] = startBit
	data[1] = uint8(m.Mode)<<7 | uint8(chanNum)<<4
	data[2] = 0

	glog.V(2).Infof("mcp3008: sendingdata buffer %v", data)
	if err := m.Bus.TransferAndReceiveData(data[:]); err != nil {
		return 0, err
	}

	return int(uint16(data[1]&0x03)<<8 | uint16(data[2])), nil
}
827534
func (s *Server) BandwidthAt(index int) int {
	if len(s.Interfaces) <= index {
		return -1
	}

	nic := s.Interfaces[index]

	switch nic.UpstreamType() {
	case EUpstreamNetworkNone:
		return -1
	case EUpstreamNetworkShared:
		return 100
	case EUpstreamNetworkSwitch, EUpstreamNetworkRouter:
		//
		// 上流ネットワークがスイッチだった場合の帯域制限
		// https://manual.sakura.ad.jp/cloud/support/technical/network.html#support-network-03
		//

		// 専有ホストの場合は制限なし
		if s.PrivateHost != nil {
			return 0
		}

		// メモリに応じた制限
		memory := s.GetMemoryGB()
		switch {
		case memory < 32:
			return 1000
		case 32 <= memory && memory < 128:
			return 2000
		case 128 <= memory && memory < 224:
			return 5000
		case 224 <= memory:
			return 10000
		default:
			return -1
		}
	default:
		return -1
	}
}
212528
func (file *File) WriteAt(buf []byte, offset int64) (int, error) {
	return file.Fid.Clnt.Write(file.Fid, buf, uint64(offset))
}
467269
func (r *RollingBucket) AddAt(v float64, t time.Time) {
	r.mu.Lock()
	r.updateTime(t)

	if r.Hist.Count() == 0 {
		r.min = v
		r.max = v
	} else {
		r.min = math.Min(r.min, v)
		r.max = math.Max(r.max, v)
	}

	r.count++
	r.sum += v
	r.sumOfSquares += v * v
	r.Hist.Add(v)

	r.mu.Unlock()
}
987494
func (eng *Engine) SetAt(t time.Time, name string, value interface{}, tags ...Tag) {
	eng.measure(t, name, value, Gauge, tags...)
}
41718
func (t *PairTree) RemoveAt(index int) *Pair {
	v := t.ObjectTree.RemoveAt(index)
	if v != nil {
		x := v.(Pair)
		return &x
	}
	return nil
}
52255
func (s *GetAssignmentOutput) SetHIT(v *HIT) *GetAssignmentOutput {
	s.HIT = v
	return s
}
770546
func pBtcToMSat(p uint64) (lnwire.MilliSatoshi, error) {
	if p < 10 {
		return 0, fmt.Errorf("minimum amount is 10p")
	}
	if p%10 != 0 {
		return 0, fmt.Errorf("amount %d pBTC not expressible in msat",
			p)
	}
	return lnwire.MilliSatoshi(p / 10), nil
}
1283678
func (t *Tree) RemoveAt(index int) interface{} {
	if t.root != nil && index < t.root.size && index >= 0 {
		var shorter bool
		return remove(&(t.root), index, &shorter)
	}

	return nil
}
712235
func (l *List) CreatedAt() time.Time {
	t, _ := IDToTime(l.ID)
	return t
}