// Arrow handles a request for an arrow pointing in a given direction.
491961
func Arrow(w http.ResponseWriter, req *http.Request) {
	arg := func(s string) int { x, _ := strconv.Atoi(req.FormValue(s)); return x }
	dir := arg("dir")
	size := arg("size")
	if size == 0 {
		size = 50
	}
	del := size / 10

	m := image.NewRGBA(image.Rect(0, 0, size, size))

	if dir == 4 {
		draw.Draw(m, m.Bounds(), image.Black, image.ZP, draw.Src)
		draw.Draw(m, image.Rect(5, 5, size-5, size-5), image.White, image.ZP, draw.Src)
	}

	pt := func(x, y int, c color.RGBA) {
		switch dir {
		case 0:
			m.SetRGBA(x, y, c)
		case 1:
			m.SetRGBA(y, size-1-x, c)
		case 2:
			m.SetRGBA(size-1-x, size-1-y, c)
		case 3:
			m.SetRGBA(size-1-y, x, c)
		}
	}

	for y := 0; y < size/2; y++ {
		for x := 0; x < del && x < y; x++ {
			pt(x, y, color.RGBA{0, 0, 0, 255})
		}
		for x := del; x < y-del; x++ {
			pt(x, y, color.RGBA{128, 128, 255, 255})
		}
		for x := max(y-del, 0); x <= y; x++ {
			pt(x, y, color.RGBA{0, 0, 0, 255})
		}
	}
	for y := size / 2; y < size; y++ {
		for x := 0; x < del && x < size-1-y; x++ {
			pt(x, y, color.RGBA{0, 0, 0, 255})
		}
		for x := del; x < size-1-y-del; x++ {
			pt(x, y, color.RGBA{128, 128, 192, 255})
		}
		for x := max(size-1-y-del, 0); x <= size-1-y; x++ {
			pt(x, y, color.RGBA{0, 0, 0, 255})
		}
	}

	w.Header().Set("Cache-Control", "public, max-age=3600")
	w.Write(pngEncode(m))
}
1245698
func (g *routeGroup) Post(path string, h ...Handler) {
	g.handle(POST, path, h)
}
397111
func (r Rect) Vertices() [4]Vec {
	return [4]Vec{
		r.Min,
		V(r.Min.X, r.Max.Y),
		r.Max,
		V(r.Max.X, r.Min.Y),
	}
}
641852
func (l *Line) Side(p *Point) int {
	val := (l.b[0]-l.a[0])*(p[1]-l.b[1]) - (l.b[1]-l.a[1])*(p[0]-l.b[0])

	if val < 0 {
		return 1 // right
	} else if val > 0 {
		return -1 // left
	}

	return 0 // collinear
}
870325
func EulerUndirected(g Iterator) (walk []int, ok bool) {
	n := g.Order()
	out := make([]int, n) // outdegree for each vertex
	edgeCount := 0
	for v := range out {
		g.Visit(v, func(w int, _ int64) (skip bool) {
			edgeCount++
			if v != w {
				out[v]++
			}
			return
		})
	}
	if edgeCount == 0 {
		return []int{}, true
	}

	start, oddDeg := -1, 0
	for v := range out {
		if out[v]&1 == 1 {
			start = v
			oddDeg++
		}
	}
	if !(oddDeg == 0 || oddDeg == 2) {
		return []int{}, false
	}

	// Find a starting point with neighbors.
	if start == -1 {
		for v := 0; v < n; v++ {
			if g.Visit(v, func(w int, _ int64) (skip bool) {
				start = w
				return true
			}) {
				break
			}
		}
	}

	h := Copy(g)
	for stack := []int{start}; len(stack) > 0; {
		n := len(stack)
		v := stack[n-1]
		stack = stack[:n-1]
		for h.Degree(v) > 0 {
			stack = append(stack, v)
			var w int
			h.Visit(v, func(u int, _ int64) (skip bool) {
				w = u
				return true
			})
			h.DeleteBoth(v, w)
			edgeCount--
			if v != w {
				edgeCount--
			}
			v = w
		}
		walk = append(walk, v)
	}
	if edgeCount > 0 {
		return []int{}, false
	}
	return walk, true
}
1358410
func (s *Sling) Post(pathURL string) *Sling {
	s.method = "POST"
	return s.Path(pathURL)
}
1023877
func (g *Graph) Dot(opts *DotOpts) []byte {
	return newMarshalGraph("", g).Dot(opts)
}
555013
func (r *Router) Post(pattern string, handler http.HandlerFunc) {
	r.AddRoute(POST, pattern, handler)
}
956879
func (p *Process) Direction(dir proc.Direction) error {
	if p.tracedir == "" {
		return proc.ErrNotRecorded
	}
	if p.conn.conn == nil {
		return proc.ErrProcessExited{Pid: p.conn.pid}
	}
	if p.conn.direction == dir {
		return nil
	}
	if p.Breakpoints().HasInternalBreakpoints() {
		return ErrDirChange
	}
	p.conn.direction = dir
	return nil
}
747533
func (r *SearchRequest) header() interface{} {
	h := make(map[string]interface{})
	if r.searchType != "" {
		h["search_type"] = r.searchType
	}

	switch len(r.indices) {
	case 0:
	case 1:
		h["index"] = r.indices[0]
	default:
		h["indices"] = r.indices
	}

	switch len(r.types) {
	case 0:
	case 1:
		h["types"] = r.types[0]
	default:
		h["type"] = r.types
	}

	if r.routing != nil && *r.routing != "" {
		h["routing"] = *r.routing
	}

	if r.preference != nil && *r.preference != "" {
		h["preference"] = *r.preference
	}

	return h
}
34509
func (bow *Browser) Form(expr string) (Submittable, error) {
	sel := bow.Find(expr)
	if sel.Length() == 0 {
		return nil, errors.NewElementNotFound(
			"Form not found matching expr '%s'.", expr)
	}
	if !sel.Is("form") {
		return nil, errors.NewElementNotFound(
			"Expr '%s' does not match a form tag.", expr)
	}

	return NewForm(bow, sel), nil
}
759353
func (app *App) POST(route string, handler interface{}) *App {
	app.defaultRouter.Handle(MethodPOST, route, handler)
	return app
}
462888
func (c *Coordinate) Node(args *structs.NodeSpecificRequest, reply *structs.IndexedCoordinates) error {
	if done, err := c.srv.forward("Coordinate.Node", args, args, reply); done {
		return err
	}

	// Fetch the ACL token, if any, and enforce the node policy if enabled.
	rule, err := c.srv.ResolveToken(args.Token)
	if err != nil {
		return err
	}
	if rule != nil && c.srv.config.ACLEnforceVersion8 {
		if !rule.NodeRead(args.Node) {
			return acl.ErrPermissionDenied
		}
	}

	return c.srv.blockingQuery(&args.QueryOptions,
		&reply.QueryMeta,
		func(ws memdb.WatchSet, state *state.Store) error {
			index, nodeCoords, err := state.Coordinate(args.Node, ws)
			if err != nil {
				return err
			}

			var coords structs.Coordinates
			for segment, coord := range nodeCoords {
				coords = append(coords, &structs.Coordinate{
					Node:    args.Node,
					Segment: segment,
					Coord:   coord,
				})
			}
			reply.Index, reply.Coordinates = index, coords
			return nil
		})
}
1001529
func (l *Loop) Vertex(i int) Point {
	return l.vertices[i%len(l.vertices)]
}
967939
func (e *Expect) POST(path string, pathargs ...interface{}) *Request {
	return e.Request("POST", path, pathargs...)
}
698284
func (c *Client) Request(verb, spath string, ro *RequestOptions) (*http.Request, error) {
	log.Printf("[INFO] request: %s %s", verb, spath)

	// Ensure we have a RequestOptions struct (passing nil is an acceptable)
	if ro == nil {
		ro = new(RequestOptions)
	}

	// Create a new URL with the appended path
	u := *c.URL
	u.Path = path.Join(c.URL.Path, spath)

	// Add the token and other params
	if c.Token != "" {
		log.Printf("[DEBUG] request: appending token (%s)", maskString(c.Token))
		if ro.Headers == nil {
			ro.Headers = make(map[string]string)
		}

		ro.Headers[atlasTokenHeader] = c.Token
	}

	return c.rawRequest(verb, &u, ro)
}
301961
func (r *Router) Handle(event string, h http.Handler) {
	r.routes[event] = h
}