// NewEditOptions returns an initialized EditOptions instance
779218
func NewEditOptions(editMode EditMode, ioStreams genericclioptions.IOStreams) *EditOptions {
	return &EditOptions{
		RecordFlags: genericclioptions.NewRecordFlags(),

		EditMode: editMode,

		PrintFlags: genericclioptions.NewPrintFlags("edited").WithTypeSetter(scheme.Scheme),

		editPrinterOptions: &editPrinterOptions{
			// create new editor-specific PrintFlags, with all
			// output flags disabled, except json / yaml
			printFlags: (&genericclioptions.PrintFlags{
				JSONYamlPrintFlags: genericclioptions.NewJSONYamlPrintFlags(),
			}).WithDefaultOutput("yaml"),
			ext:       ".yaml",
			addHeader: true,
		},

		WindowsLineEndings: goruntime.GOOS == "windows",

		Recorder: genericclioptions.NoopRecorder{},

		IOStreams: ioStreams,
	}
}
411001
func (s *GuestOSService) NewAddGuestOsParams(details map[string]string, oscategoryid string, osdisplayname string) *AddGuestOsParams {
	p := &AddGuestOsParams{}
	p.p = make(map[string]interface{})
	p.p["details"] = details
	p.p["oscategoryid"] = oscategoryid
	p.p["osdisplayname"] = osdisplayname
	return p
}
862068
func NewOptionGroupBlockElement(label *TextBlockObject, options ...*OptionBlockObject) *OptionGroupBlockObject {
	return &OptionGroupBlockObject{
		Label:   label,
		Options: options,
	}
}
666227
func NewWithLockerOptions(client *etcd3.Client, opts LockerOptions) (*Etcd3Locker, error) {
	locksMap := map[string]*etcd3Lock{}
	return &Etcd3Locker{Client: client, prefix: opts.Prefix(), sessionTtl: opts.Ttl(), locks: locksMap, mutex: sync.Mutex{}}, nil
}
483868
func NewIndexOption() *DialogOption {
	return &DialogOption{
		Description: []string{
			"Choose a story by inserting the associated index.",
		},
		IsActive: func(stories []common.Story, depth int) bool {
			return len(stories) != 0
		},
		MatchesInput: func(input string, stories []common.Story) bool {
			index, err := strconv.Atoi(input)
			if err != nil {
				return false
			}
			return 1 <= index && index <= len(stories)
		},
		SelectStory: func(
			input string,
			stories []common.Story,
			currentDialog *Dialog,
		) (common.Story, error) {

			index, _ := strconv.Atoi(input)
			return stories[index-1], nil
		},
	}
}
153381
func NewOptions(e *xorm.Engine, opts Options, keyPairs ...[]byte) (*Store, error) {
	st := &Store{
		e:      e,
		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 {
		if err := st.e.Sync2(&xormSession{tableName: st.opts.TableName}); err != nil {
			return nil, err
		}
	}

	return st, nil
}
632127
func NewOption(name string, params map[string]string) Option {
	p := Parameters{}
	for k, v := range params {
		p.Set([]byte(k), []byte(v))
	}
	return Option{
		Name:       []byte(name),
		Parameters: p,
	}
}
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
}
652255
func NewRolloutUndoOptions(streams genericclioptions.IOStreams) *UndoOptions {
	return &UndoOptions{
		PrintFlags: genericclioptions.NewPrintFlags("rolled back").WithTypeSetter(scheme.Scheme),
		IOStreams:  streams,
		ToRevision: int64(0),
	}
}
139200
func NewOptions(flags *flag.FlagSet, orchestrator command.Orchestrator) Options {
	opts := Options{
		Orchestrator: orchestrator,
	}
	if namespace, err := flags.GetString("namespace"); err == nil {
		opts.Namespace = namespace
	}
	if kubeConfig, err := flags.GetString("kubeconfig"); err == nil {
		opts.Config = kubeConfig
	}
	return opts
}
257532
func NewOptions() *Options {
	// Default values
	return &Options{
		defaultHost:  "http://www.example.com",
		sitemapsHost: "", // http://s3.amazonaws.com/sitemap-generator/,
		publicPath:   "public/",
		sitemapsPath: "sitemaps/",
		filename:     "sitemap",
		verbose:      true,
		compress:     true,
		pretty:       false,
		adp:          NewFileAdapter(),
	}
}
1374674
func NewWithOptions(out io.Writer, prefix string, flags int) gournal.Appender {
	return &appender{log.New(out, prefix, flags)}
}
40957
func newOptions(options ...Option) *Options {
	opts := &Options{}
	for _, o := range options {
		o(opts)
	}
	return opts
}
509005
func NewNatsOptions(optionFuncs ...OptionsFunc) (options *NatsOptions) {
	options = &NatsOptions{Options: nats.DefaultOptions}
	options.setOptions(prepend(optionFuncs, setDefaultOptions)...)
	return
}
794699
func NewEditMessageText(chatID int64, messageID int, text string) EditMessageTextConfig {
	return EditMessageTextConfig{
		BaseEdit: BaseEdit{
			ChatID:    chatID,
			MessageID: messageID,
		},
		Text: text,
	}
}
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
}
1304295
func (s *Subsection) AddOption(key string, value string) *Subsection {
	s.Options = s.Options.withAddedOption(key, value)
	return s
}