// InnerHit option to expand the collapsed results.
354708
func (b *CollapseBuilder) InnerHit(innerHit *InnerHit) *CollapseBuilder {
	b.innerHit = innerHit
	return b
}
474934
func (s *IndicesExistsService) ExpandWildcards(expandWildcards string) *IndicesExistsService {
	s.expandWildcards = expandWildcards
	return s
}
167454
func (r *RBFKernel) InnerProduct(vectorX *mat.Dense, vectorY *mat.Dense) float64 {
	euclidean := NewEuclidean()
	distance := euclidean.Distance(vectorX, vectorY)

	result := math.Exp(-r.gamma * math.Pow(distance, 2))

	return result
}
409202
func (scaler *DeploymentScaler) ScaleSimple(namespace, name string, preconditions *ScalePrecondition, newSize uint) error {
	deployment, err := scaler.c.Deployments(namespace).Get(name)
	if err != nil {
		return ScaleError{ScaleGetFailure, "Unknown", err}
	}
	if preconditions != nil {
		if err := preconditions.ValidateDeployment(deployment); err != nil {
			return err
		}
	}

	// TODO(madhusudancs): Fix this when Scale group issues are resolved (see issue #18528).
	// For now I'm falling back to regular Deployment update operation.
	deployment.Spec.Replicas = int(newSize)
	if _, err := scaler.c.Deployments(namespace).Update(deployment); err != nil {
		if errors.IsInvalid(err) {
			return ScaleError{ScaleUpdateInvalidFailure, deployment.ResourceVersion, err}
		}
		return ScaleError{ScaleUpdateFailure, deployment.ResourceVersion, err}
	}
	return nil
}
346733
func (h *Client) NonInteractionHit(nonInteractionHit bool) *Client {
	h.nonInteractionHit = nonInteractionHit
	h.nonInteractionHitSet = true
	return h
}
1112653
func (e *Error) InnerMost() error {
	if e.wrapped == nil {
		return e
	}

	if inner, ok := e.wrapped.(*Error); ok {
		return inner.InnerMost()
	}

	return e.wrapped
}
548699
func (q *ParentIdQuery) InnerHit(innerHit *InnerHit) *ParentIdQuery {
	q.innerHit = innerHit
	return q
}
346282
func ExpandTildeInPath(s string) string {
	if strings.HasPrefix(s, "~") {
		return UserHomeDir() + s[1:]
	}
	return s
}
712391
func (i Interval) InteriorIntersects(oi Interval) bool {
	if i.IsEmpty() || oi.IsEmpty() || i.Lo == i.Hi {
		return false
	}
	if i.IsInverted() {
		return oi.IsInverted() || oi.Lo < i.Hi || oi.Hi > i.Lo
	}
	if oi.IsInverted() {
		return oi.Lo < i.Hi || oi.Hi > i.Lo
	}
	return (oi.Lo < i.Hi && oi.Hi > i.Lo) || i.IsFull()
}
1319273
func (p *PostingsIterator) DocNum1Hit() (uint64, bool) {
	if p.normBits1Hit != 0 && p.docNum1Hit != DocNum1HitFinished {
		return p.docNum1Hit, true
	}
	return 0, false
}
931214
func (b *builtinTruncateIntSig) evalInt(row chunk.Row) (int64, bool, error) {
	x, isNull, err := b.args[0].EvalInt(b.ctx, row)
	if isNull || err != nil {
		return 0, isNull, err
	}

	d, isNull, err := b.args[1].EvalInt(b.ctx, row)
	if isNull || err != nil {
		return 0, isNull, err
	}

	if d >= 0 {
		return x, false, nil
	}
	shift := int64(math.Pow10(int(-d)))
	return x / shift * shift, false, nil
}
973053
func (s *IndicesPutSettingsService) ExpandWildcards(expandWildcards string) *IndicesPutSettingsService {
	s.expandWildcards = expandWildcards
	return s
}
679286
func (cb *configBased) CacheHits(ns string, version int, id string) (uint64, error) {
	if cache, ok := cb.metricCache[id]; ok {
		return cache.cacheHits(ns, version)
	}
	return 0, ErrCacheDoesNotExist
}
1321459
func (s *PutMappingService) ExpandWildcards(expandWildcards string) *PutMappingService {
	s.expandWildcards = expandWildcards
	return s
}
1126333
func (self *Context) initText() {
	var err error

	// 采用surf内核下载时，尝试自动转码
	if self.Request.DownloaderID == request.SURF_ID {
		var contentType, pageEncode string
		// 优先从响应头读取编码类型
		contentType = self.Response.Header.Get("Content-Type")
		if _, params, err := mime.ParseMediaType(contentType); err == nil {
			if cs, ok := params["charset"]; ok {
				pageEncode = strings.ToLower(strings.TrimSpace(cs))
			}
		}
		// 响应头未指定编码类型时，从请求头读取
		if len(pageEncode) == 0 {
			contentType = self.Request.Header.Get("Content-Type")
			if _, params, err := mime.ParseMediaType(contentType); err == nil {
				if cs, ok := params["charset"]; ok {
					pageEncode = strings.ToLower(strings.TrimSpace(cs))
				}
			}
		}

		switch pageEncode {
		// 不做转码处理
		case "utf8", "utf-8", "unicode-1-1-utf-8":
		default:
			// 指定了编码类型，但不是utf8时，自动转码为utf8
			// get converter to utf-8
			// Charset auto determine. Use golang.org/x/net/html/charset. Get response body and change it to utf-8
			var destReader io.Reader

			if len(pageEncode) == 0 {
				destReader, err = charset.NewReader(self.Response.Body, "")
			} else {
				destReader, err = charset.NewReaderLabel(pageEncode, self.Response.Body)
			}

			if err == nil {
				self.text, err = ioutil.ReadAll(destReader)
				if err == nil {
					self.Response.Body.Close()
					return
				} else {
					logs.Log.Warning(" *     [convert][%v]: %v (ignore transcoding)\n", self.GetUrl(), err)
				}
			} else {
				logs.Log.Warning(" *     [convert][%v]: %v (ignore transcoding)\n", self.GetUrl(), err)
			}
		}
	}

	// 不做转码处理
	self.text, err = ioutil.ReadAll(self.Response.Body)
	self.Response.Body.Close()
	if err != nil {
		panic(err.Error())
		return
	}

}
1180554
func (i Interval) InteriorContains(p float64) bool {
	return i.Lo < p && p < i.Hi
}
817168
func Flatten(err error) error {
	// If it isn't an *Error, just return the error as-is
	if _, ok := err.(*Error); !ok {
		return err
	}

	// Otherwise, make the result and flatten away!
	flatErr := new(Error)
	flatten(err, flatErr)
	return flatErr
}