Inits the replay module
It is possible to activate it with an REPLAY environment variable
or the "--replay" or "--record" options which take predecedence

Exemples :

REPLAY=record cozy-konnector-standalone

or

cozy-konnector-standalone --record
321983
function initReplay() {
  const replayOption = ['record', 'replay'].find(opt => program[opt] === true)
  if (replayOption) process.env.REPLAY = replayOption

  process.env.REPLAY =
    replayOption || (process.env.REPLAY ? process.env.REPLAY : 'bloody')

  if (process.env.REPLAY !== 'bloody') require('replay')
}
1148249
function initModule(forge) {

forge.mgf = forge.mgf || {};
forge.mgf.mgf1 = forge.mgf1;

}
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");
		}
	}
158417
function ReplayHandler (disp, store, def, options) {
  this.dispatcher = disp;

  this.store = store;

  def = def || {};

  this.definition = {
    correlationId: 'correlationId', // optional
    id: 'id',                       // optional
    name: 'name',                   // optional
//      aggregateId: 'aggregate.id',    // optional
//      context: 'context.name',        // optional
//      aggregate: 'aggregate.name',    // optional
    payload: 'payload'              // optional
//      revision: 'revision'            // optional
//      version: 'version',             // optional
//      meta: 'meta'                    // optional, if defined theses values will be copied to the notification (can be used to transport information like userId, etc..)
  };

  this.definition = _.defaults(def, this.definition);

  options = options || {};

  this.options = options;
}
1326354
public void init(Record record, Record recSubFile, String strSubFile, boolean bRemoveSubRecords)
    {   // For this to work right, the booking number field needs a listener to re-select this file whenever it changes
        super.init(record, null, recSubFile, true);

        m_strSubFile = strSubFile;
        m_bRemoveSubRecords = bRemoveSubRecords;
    }
1238393
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('CL record already initialized!')

        self.child_log_block_num = 0  # This gets set later

        self._initialized = True
614396
function startRecording() {
  if (room !== undefined) {
    if (!recording) {
      room.startRecording(localStream, (id) => {
        recording = true;
        recordingId = id;
      });
    } else {
      room.stopRecording(recordingId);
      recording = false;
    }
  }
}
253025
def _init_record(self, record_type_idstr):
        """"""
        record_type_data = self._record_type_data_sets[Id(record_type_idstr).get_identifier()]
        module = importlib.import_module(record_type_data['module_path'])
        record = getattr(module, record_type_data['form_record_class_name'])
        if record is not None:
            self._records[record_type_idstr] = record(self)
            return True
        else:
            return False
181494
def init(self):  # pylint: disable=too-many-branches
        """"""
        if not self.enabled:
            logger.info(" the module is disabled.")
            return True

        try:
            connections = self.test_connection()
        except Exception as exp:  # pylint: disable=broad-except
            logger.error("initialization, test connection failed. Error: %s", str(exp))

        if self.influxdb_enabled:
            try:
                # Check that configured TSDB is existing, else creates...
                dbs = self.influx.get_list_database()
                for db in dbs:
                    if db.get('name') == self.influxdb_database:
                        logger.info("the database %s is existing.", self.influxdb_database)
                        break
                else:
                    # Create the database
                    logger.info("creating database %s...", self.influxdb_database)
                    self.influx.create_database(self.influxdb_database)

                # Check that configured TSDB retention is existing, else creates...
                if self.influxdb_retention_name:
                    rps = self.influx.get_list_retention_policies()
                    for rp in rps:
                        if rp.get('name') == self.influxdb_retention_name:
                            logger.info("the retention policy %s is existing.",
                                        self.influxdb_retention_name)
                            break
                    else:
                        # Create a retention policy for this database
                        logger.info("creating database retention policy: %s - %s - %s...",
                                    self.influxdb_retention_name, self.influxdb_retention_duration,
                                    self.influxdb_retention_replication)
                        self.influx.create_retention_policy(
                            self.influxdb_retention_name, self.influxdb_retention_duration,
                            self.influxdb_retention_replication, database=self.influxdb_database)

                # Check that configured TSDB user is existing, else creates...
                if self.influxdb_username:
                    users = self.influx.get_list_users()
                    for user in users:
                        if user.get('user') == self.influxdb_username:
                            logger.info("the user %s is existing.",
                                        self.influxdb_username)
                            break
                    else:
                        # Create a retention policy for this database
                        logger.info("creating user: %s...", self.influxdb_username)
                        self.influx.create_user(self.influxdb_username, self.influxdb_password,
                                                admin=False)

                connections = connections or True
            except Exception as exp:  # pylint: disable=broad-except
                logger.error("InfluxDB, DB initialization failed. Error: %s", str(exp))

        return connections
1198702
function(options){
    // Prevent re-starting a module that is already started
    if (this._isInitialized){ return; }

    // start the sub-modules (depth-first hierarchy)
    _.each(this.submodules, function(mod){
      // check to see if we should start the sub-module with this parent
      if (mod.startWithParent){
        mod.start(options);
      }
    });

    // run the callbacks to "start" the current module
    this.triggerMethod("before:start", options);

    this._initializerCallbacks.run(options, this);
    this._isInitialized = true;

    this.triggerMethod("start", options);
  }
313044
function replayFrame(index) {

        var frame = frames[index];

        // Replay all instructions within the retrieved frame
        for (var i = 0; i < frame.instructions.length; i++) {
            var instruction = frame.instructions[i];
            playbackTunnel.receiveInstruction(instruction.opcode, instruction.args);
        }

        // Store client state if frame is flagged as a keyframe
        if (frame.keyframe && !frame.clientState) {
            playbackClient.exportState(function storeClientState(state) {
                frame.clientState = state;
            });
        }

    }
348181
def pre_init():
    

    logger.info("Run pre-initiation hook of {} plugin.".format(__file__.split(os.path.sep)[-2]))

    # Example: Monkey-Path rafcon.core.script.Script class to print additional log-message while execution
    from rafcon.core.script import Script
    old_execute_method = Script.execute

    def new_execute_method(self, state, inputs=None, outputs=None, backward_execution=False):
        logger.debug("patched version of Script class is used.")
        result = old_execute_method(self, state, inputs, outputs, backward_execution)
        logger.debug("patched version of Script execute-method is finished with result: {}.".format(result))
        return result

    Script.execute = new_execute_method
904994
function init(copyObject, cb) {
		var result = 0
		isError = false
		var cbCounter = 1
		for (var to in copyObject) {
			var o = copyObjects[copyObjectsIndex++] =
				new copyobject.CopyObject(copyObject[to], to, notifyFn)
			cbCounter++
			o.doCopy(copyResult)
		}
		copyResult()

		function copyResult(err, count) {
			if (!err) {
				if (count) result += count
				if (!--cbCounter && cb) cb(null, result)
			} else if (!isError) {
				isError = true
				if (cb) cb(err)
			}
		}
	}
257605
def init(track_log_handler):
    

    logger = logging.getLogger(__package__)

    # TODO (just document prominently)
    # assume only one trial can run at once right now
    # multi-concurrent-trial support will require complex filter logic
    # based on the currently-running trial (maybe we shouldn't allow multiple
    # trials on different python threads, that's dumb)
    to_rm = [h for h in logger.handlers if isinstance(h, TrackLogHandler)]
    for h in to_rm:
        logger.removeHandler(h)

    if not any(isinstance(h, StdoutHandler) for h in logger.handlers):
        handler = StdoutHandler()
        handler.setFormatter(_FORMATTER)
        logger.addHandler(handler)

    track_log_handler.setFormatter(_FORMATTER)
    logger.addHandler(track_log_handler)

    logger.propagate = False
    logger.setLevel(logging.DEBUG)
362141
public static void initialize() {

        if (initialized) return;

        SniffyConfiguration.INSTANCE.addTopSqlCapacityListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                ConcurrentLinkedHashMap<String, Timer> oldValues = globalSqlStats;
                globalSqlStats =
                        new ConcurrentLinkedHashMap.Builder<String, Timer>().
                                maximumWeightedCapacity(SniffyConfiguration.INSTANCE.getTopSqlCapacity()).
                                build();
                globalSqlStats.putAll(oldValues);
            }

        });


        if (SniffyConfiguration.INSTANCE.isMonitorSocket()) {

            try {
                SnifferSocketImplFactory.install();
            } catch (IOException e) {
                e.printStackTrace();
            }

        } else {

            SniffyConfiguration.INSTANCE.addMonitorSocketListener(new PropertyChangeListener() {

                private boolean sniffySocketImplFactoryInstalled = false;

                @Override
                public synchronized void propertyChange(PropertyChangeEvent evt) {
                    if (sniffySocketImplFactoryInstalled) return;
                    if (Boolean.TRUE.equals(evt.getNewValue())) {
                        try {
                            SnifferSocketImplFactory.install();
                            sniffySocketImplFactoryInstalled = true;
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }

            });

        }

        initialized = true;

    }
17835
def init(self, conn):
        
        base = self.read_scripts()[0]['fname']
        logging.info('Creating the initial schema from %s',  base)
        apply_sql_script(conn, os.path.join(self.upgrade_dir, base))
        self.install_versioning(conn)
646847
public void init(Rec record, PTable tableRemote, PhysicalDatabaseParent dbOwner)
    {
        super.init(record, tableRemote, dbOwner);
        m_iPhysicalIndex = NO_INDEX;
        m_iLogicalIndex = NO_INDEX;
    }