// NewKama creates a Kaufman Adaptive Moving Average Indicator (Kama) for online usage
971831
func NewKama(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error) {
	if selectData == nil {
		return nil, ErrDOHLCVDataSelectFuncIsNil
	}

	ind := Kama{
		selectData: selectData,
	}

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

	return &ind, err
}
197472
func NewRank() *Rank {
	return &Rank{
		0,
		0,
		Relation{
			0,
			0,
			make(map[int]map[int]Score),
		},
		make(map[int]string),
		make(map[int]*Word),
		make(map[string]int),
	}
}
1349611
func NewGrid(cols, rows int) *Grid {
	return &Grid{
		cols:          cols,
		rows:          rows,
		cells:         make(map[image.Point]Widget),
		columnStretch: make(map[int]int),
		rowStretch:    make(map[int]int),
	}
}
155068
func New() locales.Translator {
	return &kea{
		locale:                 "kea",
		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", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "৳", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "$", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "\u200b", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "$", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "៛", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "₸", "₭", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "₮", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "₱", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "$", "SCR", "SDD", "SDG", "SDP", "SEK", "$", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "₺", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
		currencyPositiveSuffix: " ",
		currencyNegativePrefix: "(",
		currencyNegativeSuffix: " )",
		monthsAbbreviated:      []string{"", "Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Otu", "Nuv", "Diz"},
		monthsNarrow:           []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
		monthsWide:             []string{"", "Janeru", "Febreru", "Marsu", "Abril", "Maiu", "Junhu", "Julhu", "Agostu", "Setenbru", "Otubru", "Nuvenbru", "Dizenbru"},
		daysAbbreviated:        []string{"dum", "sig", "ter", "kua", "kin", "ses", "sab"},
		daysNarrow:             []string{"D", "S", "T", "K", "K", "S", "S"},
		daysShort:              []string{"du", "si", "te", "ku", "ki", "se", "sa"},
		daysWide:               []string{"dumingu", "sigunda-fera", "tersa-fera", "kuarta-fera", "kinta-fera", "sesta-fera", "sabadu"},
		periodsAbbreviated:     []string{"am", "pm"},
		periodsNarrow:          []string{"a", "p"},
		periodsWide:            []string{"am", "pm"},
		erasAbbreviated:        []string{"AK", "DK"},
		erasNarrow:             []string{"", ""},
		erasWide:               []string{"Antis di Kristu", "Dispos di Kristu"},
		timezones:              map[string]string{"BT": "BT", "SRT": "SRT", "WIT": "WIT", "OESZ": "Ora di Verãu di Europa Oriental", "MDT": "Ora di Verãu di Montanha", "MEZ": "Ora Padrãu di Europa Sentral", "HENOMX": "HENOMX", "OEZ": "Ora Padrãu di Europa Oriental", "HADT": "HADT", "CDT": "Ora Sentral di Verãu", "HEPMX": "HEPMX", "HNOG": "HNOG", "ACWST": "Ora Padrãu di Australia Sentru-Osidental", "HNEG": "HNEG", "CAT": "Ora di Afrika Sentral", "COT": "COT", "COST": "COST", "UYT": "UYT", "WEZ": "Ora Padrãu di Europa Osidental", "ACDT": "Ora di Verãu di Australia Sentral", "LHDT": "LHDT", "HAT": "HAT", "CLST": "CLST", "HNCU": "HNCU", "PDT": "Ora di Pasifiku di Verãu", "HEEG": "HEEG", "EST": "Ora Oriental Padrãu", "LHST": "LHST", "HAST": "HAST", "BOT": "BOT", "HKT": "HKT", "HKST": "HKST", "IST": "IST", "VET": "VET", "CST": "Ora Sentral Padrãu", "AWDT": "Ora di Verãu di Australia Osidental", "HNPMX": "HNPMX", "SAST": "Ora di Sul di Afrika", "TMST": "TMST", "GMT": "GMT", "CHAST": "CHAST", "ACWDT": "Ora di Verãu di Australia Sentru-Osidental", "NZDT": "NZDT", "WART": "WART", "GYT": "GYT", "CHADT": "CHADT", "WIB": "WIB", "MYT": "MYT", "WARST": "WARST", "HNT": "HNT", "WITA": "WITA", "EAT": "Ora di Afrika Oriental", "AWST": "Ora Padrãu di Australia Osidental", "AST": "Ora Padrãu di Atlantiku", "∅∅∅": "∅∅∅", "AKST": "AKST", "ECT": "ECT", "HNPM": "HNPM", "HECU": "HECU", "WAT": "Ora Padrãu di Afrika Osidental", "JST": "JST", "NZST": "NZST", "EDT": "Ora Oriental di Verãu", "MESZ": "Ora di Verãu di Europa Sentral", "HEPM": "HEPM", "ART": "ART", "AEDT": "Ora di Verãu di Australia Oriental", "GFT": "GFT", "AKDT": "AKDT", "ACST": "Ora Padrãu di Australia Sentral", "HEOG": "HEOG", "HNNOMX": "HNNOMX", "PST": "Ora di Pasifiku Padrãu", "ADT": "Ora di Verãu di Atlantiku", "CLT": "CLT", "JDT": "JDT", "MST": "Ora di Montanha Padrãu", "ChST": "ChST", "AEST": "Ora Padrãu di Australia Oriental", "WESZ": "Ora di Verãu di Europa Osidental", "SGT": "SGT", "TMT": "TMT", "ARST": "ARST", "UYST": "UYST", "WAST": "Ora di Verão di Afrika Osidental"},
	}
}
570334
func NewKamaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error) {
	ind, err := NewKamaWithSrcLen(sourceLength, timePeriod, selectData)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
1292181
func NewKamaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error) {
	ind, err := NewKama(timePeriod, selectData)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
84983
func NewNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
	return NewFilteredNodeInformer(client, resyncPeriod, indexers, nil)
}
43233
func NewUtilization() Utilization {
	return &utilization{
		overallRx: metrics.NewEWMA1(),
		channelRx: map[uint64]metrics.EWMA{},
		overallTx: metrics.NewEWMA1(),
		channelTx: map[uint64]metrics.EWMA{},
	}
}
1291899
func NewAggregator(samples bool, utcOffset time.Duration, outlierTime float64) *Aggregator {
	a := &Aggregator{
		samples:     samples,
		utcOffset:   utcOffset,
		outlierTime: outlierTime,
		// --
		global:  NewClass("", "", false),
		classes: make(map[string]*Class),
	}
	return a
}
517875
func NewKafkaPartitionConsumerMetrics(topic string, partition int32) *KafkaPartitionConsumerMetrics {
	registry := metrics.NewPrefixedRegistry(fmt.Sprintf("%s.%d.", topic, partition))

	return &KafkaPartitionConsumerMetrics{
		registry:               registry,
		batchDuration:          metrics.NewRegisteredTimer("batchDuration", registry),
		fetchDuration:          metrics.NewRegisteredTimer("fetchDuration", registry),
		numFetches:             metrics.NewRegisteredCounter("numFetches", registry),
		numFailedFetches:       metrics.NewRegisteredCounter("numFailedFetches", registry),
		numEmptyFetches:        metrics.NewRegisteredCounter("numEmptyFetches", registry),
		numFetchedMessages:     metrics.NewRegisteredCounter("numFetchedMessages", registry),
		numOffsetCommits:       metrics.NewRegisteredCounter("numOffsetCommits", registry),
		numFailedOffsetCommits: metrics.NewRegisteredCounter("numFailedOffsetCommits", registry),
		lag: metrics.NewRegisteredGauge("lag", registry),
	}
}
822586
func NewKafkaLogEmitter(config *KafkaLogEmitterConfig) (*KafkaLogEmitter, error) {
	encoder := kafkaavro.NewKafkaAvroEncoder(config.SchemaRegistryUrl)
	connector, err := siesta.NewDefaultConnector(config.ConnectorConfig)
	if err != nil {
		return nil, err
	}
	emitter := &KafkaLogEmitter{
		config:   config,
		producer: producer.NewKafkaProducer(config.ProducerConfig, producer.ByteSerializer, encoder.Encode, connector),
	}

	return emitter, nil
}
611630
func NewAdapter(gossip gossip, pkiid common.PKIidType, channel common.ChainID,
	metrics *metrics.ElectionMetrics) LeaderElectionAdapter {
	return &adapterImpl{
		gossip:    gossip,
		selfPKIid: pkiid,

		incTime: uint64(time.Now().UnixNano()),
		seqNum:  uint64(0),

		channel: channel,

		logger: util.GetLogger(util.ElectionLogger, ""),

		doneCh:   make(chan struct{}),
		stopOnce: &sync.Once{},
		metrics:  metrics,
	}
}
733872
func NewMetadata(parsedMap map[string]interface{}) Metadata {
	md := Metadata{
		Variables: make(map[string]interface{}),
	}
	md.load(parsedMap)

	return md
}
281255
func (s *Application) NewRenderer(conf *render.Config, a *Module, funcMap map[string]interface{}) (driver.Driver, *resource.Static) {
	themeAbsPath := s.ThemeDir(conf.Theme)
	staticURLPath := `/assets`
	if a != nil && len(a.Name) > 0 {
		if a.Handler == nil {
			staticURLPath = `/` + a.Name + staticURLPath
		}
	}
	staticAbsPath := filepath.Join(themeAbsPath, `assets`)
	te := s.NewTemplateEngine(themeAbsPath, conf)
	static := s.NewStatic(staticURLPath, staticAbsPath, funcMap)
	te.SetFuncMap(func() map[string]interface{} {
		return funcMap
	})
	te.MonitorEvent(static.OnUpdate())
	te.SetContentProcessor(conf.Parser())
	return te, static
}
643117
func NewKadParams() *KadParams {
	return &KadParams{
		MaxProxDisplay:    16,
		NeighbourhoodSize: 2,
		MinBinSize:        2,
		MaxBinSize:        4,
		RetryInterval:     4200000000, // 4.2 sec
		MaxRetries:        42,
		RetryExponent:     2,
	}
}
71049
func NewMom(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Mom, err error) {
	if selectData == nil {
		return nil, ErrDOHLCVDataSelectFuncIsNil
	}

	ind := Mom{
		selectData: selectData,
	}

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

	return &ind, err
}
643222
func NewDefaultTema() (indicator *Tema, err error) {
	timePeriod := 30
	return NewTema(timePeriod, gotrade.UseClosePrice)
}