// Initialize already allocated NewEwmaRate structure
//
// halfLife it the time takes for a half charge or half discharge
517210
func (r *EwmaRate) Init(halfLife time.Duration) *EwmaRate {
	r.Ewma.Init(halfLife)
	return r
}
1014981
func (glpeer *GLPeer) Initialize(glc *GLContext) {
	simlog.FuncIn()

	glpeer.mu.Lock()
	defer glpeer.mu.Unlock()
	glpeer.glc = glc
	glpeer.startTime = time.Now()

	glctx := glc.glcontext

	// transparency of png
	glctx.Enable(gl.BLEND)
	glctx.BlendEquation(gl.FUNC_ADD)
	glctx.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
	glpeer.images = glutil.NewImages(glctx)
	glpeer.fps = debug.NewFPS(glpeer.images)
	glpeer.initEng()

	simlog.FuncOut()
}
466851
func initialize() {
	BothHandle = io.MultiWriter(LogHandle, OutHandle)
	for _, l := range loggers {

		var handler io.Writer
		var enabled int32

		if l.level < outputThreshold && l.level < logThreshold {
			enabled = 0
			handler = ioutil.Discard
		} else if l.level >= outputThreshold && l.level >= logThreshold {
			enabled = 1
			handler = BothHandle
		} else if l.level >= outputThreshold && l.level < logThreshold {
			enabled = 1
			handler = OutHandle
		} else {
			enabled = 1
			handler = LogHandle
		}

		atomic.StoreInt32(&l.enabled, 0)
		l.mu.Lock()
		l.logger = log.New(handler, l.prefix, Flag)
		l.mu.Unlock()
		atomic.StoreInt32(&l.enabled, enabled)
	}
}
1231603
func (i *PluginInitializer) Initialize(plugin admission.Interface) {
	if wantsProjectCache, ok := plugin.(WantsProjectCache); ok {
		wantsProjectCache.SetProjectCache(i.ProjectCache)
	}
	if castObj, ok := plugin.(WantsDefaultNodeSelector); ok {
		castObj.SetDefaultNodeSelector(i.DefaultNodeSelector)
	}
	if wantsOriginQuotaRegistry, ok := plugin.(WantsOriginQuotaRegistry); ok {
		wantsOriginQuotaRegistry.SetOriginQuotaRegistry(i.OriginQuotaRegistry)
	}
	if wantsRESTClientConfig, ok := plugin.(WantsRESTClientConfig); ok {
		wantsRESTClientConfig.SetRESTClientConfig(i.RESTClientConfig)
	}
	if wantsClusterQuota, ok := plugin.(WantsClusterQuota); ok {
		wantsClusterQuota.SetClusterQuota(i.ClusterQuotaMapper, i.ClusterResourceQuotaInformer)
	}
	if wantsSecurityInformer, ok := plugin.(WantsSecurityInformer); ok {
		wantsSecurityInformer.SetSecurityInformers(i.SecurityInformers)
	}
	if wantsDefaultRegistryFunc, ok := plugin.(WantsDefaultRegistryFunc); ok {
		wantsDefaultRegistryFunc.SetDefaultRegistryFunc(i.RegistryHostnameRetriever.InternalRegistryHostname)
	}
	if wantsUserInformer, ok := plugin.(WantsUserInformer); ok {
		wantsUserInformer.SetUserInformer(i.UserInformers)
	}
}
1225966
func (p *MSPProvider) Initialize(providers core.Providers) error {
	p.providerContext = providers
	return nil
}
43552
func (s *Discovery) Initialize(path string, heartbeat time.Duration, ttl time.Duration, _ map[string]string) error {
	s.path = path
	s.heartbeat = heartbeat
	return nil
}
413509
func Initialize(user, org string) error {
	if user == db.BLANK {
		org = db.BLANK
	}

	disabled := GetAllDefault(org)
	preferences := []interface{}{}

	for _, topic := range disabled {
		preference := db.Topic{
			User:         user,
			Organization: org,
			Ident:        topic.Ident,
			Channels:     topic.Channels,
		}

		preference.PrepareSave()
		preferences = append(preferences, preference)
	}

	if len(preferences) > 0 {
		err, _ := db.Conn.InsertMulti(db.TopicCollection, preferences...)
		return err
	}

	return nil
}
914560
func Init(h Interface) {
	for i := h.Len()/2 - 1; i >= 0; i-- { // start at first non leaf (equiv. to parent of last leaf)
		shuffleDown(h, i, h.Len())
	}
}
871628
func (conn *UnixConn) initialize() (*UnixConn, error) {
	if err := conn.unixConn.SetWriteBuffer(bufSize); err != nil {
		return nil, errors.Wrap(err, "setting write buffer size")
	}
	return conn, nil
}
22760
func Initialize(c context.Context, m monitor.Monitor, s store.Store) {
	state := GetState(c)
	state.SetMonitor(m)
	state.SetStore(s)
}
1256000
func Initialize(xu *xgbutil.XUtil) {
	xevent.MotionNotifyFun(dragStep).Connect(xu, xu.Dummy())
	xevent.ButtonReleaseFun(DragEnd).Connect(xu, xu.Dummy())
}
525839
func (s *sample) Initialize(sim simra.Simraer) {
	s.simra = sim
	s.simra.SetDesiredScreenSize(config.ScreenWidth, config.ScreenHeight)

	// add global touch listener to catch touch end event
	s.simra.AddTouchListener(s)

	s.initialize()
	s.resetPosition()
	s.setupSprites()
	s.registerViews()
	s.registerModels()
	s.remainingLife = remainingLifeAtStart

	s.simra.AddCollisionListener(&s.ball, &s.obstacle[0], &s.models)
	s.simra.AddCollisionListener(&s.ball, &s.obstacle[1], &s.models)

	s.showReadyText()
	s.gamestate = readyToStart
}
268523
func (form FormHome) Initialize(ws *websocket.Conn) valente.Form {
	log.Println("FormHome Initialize")

	action.HTML(ws, "content", htmlFormHome)

	return form
}
614094
func (conn *UDPConn) initialize() (*UDPConn, error) {
	if err := conn.udpConn.SetWriteBuffer(bufSize); err != nil {
		return nil, errors.Wrap(err, "setting write buffer size")
	}
	return conn, nil

}
484805
func (d *DotGit) Initialize() error {
	mustExists := []string{
		d.fs.Join("objects", "info"),
		d.fs.Join("objects", "pack"),
		d.fs.Join("refs", "heads"),
		d.fs.Join("refs", "tags"),
	}

	for _, path := range mustExists {
		_, err := d.fs.Stat(path)
		if err == nil {
			continue
		}

		if !os.IsNotExist(err) {
			return err
		}

		if err := d.fs.MkdirAll(path, os.ModeDir|os.ModePerm); err != nil {
			return err
		}
	}

	return nil
}
449710
func Initialize(home helmpath.Home, out io.Writer, skipRefresh bool, settings helm_env.EnvSettings, stableRepositoryURL, localRepositoryURL string) error {
	if err := ensureDirectories(home, out); err != nil {
		return err
	}
	if err := ensureDefaultRepos(home, out, skipRefresh, settings, stableRepositoryURL, localRepositoryURL); err != nil {
		return err
	}

	return ensureRepoFileFormat(home.RepositoryFile(), out)
}
1173513
func (l *PacketIntervalList) Init() *PacketIntervalList {
	l.root.next = &l.root
	l.root.prev = &l.root
	l.len = 0
	return l
}