Library initialization

@return {Boolean} return true if all is well, otherwise return false value
518874
function initialize() {
    /**
     * Get custom settings from the query string
     */
    var scripts = document.getElementsByTagName('script');
    var src = (scripts[scripts.length - 1] || {}).src || '';
    var arg = src.indexOf('?') !== -1 ? src.split('?').pop() : '';
    arg.replace(/(\w+)(?:=([^&]*))?/g, function(a, key, value) {
      settings[key] = (value || '').replace(/^(0|false)$/, '');
    });

    /**
     * hang up the event handler to listen to the events hashchange
     */
    addEvent(eventNamePrefix + 'hashchange', onHashChange, false);

    // a list of objects with pairs of descriptors/object
    var data = [locationDescriptors, locationObject, eventsDescriptors, global, historyDescriptors, historyObject];

    // if browser support object 'state' in interface 'History'
    if (isSupportStateObjectInHistory) {
      // remove state property from descriptor
      delete historyDescriptors['state'];
    }

    // initializing descriptors
    for(var i = 0; i < data.length; i += 2) {
      for(var prop in data[i]) {
        if (data[i].hasOwnProperty(prop)) {
          if (typeof data[i][prop] !== 'object') {
            // If the descriptor is a simple function, simply just assign it an object
            data[i + 1][prop] = data[i][prop];
          } else {
            // prepare the descriptor the required format
            var descriptor = prepareDescriptorsForObject(data[i], prop, data[i][prop]);
            // try to set the descriptor object
            if (!redefineProperty(data[i + 1], prop, descriptor, function(n, o) {
              // is satisfied if the failed override property
              if (o === historyObject) {
                // the problem occurs in Safari on the Mac
                global.history = historyObject = data[i + 1] = n;
              }
            })) {
              // if there is no possibility override.
              // This browser does not support descriptors, such as IE7

              // remove previously hung event handlers
              removeEvent(eventNamePrefix + 'hashchange', onHashChange, false);

              // fail to initialize :(
              return false;
            }

            // create a repository for custom handlers onpopstate/onhashchange
            if (data[i + 1] === global) {
              eventsList[prop] = eventsList[prop.substr(2)] = [];
            }
          }
        }
      }
    }

    // check settings
    historyObject['setup']();

    // redirect if necessary
    if (settings['redirect']) {
      historyObject['redirect']();
    }

    // initialize
    if (settings["init"]) {
      // You agree that you will use window.history.location instead window.location
      isUsedHistoryLocationFlag = 1;
    }

    // If browser does not support object 'state' in interface 'History'
    if (!isSupportStateObjectInHistory && JSON) {
      storageInitialize();
    }

    // track clicks on anchors
    if (!isSupportHistoryAPI) {
      document[addEventListenerName](eventNamePrefix + "click", onAnchorClick, false);
    }

    if (document.readyState === 'complete') {
      onLoad(true);
    } else {
      if (!isSupportHistoryAPI && parseURL()._relative !== settings["basepath"]) {
        isFireInitialState = true;
      }
      /**
       * Need to avoid triggering events popstate the initial page load.
       * Hang handler popstate as will be fully loaded document that
       * would prevent triggering event onpopstate
       */
      addEvent(eventNamePrefix + 'load', onLoad, false);
    }

    // everything went well
    return true;
  }
1038749
function checkInit() {
        if (!container) {
            container = document.createElement("div");
            container.style.cssText = "position: fixed;" + "opacity: 0.9;" + "right: 0;" + "bottom: 0";
            document.body.appendChild(container);
        }
        initialized = true;
    }
380496
function init() {
        if (isInitialized) {
            return;
        }
    
        isInitialized = true;
    
        // Watch for scroll position changes and trigger recalc/refresh if needed
        function checkScroll() {
            if (window.pageXOffset != scroll.left) {
                scroll.top = window.pageYOffset;
                scroll.left = window.pageXOffset;
    
                Stickyfill.refreshAll();
            } else if (window.pageYOffset != scroll.top) {
                scroll.top = window.pageYOffset;
                scroll.left = window.pageXOffset;
    
                // recalc position for all stickies
                stickies.forEach(function (sticky) {
                    return sticky._recalcPosition();
                });
            }
        }
    
        checkScroll();
        window.addEventListener('scroll', checkScroll);
    
        // Watch for window resizes and device orientation changes and trigger refresh
        window.addEventListener('resize', Stickyfill.refreshAll);
        window.addEventListener('orientationchange', Stickyfill.refreshAll);
    
        //Fast dirty check for layout changes every 500ms
        var fastCheckTimer = void 0;
    
        function startFastCheckTimer() {
            fastCheckTimer = setInterval(function () {
                stickies.forEach(function (sticky) {
                    return sticky._fastCheck();
                });
            }, 500);
        }
    
        function stopFastCheckTimer() {
            clearInterval(fastCheckTimer);
        }
    
        var docHiddenKey = void 0;
        var visibilityChangeEventName = void 0;
    
        if ('hidden' in document) {
            docHiddenKey = 'hidden';
            visibilityChangeEventName = 'visibilitychange';
        } else if ('webkitHidden' in document) {
            docHiddenKey = 'webkitHidden';
            visibilityChangeEventName = 'webkitvisibilitychange';
        }
    
        if (visibilityChangeEventName) {
            if (!document[docHiddenKey]) startFastCheckTimer();
    
            document.addEventListener(visibilityChangeEventName, function () {
                if (document[docHiddenKey]) {
                    stopFastCheckTimer();
                } else {
                    startFastCheckTimer();
                }
            });
        } else startFastCheckTimer();
    }
375524
public boolean init() {
	// open model file to load model here ... complete later
	BufferedReader fin = null;
	String modelFile = taggerOpt.modelDir + File.separator + taggerOpt.modelFile;
	
	try {
	    fin = new BufferedReader(new InputStreamReader(new FileInputStream(modelFile), "UTF-8"));
	    
	    // read context predicate map and label map
	    taggerMaps.readCpMaps(fin);
	    
	    System.gc();

	    taggerMaps.readLbMaps(fin);
	    
	    System.gc();
	    
	    // read dictionary 
	    taggerDict.readDict(fin);
	    
	    System.gc();
	    
	    // read features
	    taggerFGen.readFeatures(fin);
	    
	    System.gc();
	    
	    // close model file
	    fin.close();
	    
	} catch (IOException e) {
	    System.out.println("Couldn't open model file: " + modelFile);
	    System.out.println(e.toString());
	    
	    return false;	    
	}
	
	// update feature weights
	if (lambda == null) {
	    int numFeatures = taggerFGen.numFeatures();
	    lambda = new double[numFeatures];
	    for (int i = 0; i < numFeatures; i++) {
		Feature f = (Feature)taggerFGen.features.get(i);
                //System.out.println(f.idx);
		lambda[f.idx] = f.wgt;                
	    }
	}
    
	// call init method of Viterbi object
	if (taggerVtb != null) {
	    taggerVtb.init(this);
	}
	
	return true;
    }
329297
function init(loader) {
  var loaderConfig = loaderUtils.getLoaderConfig(loader, 'web3Loader');
  web3 = require('./lib/web3')(loaderConfig.provider);
  config = mergeConfig(loaderConfig);
  isDebug = loader.debug;
}
509925
def was_init():
    
    mask = lib.SDL_WasInit(0)
    return enumtools.get_items(InitFlags, mask, {InitFlags.everything})
459299
function init(options = {}, handlebars) {
  const opts = deepExtend({}, defaults, options);
  normalizePaths(opts);
  opts.handlebars = handlebars || Handlebars.create();
  return Promise.resolve(opts);
}
1083422
function init(options) {
		setting = options || {};

		if (!setting.googleApiKey && !setting.yandexApiKey) {
			console.warn(constant.ERROR.MISSING_TOKEN);
			return false;
		} else if (setting.yandexApiKey) {
			serviceType = constant.YANDEX_NAME;
			translateSrv = require('./service/yandex.js');
		} else {
			serviceType = constant.GOOGLE_NAME;
			translateSrv = require('./service/google.js');
		}

		translateSrv.init(setting);
		return true;
	}
1206411
function init() {  // {{{2
/**
 * Class constructor
 *
 * @method constructor
 */

  O.inherited(this)();

  this.setMaxListeners(Consts.coreListeners);

  this.subjectState = this.SUBJECT_STATE.INIT;

  this.homeTimeOffset = 0;

  this.lastTid = 0;  // {{{3
  /**
   * Autoincemental part of last transaction id created in this shard and peer
   *
   * @property lastTid
   * @type Number
   */

  this.lastEid = 0;  // {{{3
  /**
   * Autoincremental part of last entry id created in this shard and peer
   *
   * @property lastEid
   * @type Number
   */

  this.cache = {};  // {{{3
  /**
   * Object containing entries
   *
   * @property cache
   * @type Object
   */

  // }}}3

  return true;
}
969019
function(libraries) {
            var deferred       = null,
                promiseWrapper = null,
                $              = null;

            promiseWrapper = new this.Deferred();

            if (mixitup.features.has.promises) {
                // ES6 native promise or polyfill

                promiseWrapper.promise = new Promise(function(resolve, reject) {
                    promiseWrapper.resolve = resolve;
                    promiseWrapper.reject  = reject;
                });
            } else if (($ = (window.jQuery || libraries.$)) && typeof $.Deferred === 'function') {
                // jQuery

                deferred = $.Deferred();

                promiseWrapper.promise = deferred.promise();
                promiseWrapper.resolve = deferred.resolve;
                promiseWrapper.reject  = deferred.reject;
            } else if (window.console) {
                // No implementation

                console.warn(mixitup.messages.warningNoPromiseImplementation());
            }

            return promiseWrapper;
        }
1080105
function () {
    //Init Var
    var length = 0;
    //Loop filenames
    $.each(config.data, function () {
      length++;
    });
    //If value of length is equal to filenames length,
    // return true, if not, return false
    if (length === config.filenames.length) {
      return true;
    } else {
      return false;
    }
  }
401186
protected function _init() {
		parent::_init();
		$this->library = $this->library ?: true;
		$defaults = ['prefix' => null, 'path' => null];
		$this->_library = (array) Libraries::get($this->library) + $defaults;
	}
1237339
function init() {
    var debugFile = path.join(__dirname, 'debug.js');

    if (debug) {
        if (fs.existsSync(debugFile)) { fs.unlinkSync(debugFile); }
        debugFD = fs.openSync(debugFile, 'a');
    }

    getFileList(modelsPath).forEach(defineModel);
    processAllRelations(defineRelation);

    if (debug) {
        fs.closeSync(debugFD);
    }
}
186547
public static function __initialize():bool
    {
        $env = (new ModuleManager())->getCurrentEnv();
        $base =  realpath(__DIR__.'/../../../../../../').DIRECTORY_SEPARATOR;
        self::__setPaths($base, $env, '', true);
        FEnv::set(
            "framework.fcm.config.commands.file",
            $base."vendor/iumio/framework/Core/Additional/Manager/Configs/commands.json"
        );
        return (true);
    }
141025
async function init(keepAlive = false) {
  state = STATES.STARTING;
  const config = await getConfig();
  const relativeFrom = path.dirname(config.configFileUsed);
  // console.log({ config });
  twigNamespaces = await getTwigNamespaceConfig(
    relativeFrom,
    config.extraTwigNamespaces,
  );
  twigRenderer = new TwigRenderer({
    relativeFrom,
    src: {
      roots: [relativeFrom],
      namespaces: TwigRenderer.convertLegacyNamespacesConfig(twigNamespaces),
    },
    debug: true,
    alterTwigEnv: config.alterTwigEnv,
    hasExtraInfoInResponses: false, // Will add `info` onto results with a lot of info about Twig Env
    maxConcurrency: 50,
    keepAlive, // only set this to be true when doing in-browser requests to avoid issues with this process not exiting when complete
  });
  state = STATES.READY;
}
396579
function init() {
        // This function is called during Ghost's initialization.
        // Reading translation file for messages from core .js files and keeping its content in memory
        // The English file is always loaded, until back-end translations are enabled in future versions.
        // Before that, see previous tasks on issue #6526 (error codes or identifiers, error message
        // translation at the point of display...)
        coreStrings = fs.readFileSync(path.join(__dirname, '..', '..', 'translations', 'en.json'));

        // if translation file is not valid, you will see an error
        try {
            coreStrings = JSON.parse(coreStrings);
        } catch (err) {
            coreStrings = undefined;
            throw err;
        }

        _private.initializeIntl();
    }
585556
function init() {
        _isInitialized = true;

        foldCode.init();
        foldGutter.init();

        // Many CodeMirror modes specify which fold helper should be used for that language. For a few that
        // don't, we register helpers explicitly here. We also register a global helper for generic indent-based
        // folding, which cuts across all languages if enabled via preference.
        CodeMirror.registerGlobalHelper("fold", "selectionFold", function (mode, cm) {
            return prefs.getSetting("makeSelectionsFoldable");
        }, selectionFold);
        CodeMirror.registerGlobalHelper("fold", "indent", function (mode, cm) {
            return prefs.getSetting("alwaysUseIndentFold");
        }, indentFold);

        CodeMirror.registerHelper("fold", "handlebars", handlebarsFold);
        CodeMirror.registerHelper("fold", "htmlhandlebars", handlebarsFold);
        CodeMirror.registerHelper("fold", "htmlmixed", handlebarsFold);

        EditorManager.on("activeEditorChange.CodeFolding", onActiveEditorChanged);
        DocumentManager.on("documentRefreshed.CodeFolding", function (event, doc) {
            restoreLineFolds(doc._masterEditor);
        });

        ProjectManager.on("beforeProjectClose.CodeFolding beforeAppClose.CodeFolding", saveBeforeClose);

        //create menus
        codeFoldingMenuDivider = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuDivider();
        Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(COLLAPSE_ALL);
        Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(EXPAND_ALL);
        Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(COLLAPSE);
        Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(EXPAND);

        //register keybindings
        KeyBindingManager.addBinding(COLLAPSE_ALL, [ {key: collapseAllKey}, {key: collapseAllKeyMac, platform: "mac"} ]);
        KeyBindingManager.addBinding(EXPAND_ALL, [ {key: expandAllKey}, {key: expandAllKeyMac, platform: "mac"} ]);
        KeyBindingManager.addBinding(COLLAPSE, collapseKey);
        KeyBindingManager.addBinding(EXPAND, expandKey);


        // Add gutters & restore saved expand/collapse state in all currently open editors
        Editor.registerGutter(GUTTER_NAME, CODE_FOLDING_GUTTER_PRIORITY);
        Editor.forEveryEditor(function (editor) {
            enableFoldingInEditor(editor);
        });
    }