// New creates a new instance of Session. Once the Session is created it
// can be mutated to modify the Config. The Session is safe to be read
// concurrently, but it should not be written to concurrently.
763252
func New(cfgs ...*spotinst.Config) *Session {
	s := &Session{Config: spotinst.DefaultConfig()}
	s.Config.Merge(cfgs...)
	return s
}
737334
func New(accessKeyID, secretAccessKey string) (c *Config, err error) {
	c, err = NewDefault()
	if err != nil {
		c = nil
		return
	}
	c.AccessKeyID = accessKeyID
	c.SecretAccessKey = secretAccessKey

	return
}
1090731
func New(options *AuthOptions, httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}

	return &Client{
		Options: options,
		Client:  httpClient,
	}
}
548477
func New(client RedisClient, key string, opts *Options) *Locker {
	var o Options
	if opts != nil {
		o = *opts
	}
	o.normalize()

	return &Locker{client: client, key: key, opts: o}
}
997054
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
	return &Client{transport: transport, formats: formats}
}
1269391
func New(c *Config) (*Middleware, error) {
	if c == nil {
		return nil, ErrMissingConfig
	}
	if c.Secret == "" {
		return nil, ErrMissingSecret
	}
	if c.Auth == nil {
		return nil, ErrMissingAuthFunc
	}
	if c.Claims == nil {
		return nil, ErrMissingClaimsFunc
	}
	if c.IdentityField == "" {
		c.IdentityField = "email"
	}
	if c.VerifyField == "" {
		c.VerifyField = "password"
	}
	m := &Middleware{
		secret:        c.Secret,
		auth:          c.Auth,
		claims:        c.Claims,
		identityField: c.IdentityField,
		verifyField:   c.VerifyField,
	}
	return m, nil
}
1037285
func New(config Config) session.Store {
	return &redisStore{
		client: config.Client,
		prefix: config.Prefix,
	}
}
816962
func New(cfg Config) *Sessions {
	return &Sessions{
		config:   cfg.Validate(),
		provider: newProvider(),
	}
}
1093296
func (s *Session) Create(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) {
	var obj interface{}
	if se != nil {
		body := make(map[string]interface{})
		obj = body
		if se.Name != "" {
			body["Name"] = se.Name
		}
		if se.Node != "" {
			body["Node"] = se.Node
		}
		if se.LockDelay != 0 {
			body["LockDelay"] = durToMsec(se.LockDelay)
		}
		if len(se.Checks) > 0 {
			body["Checks"] = se.Checks
		}
		if se.Behavior != "" {
			body["Behavior"] = se.Behavior
		}
		if se.TTL != "" {
			body["TTL"] = se.TTL
		}
	}
	return s.create(obj, q)
}
862096
func New(cpf, pwd string, configs ...Config) (*Client, error) {
	var config = DefaultConfig
	if len(configs) > 0 {
		config = configs[0]
	}
	jar, err := cookiejar.New(nil)
	if err != nil {
		return nil, err
	}
	client := &Client{
		http.Client{
			Timeout: time.Duration(config.Timeout) * time.Second,
			Jar:     jar,
		}, config.BaseURL,
	}
	return client, client.login(cpf, pwd)
}
440198
func (s *DumbMemoryStore) New(r *http.Request, name string) (*sessions.Session, error) {
	session := sessions.NewSession(s, name)
	opts := *s.Options
	session.Options = &opts
	session.IsNew = true
	var err error
	if value, errCookie := s.ValueStorer.GetValueForSessionName(r, name); errCookie == nil {
		err = securecookie.DecodeMulti(name, value, &session.ID, s.Codecs...)
		if err == nil {
			err = s.load(session)
			if err == nil {
				session.IsNew = false
			}
		}
	}
	return session, err
}
794317
func New(conf *Config) *Server {
	conf = pointer.FillDefaultFrom(conf, DefaultConfig).(*Config)
	m := http.NewServeMux()
	s := &Server{
		Server: http.Server{
			// TODO: Also put logger in http.Server
			Handler:      m,
			ReadTimeout:  *conf.ReadTimeout,
			WriteTimeout: *conf.WriteTimeout,
		},
		Exp2: expvar2.New(),
		Mux:  m,
	}
	m.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
	m.HandleFunc("/debug/pprof/profile", pprof.Profile)
	m.HandleFunc("/debug/pprof/", pprof.Index)
	m.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
	setupTrace(m)
	if conf.ExplorableObj != nil {
		e := &explorable.Handler{
			Val:      conf.ExplorableObj,
			BasePath: "/debug/explorer/",
			Logger:   log.NewContext(conf.Logger).With(LogKeyHTTPClass, "explorable"),
		}
		m.Handle("/debug/explorer/", e)
	}
	m.Handle("/debug/vars", s.Exp2)
	return s
}
905386
func New(httpClient *http.Client, config Config) (*Client, error) {
	c := NewClient(httpClient)
	c.Config = config

	baseURL, err := url.Parse("https://" + config.Host)

	if err != nil {
		return nil, err
	}

	c.BaseURL = baseURL
	return c, nil
}
810182
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
	return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
252515
func New(c *Config) (Vocabulary, error) {
  v := Vocabulary{c: c}
  return v, nil
}
1127351
func New(i Interface, c *Config) (Service, error) {
	if len(c.Name) == 0 {
		return nil, ErrNameFieldRequired
	}
	if system == nil {
		return nil, ErrNoServiceSystemDetected
	}
	return system.New(i, c)
}
579712
func New(c Config) context.Handler {
	config := DefaultConfig()
	if c.Realm != "" {
		config.Realm = c.Realm
	}
	config.Users = c.Users
	config.Expires = c.Expires
	config.OnAsk = c.OnAsk

	b := &basicAuthMiddleware{config: config}
	b.init()
	return b.Serve
}