// newJoinOptions returns a struct ready for being used for creating cmd join flags.
972212
func newJoinOptions() *joinOptions {
	// initialize the public kubeadm config API by applying defaults
	externalcfg := &kubeadmapiv1beta2.JoinConfiguration{}

	// Add optional config objects to host flags.
	// un-set objects will be cleaned up afterwards (into newJoinData func)
	externalcfg.Discovery.File = &kubeadmapiv1beta2.FileDiscovery{}
	externalcfg.Discovery.BootstrapToken = &kubeadmapiv1beta2.BootstrapTokenDiscovery{}
	externalcfg.ControlPlane = &kubeadmapiv1beta2.JoinControlPlane{}

	// Apply defaults
	kubeadmscheme.Scheme.Default(externalcfg)

	return &joinOptions{
		externalcfg: externalcfg,
	}
}
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
}
1248526
func newNonTS() *SetNonTS {
	s := &SetNonTS{}
	s.m = make(map[interface{}]struct{})

	// Ensure interface compliance
	var _ Interface = s

	return s
}
734637
func buildLabelOptions(labels map[string]string, stages []instructions.Stage) {
	keys := []string{}
	for key := range labels {
		keys = append(keys, key)
	}

	// Sort the label to have a repeatable order
	sort.Strings(keys)
	for _, key := range keys {
		value := labels[key]
		stages[len(stages)-1].AddCommand(instructions.NewLabelCommand(key, value, true))
	}
}
1374674
func NewWithOptions(out io.Writer, prefix string, flags int) gournal.Appender {
	return &appender{log.New(out, prefix, flags)}
}
1138489
func newJoin(lpb, rpb *primitiveBuilder, ajoin *sqlparser.JoinTableExpr) error {
	// This function converts ON clauses to WHERE clauses. The WHERE clause
	// scope can see all tables, whereas the ON clause can only see the
	// participants of the JOIN. However, since the ON clause doesn't allow
	// external references, and the FROM clause doesn't allow duplicates,
	// it's safe to perform this conversion and still expect the same behavior.

	opcode := engine.NormalJoin
	if ajoin != nil {
		switch {
		case ajoin.Join == sqlparser.LeftJoinStr:
			opcode = engine.LeftJoin

			// For left joins, we have to push the ON clause into the RHS.
			// We do this before creating the join primitive.
			// However, variables of LHS need to be visible. To allow this,
			// we mark the LHS symtab as outer scope to the RHS, just like
			// a subquery. This make the RHS treat the LHS symbols as external.
			// This will prevent constructs from escaping out of the rpb scope.
			// At this point, the LHS symtab also contains symbols of the RHS.
			// But the RHS will hide those, as intended.
			rpb.st.Outer = lpb.st
			if err := rpb.pushFilter(ajoin.Condition.On, sqlparser.WhereStr); err != nil {
				return err
			}
		case ajoin.Condition.Using != nil:
			return errors.New("unsupported: join with USING(column_list) clause")
		}
	}
	lpb.bldr = &join{
		Left:  lpb.bldr,
		Right: rpb.bldr,
		ejoin: &engine.Join{
			Opcode: opcode,
			Vars:   make(map[string]int),
		},
	}
	lpb.bldr.Reorder(0)
	if ajoin == nil || opcode == engine.LeftJoin {
		return nil
	}
	return lpb.pushFilter(ajoin.Condition.On, sqlparser.WhereStr)
}
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,
	}
}
1347199
func NewCookieOptions() CookieOptions {
	return CookieOptions{
		Name:     "id",
		Path:     "/",
		MaxAge:   0,
		Secure:   true,
		HTTPOnly: true,
	}
}
1034190
func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) {
	errors := make([]error, 0)
	x := &Operation{}
	m, ok := compiler.UnpackMap(in)
	if !ok {
		message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
		errors = append(errors, compiler.NewError(context, message))
	} else {
		requiredKeys := []string{"responses"}
		missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
		if len(missingKeys) > 0 {
			message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
			errors = append(errors, compiler.NewError(context, message))
		}
		allowedKeys := []string{"callbacks", "deprecated", "description", "externalDocs", "operationId", "parameters", "requestBody", "responses", "security", "servers", "summary", "tags"}
		allowedPatterns := []*regexp.Regexp{pattern1}
		invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
		if len(invalidKeys) > 0 {
			message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
			errors = append(errors, compiler.NewError(context, message))
		}
		// repeated string tags = 1;
		v1 := compiler.MapValueForKey(m, "tags")
		if v1 != nil {
			v, ok := v1.([]interface{})
			if ok {
				x.Tags = compiler.ConvertInterfaceArrayToStringArray(v)
			} else {
				message := fmt.Sprintf("has unexpected value for tags: %+v (%T)", v1, v1)
				errors = append(errors, compiler.NewError(context, message))
			}
		}
		// string summary = 2;
		v2 := compiler.MapValueForKey(m, "summary")
		if v2 != nil {
			x.Summary, ok = v2.(string)
			if !ok {
				message := fmt.Sprintf("has unexpected value for summary: %+v (%T)", v2, v2)
				errors = append(errors, compiler.NewError(context, message))
			}
		}
		// string description = 3;
		v3 := compiler.MapValueForKey(m, "description")
		if v3 != nil {
			x.Description, ok = v3.(string)
			if !ok {
				message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3)
				errors = append(errors, compiler.NewError(context, message))
			}
		}
		// ExternalDocs external_docs = 4;
		v4 := compiler.MapValueForKey(m, "externalDocs")
		if v4 != nil {
			var err error
			x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", context))
			if err != nil {
				errors = append(errors, err)
			}
		}
		// string operation_id = 5;
		v5 := compiler.MapValueForKey(m, "operationId")
		if v5 != nil {
			x.OperationId, ok = v5.(string)
			if !ok {
				message := fmt.Sprintf("has unexpected value for operationId: %+v (%T)", v5, v5)
				errors = append(errors, compiler.NewError(context, message))
			}
		}
		// repeated ParameterOrReference parameters = 6;
		v6 := compiler.MapValueForKey(m, "parameters")
		if v6 != nil {
			// repeated ParameterOrReference
			x.Parameters = make([]*ParameterOrReference, 0)
			a, ok := v6.([]interface{})
			if ok {
				for _, item := range a {
					y, err := NewParameterOrReference(item, compiler.NewContext("parameters", context))
					if err != nil {
						errors = append(errors, err)
					}
					x.Parameters = append(x.Parameters, y)
				}
			}
		}
		// RequestBodyOrReference request_body = 7;
		v7 := compiler.MapValueForKey(m, "requestBody")
		if v7 != nil {
			var err error
			x.RequestBody, err = NewRequestBodyOrReference(v7, compiler.NewContext("requestBody", context))
			if err != nil {
				errors = append(errors, err)
			}
		}
		// Responses responses = 8;
		v8 := compiler.MapValueForKey(m, "responses")
		if v8 != nil {
			var err error
			x.Responses, err = NewResponses(v8, compiler.NewContext("responses", context))
			if err != nil {
				errors = append(errors, err)
			}
		}
		// CallbacksOrReferences callbacks = 9;
		v9 := compiler.MapValueForKey(m, "callbacks")
		if v9 != nil {
			var err error
			x.Callbacks, err = NewCallbacksOrReferences(v9, compiler.NewContext("callbacks", context))
			if err != nil {
				errors = append(errors, err)
			}
		}
		// bool deprecated = 10;
		v10 := compiler.MapValueForKey(m, "deprecated")
		if v10 != nil {
			x.Deprecated, ok = v10.(bool)
			if !ok {
				message := fmt.Sprintf("has unexpected value for deprecated: %+v (%T)", v10, v10)
				errors = append(errors, compiler.NewError(context, message))
			}
		}
		// repeated SecurityRequirement security = 11;
		v11 := compiler.MapValueForKey(m, "security")
		if v11 != nil {
			// repeated SecurityRequirement
			x.Security = make([]*SecurityRequirement, 0)
			a, ok := v11.([]interface{})
			if ok {
				for _, item := range a {
					y, err := NewSecurityRequirement(item, compiler.NewContext("security", context))
					if err != nil {
						errors = append(errors, err)
					}
					x.Security = append(x.Security, y)
				}
			}
		}
		// repeated Server servers = 12;
		v12 := compiler.MapValueForKey(m, "servers")
		if v12 != nil {
			// repeated Server
			x.Servers = make([]*Server, 0)
			a, ok := v12.([]interface{})
			if ok {
				for _, item := range a {
					y, err := NewServer(item, compiler.NewContext("servers", context))
					if err != nil {
						errors = append(errors, err)
					}
					x.Servers = append(x.Servers, y)
				}
			}
		}
		// repeated NamedAny specification_extension = 13;
		// MAP: Any ^x-
		x.SpecificationExtension = make([]*NamedAny, 0)
		for _, item := range m {
			k, ok := compiler.StringValue(item.Key)
			if ok {
				v := item.Value
				if strings.HasPrefix(k, "x-") {
					pair := &NamedAny{}
					pair.Name = k
					result := &Any{}
					handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
					if handled {
						if err != nil {
							errors = append(errors, err)
						} else {
							bytes, _ := yaml.Marshal(v)
							result.Yaml = string(bytes)
							result.Value = resultFromExt
							pair.Value = result
						}
					} else {
						pair.Value, err = NewAny(v, compiler.NewContext(k, context))
						if err != nil {
							errors = append(errors, err)
						}
					}
					x.SpecificationExtension = append(x.SpecificationExtension, pair)
				}
			}
		}
	}
	return x, compiler.NewErrorGroupOrNil(errors)
}
891373
func NewGlobOption(opts ...GlogOptFunc) *GlobOption {
	o := &GlobOption{flags: GlobStdFlags}
	for _, opt := range opts {
		opt(o)
	}
	return o
}
344272
func NewOptions(opts []*container.Container, index map[string]*container.Container) Matcher {
	return &options{
		options: opts,
		index:   index,
	}
}
796469
func (me *Dataset) InnerJoin(table Expression, condition joinExpression) *Dataset {
	return me.joinTable(INNER_JOIN, table, condition)
}
741016
func NewCreateJobOptions(ioStreams genericclioptions.IOStreams) *CreateJobOptions {
	return &CreateJobOptions{
		PrintFlags: genericclioptions.NewPrintFlags("created").WithTypeSetter(scheme.Scheme),
		IOStreams:  ioStreams,
	}
}
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
}
393257
func NewOptionsSelectBlockElement(optType string, placeholder *TextBlockObject, actionID string, options ...*OptionBlockObject) *SelectBlockElement {
	return &SelectBlockElement{
		Type:        optType,
		Placeholder: placeholder,
		ActionID:    actionID,
		Options:     options,
	}
}
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(),
	}
}
1138150
func RunOptionalJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.ClusterConfiguration, ignorePreflightErrors sets.String) error {
	checks := []Checker{}

	// Check if IVPS kube-proxy mode is supported
	if cfg.ComponentConfigs.KubeProxy != nil && cfg.ComponentConfigs.KubeProxy.Mode == ipvsutil.IPVSProxyMode {
		checks = append(checks, IPVSProxierCheck{exec: execer})
	}

	return RunChecks(checks, os.Stderr, ignorePreflightErrors)
}