Initializes data by reading it from the datastore.
976239
def init_from_datastore(self):
    """"""
    self._data = {}
    client = self._datastore_client
    for entity in client.query_fetch(kind=KIND_CLASSIFICATION_BATCH):
      class_batch_id = entity.key.flat_path[-1]
      self.data[class_batch_id] = dict(entity)
1365415
public void init() {
        surnameIndex.clear();

        final RootVisitor visitor = new RootVisitor();
        mRoot.accept(visitor);
        for (final Person person : visitor.getPersons()) {
            final String key = person.getString();
            // Surname for inclusion in the index.
            // This is the string by which the person will be indexed.
            final String indexName = person.getIndexName();

            if (!indexName.isEmpty()) {
                final SortedMap<String, SortedSet<String>> names =
                        findNamesPerSurname(person.getSurname());
                final SortedSet<String> ids = findIdsPerName(indexName, names);
                ids.add(key);
            }
        }
    }
187735
public void init() {
        if (FacesContext.getCurrentInstance().getPartialViewContext().isAjaxRequest()) {
            return;
        }

        if (id != null && !"".equals(id)) {
            entity = crudService.findById(id);
            if (entity == null) {
                log.info(String.format("Entity not found with id %s, a new one will be initialized.", id));
                id = null;
                entity = initEntity();
            }
        }
    }
724039
public void onInitialDataDownloaded() {
        Log.d(TAG, "Initial Data Loaded");
        context().getContactsModule().startImport();
        if (appStateVM.isBookImported()) {
            onAppLoaded();
        }
    }
542393
protected void initDataSource() {
    if (dataSource == null) {
      if (dataSourceJndiName != null) {
        try {
          dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName);
        } catch (Exception e) {
          throw new ProcessEngineException("couldn't lookup datasource from " + dataSourceJndiName + ": " + e.getMessage(), e);
        }

      } else if (jdbcUrl != null) {
        if ((jdbcDriver == null) || (jdbcUrl == null) || (jdbcUsername == null)) {
          throw new ProcessEngineException("DataSource or JDBC properties have to be specified in a process engine configuration");
        }

        PooledDataSource pooledDataSource =
            new PooledDataSource(ReflectUtil.getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword);

        if (jdbcMaxActiveConnections > 0) {
          pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections);
        }
        if (jdbcMaxIdleConnections > 0) {
          pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections);
        }
        if (jdbcMaxCheckoutTime > 0) {
          pooledDataSource.setPoolMaximumCheckoutTime(jdbcMaxCheckoutTime);
        }
        if (jdbcMaxWaitTime > 0) {
          pooledDataSource.setPoolTimeToWait(jdbcMaxWaitTime);
        }
        if (jdbcPingEnabled == true) {
          pooledDataSource.setPoolPingEnabled(true);
          if (jdbcPingQuery != null) {
            pooledDataSource.setPoolPingQuery(jdbcPingQuery);
          }
          pooledDataSource.setPoolPingConnectionsNotUsedFor(jdbcPingConnectionNotUsedFor);
        }
        dataSource = pooledDataSource;
      }

      if (dataSource instanceof PooledDataSource) {
        // ACT-233: connection pool of Ibatis is not properely initialized if this is not called!
        ((PooledDataSource) dataSource).forceCloseAll();
      }
    }

    if (databaseType == null) {
      initDatabaseType();
    }
  }
1015806
def init_from_datastore(self):
    
    self._attacks = {}
    self._targeted_attacks = {}
    self._defenses = {}
    for entity in self._datastore_client.query_fetch(kind=KIND_SUBMISSION):
      submission_id = entity.key.flat_path[-1]
      submission_path = entity['submission_path']
      participant_id = {k: entity[k]
                        for k in ['team_id', 'baseline_id']
                        if k in entity}
      submission_descr = SubmissionDescriptor(path=submission_path,
                                              participant_id=participant_id)
      if list(entity.key.flat_path[0:2]) == ATTACKS_ENTITY_KEY:
        self._attacks[submission_id] = submission_descr
      elif list(entity.key.flat_path[0:2]) == TARGET_ATTACKS_ENTITY_KEY:
        self._targeted_attacks[submission_id] = submission_descr
      elif list(entity.key.flat_path[0:2]) == DEFENSES_ENTITY_KEY:
        self._defenses[submission_id] = submission_descr
951002
public void initialize() {
        val pair = buildLoggerContext(environment, resourceLoader);
        pair.ifPresent(it -> {
            this.logConfigurationFile = it.getKey();
            this.loggerContext = it.getValue();
        });
    }
1283197
private void initializeDataSource()
   {
      final String jdbcUrl = config.getJdbcUrl();
      final String username = config.getUsername();
      final String password = config.getPassword();
      final String dsClassName = config.getDataSourceClassName();
      final String driverClassName = config.getDriverClassName();
      final String dataSourceJNDI = config.getDataSourceJNDI();
      final Properties dataSourceProperties = config.getDataSourceProperties();

      DataSource ds = config.getDataSource();
      if (dsClassName != null && ds == null) {
         ds = createInstance(dsClassName, DataSource.class);
         PropertyElf.setTargetFromProperties(ds, dataSourceProperties);
      }
      else if (jdbcUrl != null && ds == null) {
         ds = new DriverDataSource(jdbcUrl, driverClassName, dataSourceProperties, username, password);
      }
      else if (dataSourceJNDI != null && ds == null) {
         try {
            InitialContext ic = new InitialContext();
            ds = (DataSource) ic.lookup(dataSourceJNDI);
         } catch (NamingException e) {
            throw new PoolInitializationException(e);
         }
      }

      if (ds != null) {
         setLoginTimeout(ds);
         createNetworkTimeoutExecutor(ds, dsClassName, jdbcUrl);
      }

      this.dataSource = ds;
   }
692176
private function read()
    {
        if (!$this->file->canRead()) {
            throw new BuildException(
                "Can't read data store from '" .
                $this->file->getPath() . "'"
            );
        } else {
            $serializedData = $this->file->contents();

            $this->data = unserialize($serializedData);
        }
    }
1214185
protected function loadData(): void
	{
		$data = $this->store->read($this->sessionId);

		$this->sessionData = $data === false ? [] : $data;
	}
777957
final void init(WSJdbcObject parent) {
        if (parent != null) {
            parentWrapper = parent;
            dsConfig = parent.dsConfig; 
            freeResourcesOnClose = parent.freeResourcesOnClose;
        }

        if (freeResourcesOnClose) // then initialize data structures to track them
        {
            arrays = new LinkedList<Array>();
            blobs = new LinkedList<Blob>();
            clobs = new LinkedList<Clob>();
            resources = new LinkedList<Closeable>();
            xmls = new LinkedList<SQLXML>();
        }
    }
1019779
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);

        m_gridList = new DataRecordList();      
        m_iEndOfFileIndex = UNKNOWN_POSITION; // Actual end of file (-1 means don't know)

        m_gridBuffer = new DataRecordBuffer();
        m_gridNew = new DataRecordBuffer();
        m_iPhysicalFilePosition = UNKNOWN_POSITION;
        m_iLogicalFilePosition = UNKNOWN_POSITION;

        if (((record.getOpenMode() & DBConstants.OPEN_READ_ONLY) != DBConstants.OPEN_READ_ONLY)
            && (record.getCounterField() != null))
                record.setOpenMode(record.getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY);  // Must have for GridTable to re-read.
    }
397793
private function Initialize()
    {
        if (!$this->initialized)
        {
            $schema = $this->GetSchema();
            $t = $schema->Table();
            $sql = $schema->SqlBuilder();
           
            $what = $t->ToSelectList();
            $where = $sql->Equals($t->Field($schema->KeyField()), $sql->Value($this->KeyValue()));
            $select = $sql->Select(false, $what, $t, $where);
            $reader = $schema->Connection()->ExecuteQuery((string)$select);
            if ($reader->Read())
                $this->InitFromReader($reader);

            $reader->Close();
        }
    }
1047472
def initialize(self, data):
        
        for item in data:
            if hasattr(self, item):
                setattr(self, item, data[item])
886129
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);
        m_iRow = -1;        // resultSet row 0 = First row.
        m_iEOFRow = Integer.MAX_VALUE;  // Last valid row.
        m_iLastOrder = -1;
    }
891501
private function initDataProviders()
    {
        $this->dataProviders = [];

        foreach ($this->loadDataProviders() as $name => $dataProvider) {
            $this->dataProviders[$name] = $dataProvider;
        }
    }
616205
public void init() throws Exception {
		filter = bundleContext.createFilter(getFilter(dsName));
		
		tracker = new ServiceTracker<DataSource, DataSource>(bundleContext, filter, null);
		tracker.open();
		
		proxy = (DataSource) Proxy.newProxyInstance(
				DataSourceProxyFactory.class.getClassLoader(),
				new Class<?>[] { DataSource.class }, this);
	}