// newAWSIPs returns a New awsIP object.
// If awsRegion is `nil`, it accepts any region. Otherwise, it only allow the regions specified
349097
func newAWSIPs(host string, updateFrequency time.Duration, awsRegion []string) *awsIPs {
	ips := &awsIPs{
		host:            host,
		updateFrequency: updateFrequency,
		awsRegion:       awsRegion,
		updaterStopChan: make(chan bool),
	}
	if err := ips.tryUpdate(); err != nil {
		dcontext.GetLogger(context.Background()).WithError(err).Warn("failed to update AWS IP")
	}
	go ips.updater()
	return ips
}
1290476
func newEdges(n int, e EdgeSet) *Virtual {
	switch {
	case n < 0:
		return nil
	case n == 0:
		return null
	case n == 1:
		return singleton()
	}

	var noCost bool
	if e.Cost == nil {
		noCost = true
		e.Cost = zero
	}
	var noFilter bool
	if e.Keep == nil {
		noFilter = true
		e.Keep = alwaysEdge
	}

	from := e.From.And(Range(0, n))
	to := e.To.And(Range(0, n))
	if from.size() == 0 || to.size() == 0 {
		return Empty(n)
	}
	res := generic(n, e.Cost, func(v, w int) (edge bool) {
		return e.Contains(v, w)
	})

	intersect := from.And(to)
	union := from.Or(to)
	if noFilter {
		res.degree = func(v int) (deg int) {
			switch {
			case intersect.Contains(v):
				return union.size() - 1
			case from.Contains(v):
				return to.size()
			case to.Contains(v):
				return from.size()
			default:
				return
			}
		}
	}

	visit := func(v int, a int, do func(w int, c int64) bool) (aborted bool) {
		switch {
		case intersect.Contains(v):
			for _, in := range union.And(Range(a, n)).set {
				for w := in.a; w < in.b; w++ {
					if v != w && e.Keep(v, w) && do(w, e.Cost(v, w)) {
						return true
					}
				}
			}
			return
		case from.Contains(v):
			for _, in := range to.And(Range(a, n)).set {
				for w := in.a; w < in.b; w++ {
					if e.Keep(v, w) && do(w, e.Cost(v, w)) {
						return true
					}
				}
			}
			return
		case to.Contains(v):
			for _, in := range from.And(Range(a, n)).set {
				for w := in.a; w < in.b; w++ {
					if e.Keep(v, w) && do(w, e.Cost(v, w)) {
						return true
					}
				}
			}
			return
		default:
			return
		}
	}

	visit0 := func(v int, a int, do func(w int, c int64) bool) (aborted bool) {
		switch {
		case intersect.Contains(v):
			for _, in := range union.And(Range(a, n)).set {
				for w := in.a; w < in.b; w++ {
					if v != w && e.Keep(v, w) && do(w, 0) {
						return true
					}
				}
			}
			return
		case from.Contains(v):
			for _, in := range to.And(Range(a, n)).set {
				for w := in.a; w < in.b; w++ {
					if e.Keep(v, w) && do(w, 0) {
						return true
					}
				}
			}
			return
		case to.Contains(v):
			for _, in := range from.And(Range(a, n)).set {
				for w := in.a; w < in.b; w++ {
					if e.Keep(v, w) && do(w, 0) {
						return true
					}
				}
			}
			return
		default:
			return
		}
	}

	if noCost {
		res.visit = visit0
	} else {
		res.visit = visit
	}
	return res
}
340135
func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {
	return nil, errors.New("you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration")
}
656915
func (api *SIMAPI) New(name, iccID, passcode string) *sacloud.SIM {
	return sacloud.CreateNewSIM(name, iccID, passcode)
}
608209
func NewOvsSet(goSlice interface{}) (*OvsSet, error) {
	v := reflect.ValueOf(goSlice)
	if v.Kind() != reflect.Slice {
		return nil, errors.New("OvsSet supports only Go Slice types")
	}

	var ovsSet []interface{}
	for i := 0; i < v.Len(); i++ {
		ovsSet = append(ovsSet, v.Index(i).Interface())
	}
	return &OvsSet{ovsSet}, nil
}
23972
func NewLatches(size uint) *Latches {
	powerOfTwoSize := 1 << uint32(bits.Len32(uint32(size-1)))
	slots := make([]latch, powerOfTwoSize)
	return &Latches{
		slots: slots,
	}
}
1005618
func New(accessKey string, secretKey string, regionName string, secure bool, internal bool, regionEndpoint string) (*KS3, error) {
	auth, err := util.GetAuth(accessKey, secretKey, "", time.Time{})
	if err != nil {
		return nil, fmt.Errorf("unable to resolve ks3 credentials, please ensure that 'accesskey' and 'secretkey' are properly set : %v", err)
	}

	region := GetRegion(fmt.Sprint(regionName))
	if region.Name == "" {
		return nil, fmt.Errorf("Invalid region provided: %v", regionName)
	}
	region.SetCurrentUseEndpoint(internal)
	region.SetProtocol(secure)
	region.SetRegionEndpoint(regionEndpoint)

	return &KS3{
		Auth:    auth,
		Region:  region,
		Client:  http.DefaultClient,
		private: 0,
	}, nil
}
148875
func (c *BucketizedPoolConfiguration) NewBuckets() []Bucket {
	buckets := make([]Bucket, 0, len(c.Buckets))
	for _, bconfig := range c.Buckets {
		bucket := bconfig.NewBucket()
		buckets = append(buckets, bucket)
	}
	return buckets
}
230239
func (factory *NagiosBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := NagiosBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.services = make(map[string]map[string]service)
	bee.ReloadOptions(options)

	return &bee
}
1211549
func New() locales.Translator {
	return &wo{
		locale:                 "wo",
		pluralsCardinal:        []locales.PluralRule{6},
		pluralsOrdinal:         nil,
		pluralsRange:           nil,
		decimal:                ",",
		group:                  ".",
		minus:                  "-",
		percent:                "%",
		perMille:               "‰",
		timeSeparator:          ":",
		inifinity:              "∞",
		currencies:             []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
		currencyPositivePrefix: " ",
		currencyNegativePrefix: " ",
		monthsAbbreviated:      []string{"", "Sam", "Few", "Mar", "Awr", "Mee", "Suw", "Sul", "Ut", "Sàt", "Okt", "Now", "Des"},
		monthsNarrow:           []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
		monthsWide:             []string{"", "Samwiyee", "Fewriyee", "Mars", "Awril", "Mee", "Suwe", "Sulet", "Ut", "Sàttumbar", "Oktoobar", "Nowàmbar", "Desàmbar"},
		daysAbbreviated:        []string{"Dib", "Alt", "Tal", "Àla", "Alx", "Àjj", "Ase"},
		daysNarrow:             []string{"Dib", "Alt", "Tal", "Àla", "Alx", "Àjj", "Ase"},
		daysShort:              []string{"Dib", "Alt", "Tal", "Àla", "Alx", "Àjj", "Ase"},
		daysWide:               []string{"Dibéer", "Altine", "Talaata", "Àlarba", "Alxamis", "Àjjuma", "Aseer"},
		periodsAbbreviated:     []string{"Sub", "Ngo"},
		periodsNarrow:          []string{"Sub", "Ngo"},
		periodsWide:            []string{"Sub", "Ngo"},
		erasAbbreviated:        []string{"JC", "AD"},
		erasNarrow:             []string{"", ""},
		erasWide:               []string{"av. JC", "AD"},
		timezones:              map[string]string{"ACDT": "ACDT", "MEZ": "CEST (waxtu estàndaaru ëroop sàntaraal)", "MESZ": "CEST (waxtu ete wu ëroop sàntaraal)", "EAT": "EAT", "∅∅∅": "∅∅∅", "GYT": "GYT", "ADT": "ADT (waxtu bëccëgu atlàntik)", "SAST": "SAST", "BT": "BT", "NZDT": "NZDT", "ECT": "ECT", "IST": "IST", "WARST": "WARST", "HNT": "HNT", "HNCU": "HNCU", "HEPMX": "HEPMX", "BOT": "BOT", "LHST": "LHST", "SRT": "SRT", "OEZ": "EEST (waxtu estàndaaru ëroop u penku)", "GMT": "GMT (waxtu Greenwich)", "MST": "MST (waxtu estàndaaru tundu)", "AKST": "AKST", "EDT": "EDT (waxtu bëccëgu penku)", "VET": "VET", "WIT": "WIT", "HADT": "HADT", "UYT": "UYT", "UYST": "UYST", "ChST": "ChST", "AKDT": "AKDT", "ACST": "ACST", "ACWST": "ACWST", "HEOG": "HEOG", "CLST": "CLST", "OESZ": "EEST (waxtu ete wu ëroop u penku)", "ART": "ART", "AWDT": "AWDT", "AEST": "AEST", "WIB": "WIB", "HEEG": "HEEG", "COT": "COT", "COST": "COST", "HECU": "HECU", "AWST": "AWST", "GFT": "GFT", "CLT": "CLT", "HNPMX": "HNPMX", "MYT": "MYT", "TMST": "TMST", "AEDT": "AEDT", "WESZ": "WEST (waxtu ete wu ëroop u sowwu-jant)", "HNEG": "HNEG", "HEPM": "HEPM", "CAT": "CAT", "HAST": "HAST", "CHAST": "CHAST", "JDT": "JDT", "HNPM": "HNPM", "WITA": "WITA", "CDT": "CDT (waxtu bëccëgu sàntaraal", "MDT": "MDT (waxtu bëccëgu tundu)", "WAT": "WAT", "WAST": "WAST", "SGT": "SGT", "EST": "EST (waxtu estàndaaru penku)", "HNOG": "HNOG", "HAT": "HAT", "HENOMX": "HENOMX", "CHADT": "CHADT", "AST": "AST (waxtu estàndaaru penku)", "LHDT": "LHDT", "HNNOMX": "HNNOMX", "ARST": "ARST", "NZST": "NZST", "HKT": "HKT", "PDT": "PDT (waxtu bëccëgu pasifik)", "WEZ": "WEST (waxtu estàndaaru ëroop u sowwu-jant)", "ACWDT": "ACWDT", "WART": "WART", "TMT": "TMT", "CST": "CST (waxtu estàndaaru sàntaraal)", "PST": "PST (waxtu estàndaaru pasifik)", "JST": "JST", "HKST": "HKST"},
	}
}
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
}
434250
func (s *AggregatedSourceStatus) SetAwsRegion(v string) *AggregatedSourceStatus {
	s.AwsRegion = &v
	return s
}
572237
func NewAwsManager(awsManagerConfig *AwsManagerConfig) *AwsManager {
	if awsManagerConfig == nil {
		awsManagerConfig = &AwsManagerConfig{}
	}
	awsManagerConfig.clean()
	return &AwsManager{
		config: awsManagerConfig,
		api:    &awsApi{},
	}
}
734081
func (s *Record) SetAwsRegion(v string) *Record {
	s.AwsRegion = &v
	return s
}
978320
func (i *goIpsetProvider) NewIpset(name string, hasht string, p *ipset.Params) (Ipset, error) {
	return ipset.New(name, hasht, p)
}
1252008
func NewBySubSpan(path, key string, i, j int) *Parth {
	s, err := SubSpan(path, key, i, j)
	return &Parth{s, err}
}
171048
func NewUnixSock(s string) (ret UnixSock, err error) {
	ret.path = s
	return ret, nil
}