// LMclear clears multi lists.
336820
func (db *DB) LMclear(keys ...[]byte) (int64, error) {
	t := db.listBatch
	t.Lock()
	defer t.Unlock()

	for _, key := range keys {
		if err := checkKeySize(key); err != nil {
			return 0, err
		}

		db.lDelete(t, key)
		db.rmExpire(t, ListType, key)

	}

	err := t.Commit()
	return int64(len(keys)), err
}
1124511
func (w *Writer) ReadCloser() (io.ReadCloser, error) {
	if w.Error != nil {
		return nil, w.Error
	}

	return w.Buffer.ReadCloser(), nil
}
881735
func NewReadCloser(r io.Reader, c io.Closer) io.ReadCloser {
	return &readCloser{Reader: r, closer: c}
}
799162
func (s *AutoScaleService) NewListConditionsParams() *ListConditionsParams {
	p := &ListConditionsParams{}
	p.p = make(map[string]interface{})
	return p
}
1085521
func MultiWriteCloser(wc ...io.WriteCloser) io.WriteCloser {
	wcs := make([]io.WriteCloser, len(wc))
	copy(wcs, wc)
	return &mwc{wcs}
}
1280742
func (s *lineEndingSplitter) dropCR(data []byte) []byte {
	if len(data) > 0 && data[len(data)-1] == '\r' {
		s.CRLFCount++
		return data[0 : len(data)-1]
	}
	s.LFCount++
	return data
}
495680
func (c *Client) ScrubAllValueDescriptors() error {
	conn := c.Pool.Get()
	defer conn.Close()

	err := unlinkCollection(conn, db.ValueDescriptorCollection)
	if err != nil {
		return err
	}

	return nil
}
1230178
func MyWordCompleter(line string, pos int) (head string, c []string, tail string) {

	beg := []rune(line[:pos])
	end := line[pos:]
	Q("\nline = '%s' pos=%v\n", line, pos)
	Q("\nbeg = '%v'\nend = '%s'\n", string(beg), end)
	// find most recent paren in beg
	n := len(beg)
	last := n - 1
	var i int
	var p int = -1
outer:
	for i = last; i >= 0; i-- {
		Q("\nbeg[i=%v] is '%v'\n", i, string(beg[i]))
		switch beg[i] {
		case ' ':
			break outer
		case '(':
			p = i
			Q("\n found paren at p = %v\n", i)
			break outer
		}
	}
	Q("p=%d\n", p)
	prefix := string(beg)
	extendme := ""
	if p == 0 {
		prefix = ""
		extendme = string(beg)
	} else if p > 0 {
		prefix = string(beg[:p])
		extendme = string(beg[p:])
	}
	Q("prefix = '%s'\nextendme = '%s'\n", prefix, extendme)

	for _, n := range completion_keywords {
		if strings.HasPrefix(n, strings.ToLower(extendme)) {
			Q("n='%s' has prefix  = '%s'\n", n, extendme)
			c = append(c, n)
		}
	}

	return prefix, c, end
}
709197
func (t Topic) SplitErr() (p, n string, err error) {
	p, n, err = resourceProjectName(string(t))
	return
}
893914
func (l *List) Clear() {
	for i := range l.errs {
		l.errs[i] = nil
	}
	l.errs = l.errs[:0]
	l.err = nil
}
1111499
func MultiLineString(b orb.Bound, mls orb.MultiLineString, opts ...Option) orb.MultiLineString {
	open := false
	if len(opts) > 0 {
		o := &options{}
		for _, opt := range opts {
			opt(o)
		}

		open = o.openBound
	}

	var result orb.MultiLineString
	for _, ls := range mls {
		r := line(b, ls, open)
		if len(r) != 0 {
			result = append(result, r...)
		}
	}
	return result
}
565027
func (slocs SegmentLocs) DecRef() {
	for _, sloc := range slocs {
		if sloc.mref != nil {
			sloc.mref.DecRef()
		}
	}
}
227968
func (p *terminalPrompter) SetWordCompleter(completer WordCompleter) {
	p.State.SetWordCompleter(liner.WordCompleter(completer))
}
1327538
func (b *Bitmap) removeEmptyContainers() {
	citer, _ := b.Containers.Iterator(0)
	for citer.Next() {
		k, c := citer.Value()
		if c.n == 0 {
			b.Containers.Remove(k)
		}
	}
}
923398
func (c *Client) ListDiskOfferings(p *ListDiskOfferingsParameter) ([]*DiskOffering, error) {
	obj, err := c.Request("listDiskOfferings", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*DiskOffering), err
}
374908
func TeeReadCloser(rc io.ReadCloser, w io.Writer) io.ReadCloser {
	return &teeReadCloser{rc, io.TeeReader(rc, w)}
}
1278046
func (p *Parser) parseFilter(cur *ListNode) error {
	p.pos += len("[?(")
	p.consumeText()
Loop:
	for {
		switch p.next() {
		case eof, '\n':
			return fmt.Errorf("unterminated filter")
		case ')':
			break Loop
		}
	}
	if p.next() != ']' {
		return fmt.Errorf("unclosed array expect ]")
	}
	reg := regexp.MustCompile(`^([^!<>=]+)([!<>=]+)(.+?)$`)
	text := p.consumeText()
	text = string(text[:len(text)-2])
	value := reg.FindStringSubmatch(text)
	if value == nil {
		parser, err := parseAction("text", text)
		if err != nil {
			return err
		}
		cur.append(newFilter(parser.Root, newList(), "exists"))
	} else {
		leftParser, err := parseAction("left", value[1])
		if err != nil {
			return err
		}
		rightParser, err := parseAction("right", value[3])
		if err != nil {
			return err
		}
		cur.append(newFilter(leftParser.Root, rightParser.Root, value[2]))
	}
	return p.parseInsideAction(cur)
}