// KeyAt extracts a key from an Object at the specified index.
354248
func (s Slice) KeyAt(index ValueLength, translate ...bool) (Slice, error) {
	if !s.IsObject() {
		return nil, InvalidTypeError{"Expecting type Object"}
	}

	return s.getNthKey(index, optionalBool(translate, true))
}
523329
func (ps *PointSet) GetAt(i int) *Point {
	deref := *ps
	if i >= len(deref) || i < 0 {
		return nil
	}

	return &deref[i]
}
1352258
func (s *items) insertAt(index int, item Item) {
	*s = append(*s, nil)
	if index < len(*s) {
		copy((*s)[index+1:], (*s)[index:])
	}
	(*s)[index] = item
}
179124
func (c *Client) GAT(key string, exp uint32) (val string, flags uint32, cas uint64, err error) {
	// Variants: GAT [Q, K, KQ]
	// Request : MUST key, extras; MUST NOT value
	// Response: MAY key, value, extras ([0..3] flags)
	m := &msg{
		header: header{
			Op: opGAT,
		},
		iextras: []interface{}{exp},
		oextras: []interface{}{&flags},
		key:     key,
	}

	err = c.perform(m)
	return m.val, flags, m.CAS, err
}
1372410
func (ps *PointSet) InsertAt(index int, point *Point) *PointSet {
	deref := *ps
	if index > len(deref) || index < 0 {
		panic(fmt.Sprintf("geo: insert index out of range, requested: %d, length: %d", index, len(deref)))
	}

	if index == len(deref) {
		deref = append(deref, *point)
		*ps = deref
		return ps
	}

	deref = append(deref, Point{})
	copy(deref[index+1:], deref[index:])
	deref[index] = *point
	*ps = deref
	return ps
}
1141913
func (flb FilteredBuffer) LineAt(i int) (line.Line, error) {
	if i >= len(flb.selection) {
		return nil, errors.Errorf("specified index %d is out of range", len(flb.selection))
	}
	return flb.src.LineAt(flb.selection[i])
}
66770
func (ps *PointSet) RemoveAt(index int) *PointSet {
	deref := *ps
	if index >= len(deref) || index < 0 {
		panic(fmt.Sprintf("geo: remove index out of range, requested: %d, length: %d", index, len(deref)))
	}

	deref = append(deref[:index], deref[index+1:]...)
	*ps = deref
	return ps
}
664237
func SplitAt(args []string, sep string) ([]string, []string) {
	index := -1
	for i, a := range args {
		if a == sep {
			index = i
			break
		}
	}
	if index == -1 {
		return args, []string{}
	}
	return args[:index], args[index+1:]
}
120507
func (f Uint64Vector) indexKey(i uint64) (key []byte) {
	b := make([]byte, 8)
	binary.BigEndian.PutUint64(b, i)
	return append(f.key, b...)
}
1172536
func (c *Client) ExpireAt(key string, unixTime uint64) (bool, error) {
	var ret bool
	err := c.command(
		&ret,
		[]byte("EXPIREAT"),
		[]byte(key),
		to.Bytes(unixTime),
	)
	return ret, err
}
1186248
func (j *jws) HeaderAt(i int) jose.Header {
	return j.sb[i].unprotected
}
904042
func (self *Commands) ClickAt(args *ClickAtArgs) ([]dom.Element, error) {
	return nil, browser.NotImplemented
}
800497
func (c *MemoryStore) MGet(keys []string) (map[string]interface{}, error) {
	results := make(map[string]interface{}, len(keys))
	for _, key := range keys {
		item, _ := c.Get(key)
		results[key] = item
	}
	return results, nil
}
217978
func (kf *KeyFormat) Scan(key []byte, args ...interface{}) error {
	segments := kf.ScanBytes(key)
	if len(args) > len(segments) {
		return fmt.Errorf("KeyFormat.Scan() is provided with %d args but format only has %d segments in key %X",
			len(args), len(segments), key)
	}
	for i, a := range args {
		scan(a, segments[i])
	}
	return nil
}
1299543
func IntKeySet(theMap interface{}) Int {
	v := reflect.ValueOf(theMap)
	ret := Int{}

	for _, keyValue := range v.MapKeys() {
		ret.Insert(keyValue.Interface().(int))
	}
	return ret
}
852762
func (rs *ResultSet) ValueAt(index int) (Value, error) {
	if len(rs.items) < index+1 {
		return nil, errors.New(ErrIllegalItemIndex, errorMessages, index, len(rs.items))
	}
	value, ok := rs.items[index].(Value)
	if !ok {
		return nil, errors.New(ErrIllegalItemType, errorMessages, index, "value")
	}
	return value, nil
}
218601
func (b *BitSet) DeleteAt(i uint) *BitSet {
	// the index of the slice element where we'll delete a bit
	deleteAtElement := i >> log2WordSize

	// generate a mask for the data that needs to be shifted right
	// within that slice element that gets modified
	dataMask := ^((uint64(1) << (i & (wordSize - 1))) - 1)

	// extract the data that we'll shift right from the slice element
	data := b.set[deleteAtElement] & dataMask

	// set the masked area to 0 while leaving the rest as it is
	b.set[deleteAtElement] &= ^dataMask

	// shift the previously extracted data to the right and then
	// set it in the previously masked area
	b.set[deleteAtElement] |= (data >> 1) & dataMask

	// loop over all the consecutive slice elements to copy each
	// lowest bit into the highest position of the previous element,
	// then shift the entire content to the right by 1
	for i := int(deleteAtElement) + 1; i < len(b.set); i++ {
		b.set[i-1] |= (b.set[i] & 1) << 63
		b.set[i] >>= 1
	}

	b.length = b.length - 1

	return b
}