// Deadline calls the underlying golang.org/x/net/context Deadline()
546860
func (c *Ctx) Deadline() (deadline time.Time, ok bool) {
	return c.netContext.Deadline()
}
719136
func contextError(ctx context.Context) error {
	if ctx.Err() == context.DeadlineExceeded {
		return operationTimeout{err: ctx.Err()}
	}
	return ctx.Err()
}
1002802
func (c *TasksCancelCall) Context(ctx context.Context) *TasksCancelCall {
	c.ctx_ = ctx
	return c
}
1313508
func (c *CancelCall) Context(ctx context.Context) *CancelCall {
	c.ctx_ = ctx
	return c
}
1253951
func Timing(metric string, value time.Duration) {
	DefaultClient.Timing(metric, value)
}
849221
func (s *Server) Ready() <-chan struct{} {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.started
}
1323442
func (s *scheduler) Ready() error {
	glog.Infof("Entering lead for realm %s!", s.realm)
	glog.Infof("Host Master successfully started")
	return nil
}
294229
func (p *parser) Date(i int, context string) Date {
	s := p.String(i, context)
	if p.err != nil {
		return Date{}
	}
	v, err := ParseDate(s)
	if err != nil {
		p.SetErr(context, s)
	}
	return v
}
189804
func (c *GetTaskDefCall) Context(ctx context.Context) *GetTaskDefCall {
	c.ctx_ = ctx
	return c
}
561113
func (c *Ctx) WithDeadline(deadline time.Time) context.CancelFunc {
	ctx, cf := context.WithDeadline(c.request.Context(), deadline)
	c.request = c.request.WithContext(ctx)
	return cf
}
967112
func (c *SucceedCall) Context(ctx context.Context) *SucceedCall {
	c.ctx_ = ctx
	return c
}
746285
func (c *TasksRequestsCall) Context(ctx context.Context) *TasksRequestsCall {
	c.ctx_ = ctx
	return c
}
823688
func (c *GroupPercentSetCall) Context(ctx context.Context) *GroupPercentSetCall {
	c.ctx_ = ctx
	return c
}
1360159
func ContextErr(err error) error {
	switch err {
	case context.DeadlineExceeded:
		return status.Error(codes.DeadlineExceeded, err.Error())
	case context.Canceled:
		return status.Error(codes.Canceled, err.Error())
	}
	return status.Errorf(codes.Internal, "Unexpected error from context packet: %v", err)
}
560340
func (c *AckCall) Context(ctx context.Context) *AckCall {
	c.ctx_ = ctx
	return c
}
1187125
func (m *mutex) ContextUnlock(ctx context.Context) error {
	url := fmt.Sprintf("%s/b/%s/o/%s?", storageUnlockURL, m.bucket, m.object)
	// NOTE: ctx deadline/timeout and backoff are independent. The former is
	// an aggregate timeout and the latter is a per loop iteration delay.
	backoff := 10 * time.Millisecond
	for {
		req, err := http.NewRequest("DELETE", url, nil)
		if err != nil {
			// Likely malformed URL - retry won't fix so return.
			return err
		}
		req = req.WithContext(ctx)
		res, err := m.client.Do(req)
		if err == nil {
			res.Body.Close()
			if res.StatusCode == 204 {
				return nil
			}
		}
		select {
		case <-time.After(backoff):
			backoff *= 2
			continue
		case <-ctx.Done():
			return ctx.Err()
		}
	}
}
1373783
func (c *BotTerminateCall) Context(ctx context.Context) *BotTerminateCall {
	c.ctx_ = ctx
	return c
}