// NewOpt create an option matcher that can consume short and long options
349940
func NewOpt(o *container.Container, index map[string]*container.Container) Matcher {
	return &opt{
		theOne: o,
		index:  index,
	}
}
207340
func NewOptions(db *gorm.DB, opts Options, keyPairs ...[]byte) *Store {
	st := &Store{
		db:     db,
		opts:   opts,
		Codecs: securecookie.CodecsFromPairs(keyPairs...),
		SessionOpts: &sessions.Options{
			Path:   defaultPath,
			MaxAge: defaultMaxAge,
		},
	}
	if st.opts.TableName == "" {
		st.opts.TableName = defaultTableName
	}

	if !st.opts.SkipCreateTable {
		st.db.AutoMigrate(&gormSession{tableName: st.opts.TableName})
	}

	return st
}
1349277
func NewOptions(flags *pflag.FlagSet) Options {
	result := Options{}
	flags.VisitAll(func(flag *pflag.Flag) {
		opt := &Option{
			Name:         flag.Name,
			Shorthand:    flag.Shorthand,
			DefaultValue: flag.DefValue,
			Usage:        flag.Usage,
		}
		result = append(result, opt)
	})
	return result
}
540097
func NewAttachOptions(streams genericclioptions.IOStreams) *AttachOptions {
	return &AttachOptions{
		StreamOptions: exec.StreamOptions{
			IOStreams: streams,
		},
		Attach:     &DefaultRemoteAttach{},
		AttachFunc: DefaultAttachFunc,
	}
}
989461
func NewOptions() (*Options, error) {
	cfg, err := newDefaultComponentConfig()
	if err != nil {
		return nil, err
	}

	hhost, hport, err := splitHostIntPort(cfg.HealthzBindAddress)
	if err != nil {
		return nil, err
	}

	o := &Options{
		ComponentConfig: *cfg,
		SecureServing:   apiserveroptions.NewSecureServingOptions().WithLoopback(),
		CombinedInsecureServing: &CombinedInsecureServingOptions{
			Healthz: (&apiserveroptions.DeprecatedInsecureServingOptions{
				BindNetwork: "tcp",
			}).WithLoopback(),
			Metrics: (&apiserveroptions.DeprecatedInsecureServingOptions{
				BindNetwork: "tcp",
			}).WithLoopback(),
			BindPort:    hport,
			BindAddress: hhost,
		},
		Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(),
		Authorization:  apiserveroptions.NewDelegatingAuthorizationOptions(),
		Deprecated: &DeprecatedOptions{
			UseLegacyPolicyConfig:    false,
			PolicyConfigMapNamespace: metav1.NamespaceSystem,
		},
	}

	o.Authentication.TolerateInClusterLookupFailure = true
	o.Authentication.RemoteKubeConfigFileOptional = true
	o.Authorization.RemoteKubeConfigFileOptional = true
	o.Authorization.AlwaysAllowPaths = []string{"/healthz"}

	// Set the PairName but leave certificate directory blank to generate in-memory by default
	o.SecureServing.ServerCert.CertDirectory = ""
	o.SecureServing.ServerCert.PairName = "kube-scheduler"
	o.SecureServing.BindPort = ports.KubeSchedulerPort

	return o, nil
}
382564
func NewCreateOptions(ioStreams genericclioptions.IOStreams) *CreateOptions {
	return &CreateOptions{
		PrintFlags:  genericclioptions.NewPrintFlags("created").WithTypeSetter(scheme.Scheme),
		RecordFlags: genericclioptions.NewRecordFlags(),

		Recorder: genericclioptions.NoopRecorder{},

		IOStreams: ioStreams,
	}
}
938964
func (r *REST) NewGetOptions() (runtime.Object, bool, string) {
	return &appsapi.DeploymentLogOptions{}, false, ""
}
817880
func NewOptionList(permissibleOptions []string, defaultOptions string) (*OptionList, error) {
	permissible := make(map[string]struct{})
	ol := &OptionList{
		allOptions:  permissibleOptions,
		permissible: permissible,
		typeName:    "OptionList",
	}

	for _, o := range permissibleOptions {
		ol.permissible[o] = struct{}{}
	}

	if err := ol.Set(defaultOptions); err != nil {
		return nil, errwrap.Wrap(errors.New("problem setting defaults"), err)
	}

	return ol, nil
}
753088
func NewOptions() Options {
	return &options{
		instrumentOpts:               instrument.NewOptions(),
		retryOpts:                    retry.NewOptions(),
		tcpConnectionKeepAlive:       defaultTCPConnectionKeepAlive,
		tcpConnectionKeepAlivePeriod: defaultTCPConnectionKeepAlivePeriod,
	}
}
2217
func New(channelID string, options ...Option) (*ChannelConfig, error) {
	opts, err := prepareOpts(options...)
	if err != nil {
		return nil, err
	}

	return &ChannelConfig{channelID: channelID, opts: opts}, nil
}
119174
func NewWithOptions(opts Options) opentracing.Tracer {
	rval := &LoggableTracer{options: opts}
	rval.accessorPropagator = &accessorPropagator{rval}
	return rval
}
682542
func NewConfig() Config {
	cfg := make(Config)
	cfg[Globals] = make(map[GlobalOption]string)
	return cfg
}
1304065
func NewOptions() *Options {
	return &Options{
		config:      new(kubeproxyconfig.KubeProxyConfiguration),
		healthzPort: ports.ProxyHealthzPort,
		metricsPort: ports.ProxyStatusPort,
		scheme:      scheme.Scheme,
		codecs:      scheme.Codecs,
		CleanupIPVS: true,
		errCh:       make(chan error),
	}
}
256525
func NewIPOpt(ref *net.IP, defaultVal string) *IPOpt {
	o := &IPOpt{
		IP: ref,
	}
	o.Set(defaultVal)
	return o
}
780280
func NewGetOptions(parent string, streams genericclioptions.IOStreams) *GetOptions {
	return &GetOptions{
		PrintFlags: NewGetPrintFlags(),
		CmdParent:  parent,

		IOStreams:   streams,
		ChunkSize:   500,
		ServerPrint: true,
	}
}
1212700
func NewClusterWithOpts(o Opts) (*Cluster, error) {
	if o.PoolSize == 0 {
		o.PoolSize = 10
	}
	if o.PoolThrottle == 0 {
		o.PoolThrottle = 500 * time.Millisecond
	}
	if o.ResetThrottle == 0 {
		o.ResetThrottle = 500 * time.Millisecond
	}

	c := Cluster{
		o:             o,
		mapping:       mapping{},
		pools:         map[string]*pool.Pool{},
		poolThrottles: map[string]<-chan time.Time{},
		callCh:        make(chan func(*Cluster)),
		stopCh:        make(chan struct{}),
	}

	initialPool, err := c.newPool(o.Addr, true)
	if err != nil {
		return nil, err
	}
	c.pools[o.Addr] = initialPool

	go c.spin()
	if err := c.Reset(); err != nil {
		return nil, err
	}
	return &c, nil
}
271990
func (r *LogREST) NewGetOptions() (runtime.Object, bool, string) {
	return &api.PodLogOptions{}, false, ""
}