// Initialize performs initial schema checks against all registered entities.
183277
func (c *client) Initialize(ctx context.Context) error {
	if c.initialized {
		return nil
	}

	// check schema for all registered entities
	registered := c.registrar.FindAll()
	if len(registered) == 0 {
		return errors.Errorf("No registered entities found")
	}

	eds := []*EntityDefinition{}
	for _, re := range registered {
		eds = append(eds, re.EntityDefinition())
	}

	// fetch latest version for all registered entities, assume order is preserved
	version, err := c.connector.CheckSchema(ctx, c.registrar.Scope(), c.registrar.NamePrefix(), eds)
	if err != nil {
		return errors.Wrap(err, "CheckSchema failed")
	}

	// set version for all registered entities
	for _, reg := range registered {
		reg.SetVersion(version)
	}
	c.initialized = true
	return nil
}
714402
func (s *globalTaskService) Init(ctx types.Context, config gofig.Config) error {
	s.tasks = map[int]*task{}
	s.config = config

	s.resultSchemaValidationEnabled = config.GetBool(
		types.ConfigSchemaResponseValidationEnabled)
	ctx.WithField("enabled", s.resultSchemaValidationEnabled).Debug(
		"configured result schema validation")

	return nil
}
770859
func (s *service) initialize(ctx contextAPI.Client) error {
	s.lock.Lock()
	defer s.lock.Unlock()

	if s.ctx != nil {
		// Already initialized
		logger.Debugf("Already initialized with context: %#v", s.ctx)
		return nil
	}

	discoveryClient, err := clientProvider(ctx)
	if err != nil {
		return errors.Wrap(err, "error creating discover client")
	}

	logger.Debugf("Initializing with context: %#v", ctx)
	s.ctx = ctx
	s.discClient = discoveryClient
	return nil
}
265608
func (w *Wallet) Initialize(seed []byte) error {
	go w.selfDerive()
	// DO NOT lock at this stage, as the initialize
	// function relies on Status()
	return w.session.initialize(seed)
}
951186
func (p *Process) initialize(path string, debugInfoDirs []string) error {
	return proc.PostInitializationSetup(p, path, debugInfoDirs, p.writeBreakpoint)
}
27771
func (i pluginInitializer) Initialize(plugin admission.Interface) {
	if wants, ok := plugin.(WantsInternalWardleInformerFactory); ok {
		wants.SetInternalWardleInformerFactory(i.informers)
	}
}
424761
func Initialize(c context.Context, cfg *Config) context.Context {
	if getConfig(c) != nil {
		panic("auth.Initialize is called twice on same context")
	}
	return setConfig(c, cfg)
}
90984
func (provider *Provider) Initialize(initializer *ledger.Initializer) error {
	var err error
	configHistoryMgr := confighistory.NewMgr(initializer.DeployedChaincodeInfoProvider)
	collElgNotifier := &collElgNotifier{
		initializer.DeployedChaincodeInfoProvider,
		initializer.MembershipInfoProvider,
		make(map[string]collElgListener),
	}
	stateListeners := initializer.StateListeners
	stateListeners = append(stateListeners, collElgNotifier)
	stateListeners = append(stateListeners, configHistoryMgr)

	provider.initializer = initializer
	provider.configHistoryMgr = configHistoryMgr
	provider.stateListeners = stateListeners
	provider.collElgNotifier = collElgNotifier
	provider.bookkeepingProvider = bookkeeping.NewProvider()
	provider.vdbProvider, err = privacyenabledstate.NewCommonStorageDBProvider(provider.bookkeepingProvider, initializer.MetricsProvider, initializer.HealthCheckRegistry)
	if err != nil {
		return err
	}
	provider.stats = newStats(initializer.MetricsProvider)
	provider.recoverUnderConstructionLedger()
	return nil
}
853253
func (sc *SpriteContainer) Initialize(gl GLer) {
	simlog.FuncIn()
	sc.gl = gl
	GetTouchPeer().AddTouchListener(sc)
	simlog.FuncOut()
}
673684
func (i *PluginInitializer) Initialize(plugin admission.Interface) {
	if wants, ok := plugin.(WantsServiceResolver); ok {
		wants.SetServiceResolver(i.serviceResolver)
	}

	if wants, ok := plugin.(WantsAuthenticationInfoResolverWrapper); ok {
		if i.authenticationInfoResolverWrapper != nil {
			wants.SetAuthenticationInfoResolverWrapper(i.authenticationInfoResolverWrapper)
		}
	}
}
201132
func (s *Definitions) InitializeFields(d *Definition) {
	for fieldName, property := range d.schema.Properties {
		des := strings.Replace(property.Description, "\n", " ", -1)
		f := &Field{
			Name:        fieldName,
			Type:        GetTypeName(property),
			Description: EscapeAsterisks(des),
		}
		if len(property.Extensions) > 0 {
			if ps, ok := property.Extensions.GetString(patchStrategyKey); ok {
				f.PatchStrategy = ps
			}
			if pmk, ok := property.Extensions.GetString(patchMergeKeyKey); ok {
				f.PatchMergeKey = pmk
			}
		}

		if fd, ok := s.GetForSchema(property); ok {
			f.Definition = fd
		}
		d.Fields = append(d.Fields, f)
	}
}
1202916
func (form FormLogin) Initialize(ws *websocket.Conn) valente.Form {
	log.Println("FormLogin Initialize")

	f := form.AddEventHandler("loginOk", loginOk)

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

	return f
}
208426
func initialize() {
	// defaultPriority is never used because we always use specific priority-based
	// logging methods.
	const defaultPriority = syslog.LOG_INFO | syslog.LOG_LOCAL0
	syslogger, err := syslog.Dial("", "", defaultPriority, "test")
	if err != nil {
		panic(err)
	}
	logger, err := New(syslogger, int(syslog.LOG_DEBUG), int(syslog.LOG_DEBUG))
	if err != nil {
		panic(err)
	}

	_ = Set(logger)
}
264247
func (s *LocalService) Initialize(ctx contextAPI.Local) error {
	if ctx.Identifier().MSPID != s.mspID {
		return errors.Errorf("expecting context for MSP [%s] but got [%s]", s.mspID, ctx.Identifier().MSPID)
	}
	return s.service.initialize(ctx)
}
1169
func Initialize(l api.LoggerProvider) {
	loggerProviderOnce.Do(func() {
		loggerProviderInstance = l
		logger := loggerProviderInstance.GetLogger(loggerModule)
		logger.Debug("Logger provider initialized")

		// TODO
		// use custom leveler implementation (otherwise fallback to default)
		//		levelerProvider, ok := loggingProvider.(apilogging.Leveler)
		//		if !ok {
		//		}
	})
}
1250944
func (c *ConfigRepository) init() {
	c.initOnce.Do(func() {
		err := c.persistor.Load(c.data)
		if err != nil {
			c.onError(err)
		}
	})
}
504119
func (i *INA3221Driver) initialize() error {
	config := ina3221ConfigEnableChan1 |
		ina3221ConfigEnableChan2 |
		ina3221ConfigEnableChan3 |
		ina3221ConfigAvg1 |
		ina3221ConfigVBusCT2 |
		ina3221ConfigVShCT2 |
		ina3221ConfigMode2 |
		ina3221ConfigMode1 |
		ina3221ConfigMode0

	return i.connection.WriteBlockData(ina3221RegConfig, []byte{byte(config >> 8), byte(config & 0x00FF)})
}