// WithInputPath returns the TaskState input data selector
486956
func (wd *WaitDelay) WithInputPath(inputPath string) TransitionState {
	wd.inputPath = inputPath
	return wd
}
730378
func (o *PostIPAMIPURL) WithBasePath(bp string) *PostIPAMIPURL {
	o.SetBasePath(bp)
	return o
}
1076511
func taskInTerminalState(task *api.Task) bool {
	return task.Status.State > api.TaskStateRunning
}
1089937
func (n *Network) OutputBlockPath(channelName string) string {
	return filepath.Join(n.RootDir, fmt.Sprintf("%s_block.pb", channelName))
}
1212497
func WithResourcePath(p string) source.Option {
	return func(o *source.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, resourcePath{}, p)
	}
}
89153
func wrpath(ctxt *Link, b *Biobuf, p string) {
	var i int
	var n int
	if ctxt.Windows == 0 || !strings.Contains(p, `\`) {
		wrstring(b, p)
		return
	}
	n = len(p)
	wrint(b, int64(n))
	for i = 0; i < n; i++ {
		var tmp int
		if p[i] == '\\' {
			tmp = '/'
		} else {
			tmp = int(p[i])
		}
		Bputc(b, tmp)
	}
}
1166146
func (r *Router) WithInstrumentation(instrh func(handlerName string, handler http.HandlerFunc) http.HandlerFunc) *Router {
	return &Router{rtr: r.rtr, prefix: r.prefix, instrh: instrh}
}
826247
func (bt *BaseTask) WithOutputPath(outputPath string) TransitionState {
	bt.outputPath = outputPath
	return bt
}
1182223
func (s *Server) HandlePutShortcut(c web.C, w http.ResponseWriter, r *http.Request) {
	shortcut := Shortcut{}
	if err := json.NewDecoder(r.Body).Decode(&shortcut); err != nil {
		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
		return
	}
	shortcut.Name = c.URLParams["id"]

	err := s.Store.Put(fmt.Sprintf("/shortcuts/%s", c.URLParams["id"]), &shortcut)
	if err != nil {
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(http.StatusNoContent)
}
29364
func WithPath(path string) PrepareDecorator {
	return func(p Preparer) Preparer {
		return PreparerFunc(func(r *http.Request) (*http.Request, error) {
			r, err := p.Prepare(r)
			if err == nil {
				if r.URL == nil {
					return r, NewError("autorest", "WithPath", "Invoked with a nil URL")
				}
				if r.URL, err = parseURL(r.URL, path); err != nil {
					return r, err
				}
			}
			return r, err
		})
	}
}
398660
func (pc *processContainer) processPath(path string, info os.FileInfo, err error) error {
	if err != nil {
		utils.Logger.Error("Error scanning app source:", "error", err)
		return nil
	}

	if !info.IsDir() || info.Name() == "tmp" {
		return nil
	}

	// Get the import path of the package.
	pkgImportPath := pc.rootImportPath
	if pc.root != path {
		pkgImportPath = pc.rootImportPath + "/" + filepath.ToSlash(path[len(pc.root)+1:])
	}

	// Parse files within the path.
	var pkgs map[string]*ast.Package
	fset := token.NewFileSet()
	pkgs, err = parser.ParseDir(
		fset,
		path,
		func(f os.FileInfo) bool {
			return !f.IsDir() && !strings.HasPrefix(f.Name(), ".") && strings.HasSuffix(f.Name(), ".go")
		},
		0)

	if err != nil {
		if errList, ok := err.(scanner.ErrorList); ok {
			var pos = errList[0].Pos
			newError := &utils.Error{
				SourceType:  ".go source",
				Title:       "Go Compilation Error",
				Path:        pos.Filename,
				Description: errList[0].Msg,
				Line:        pos.Line,
				Column:      pos.Column,
				SourceLines: utils.MustReadLines(pos.Filename),
			}

			errorLink := pc.paths.Config.StringDefault("error.link", "")
			if errorLink != "" {
				newError.SetLink(errorLink)
			}
			return newError
		}

		// This is exception, err already checked above. Here just a print
		ast.Print(nil, err)
		utils.Logger.Fatal("Failed to parse dir", "error", err)
	}

	// Skip "main" packages.
	delete(pkgs, "main")

	// Ignore packages that end with _test
	// These cannot be included in source code that is not generated specifically as a test
	for i := range pkgs {
		if len(i) > 6 {
			if string(i[len(i)-5:]) == "_test" {
				delete(pkgs, i)
			}
		}
	}

	// If there is no code in this directory, skip it.
	if len(pkgs) == 0 {
		return nil
	}

	// There should be only one package in this directory.
	if len(pkgs) > 1 {
		for i := range pkgs {
			println("Found package ", i)
		}
		utils.Logger.Fatal("Most unexpected! Multiple packages in a single directory:", "packages", pkgs)
	}

	var pkg *ast.Package
	for _, v := range pkgs {
		pkg = v
	}

	if pkg != nil {
		pc.srcInfo = appendSourceInfo(pc.srcInfo, processPackage(fset, pkgImportPath, path, pkg))
	} else {
		utils.Logger.Info("Ignoring package, because it contained no packages", "path", path)
	}
	return nil
}
586521
func runIsImportPath(pathToCheck string) bool {
	if _, err := build.Import(pathToCheck, "", build.FindOnly);err==nil {
		return true
	}
	return filepath.IsAbs(pathToCheck)
}
1289641
func (m *Meta) initStatePaths() {
	if m.statePath == "" {
		m.statePath = DefaultStateFilename
	}
	if m.stateOutPath == "" {
		m.stateOutPath = m.statePath
	}
	if m.backupPath == "" {
		m.backupPath = m.stateOutPath + DefaultBackupExtension
	}
}
1340636
func (e Endpoint) urlWithoutPath() string {
	return fmt.Sprintf("%s://%s", e.scheme(), e.SocketAddress())
}
523816
func (ps *PassState) WithOutputPath(outputPath string) TransitionState {
	ps.outputPath = outputPath
	return ps
}
201387
func RequestPath(req *http.Request) (value string) {
	ex := getRequestExecution(req)
	return ex.pattern
}
14154
func (r *EtcdRegistry) unitStatePath(machID, jobName string) string {
	return path.Join(r.unitStatesNamespace(jobName), machID)
}