Initialize a storage
@constructor Graph
508037
function (hash, capacity) {
        if (!hash) hash = 255;
        if (!capacity) capacity = hash * 4;
        this._hash = hash;
        this._capacity = capacity;
        this._nextId = 0;
        this._shards = [];
        this._indexes = [];
    }
217061
protected function initialize()
    {
        if ($this->initialized === true) {
            return;
        }

        $this->initializeStorages();
        $this->initializeTargets();
        $this->initializeCollections();
        $this->initialized = true;
    }
1195751
protected void initialize() {
        log.info("Building Huffman tree for source graph...");
        int nVertices = sourceGraph.numVertices();
        //int[] degrees = new int[nVertices];
        //for( int i=0; i<nVertices; i++ )
        // degrees[i] = sourceGraph.getVertexDegree(i);
        /*
        for (int y = 0; y < nVertices; y+= 20) {
            int[] copy = Arrays.copyOfRange(degrees, y, y+20);
            System.out.println("D: " + Arrays.toString(copy));
        }
        */
        //        GraphHuffman huffman = new GraphHuffman(nVertices);
        //        huffman.buildTree(degrees);

        log.info("Transferring Huffman tree info to nodes...");
        for (int i = 0; i < nVertices; i++) {
            T element = sourceGraph.getVertex(i).getValue();
            element.setElementFrequency(sourceGraph.getConnectedVertices(i).size());

            if (vocabCache != null)
                vocabCache.addToken(element);
        }

        if (vocabCache != null) {
            Huffman huffman = new Huffman(vocabCache.vocabWords());
            huffman.build();
            huffman.applyIndexes(vocabCache);
        }
    }
1201274
function init() {
    try {
        keepOrganized().then((AllFiles) => {
            console.log('Marked Reference Links');
            console.log('Created Directory Tree');
            console.log('Setting up watchers...');
            let watcher = new Watcher(AllFiles);
            console.log('Watching for file changes...');
            watcher.on('update', () => {
                console.log('Updating dirTree...')
                keepOrganized().then((AllFiles) => {
                    console.log('Updated dirTree.');
                    watcher.update(AllFiles);
                })
            })
        })
    } catch (err) {
        console.error(err);
    }
}
537166
function loadGraphSON(graph, filename, callback) {
        var FileInputStream = Tinkerpop.autoImport('FileInputStream');
        var stream = new FileInputStream(filename);
        return Tinkerpop.GraphSONReader.buildP()
            .then(function (builder) {
            return _newGraphSONMapper()
                .then(function (mapper) { return builder.mapperP(mapper); });
        })
            .then(function (builder) { return builder.createP(); })
            .then(function (reader) { return reader.readGraphP(stream, graph); })
            .then(function () { return graph; })
            .nodeify(callback);
    }
1317513
function _initStorage(options) {
        var self = this;
        var dbInfo = {
            db: null
        };

        if (options) {
            for (var i in options) {
                dbInfo[i] = options[i];
            }
        }

        return new Promise(function(resolve, reject) {
            var openreq = indexedDB.open(dbInfo.name, dbInfo.version);
            openreq.onerror = function() {
                reject(openreq.error);
            };
            openreq.onupgradeneeded = function() {
                // First time setup: create an empty object store
                openreq.result.createObjectStore(dbInfo.storeName);
            };
            openreq.onsuccess = function() {
                dbInfo.db = openreq.result;
                self._dbInfo = dbInfo;
                resolve();
            };
        });
    }
1065762
function(options){
      var storage;

      var StorageType = options.storageType || this.storageType;
      if (_.isFunction(StorageType)){
        storage = new StorageType();
      } else {
        storage = StorageType;
      }

      this.storage = storage;
    }
658965
function init() {
    var stateFromHash = getStateFromHash();
    var stateChanged = false;

    if (typeof defaults === 'object' && defaults) {
      Object.keys(defaults).forEach(function(key) {
        if (key in stateFromHash) return;

        stateFromHash[key] = defaults[key]
        stateChanged = true;
      });
    }

    if (stateChanged) set(stateFromHash);
  }
662724
public GraphHopperStorage build() {
        Directory dir = mmap ?
                new MMapDirectory(location) :
                new RAMDirectory(location, store);

        GraphExtension graphExtension = encodingManager.needsTurnCostsSupport() ?
                new TurnCostExtension() :
                new TurnCostExtension.NoOpExtension();

        return singleCHWeighting == null ?
                new GraphHopperStorage(dir, encodingManager, elevation, graphExtension) :
                edgeBasedCH ?
                        new GraphHopperStorage(Collections.<Weighting>emptyList(), Arrays.asList(singleCHWeighting), dir, encodingManager, elevation, graphExtension) :
                        new GraphHopperStorage(Arrays.asList(singleCHWeighting), Collections.<Weighting>emptyList(), dir, encodingManager, elevation, graphExtension);
    }
947781
function(localStorage,paths,namespace) {

	var pathGraph = '',
		nodeGraph = '',
		rootNodeGraph = '',
		i = 0,
		l = 0;
	
	var toIdentifier = function(src) {
		if (src.match(/\:/)) {
			var x = src.split(':');
			return x[0].replace(/[^0-9a-zA-Z]/g,'_')+':'+x[1];
		}
		return src.replace(/[^0-9a-zA-Z]/g,'_');
	};

	var toNode = function(src) {
		var kr = '',
			r = [];
			var getInnerRec = function(item) {
				var r = [],
					k = '';
				for (k in item) {
					if (item.hasOwnProperty(k)) {
						r.push(''+k+':'+JSON.stringify(item[k])
							.replace(/"/g,'\\"')
							.replace(/\{/g,'\\{')
							.replace(/\}/g,'\\}')
							.replace(/\|/g,'|')
							.replace(/\(/g,'(')
							.replace(/\)/g,')')
						);
					}
				}
				return r.join('|');
			};
		var item = JSON.parse(localStorage.getItem(namespace + '.'+src.replace(/\:.*/,'')));
		if (src.match(/\:/)) {
			for (kr in item) {
				if (item.hasOwnProperty(kr)) {
					r.push(
						(r.length ? '' : src.replace(/\:.*/,'') + '|') +
						'{ <'+kr+"> "+kr+" |{"+getInnerRec(item[kr])+'}}'
					);
				}
			}
			return toIdentifier(src) + ' [label="'+r.join('|')+'"];';
		}
		return toIdentifier(src) + ' [label="'+src+'|'+getInnerRec(item)+'"]' + ";\n";
	};
	
	for (i=0, l=paths.length; i<l; i++) {
		if (paths[i].from.match(/\:/)) {
			rootNodeGraph = rootNodeGraph + toNode(paths[i].from);
		} else {
			nodeGraph = nodeGraph + toNode(paths[i].from);
		}
		if (paths[i].to) {
			var tmp = paths[i].from.split(/[\.\:]/);
			nodeGraph = nodeGraph + toNode(tmp[0]+'.'+tmp[1]+'.'+paths[i].to);
			pathGraph = pathGraph + 
				toIdentifier(paths[i].from) + 
				' -> ' +
				toIdentifier(tmp[0]+'.'+tmp[1]+'.'+paths[i].to) +
				(paths[i].hasOwnProperty('via') ? '[label="'+paths[i].via+'"]' : '') +
				";\n";
		}
	}

	var str = 'digraph { graph [ dpi = 50 ]; rankdir="LR"; node[shape=record]; % }';
	str = str.replace('%','subgraph clusterStore { label=Roots; '+rootNodeGraph+' } %');
	str = str.replace('%',nodeGraph+' %');
	str = str.replace('%',pathGraph+' ');

	return str;
}
1072683
@Override
    protected void initializeGraph() {
        super.initializeGraph();
        mData = new ArrayList<>();

        mValuePaint = new Paint(mLegendPaint);

        if(this.isInEditMode()) {
            addBar(new BarModel(2.3f));
            addBar(new BarModel(2.f));
            addBar(new BarModel(3.3f));
            addBar(new BarModel(1.1f));
            addBar(new BarModel(2.7f));
            addBar(new BarModel(2.3f));
            addBar(new BarModel(2.f));
            addBar(new BarModel(3.3f));
            addBar(new BarModel(1.1f));
            addBar(new BarModel(2.7f));
        }
    }
320327
function initialize () {
        return pullTaskRunner.run(function() {
            return store.defineTable({
                name: pulltimeTableName,
                columnDefinitions: {
                    id: 'string', // column for storing queryId
                    tableName: 'string', // column for storing table name 
                    value: 'date' // column for storing lastKnownUpdatedAt
                }
            });
        });
    }
398
function initialize() {
  var flags = [];

  Object.keys( levels ).forEach(function( type, level ) {
    var method = type.toLowerCase();
    exports[ method ] = log.bind( exports, type, level, false );
    exports[ method ].json = log.bind( exports, type, level, true );
    if ( new RegExp( '\\b' + type + '\\b', 'i' ).test( env ) ) {
      flags.push( level );
    }
  });

  loglevel = Math.min.apply( Math, flags );
}
307173
@Override
    protected void initializeGraph() {
        super.initializeGraph();
        mData = new ArrayList<>();

        mValuePaint = new Paint(mLegendPaint);
        mValuePaint.setTextAlign(Paint.Align.CENTER);

        if(this.isInEditMode()) {
            addBar(new BarModel(2.3f));
            addBar(new BarModel(2.f));
            addBar(new BarModel(3.3f));
            addBar(new BarModel(1.1f));
            addBar(new BarModel(2.7f));
            addBar(new BarModel(2.3f));
            addBar(new BarModel(2.f));
            addBar(new BarModel(3.3f));
            addBar(new BarModel(1.1f));
            addBar(new BarModel(2.7f));
        }
    }
648208
def init_app(app, *storages):
    '''
    
    '''

    # Set default configuration
    app.config.setdefault('FS_SERVE', app.config.get('DEBUG', False))
    app.config.setdefault('FS_ROOT', join(app.instance_path, 'fs'))
    app.config.setdefault('FS_PREFIX', None)
    app.config.setdefault('FS_URL', None)
    app.config.setdefault('FS_BACKEND', DEFAULT_BACKEND)
    app.config.setdefault('FS_IMAGES_OPTIMIZE', False)

    state = app.extensions['fs'] = app.extensions.get('fs', {})
    for storage in storages:
        storage.configure(app)
        state[storage.name] = storage

    from .views import bp
    app.register_blueprint(bp, url_prefix=app.config['FS_PREFIX'])
418574
function(options) {
  Data.Graph.call(this, options.schema, options);

  this.containers = {};

  this.addIndex("annotations", {
    types: ["annotation"],
    property: "path"
  });
}
962740
function initialize() {
        var self = this;

        // NOTE: triggered before `creating`/`updating`
        this.on('saving', function onSaving(newObj, attrs, options) {
            if (options.method === 'insert') {
                // id = 0 is still a valid value for external usage
                if (_.isUndefined(newObj.id) || _.isNull(newObj.id)) {
                    newObj.setId();
                }
            }
        });

        [
            'fetching',
            'fetching:collection',
            'fetched',
            'fetched:collection',
            'creating',
            'created',
            'updating',
            'updated',
            'destroying',
            'destroyed',
            'saving',
            'saved'
        ].forEach(function (eventName) {
            var functionName = 'on' + eventName[0].toUpperCase() + eventName.slice(1);

            if (functionName.indexOf(':') !== -1) {
                functionName = functionName.slice(0, functionName.indexOf(':'))
                    + functionName[functionName.indexOf(':') + 1].toUpperCase()
                    + functionName.slice(functionName.indexOf(':') + 2);
                functionName = functionName.replace(':', '');
            }

            if (!self[functionName]) {
                return;
            }

            self.on(eventName, self[functionName]);
        });

        // @NOTE: Please keep here. If we don't initialize the parent, bookshelf-relations won't work.
        proto.initialize.call(this);
    }