// New creates a new path expression from the given path segments
// It returns an error if any of the values fail to validate
// and it must contain all relevant parts
553718
func New(org, project string, envs, services, identities, instances []string) (*PathExp, error) {
	return newPathexp(org, project, envs, services, identities, instances, true)
}
1295714
func New(metadata map[string]string) ([]*x509.Certificate, error) {
	roots := initSystemRoots()
	if len(roots) == 0 {
		return nil, errors.New("transport: unable to find system roots")
	}
	return roots, nil
}
675892
func New(reg *descriptor.Registry, useRequestContext bool, registerFuncSuffix, pathTypeString string, allowPatchFeature bool) gen.Generator {
	var imports []descriptor.GoPackage
	for _, pkgpath := range []string{
		"context",
		"io",
		"net/http",
		"github.com/grpc-ecosystem/grpc-gateway/runtime",
		"github.com/grpc-ecosystem/grpc-gateway/utilities",
		"github.com/golang/protobuf/proto",
		"google.golang.org/grpc",
		"google.golang.org/grpc/codes",
		"google.golang.org/grpc/grpclog",
		"google.golang.org/grpc/status",
	} {
		pkg := descriptor.GoPackage{
			Path: pkgpath,
			Name: path.Base(pkgpath),
		}
		if err := reg.ReserveGoPackageAlias(pkg.Name, pkg.Path); err != nil {
			for i := 0; ; i++ {
				alias := fmt.Sprintf("%s_%d", pkg.Name, i)
				if err := reg.ReserveGoPackageAlias(alias, pkg.Path); err != nil {
					continue
				}
				pkg.Alias = alias
				break
			}
		}
		imports = append(imports, pkg)
	}

	var pathType pathType
	switch pathTypeString {
	case "", "import":
		// paths=import is default
	case "source_relative":
		pathType = pathTypeSourceRelative
	default:
		glog.Fatalf(`Unknown path type %q: want "import" or "source_relative".`, pathTypeString)
	}

	return &generator{
		reg:                reg,
		baseImports:        imports,
		useRequestContext:  useRequestContext,
		registerFuncSuffix: registerFuncSuffix,
		pathType:           pathType,
		allowPatchFeature:  allowPatchFeature,
	}
}
931193
func New(filepath string) (ef File, err error) {
	file, err := os.Open(filepath)
	if err != nil {
		return
	}
	ef.file = file
	ef.ParseFileHeader()
	return
}
152756
func New(org, team, certpath, keypath string, cfg *config.Config) (g *http.Gatekeeper, err error) {
	api := api.NewClient(cfg)
	http, err := http.NewGatekeeper(org, team, certpath, keypath, cfg, api)
	if err != nil {
		return nil, err
	}

	return http, nil
}
832332
func New(t *testing.T) *GopathTest {
	base, err := ioutil.TempDir(os.TempDir(), "vendor_")
	if err != nil {
		t.Fatal(err)
	}
	wd, err := os.Getwd()
	if err != nil {
		t.Fatal(err)
	}
	g := &GopathTest{
		T:    t,
		base: base,

		initPath: wd,
	}
	g.mkdir("src")
	os.Setenv("GOPATH", g.base)
	return g
}
12451
func New(params *stripe.TokenParams) (*stripe.Token, error) {
	return getC().New(params)
}
701212
func NewPathExpression(pos int, line int, data bool) *PathExpression {
	result := &PathExpression{
		NodeType: NodePath,
		Loc:      Loc{pos, line},

		Data: data,
	}

	if data {
		result.Original = "@"
	}

	return result
}
331404
func New(c Config) (*Foo, error) {
	//ensure proper initialization of Foo
	foo := &Foo{
		c:    c,
		bar:  42 + c.Zip,
		bazz: 21 + c.Zop,
	}

	return foo, nil
}
1319460
func New(ctx context.Context, next http.Handler, config config.StripPrefixRegex, name string) (http.Handler, error) {
	middlewares.GetLogger(ctx, name, typeName).Debug("Creating middleware")

	stripPrefix := stripPrefixRegex{
		next:   next,
		router: mux.NewRouter(),
		name:   name,
	}

	for _, prefix := range config.Regex {
		stripPrefix.router.PathPrefix(prefix)
	}

	return &stripPrefix, nil
}
237243
func New(dir string, client agentClient) (*XC, error) {
	skr, _ := keyring.LoadSecring(filepath.Join(dir, secringFilename))
	pkr, _ := keyring.LoadPubring(filepath.Join(dir, pubringFilename), skr)
	return &XC{
		dir:     dir,
		pubring: pkr,
		secring: skr,
		client:  client,
	}, nil
}
37410
func New(path ...string) (client ClientAPI, err error) {
	socketPath := socket
	if len(path) > 0 {
		socketPath = path[0]
	}

	conn, err := net.Dial("unix", socketPath)
	if err != nil {
		return
	}

	client = &Client{
		conn:   conn,
		writer: bufio.NewWriter(conn),
		reply:  make(chan Reply),
	}

	go client.read()

	return
}
894674
func (c Client) New(params *stripe.FileParams) (*stripe.File, error) {
	if params == nil {
		return nil, fmt.Errorf("params cannot be nil, and params.Purpose and params.File must be set")
	}

	bodyBuffer, boundary, err := params.GetBody()
	if err != nil {
		return nil, err
	}

	file := &stripe.File{}
	err = c.B.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, &params.Params, file)

	return file, err
}
630663
func New(params *stripe.PlanParams) (*stripe.Plan, error) {
	return getC().New(params)
}
203221
func New(fieldSeparators, quotes []rune, escape rune) Scanner {
	return &scanner{
		splitter{
			fieldSeparators: fieldSeparators,
			quotes:          quotes,
			esc:             escape,
			noesc:           utf8.RuneError, // assume shouldn't exist
		},
	}
}
333328
func New(chartpath string, helmhome helmpath.Home) *Resolver {
	return &Resolver{
		chartpath: chartpath,
		helmhome:  helmhome,
	}
}
1337080
func New(auth *auth.Auth) *Router {
	return &Router{
		RedirectTrailingSlash: true,
		RedirectFixedPath:     true,
		auth:                  auth,
	}
}