Load the saved previous state from disk
@method loadSavedState
@return {Object} Configuration
355190
function loadSavedState () {
    var output;
    try {
        output = jsonfile.readFileSync(STATE_FILE);
    } catch (ex) {
        winston.info('No previous state found, continuing');
        output = {
            subscriptions: [],
            callback: '',
            history: {},
            version: '0.0.0'
        };
    }
    return output;
}
1343126
function getState (file) {
    // collect state for all possible data and recovery files
    var state = {};
    state.ephemeral = getFileInfo (file + ".eph");
    state.ready = getFileInfo (file + ".rdy");
    state.base = getFileInfo (file);
    state.backup = getFileInfo (file + ".bak");
    state.tertiary = getFileInfo (file + ".bk2");

    if (state.ephemeral.exists) {
        state.status = cc.SAFE_INTERVENE;
    } else if ((state.ready.exists) || (state.tertiary.exists)) {
        state.status = cc.SAFE_RECOVERABLE;
    } else if (state.base.exists) {
        state.status = cc.SAFE_NORMAL;
    } else {
        if (state.backup.exists) {
            state.status = cc.SAFE_RECOVERABLE;
        } else {
            state.status = cc.DOES_NOT_EXIST;
        }
    }

    return (state);
}
931829
function() {
    var deferred = $q.defer();

    var current = $state.current();

    // Evaluate
    if(current) {
      var sources = (typeof current.load === 'string' ? [current.load] : current.load) || [];
      
      // Get promises
      $q.all(sources
        .map(function(src) {
          return _createLoadable(src);
        })
        .filter(function(loadable) {
          return !loadable.isComplete;
        })
        .map(function(loadable) {
          return loadable.promise;
        })
      )
          .then(function() {
            deferred.resolve();

          }, function(err) {
            $rootScope.$broadcast('$loadableError', err);
            deferred.reject(err);
          });

    // No state
    } else {
      deferred.resolve();
    }

    return deferred.promise;
  }
300565
function loadOptions() {
    chrome.storage.sync.get('options', function(data) {
      var options = data.options;

      document.querySelector('[data-settings=tomster]').checked = options && options.showTomster;
    });
  }
586826
function _fnLoadState ( oSettings, oInit )
		{
			if ( !oSettings.oFeatures.bStateSave )
			{
				return;
			}
		
			var oData = oSettings.fnStateLoad.call( oSettings.oInstance, oSettings );
			if ( !oData )
			{
				return;
			}
			
			/* Allow custom and plug-in manipulation functions to alter the saved data set and
			 * cancelling of loading by returning false
			 */
			var abStateLoad = _fnCallbackFire( oSettings, 'aoStateLoadParams', 'stateLoadParams', [oSettings, oData] );
			if ( $.inArray( false, abStateLoad ) !== -1 )
			{
				return;
			}
			
			/* Store the saved state so it might be accessed at any time */
			oSettings.oLoadedState = $.extend( true, {}, oData );
			
			/* Restore key features */
			oSettings._iDisplayStart    = oData.iStart;
			oSettings.iInitDisplayStart = oData.iStart;
			oSettings._iDisplayEnd      = oData.iEnd;
			oSettings._iDisplayLength   = oData.iLength;
			oSettings.aaSorting         = oData.aaSorting.slice();
			oSettings.saved_aaSorting   = oData.aaSorting.slice();
			
			/* Search filtering  */
			$.extend( oSettings.oPreviousSearch, oData.oSearch );
			$.extend( true, oSettings.aoPreSearchCols, oData.aoSearchCols );
			
			/* Column visibility state
			 * Pass back visibiliy settings to the init handler, but to do not here override
			 * the init object that the user might have passed in
			 */
			oInit.saved_aoColumns = [];
			for ( var i=0 ; i<oData.abVisCols.length ; i++ )
			{
				oInit.saved_aoColumns[i] = {};
				oInit.saved_aoColumns[i].bVisible = oData.abVisCols[i];
			}
		
			_fnCallbackFire( oSettings, 'aoStateLoaded', 'stateLoaded', [oSettings, oData] );
		}
983510
function load() {
      var key, data, value, pos = 0;

      items = {};

      // localStorage can be disabled on WebKit/Gecko so make a dummy storage
      if (!hasOldIEDataSupport) {
        return;
      }

      function next(end) {
        var value, nextPos;

        nextPos = end !== undefined ? pos + end : data.indexOf(',', pos);
        if (nextPos === -1 || nextPos > data.length) {
          return null;
        }

        value = data.substring(pos, nextPos);
        pos = nextPos + 1;

        return value;
      }

      storageElm.load(userDataKey);
      data = storageElm.getAttribute(userDataKey) || '';

      do {
        var offset = next();
        if (offset === null) {
          break;
        }

        key = next(parseInt(offset, 32) || 0);
        if (key !== null) {
          offset = next();
          if (offset === null) {
            break;
          }

          value = next(parseInt(offset, 32) || 0);

          if (key) {
            items[key] = value;
          }
        }
      } while (key !== null);

      updateKeys();
    }
1002098
function loadFromDisk(resolvedPath, configContext) {
    const dirname = path.dirname(resolvedPath.filePath),
        lookupPath = getLookupPath(dirname),
        config = loadConfigFile(resolvedPath);

    return config;
}
938735
def restoreState(self):
        
        if os.path.exists(self._stateFile):
            try:
                fp = open(self._stateFile,  'r')
                stateObj = pickle.load(fp)
            except:
                raise IOError("Failure in reading plugin state from file: %s" 
                              % self._stateFile)
            return stateObj
        return None
1062568
function () {
            if (savedToStatePath) {
              toState.path = savedToStatePath;
              savedToStatePath = null;
            }

            if (savedFromStatePath) {
              fromState.path = savedFromStatePath;
              savedFromStatePath = null;
            }

            angular.forEach(restore.restoreFunctions, function (restoreFunction) {
              restoreFunction();
            });
            // Restore is done, now set the restore function to noop in case it gets called again.
            restore = noop;
            // pendingRestore keeps track of a transition that is in progress.  It allows the decorated transitionTo
            // method to be re-entrant (for example, when superceding a transition, i.e., redirect).  The decorated
            // transitionTo checks right away if there is a pending transition in progress and restores the paths
            // if so using pendingRestore.
            pendingRestore = null;
            pendingTransitions.splice(idx, 1); // Remove this transition from the list
          }
199954
function createSessionState(responseData)
{
  var currentRole             = responseData.finalRoleName;
  var currentWarehouse        = responseData.finalWarehouseName;
  var currentDatabaseProvider = responseData.databaseProvider;
  var currentDatabase         = responseData.finalDatabaseName;
  var currentSchema           = responseData.finalSchemaName;

  return {
    getCurrentRole: function()
    {
      return currentRole;
    },
    getCurrentWarehouse: function()
    {
      return currentWarehouse;
    },
    getCurrentDatabaseProvider: function()
    {
      return currentDatabaseProvider;
    },
    getCurrentDatabase: function()
    {
      return currentDatabase;
    },
    getCurrentSchema: function()
    {
      return currentSchema;
    }
  };
}
128902
function initializeState() {
        var result = $.Deferred();

        FileSystem.resolve(updateDir, function (err) {
            if (!err) {
                result.resolve();
            } else {
                var directory = FileSystem.getDirectoryForPath(updateDir);
                directory.create(function (error) {
                    if (error) {
                        console.error('AutoUpdate : Error in creating update directory in Appdata');
                        result.reject();
                    } else {
                        result.resolve();
                    }
                });
            }
        });

        return result.promise();
    }
174889
function saveBoxed(onDoneCallback = UNDEFINED) {
    const boxed = this.boxed;
    if (boxed) {
        const modified = boxed[boxedImmutable.BOXED_GET_THIS].valueOfModified();
        if (modified !== UNDEFINED) {
            this.boxed = UNDEFINED;
            if (this.saveState) {
                return this.saveState(modified, boxed, onDoneCallback);
            } else {
                throw new TypeError("Save State Not Supported on this instance, saveState callback not provided");
            }
        }
    } else if (onDoneCallback) {
        onDoneCallback();
    }
}
1243669
def load_state(self, fname=None):
        """"""
        with open(fname, 'rb') as fh:
            self.state = pickle.load(fh)
1124320
function(){
		var loaded = FuncUnit.win.document.readyState === "complete" && 
				     FuncUnit.win.location.href != "about:blank" &&
				     FuncUnit.win.document.body;
		return loaded;
	}
487500
function reset() {
  const oldOptions = options()
  options({
    wishes: [],
    noWishMerge: true,
    previousId: 0,
    enteredMagicWords: {},
    context: _defaultContext,
    previousContext: _defaultContext,
    enabled: true,
  })
  return oldOptions
}
938530
function pushLoadingState(xhrEvent, stateName, modelOrCollection, context, force) {
        var currentLoads = getState(stateName, context),
            currentlyLoading = currentLoads && currentLoads.length;
        if (!currentLoads) {
            currentLoads = [];
        }
        if (_.isArray(currentLoads)) {
            if (_.indexOf(currentLoads, xhrEvent) >= 0) {
                if (!force) {
                    return;
                }
                
            } else {
                currentLoads.push(xhrEvent);
            }
            
            if (!currentlyLoading) {
                var toSet = {};
                toSet[stateName] = currentLoads;
                setState(toSet, context);
            }

            xhrEvent.on('complete', function() {
                popLoadingState(xhrEvent, stateName, modelOrCollection, context);
            });
        }
    }
503760
function loadingStateGetter() {
	if (Object.keys(this._syncers).length > 0) {
		return some(this._syncers, syncer => {
			return syncer.loading
		})
	}
	return false
}