// Position returns the position of a parameter
767353
func (c Command) Position(param ParameterInterface) int {
	for index, item := range c.Parameters() {
		if item.Equals(param) {
			return index
		}
	}

	return -1
}
754452
func Positions(result interface{}, err error) ([]*[2]float64, error) {
	values, err := Values(result, err)
	if err != nil {
		return nil, err
	}
	positions := make([]*[2]float64, len(values))
	for i := range values {
		if values[i] == nil {
			continue
		}
		p, ok := values[i].([]interface{})
		if !ok {
			return nil, fmt.Errorf("redigo: unexpected element type for interface slice, got type %T", values[i])
		}
		if len(p) != 2 {
			return nil, fmt.Errorf("redigo: unexpected number of values for a member position, got %d", len(p))
		}
		lat, err := Float64(p[0], nil)
		if err != nil {
			return nil, err
		}
		long, err := Float64(p[1], nil)
		if err != nil {
			return nil, err
		}
		positions[i] = &[2]float64{lat, long}
	}
	return positions, nil
}
775032
func PosFromPositionExpr(ctx sessionctx.Context, v *ast.PositionExpr) (int, bool, error) {
	if v.P == nil {
		return v.N, false, nil
	}
	value, err := GetParamExpression(ctx, v.P.(*driver.ParamMarkerExpr))
	if err != nil {
		return 0, true, err
	}
	pos, isNull, err := GetIntFromConstant(ctx, value)
	if err != nil || isNull {
		return 0, true, err
	}
	return pos, false, nil
}
290441
func (p *WebPage) ScrollPosition() (Position, error) {
	var resp struct {
		Top  int `json:"top"`
		Left int `json:"left"`
	}
	if err := p.ref.process.doJSON("POST", "/webpage/ScrollPosition", map[string]interface{}{"ref": p.ref.id}, &resp); err != nil {
		return Position{}, err
	}
	return Position{Top: resp.Top, Left: resp.Left}, nil
}
541046
func (s *Send) Location(latitude float64, long float64) *SendLocation {
	return &SendLocation{s, latitude, long, nil, nil}
}
277456
func (v List) Position(link List) int {
	return int(C.g_list_position(v.GList, link.GList))
}
336428
func (s *GetTagsInput) SetPosition(v string) *GetTagsInput {
	s.Position = &v
	return s
}
225271
func (r *Reader) Position() int64 {
	return r.position - int64(len(r.buffer)/r.Channels()) + int64(r.toSkip/r.Channels())
}
60177
func (s *GetModelsInput) SetPosition(v string) *GetModelsInput {
	s.Position = &v
	return s
}
1116168
func (w *Window) GetPosition() (x, y int) {
	var xpos, ypos C.int

	C.glfwGetWindowPos(w.data, &xpos, &ypos)
	return int(xpos), int(ypos)
}
455234
func (s *GetDocumentationVersionsOutput) SetPosition(v string) *GetDocumentationVersionsOutput {
	s.Position = &v
	return s
}
995589
func Position(row, col uint) ANSI {
	return newAnsi(fmt.Sprintf(esc+"%d;%dH", row, col))
}
426160
func (m Match) Match(position int) (string, error) {
	matches := m.Command.Expression().FindAllStringSubmatch(m.Request, -1)

	if len(matches) != 1 {
		return "", errors.New("Unable to parse request")
	}

	if position >= len(matches[0]) {
		return "", fmt.Errorf("No parameter at position %d", position)
	}

	return matches[0][position+1], nil
}
1050424
func (s *GetDomainNamesOutput) SetPosition(v string) *GetDomainNamesOutput {
	s.Position = &v
	return s
}
1371391
func (s *VideoDescription) SetPosition(v *Rectangle) *VideoDescription {
	s.Position = v
	return s
}
19166
func (t *Tree) GetPosition(key string) Position {
	if key == "" {
		return t.position
	}
	return t.GetPositionPath(strings.Split(key, "."))
}
1309866
func (s *GetClientCertificatesOutput) SetPosition(v string) *GetClientCertificatesOutput {
	s.Position = &v
	return s
}