// Redis `BZPOPMAX key [key ...] timeout` command.
173311
func (c *cmdable) BZPopMax(timeout time.Duration, keys ...string) *ZWithKeyCmd {
	args := make([]interface{}, 1+len(keys)+1)
	args[0] = "bzpopmax"
	for i, key := range keys {
		args[1+i] = key
	}
	args[len(args)-1] = formatSec(timeout)
	cmd := NewZWithKeyCmd(args...)
	cmd.setReadTimeout(timeout)
	c.process(cmd)
	return cmd
}
1345276
func MaxWaitTime(value time.Duration) Option {
	return func(o *Options) {
		o.maxWaitTime = value
	}
}
1185305
func (p *parser) popOptions() {
	lastIdx := len(p.optionsStack) - 1
	// get the last item on the stack and then remove it by reslicing
	p.options = p.optionsStack[lastIdx]
	p.optionsStack = p.optionsStack[:lastIdx]
}
249358
func (rlf *RateLimitedFunction) pop() {
	rlf.RateLimiter.Accept()
	if _, err := rlf.queue.Pop(func(_ interface{}) error {
		return rlf.Handler()
	}); err != nil {
		utilruntime.HandleError(err)
	}
}
1275818
func (s *IndicesUnfreezeService) Timeout(timeout string) *IndicesUnfreezeService {
	s.timeout = timeout
	return s
}
1188177
func (p *Plugin) Timeout() time.Duration {
	p.mu.RLock()
	t := p.timeout
	p.mu.RUnlock()
	return t
}
163571
func DialTimeout(network, addr string, timeout time.Duration) (*Conn, error) {
	dialer := &net.Dialer{
		Timeout:   timeout,
		KeepAlive: DefaultKeepAlivePeriod,
	}
	c, err := dialer.Dial(network, addr)
	if err != nil {
		return nil, err
	}
	return NewConn(c), nil
}
1123798
func (r *SearchRequest) Timeout(timeout string) *SearchRequest {
	r.searchSource = r.searchSource.Timeout(timeout)
	return r
}
410833
func (s *IndicesCreateService) Timeout(timeout string) *IndicesCreateService {
	s.timeout = timeout
	return s
}
1285069
func (s *BulkService) Timeout(timeout string) *BulkService {
	s.timeout = timeout
	return s
}
183142
func (s *Session) PopBool(key string) bool {
	r, _ := s.Pop(key).(bool)
	return r
}
1022079
func (r *RedisStorer) ResetExpiry(key string) error {
	return r.client.Expire(key, r.maxAge).Err()
}
1258018
func (t *timeRangeMerger) Pop() (out TimeRange, ok bool) {
	var where *[]TimeRange
	var what []TimeRange

	if len(t.sorted) > 0 {
		where, what = &t.sorted, t.sorted[1:]
		out, ok = t.sorted[0], true
	}

	if len(t.unsorted) > 0 && (!ok || t.unsorted[0].Less(out)) {
		where, what = &t.unsorted, t.unsorted[1:]
		out, ok = t.unsorted[0], true
	}

	if !t.used && (!ok || t.single.Less(out)) {
		t.used = true
		return t.single, true
	}

	if ok {
		*where = what
	}

	return out, ok
}
1263961
func (c *Client) BRPopLPush(src, dst string, timeout int) (string, error) {
	v, err := c.execWithKeyTimeout(true, timeout, "BRPOPLPUSH", src, dst, timeout)
	if err != nil {
		return "", err
	}
	if v == nil {
		return "", ErrTimedOut
	}
	return iface2str(v)
}
412056
func Timeout(timeout time.Duration) QueryOption {
	return func(qo *queryOptions) {
		qo.timeout = timeout
	}
}
257975
func (p *parser) popRecovery() {
	// GC that map
	p.recoveryStack[len(p.recoveryStack)-1] = nil

	p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)-1]
}
97212
func dict_pop(fnname string, recv_ Value, args Tuple, kwargs []Tuple) (Value, error) {
	recv := recv_.(*Dict)
	var k, d Value
	if err := UnpackPositionalArgs(fnname, args, kwargs, 1, &k, &d); err != nil {
		return nil, err
	}
	if v, found, err := recv.Delete(k); err != nil {
		return nil, err // dict is frozen or key is unhashable
	} else if found {
		return v, nil
	} else if d != nil {
		return d, nil
	}
	return nil, fmt.Errorf("pop: missing key")
}