// NewOptions returns a new Options object.
437278
func NewOptions() Options {
	return &opts{
		contextPoolOpts:        pool.NewObjectPoolOptions(),
		finalizerPoolOpts:      pool.NewObjectPoolOptions(),
		maxPooledFinalizerCap:  defaultMaxFinalizersCap,
		initPooledFinalizerCap: defaultInitFinalizersCap,
	}
}
382564
func NewCreateOptions(ioStreams genericclioptions.IOStreams) *CreateOptions {
	return &CreateOptions{
		PrintFlags:  genericclioptions.NewPrintFlags("created").WithTypeSetter(scheme.Scheme),
		RecordFlags: genericclioptions.NewRecordFlags(),

		Recorder: genericclioptions.NoopRecorder{},

		IOStreams: ioStreams,
	}
}
1067257
func WithCreateOptions(opts map[string]string) CreateOption {
	return func(cfg *CreateConfig) {
		cfg.Options = opts
	}
}
1374674
func NewWithOptions(out io.Writer, prefix string, flags int) gournal.Appender {
	return &appender{log.New(out, prefix, flags)}
}
148936
func NewWithOptions(opts *Options) *Interpolator {
	return &Interpolator{
		template: templateReader(opts),
		output:   outputWriter(opts),
		format:   opts.Format,
		rb:       make([]rune, 0, 64),
		start:    -1,
		closing:  false,
	}
}
275685
func newOption(w io.Writer, eh flag.ErrorHandling) (o *option) {
	o = &option{
		flagSet: flag.NewFlagSet(CommandName, eh),
	}
	// option settings
	o.flagSet.StringVar(&o.udic, "udic", "", "user dic")
	o.flagSet.StringVar(&o.sysdic, "sysdic", "ipa", "system dic type (ipa|uni)")
	o.flagSet.StringVar(&o.output, "output", "", "output file")
	o.flagSet.BoolVar(&o.verbose, "v", false, "verbose mode")
	return
}
657348
func NewRequestOptions(r *http.Request) *RequestOptions {
	if reqOpt := getFromForm(r.URL.Query()); reqOpt != nil {
		return reqOpt
	}

	if r.Method != http.MethodPost {
		return &RequestOptions{}
	}

	if r.Body == nil {
		return &RequestOptions{}
	}

	// TODO: improve Content-Type handling
	contentTypeStr := r.Header.Get("Content-Type")
	contentTypeTokens := strings.Split(contentTypeStr, ";")
	contentType := contentTypeTokens[0]

	switch contentType {
	case ContentTypeGraphQL:
		body, err := ioutil.ReadAll(r.Body)
		if err != nil {
			return &RequestOptions{}
		}
		return &RequestOptions{
			Query: string(body),
		}
	case ContentTypeFormURLEncoded:
		if err := r.ParseForm(); err != nil {
			return &RequestOptions{}
		}

		if reqOpt := getFromForm(r.PostForm); reqOpt != nil {
			return reqOpt
		}

		return &RequestOptions{}

	case ContentTypeJSON:
		fallthrough
	default:
		var opts RequestOptions
		body, err := ioutil.ReadAll(r.Body)
		if err != nil {
			return &opts
		}
		err = json.Unmarshal(body, &opts)
		if err != nil {
			// Probably `variables` was sent as a string instead of an object.
			// So, we try to be polite and try to parse that as a JSON string
			var optsCompatible requestOptionsCompatibility
			json.Unmarshal(body, &optsCompatible)
			json.Unmarshal([]byte(optsCompatible.Variables), &opts.Variables)
		}
		return &opts
	}
}
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
}
683199
func (t *MetricSanitizationType) NewOptions() *tally.SanitizeOptions {
	switch *t {
	case NoMetricSanitization:
		return nil
	case M3MetricSanitization:
		return &m3.DefaultSanitizerOpts
	case PrometheusMetricSanitization:
		return &prometheus.DefaultSanitizerOpts
	}
	return nil
}
817921
func New(name string, options []string) *List {
	list := &List{}

	list.name = name
	list.options = options
	list.Index = 0

	list.Cursor = &curse.Cursor{}

	list.SetColors(DefaultColors)
	list.SetPrint(fmt.Print)
	list.SetChooser(" ❯ ")
	list.SetIndent(3)

	return list
}
331315
func (r *REST) NewGetOptions() (runtime.Object, bool, string) {
	return &buildapi.BuildLogOptions{}, false, ""
}
349940
func NewOpt(o *container.Container, index map[string]*container.Container) Matcher {
	return &opt{
		theOne: o,
		index:  index,
	}
}
1319966
func New(o *rules.Options) *Parser {
	if o == nil {
		return &Parser{options: defaultOptions}
	}
	return &Parser{options: o}
}
883951
func NewOptions() Options {
	return &options{
		scope:          tally.NoopScope,
		initialBackoff: defaultInitialBackoff,
		backoffFactor:  defaultBackoffFactor,
		maxBackoff:     defaultMaxBackoff,
		maxRetries:     defaultMaxRetries,
		forever:        defaultForever,
		jitter:         defaultJitter,
		rngFn:          rand.Int63n,
	}
}
583813
func (c Configuration) NewOptions(iOpts instrument.Options) Options {
	opts := NewOptions().
		SetRetryOptions(c.Retry.NewOptions(iOpts.MetricsScope())).
		SetInstrumentOptions(iOpts)
	if c.KeepAliveEnabled != nil {
		opts = opts.SetTCPConnectionKeepAlive(*c.KeepAliveEnabled)
	}
	if c.KeepAlivePeriod != nil {
		opts = opts.SetTCPConnectionKeepAlivePeriod(*c.KeepAlivePeriod)
	}
	return opts
}
113512
func NewWithOptions(opts Options) opentracing.Tracer {
	rval := &tracerImpl{options: opts}
	rval.textPropagator = &textMapPropagator{rval}
	rval.binaryPropagator = &binaryPropagator{rval}
	rval.accessorPropagator = &accessorPropagator{rval}
	return rval
}
793924
func NewOptions(opts OptionsOptions) (*Options, error) {
	if opts.ConnectorName == "" {
		return nil, fmt.Errorf("Missing required opt: opts.ConnectorName")
	}
	if opts.GithubSlug == "" {
		return nil, fmt.Errorf("Missing required opt: opts.GithubSlug")
	}
	if opts.Tag == "" {
		return nil, fmt.Errorf("Missing required opt: opts.Tag")
	}
	if opts.UUID == "" {
		return nil, fmt.Errorf("Missing required opt: opts.UUID")
	}
	if opts.Token == "" {
		return nil, fmt.Errorf("Missing required opt: opts.Token")
	}
	if opts.IgnitionTag == "" {
		return nil, fmt.Errorf("Missing required opt: opts.IgnitionTag")
	}
	if opts.ServiceType == "" {
		opts.ServiceType = "Service"
	}
	if opts.ServiceType == "UserService" {
		if opts.ServiceUsername == "" {
			opts.ServiceUsername = os.Getenv("USER")
		}
	}

	OutputDirectory := opts.OutputDirectory
	if OutputDirectory == "" {
		OutputDirectory = getUserServiceDirectory()
		if opts.ServiceType == "Service" {
			OutputDirectory = getServiceDirectory()
		}
	}

	OutputDirectory, err := filepath.Abs(OutputDirectory)
	if err != nil {
		return nil, err
	}
	ConnectorDirectory := getConnectorDirectory(OutputDirectory, opts.UUID)

	return &Options{
		ConnectorDirectory: ConnectorDirectory,
		OutputDirectory:    OutputDirectory,
		Domain:             getDomain(opts.Domain, opts.ResolveSRV),
		ResolveSRV:         opts.ResolveSRV,
		IgnitionURL:        getIgnitionURI(opts.IgnitionTag, runtime.GOOS, runtime.GOARCH),
		IgnitionPath:       getIgnitionPath(ConnectorDirectory),
		LogDirectory:       getLogDirectory(ConnectorDirectory),
		BinDirectory:       getBinDirectory(OutputDirectory),

		ServiceName: getServiceName(opts.UUID),
		DisplayName: getDisplayName(opts.UUID),
		Description: getDescription(opts.ConnectorName, opts.UUID),

		ConnectorName: opts.ConnectorName,
		GithubSlug:    opts.GithubSlug,
		Tag:           opts.Tag,
		UUID:          opts.UUID,
		Token:         opts.Token,

		ServiceType:     opts.ServiceType,
		ServiceUsername: opts.ServiceUsername,
		ServicePassword: opts.ServicePassword,
	}, nil
}