// NewVarSet returns a new VarSet containing the specified variables.
331826
func NewVarSet(vs ...Var) VarSet {
	s := VarSet{}
	for _, v := range vs {
		s.Add(v)
	}
	return s
}
833209
func NewVar(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Var, err error) {
	if selectData == nil {
		return nil, ErrDOHLCVDataSelectFuncIsNil
	}

	ind := Var{
		selectData: selectData,
	}

	ind.VarWithoutStorage, err = NewVarWithoutStorage(timePeriod,
		func(dataItem float64, streamBarIndex int) {
			ind.Data = append(ind.Data, dataItem)
		})

	return &ind, err
}
1240138
func NewPropertySet(ctx Context, job *structs.Job) *propertySet {
	p := &propertySet{
		ctx:            ctx,
		jobID:          job.ID,
		namespace:      job.Namespace,
		existingValues: make(map[string]uint64),
		logger:         ctx.Logger().Named("property_set"),
	}

	return p
}
97837
func NewFlagSet(name string) *FlagSet {
	return &FlagSet{
		name:    name,
		flagSet: flag.NewFlagSet(name, flag.ContinueOnError),
	}
}
552631
func NewFields(v map[string]interface{}) Fields {
	fields := make(Fields)
	for k, v := range v {
		fields[k] = v
	}
	return fields
}
120062
func NewIntSet() *Set {
	return NewCustomSet(func(l, r interface{}) bool {
		return l.(int) < r.(int)
	})
}
187254
func NewNonTS(items ...interface{}) *SetNonTS {
	s := &SetNonTS{}
	s.m = make(map[interface{}]struct{})

	// Ensure interface compliance
	var _ Interface = s

	s.Add(items...)
	return s
}
1089905
func (rule *Rule) AddVariable(variable *Variable) {
	for key, existingVariable := range rule.Variables {
		if existingVariable.Name == variable.Name {
			rule.Variables[key] = variable

			return
		}
	}

	rule.Variables = append(rule.Variables, variable)
}
746921
func (s VarSet) Update(vs VarSet) {
	for v := range vs {
		s.Add(v)
	}
}
938243
func (s *StringValue) Set(v string) error {
	if s.v == nil {
		s.v = new(string)
	}
	*(s.v) = v
	return nil
}
591009
func (ev *EnvVars) Set(key, value string) {
	v := os.Getenv(key)
	_, ok := ev.vars[key]
	if !ok {
		ev.vars[key] = v
	}
	if err := os.Setenv(key, value); err != nil {
		msg := fmt.Sprintf("cannot set environment variable %q: %v", key, err)
		ev.assert.Fail(msg)
	}
}
758167
func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
	f.VarP(newIPValue(value, p), name, shorthand, usage)
}
978320
func (i *goIpsetProvider) NewIpset(name string, hasht string, p *ipset.Params) (Ipset, error) {
	return ipset.New(name, hasht, p)
}
1317673
func (s VarSet) Copy() VarSet {
	cpy := VarSet{}
	for v := range s {
		cpy.Add(v)
	}
	return cpy
}
711989
func (g *Generator) New(varName string, varType interface{}) (string, error) {
	switch t := varType.(type) {
	case *Param:
		return g.New(varName, t.OriginalType)
	case types.Type:
		return g.varInitString(varName, t)
	}

	return "", fmt.Errorf("New: unsupported argument type: %T", varType)
}
1148956
func New(items ...interface{}) *Set {
	set := pool.Get().(*Set)
	for _, item := range items {
		set.items[item] = struct{}{}
	}
	
	if len(items) > 0 {
		set.flattened = nil
	}

	return set
}
113452
func newVariable(ln *line, parent element) (*variable, error) {
	name, value, err := variableNV(ln)

	if err != nil {
		return nil, err
	}

	if strings.HasSuffix(value, semicolon) {
		return nil, fmt.Errorf("variable must not end with %q", semicolon)
	}

	return &variable{
		elementBase: newElementBase(ln, parent),
		name:        name,
		value:       value,
	}, nil
}