Initialize the driver by setting up GPIO interrupts
        and periodic statistics processing.
427849
def setup(self):
        
        # Initialize the statistics variables.
        self.radiation_count = 0
        self.noise_count = 0
        self.count = 0
        # Initialize count_history[].
        self.count_history = [0] * HISTORY_LENGTH
        self.history_index = 0
        # Init measurement time.
        self.previous_time = millis()
        self.previous_history_time = millis()
        self.duration = 0
        # Init the GPIO context.
        GPIO.setup(self.radiation_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
        GPIO.setup(self.noise_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
        # Register local callbacks.
        GPIO.add_event_detect(
            self.radiation_pin, GPIO.FALLING, callback=self._on_radiation
        )
        GPIO.add_event_detect(self.noise_pin, GPIO.FALLING, callback=self._on_noise)
        # Enable the timer for processing the statistics periodically.
        self._enable_timer()
        return self
953096
final static void init() {
		StopWatch stopWatch = new StopWatch();
		stopWatch.start("Audit4jInit");
		if (configContext == null) {
			configContext = new ConcurrentConfigurationContext();
		}

		if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
			Audit4jBanner banner = new Audit4jBanner();
			banner.printBanner();
			Log.info("Initializing Audit4j...");
			
			// Check system environment;
			checkEnvironment();
			
			// Load configurations to Memory
			Log.info("Loading Configurations...");
			if (conf == null) {
				loadConfig();
			}
			Log.info("Validating Configurations...");
			if (conf == null) {
				terminate();
				throw new InitializationException(INIT_FAILED);
			}
			try {
				ValidationManager.validateConfigurations(conf);
			} catch (ValidationException e1) {
				terminate();
				throw new InitializationException(INIT_FAILED, e1);
			}

			// Execute commands.
			CommandProcessor.getInstance().process(conf.getCommands());

			// Load Registry configurations.
			loadRegistry();

			if (conf.getProperties() == null) {
				conf.setProperties(new HashMap<String, String>());
			} else {
				for (Map.Entry<String, String> entry : conf.getProperties().entrySet()) {
					if (System.getProperties().containsKey(entry.getValue())) {
						conf.getProperties().put(entry.getKey(), System.getProperty(entry.getValue()));
					}
				}
			}
			configContext.getProperties().putAll(conf.getProperties());

			// Initialize handlers.
			initHandlers();

			// Initialize layouts.
			initLayout();

			// Initialize annotation transformer.

			if (conf.getAnnotationTransformer() == null) {
				annotationTransformer = getDefaultAnnotationTransformer();
			} else {
				annotationTransformer = conf.getAnnotationTransformer();
			}

			// Initialize IO streams.
			initStreams();

			if (!conf.getFilters().isEmpty()) {
			    Log.info("Registoring Filters...");
            }
			for (AuditEventFilter filter : conf.getFilters()) {
				configContext.addFilter(filter);
				Log.info(filter.getClass().getName() +  " Registored...");
			}

			configContext.setMetaData(conf.getMetaData());

			// Execute Scheduler tasks.
			Log.info("Executing Schedulers...");
			Schedulers.taskRegistry().scheduleAll();

			// Initialize monitoring support if available in the configurations.
			if (conf.getJmx() != null) {
				MBeanAgent agent = new MBeanAgent();
				agent.setJmxConfig(conf.getJmx());
				agent.init();
				agent.registerMbeans();
			}

			lifeCycle.setStatus(RunStatus.RUNNING);
			lifeCycle.setStartUpTime(new Date().getTime());
			stopWatch.stop();
			Long initializationTime = stopWatch.getLastTaskTimeMillis();
			Log.info("Audit4j initialized. Total time: ", initializationTime, "ms");
		}
	}
385082
private void initGui() {
        totalThreads.setText("100");
        initialDelay.setText("0");
        incUserCount.setText("10");
        incUserCountBurst.setText("0");
        incUserPeriod.setText("30");
        flightTime.setText("60");
        decUserCount.setText("5");
        decUserPeriod.setText("1");
        rampUp.setText("5");
    }
543183
@Override
	protected void initialize() throws Exception {
		super.initialize();

		// check if the driver is resettable
		if (this.driver instanceof ResettablePactDriver) {
			final ResettablePactDriver<?, ?> resDriver = (ResettablePactDriver<?, ?>) this.driver;
			// make sure that the according inputs are not reseted
			for (int i = 0; i < resDriver.getNumberOfInputs(); i++) {
				if (resDriver.isInputResettable(i)) {
					excludeFromReset(i);
				}
			}
		}
		
		TaskConfig config = getLastTasksConfig();
		isWorksetIteration = config.getIsWorksetIteration();
		isWorksetUpdate = config.getIsWorksetUpdate();
		isSolutionSetUpdate = config.getIsSolutionSetUpdate();

		if (isWorksetUpdate) {
			worksetBackChannel = BlockingBackChannelBroker.instance().getAndRemove(brokerKey());

			if (isWorksetIteration) {
				worksetAggregator = getIterationAggregators().getAggregator(WorksetEmptyConvergenceCriterion.AGGREGATOR_NAME);

				if (worksetAggregator == null) {
					throw new RuntimeException("Missing workset elements count aggregator.");
				}
			}
		}
	}
753041
def initialize_worker(self):
        """"""
        worker_thread = threading.Thread(
            name="WorkerThread", target=message_worker, args=(self,))
        worker_thread.setDaemon(True)
        worker_thread.start()
802414
def _initialize_system_sync(self):
        """"""
        connected_devices = self.bable.list_connected_devices()
        for device in connected_devices:
            self.disconnect_sync(device.connection_handle)

        self.stop_scan()

        self.set_advertising(False)

        # Register the GATT table to send the right services and characteristics when probed (like an IOTile device)
        self.register_gatt_table()
111747
def _init_display(self):
        
        self._command([
            # 0xAE
            self.CMD_SSD1306_DISPLAY_OFF,
            #Stop Scroll
            self.CMD_SSD1306_SET_SCROLL_DEACTIVE,
            # 0xA8 SET MULTIPLEX 0x3F
            self.CMD_SSD1306_SET_MULTIPLEX_RATIO,
            0x3F,
            # 0xD3 SET DISPLAY OFFSET
            self.CMD_SSD1306_SET_DISPLAY_OFFSET,
            0x00,
            # 0x40 Set Mapping RAM Display Start Line  (0x00~0x3F)
            self.CMD_SSD1306_SET_DISPLAY_START_LINE,
            # 0xDA Set COM Pins hardware configuration, (0x00/0x01/0x02)
            self.CMD_SSD1306_SET_COM_PINS,
            (0x02 | 0x10),
            self.CMD_SSD1306_SET_CONTRAST,
            0x7F,
            # 0xA4 Disable Entire Display On
            self.CMD_SSD1306_ENTIRE_DISPLAY_ON_0,
            # 0xA6 Set normal display
            self.CMD_SSD1306_NORMAL_DISPLAY,
            # 0xA7 Set inverse display
            # CMD_SSD1306_INVERSE_DISPLAY, 
            # 0xD5 Set osc frequency 0x80
            self.CMD_SSD1306_SET_CLOCK_DIVIDE_RATIO,
            0x80,
            # 0x8D Enable DC/DC charge pump regulator 0x14
            self.CMD_SSD1306_CHARGE_PUMP,
            0x14,
            # 0x20 Set Page Addressing Mode (0x00/0x01/0x02)
            self.CMD_SSD1306_SET_MEM_ADDR_MODE,
            0x01,
  
            # 0xC0 / 0xC8 Set COM Output Scan Direction
            #CMD_SSD1306_SCAN_DIRECTION_INC,
            #CMD_SSD1306_SCAN_DIRECTION_DEC,
            self.CMD_SSD1306_SCAN_DIRECTION_INC if self._mirror_v else self.CMD_SSD1306_SCAN_DIRECTION_DEC,
  
            # 0xA0 / oxA1 Set Segment re-map
            # 0xA0    left to right
            # 0xA1    right to left
            self.CMD_SSD1306_SET_SEGMENT_REMAP_0 if self._mirror_h else self.CMD_SSD1306_SET_SEGMENT_REMAP_1,
        ])
824974
def setup(self):
        '''
        
        '''
        if self.controller:
            self.controller.setup()
        for monitor in self.monitors:
            monitor.setup()
200157
def start(self):
        """"""
        # TODO(BMo) having this check is probably a good idea but I've \
        # disabled it for now while the PBC is in flux.
        # assert sip_pbc.release.__version__ == '1.2.3'

        scheduler_threads = [
            Thread(target=self._monitor_events, daemon=True),
            Thread(target=self._processing_controller_status, daemon=True),
            Thread(target=self._schedule_processing_blocks, daemon=True),
            Thread(target=self._monitor_pbc_status, daemon=True)
        ]

        for thread in scheduler_threads:
            thread.start()

        try:
            for thread in scheduler_threads:
                thread.join()
        except KeyboardInterrupt:
            LOG.info('Keyboard interrupt!')
            sys.exit(0)
        finally:
            LOG.info('Finally!')
955878
def _init_devices(self):
        
        if not settings.PDU_CONTROLLER_TYPE:
            if settings.AUTO_DUT:
                return

            for device in settings.GOLDEN_DEVICES:
                port, _ = device
                try:
                    with OpenThreadController(port) as otc:
                        logger.info('Resetting %s', port)
                        otc.reset()
                except:
                    logger.exception('Failed to reset device %s', port)
                    self.history.mark_bad_golden_device(device)

            return

        tries = 3
        pdu_factory = PduControllerFactory()

        while True:
            try:
                pdu = pdu_factory.create_pdu_controller(settings.PDU_CONTROLLER_TYPE)
                pdu.open(**settings.PDU_CONTROLLER_OPEN_PARAMS)
            except EOFError:
                logger.warning('Failed to connect to telnet')
                tries = tries - 1
                if tries:
                    time.sleep(10)
                    continue
                else:
                    logger.error('Fatal error: cannot connect to apc')
                    raise
            else:
                pdu.reboot(**settings.PDU_CONTROLLER_REBOOT_PARAMS)
                pdu.close()
                break

        time.sleep(len(settings.GOLDEN_DEVICES))
822959
public static synchronized void init() {
        if (initialized)
            return;
        if (tc.isEntryEnabled()) {
            Tr.entry(tc, "init");
        }

        initialized = true;
        //defaultLevel = StatConstants.STATISTIC_SET_EXTENDED;
        defaultLevel = StatConstants.STATISTIC_SET_BASIC;
        moduleRoot = new ModuleItem();
        setInstrumentationLevel(defaultLevel);
        //disabled = false;
        try {
            MBeanServer mServer = ManagementFactory.getPlatformMBeanServer();
            ObjectName pmiMBean = new ObjectName(PmiConstants.MBEAN_NAME);
            mServer.registerMBean(PmiCollaboratorFactory.getPmiCollaborator(), pmiMBean);
            printAllMBeans();
        } catch (Exception e) {
            Tr.error(tc, "Unable to create Perf MBean.");
            FFDCFilter.processException(e, "com.ibm.ws.pmi.server.PmiRegistry", "Init");
        }
        if (tc.isEntryEnabled()) {
            Tr.exit(tc, "init");
        }
    }
1259487
def init_client(client_id):
    
    if client_id not in drivers:
        drivers[client_id] = init_driver(client_id)
    return drivers[client_id]
105550
def initialize():
    
    for pin in sorted(OUTPUT_PINS.values()):
        _enable_pin(pin, OUT)

    for pin in sorted(INPUT_PINS.values()):
        _enable_pin(pin, IN)
1216150
def init_device(self):
        """"""
        Device.init_device(self)
        time.sleep(0.1)
        self.set_state(DevState.STANDBY)
242138
public synchronized void initDevice() {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        if (stateImpl == null) {
            stateImpl = new StateImpl(businessObject, null, null);
        }
        if (statusImpl == null) {
            statusImpl = new StatusImpl(businessObject, null, null);
        }
        if (initImpl == null) {
            buildInit(null, false);
        }
        doInit();
        try {
            pushInterfaceChangeEvent(true);
        } catch (final DevFailed e) {
            // ignore
            logger.error("error pushing event", e);
        }
        logger.debug("device init done");
        xlogger.exit();
    }
744073
private void init() {
        assertUnlocked();
        
        lock.lock();
        try {
            httpSender.init(cfg);

            LOG.info(
                "Starting with "
                    + DEFAULT_REQ_PROC_COUNT + " request processors");

            procThreads = new RequestProcessor[DEFAULT_REQ_PROC_COUNT];

            for (int i = 0; i < procThreads.length; i++) {
                procThreads[i] = new RequestProcessor(i);
                procThreads[i].start();
            }

        } finally {
            lock.unlock();
        }
    }
317493
protected void startSchedulerDriver() {
    // start the driver non-blocking,
    // since we need to set heron state after the scheduler driver is started.
    // Heron will block the main thread eventually
    driver.start();

    // Staging the Mesos Framework
    LOG.info("Waiting for Mesos Framework get registered");
    long timeout = MesosContext.getHeronMesosFrameworkStagingTimeoutMs(config);
    if (!mesosFramework.waitForRegistered(timeout, TimeUnit.MILLISECONDS)) {
      throw new RuntimeException("Failed to register with Mesos Master in time");
    }
  }