Will load the aws-sdk npm dependency if it's not already loaded.

@param generator the yeoman generator it'll be loaded in.
@returns {Promise} The promise will succeed if the aws-sdk has been loaded and fails if it couldn't be installed.
424832
function loadAWS(generator) {
    return new Promise((resolve, reject) => {
        try {
            AWS = require('aws-sdk'); // eslint-disable-line
            ProgressBar = require('progress'); // eslint-disable-line
            ora = require('ora'); // eslint-disable-line
        } catch (e) {
            generator.log('Installing AWS dependencies');
            let installCommand = 'yarn add aws-sdk@2.167.0 progress@2.0.0 ora@1.3.0';
            if (generator.config.get('clientPackageManager') === 'npm') {
                installCommand = 'npm install aws-sdk@2.167.0 progress@2.0.0 ora@1.3.0--save';
            }
            shelljs.exec(installCommand, { silent: false }, code => {
                if (code !== 0) {
                    generator.error('Something went wrong while installing the dependencies\n');
                    reject();
                }
                AWS = require('aws-sdk'); // eslint-disable-line
                ProgressBar = require('progress'); // eslint-disable-line
                ora = require('ora'); // eslint-disable-line
            });
        }
        resolve();
    });
}
68945
function (version) {
        return __awaiter(this, void 0, void 0, function* () {
            let versions = yield ForestInternal.queryElmVersions();
            let result = ForestInternal.findSuitable(version, versions);
            if (result === null) {
                throw new ForestError(Errors.NoMatchingVersion, `Unable to find an Elm version matching ${version} on NPM`);
            }
            return Promise.resolve(result);
        });
    }
1230339
function execDependencyInstall () {

	console.log('\nExecuting npm install command...');

	return new Promise(function(resolve, reject){

		var child = require('child_process').spawn('npm', ['install'], {
			cwd: process.cwd,
			detached: false,
			env: process.env,
			stdio: [process.stdin, process.stdout, process.stderr]
		});

		child.on('error', function (error) {
			console.error(colors.bold.red('ERROR: Could not install the required modules:'));
			console.error(error.stack.toString());
			process.exit(255);
		});

		child.on('close', function (exit_code) {
			if (exit_code !== 0) {
				console.error(colors.bold.red('\nERROR: npm install has been failed.'));
				process.exit(255);
			}
			console.log('\nnpm install has been completed.\n\n');
			resolve(true);
		});

	});

}
548160
function requireDependencies(dependencies) {
    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

    var promise = new _es6Promise.Promise(function (succeed, fail) {
        var requirements = {};

        // no requirements
        if (!(dependencies instanceof Array)) {
            return succeed(requirements);
        }

        // check if succeeded
        function checkStatus() {
            if (Object.keys(requirements).length === dependencies.length) {
                succeed(requirements);
            }
        }

        dependencies.forEach(function (dependency) {
            if (packages.has(dependency)) {
                requirements[dependency] = packages.get(dependency);
            } else {
                events.once("load:" + dependency, function (requirement) {
                    requirements[dependency] = requirement;
                    checkStatus();
                });
            }
        });

        // First check
        checkStatus();
    });

    return typeof callback === "function" ? promise.then(callback) : promise;
}
1252548
function main(options = util.getDefaultOptions()) {
  createLogger(options.debug);
  log.info(`Preparing '${options.sdk}' schemas in version '${options.version || 'latest'}'...`);

  let allLibs = {};

  // do the downloading and encapsulate in Promise
  const dlPromise = new Promise((resolve, reject) => {
    download.allLibsFile(options)
      .then((allLibsJSON) => {
        allLibs = allLibsJSON;
        download.schemas(options, allLibs)
          .then((values) => {
            resolve(values);
          })
          .catch((e) => {
            reject(e);
          });
      })
      .catch((e) => {
        reject(e);
      });
  });


  dlPromise.then(() => {
    log.info('Yay, all schema files were successfully downloaded!');
    if (options.upgrade) {
      upgrade(options, allLibs);
    }
    if (options.link) {
      link(options, allLibs);
    }
  }, (e) => {
    log.error('Damn... Something went all wrong while downloading the schema files!');
    log.error(`Are you sure the version '${options.version}' is still available on '${options.sdk}' download pages?`);
    log.error(e);
  });
}
897348
function npmLoad(context, pkg){
	var task = new FetchTask(context, pkg);

	return task.load().then(function(){
		if(task.failed) {
			// Recurse. Calling task.next gives us a new pkg object
			// with the fileUrl being the parent node_modules folder.
			return npmLoad(context, task.next());
		}
		return task.getPackage();
	});
}
542541
function load() {
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  params = (0, _lodash.defaults)({}, params, {
    locale: 'en_US'
  });
  return new Promise(function (resolve, reject) {
    if (window.FB) {
      return resolve(window.FB);
    }

    var src = '//connect.facebook.net/' + params.locale + '/sdk.js';
    var script = document.createElement('script');
    script.id = 'facebook-jssdk';
    script.src = src;
    script.async = true;
    script.addEventListener('load', function () {
      return resolve(window.FB);
    }, false);
    script.addEventListener('error', function () {
      return reject('Error loading Facebook JS SDK from ' + src);
    }, false);

    var sibling = document.getElementsByTagName('script')[0];
    sibling.parentNode.insertBefore(script, sibling);
  });
}
1364264
function build() {
	runTypeScriptBuild('.build.es5', ts.ScriptTarget.ES5, true);
	runTypeScriptBuild('.build.es6', ts.ScriptTarget.ES2015, false);
	return Promise.all([
		generateBundledModule(
			path.resolve('.build.es5', 'index.js'),
			path.resolve('lib', 'firestorter.js'),
			'cjs'
		),

		generateBundledModule(
			path.resolve('.build.es5', 'index.js'),
			path.resolve('lib', 'firestorter.umd.js'),
			'umd',
			'firestorter'
		),

		generateBundledModule(
			path.resolve('.build.es5', 'index.js'),
			path.resolve('lib', 'firestorter.module.js'),
			'es'
		),

		generateBundledModule(
			path.resolve('.build.es6', 'index.js'),
			path.resolve('lib', 'firestorter.es6.js'),
			'es'
		)
	]).then(() => {
		generateMinified();
		// copyFlowDefinitions();
	});
}
583109
function () {
		var that = this,
				independent, 
				dependencyNotRequired;
		
		promiseIndependent = this.saveFixturesFromArray(independentFixtures);
		promiseDelayedDependency = this.saveFixturesFromArray(delayedDependencyFixtures);
		
		promise = Q.all([ promiseIndependent, promiseDelayedDependency ])
			.then(function(models) {
				return that.saveFixturesFromArray(requiredDependencyFixtures);
			});
		
		return promise;
	}
44179
function _require(dependency) {
        let result;
        try {
            result = require(path.join('ng-apimock', 'node_modules', dependency));
        } catch (ex) {
            result = require(dependency)
        }
        return result;
    }
1074075
public final void addGenerator(@NotNull final GeneratorConfig generator) {
        Contract.requireArgNotNull("generator", generator);
        if (list == null) {
            list = new ArrayList<>();
        }
        list.add(generator);
    }
381059
@SuppressWarnings( "UnusedDeclaration" )
    public void addGenerator( ObjectIdGenerator<?> generator ) {
        if ( null == generators ) {
            generators = new ArrayList<ObjectIdGenerator<?>>();
        }
        generators.add( generator );
    }
1145712
function (plugin){
      if (Utils.isObject(plugin) && Utils.isFunction(plugin.install)) {
        var installArgs = [];

        // Inject plugin dependencies as requested, using the synchronous
        // require API for Require.js and Almond.js.
        if(plugin.$inject){
          plugin.$inject.forEach(function (dependency) {
            installArgs.push(require(dependency));
          });
        }

        plugin.install.apply(plugin, installArgs);

        return this;
      } else {
        throw new TypeError('Plugin must implement \'install()\' method.');
      }
    }
1193482
public void scheduleUpdate(UniqueKeyGenerator generator)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "scheduleUpdate", "GeneratorName="+generator.getName());

        synchronized (_asyncQ)
        {
            _asyncQ.add(generator);
            _asyncQ.notify();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "scheduleUpdate");
    }
422581
function compile(config) {
  return new Promise((resolve, reject) => {
    let compiler;
    try {
      compiler = webpack(config);
    } catch (e) {
      console.log('compile errors:', [e]); // eslint-disable-line
      reject(e);
      process.exit(1);
    }
    compiler.run((err, stats) => {
      err ? reject(err) : resolve(stats);
    });
  });
}
163617
function requireLoader(loaderConfig) {
  const errMsgBase = `while requiring loader ${JSON.stringify(loaderConfig)} config,`;
  if (typeof loaderConfig !== 'object') { throw error(`${errMsgBase}, config must be object, got ${typeof loaderConfig}`); }
  if (typeof loaderConfig.loader !== 'string') { throw error(`${errMsgBase}, config.loader must be String, got ${JSON.stringify(loaderConfig.loader)}`); }

  return require(loaderConfig.loader); // eslint-disable-line
}
168441
public void load(ScriptEngine engine) {
        try {
            //module loading
            engine.eval("load('" + getResourceAsURLStirng("/eclairjs/EclairJS_Globals.js") + "');");
            engine.eval("load('" + getResourceAsURLStirng("/eclairjs/ModuleUtils.js") + "');");
            engine.eval("load('" + getResourceAsURLStirng("/eclairjs/jvm-npm/jvm-npm.js") + "');");
            engine.eval("load('" + getResourceAsURLStirng("/eclairjs/Serialize.js") + "');");

            NashornEngineSingleton.setEngine(engine);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }