Check for bug from issue 3: https://github.com/nikospara/require-lazy/issues/3
558278
function checkBug3(pmresult) {
	var fileContents, i, bundlesArray = pmresult.bundles.bundlesArray,
		STR_TO_SEARCH='\tconsole.log("BUG 3 - if this is printed more than once, then issue 3 is not solved");';
	fileContents = fs.readFileSync("../build/scripts/main/main-built.js", {encoding:"utf8"});
	if( fileContents.indexOf(STR_TO_SEARCH) < 0 ) return "not found in main-built.js";
	for( i=0; i < bundlesArray.length; i++ ) {
		if( bundlesArray[i].exclusive || bundlesArray[i].includedIn ) continue;
		fileContents = fs.readFileSync("../build/scripts/bundles/" + bundlesArray[i].id + ".js", {encoding:"utf8"});
		if( fileContents.indexOf(STR_TO_SEARCH) >= 0 ) return "found in bundle " + bundlesArray[i].id;
	}
	return false;
}
858372
function require(names, callback, errback, referer) {
      // in amd, first arg can be a config object... we just ignore
      if (typeof names == 'object' && !(names instanceof Array))
        return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1));

      // amd require
      if (typeof names == 'string' && typeof callback == 'function')
        names = [names];
      if (names instanceof Array) {
        var dynamicRequires = [];
        for (var i = 0; i < names.length; i++)
          dynamicRequires.push(loader['import'](names[i], referer));
        Promise.all(dynamicRequires).then(function(modules) {
          if (callback)
            callback.apply(null, modules);
        }, errback);
      }

      // commonjs require
      else if (typeof names == 'string') {
        var defaultJSExtension = loader.defaultJSExtensions && names.substr(names.length - 3, 3) != '.js';
        var normalized = loader.decanonicalize(names, referer);
        if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) == '.js')
          normalized = normalized.substr(0, normalized.length - 3);
        var module = loader.get(normalized);
        if (!module)
          throw new Error('Module not already loaded loading "' + names + '" as ' + normalized + (referer ? ' from "' + referer + '".' : '.'));
        return module.__useDefault ? module['default'] : module;
      }

      else
        throw new TypeError('Invalid require');
    }
84924
function perform_require(reqfunc, plugin_desc, builtin, level) {
  var search_list = plugin_desc.search
  var initfunc, search

  next_search_entry: for (var i = 0; i < search_list.length; i++) {
    search = search_list[i]

    // only load builtins if builtin flag true
    if (!builtin && 'builtin' == search.type) continue

    if (0 === level && 'builtin' != search.type && search.name.match(/^[.\/]/))
      continue

    try {
      plugin_desc.history.push({ module: reqfunc.module, path: search.name })

      initfunc = reqfunc(search.name)

      // Found it!
      break
    } catch (e) {
      if ('MODULE_NOT_FOUND' == e.code) {
        // A require failed inside the plugin.
        if (-1 == e.message.indexOf(search.name)) {
          return { error: e, found: search }
        }

        // Plain old not found, so continue searching.
        continue next_search_entry
      } else {
        // The require failed for some other reason.
        return { error: e, found: search }
      }
    }
  }

  // Return the init function, and a description of where we found it.
  return {
    initfunc: initfunc,
    module: reqfunc.module,
    require: search.name,
    found: search
  }
}
1045041
function rerequire (module) {
  if (module[0] === '.') {
    module = Path.join(Path.dirname(getCaller()), module)
  }

  var oldkeys = Object.keys(require.cache)
  var result = require(module)
  var newkeys = Object.keys(require.cache)
  newkeys.forEach(function (newkey) {
    if (!~oldkeys.indexOf(newkey)) {
      delete require.cache[newkey]
    }
  })
  return result
}
818037
function Slack(opts, debug) {
  if (!(this instanceof Slack)) return new Slack(opts);
  this.opts = opts;
  this.debug = debug;

  /**
   * Do everything.
   */

  this.import = function *() {
    try {
      console.log('Starting import');
      yield this.tokens();
      console.log('Got tokens');
      yield this.login();
      console.log('Logged in');
    } catch (e) {
      console.log('Uh oh! ' + e);
      throw e;
    }
    console.log('Getting emoji page');
    var emojiList = '';
    var aliasList = '';
    for (var i = 0; i < Object.keys(this.opts.emojis).length; i++) {
      var e = this.opts.emojis[i];
      if (e.src) {
        var uploadRes = yield this.upload(e.name, e.src);
        emojiList += ' :' + e.name + ':';
      }
      if (e.aliases) {
        for (var n = 0; n < e.aliases.length; n++) {
          yield this.alias(e.name, e.aliases[n]);
          aliasList += ' :' + e.aliases[n] + ':';
        }
      }
    }
    console.log('Uploaded emojis:' + emojiList);
    console.log('Uploaded emoji aliases:' + aliasList);
    return 'Success';
  };

  /**
   * Get login page (aka credentials).
   */

  this.tokens = function *() {
    var opts = this.opts;
    opts.jar = opts.jar || { _jar: { store: { idx: {} } } };
    var load = {
      url: opts.url + loginFormPath,
      headers: headers,
      jar: opts.jar,
      method: 'GET'
    };
    var res = yield request(load);
    var $ = cheerio.load(res[0].body);
    if (this.debug) write($('title').text(), $.html());
    opts.formData = {
      signin: $('#signin_form input[name="signin"]').attr('value'),
      redir: $('#signin_form input[name="redir"]').attr('value'),
      crumb: $('#signin_form input[name="crumb"]').attr('value'),
      remember: 'on',
      email: opts.email,
      password: opts.password
    };
    if (!opts.formData.signin && !opts.formData.redir && !opts.formData.crumb) throw new Error('Login error: could not get login form for ' + opts.url);
    return this.opts = opts;
  };

  /**
   * Log into Slack and populate cookies.
   */

  this.login = function *() {
    var opts = this.opts;
    var load = {
      url: opts.url + loginFormPath,
      headers: headers,
      jar: opts.jar,
      method: 'POST',
      followAllRedirects: true,
      formData: opts.formData
    };
    var res = yield request(load);
    if(res[0].body.indexOf("Sorry, you entered an incorrect email address or password.") != -1){
      throw new Error('Login error: incorrect username / password');
    }

    if(res[0].body.indexOf("Enter your authentication code") != -1){

      var $ = cheerio.load(res[0].body);

      var inputs = $("form input")

      var formData = {};

      inputs.each(function(i,v){
        formData[v.attribs.name] = v.attribs.value;
      })

      user_2fa_code = yield ask('2FA Code: ', isPassword, 'A password (as defined by this script) needs to have at least one character (not including you).');
      formData["2fa_code"] = user_2fa_code

      delete formData[undefined]
      delete formData['input']

      var load_2fa = {
        url: opts.url + "/",
        headers: headers,
        jar: opts.jar,
        method: 'POST',
        followAllRedirects: true,
        formData: formData
      };
      res = yield request(load_2fa);
    }

    //TODO: it may be necessary in the future to replace this with a user-supplied token
    var match = apiTokenRegex.exec(res[0].body);
    if (!match || !match[1]) {
      throw new Error('Application Error: unable to find api token on login page');
    }
    opts.apiToken = match[1];

    return this.opts = opts;
  };

  /**
   * Upload the emoji.
   */

  this.upload = function *(name, emoji) {
    console.log('Uploading %s with %s', name, emoji);
    return new Promise(function(resolve, reject, notify) {
      var opts = this.opts;
      var r = req({
        url: opts.url + emojiAddEndpoint,
        headers: headers,
        method: 'POST',
        jar: opts.jar,
        followAllRedirects: true
      }, function(err, res, body) {
        if (err || !body) return reject(err);
        resolve(body);
      });
      var form = r.form();
      form.append('name', name);
      form.append('mode', 'data');
      form.append('image', req(emoji));
      form.append('token', opts.apiToken);
    }.bind(this));
  };

  this.alias = function *(name, alias) {
    console.log('Aliasing %s to %s', alias, name);
    return new Promise(function(resolve, reject, notify) {
      var opts = this.opts;
      var r = req({
        url: opts.url + emojiAddEndpoint,
      headers: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'},
        method: 'POST',
        jar: opts.jar,
        followAllRedirects: true
      }, function(err, res, body) {
        if (err || !body) return reject(err);
        resolve(body);
      });
      var form = r.form();
      form.append('name', alias);
      form.append('mode', 'alias');
      form.append('alias', name);
      form.append('token', opts.apiToken);
    }.bind(this));
  };
}
128153
function require_reset() {
    ModuleStore        = {}
    ModulePreloadStore = {}
    MainModule         = create_module(null)

    var require = get_require(MainModule)
    var define  = require_define
    
    define("modjewel", modjewel_module)

    global.modjewel            = require("modjewel")
    global.modjewel.require    = require
    global.modjewel.define     = define
    global.modjewel.define.amd = {implementation: PROGRAM, version: VERSION}
}
523031
def check_other(self):
        
        if self.reqs:
            self.stdout.write(self.style.ERROR("\nOnly pypi and github based requirements are supported:"))
            for name, req in self.reqs.items():
                if "dist" in req:
                    pkg_info = "{dist.project_name} {dist.version}".format(dist=req["dist"])
                elif "url" in req:
                    pkg_info = "{url}".format(url=req["url"])
                else:
                    pkg_info = "unknown package"
                self.stdout.write(self.style.BOLD("{pkg_info:40} is not a pypi or github requirement".format(pkg_info=pkg_info)))
496111
function hotCreateRequire(moduleId) {
/******/ 		var me = installedModules[moduleId];
/******/ 		if (!me) return __webpack_require__;
/******/ 		var fn = function(request) {
/******/ 			if (me.hot.active) {
/******/ 				if (installedModules[request]) {
/******/ 					if (installedModules[request].parents.indexOf(moduleId) === -1) {
/******/ 						installedModules[request].parents.push(moduleId);
/******/ 					}
/******/ 				} else {
/******/ 					hotCurrentParents = [moduleId];
/******/ 					hotCurrentChildModule = request;
/******/ 				}
/******/ 				if (me.children.indexOf(request) === -1) {
/******/ 					me.children.push(request);
/******/ 				}
/******/ 			} else {
/******/ 				console.warn(
/******/ 					"[HMR] unexpected require(" +
/******/ 						request +
/******/ 						") from disposed module " +
/******/ 						moduleId
/******/ 				);
/******/ 				hotCurrentParents = [];
/******/ 			}
/******/ 			return __webpack_require__(request);
/******/ 		};
/******/ 		var ObjectFactory = function ObjectFactory(name) {
/******/ 			return {
/******/ 				configurable: true,
/******/ 				enumerable: true,
/******/ 				get: function() {
/******/ 					return __webpack_require__[name];
/******/ 				},
/******/ 				set: function(value) {
/******/ 					__webpack_require__[name] = value;
/******/ 				}
/******/ 			};
/******/ 		};
/******/ 		for (var name in __webpack_require__) {
/******/ 			if (
/******/ 				Object.prototype.hasOwnProperty.call(__webpack_require__, name) &&
/******/ 				name !== "e" &&
/******/ 				name !== "t"
/******/ 			) {
/******/ 				Object.defineProperty(fn, name, ObjectFactory(name));
/******/ 			}
/******/ 		}
/******/ 		fn.e = function(chunkId) {
/******/ 			if (hotStatus === "ready") hotSetStatus("prepare");
/******/ 			hotChunksLoading++;
/******/ 			return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {
/******/ 				finishChunkLoading();
/******/ 				throw err;
/******/ 			});
/******/
/******/ 			function finishChunkLoading() {
/******/ 				hotChunksLoading--;
/******/ 				if (hotStatus === "prepare") {
/******/ 					if (!hotWaitingFilesMap[chunkId]) {
/******/ 						hotEnsureUpdateChunk(chunkId);
/******/ 					}
/******/ 					if (hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ 						hotUpdateDownloaded();
/******/ 					}
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 		fn.t = function(value, mode) {
/******/ 			if (mode & 1) value = fn(value);
/******/ 			return __webpack_require__.t(value, mode & ~1);
/******/ 		};
/******/ 		return fn;
/******/ 	}
142105
function pretendRequire(file)
{
  if (file && file.substr(0, 1) == '/')
  {
    file = path.join(projectPath, file.substr(1));
  }

  return require(file);
}
484654
def require(*requirements, **kwargs):
    
    # TODO: require(*requirements, none_on_failure=False) is not supported by Python 2
    none_on_failure = kwargs.get('none_on_failure', False)

    def inner(f):
        @functools.wraps(f)
        def wrapper(*args, **kwargs):
            for req in requirements:
                if none_on_failure:
                    if not getattr(req, 'is_available'):
                        return None
                else:
                    getattr(req, 'require')()
            return f(*args, **kwargs)
        return wrapper
    return inner
197968
function (fn) {
            var requires = [];
            // Remove comments from the callback string,
            // look for require calls, and pull them into the dependencies,
            // but only if there are function args.
            fn.toString()
                .replace(commentRegExp, '')
                .replace(requireRegExp, function (match, _, dep) {
                    requires.push(dep);
                });
            return requires;
        }
783643
function check(suppliedOptions){
    var options = assign(Object.create(defaultOptions), suppliedOptions || {});
    var packageJson = require(path.resolve(process.cwd(), options.package));
    var checkDevDependencies = !!options.checkDevDependencies;
    var checkDependencies = !!options.checkDependencies;
    var moduleTimes = {
        dependencies: {},
        devDependencies: {}
    };
    var loadTime = -1;

    if(packageJson.main){
        loadTime = execSync(execString + path.resolve(process.cwd(), packageJson.main), {encoding: "utf8"});
    }

    if(checkDependencies){
        Object.keys(packageJson.dependencies).forEach(function(depen){
            var time = execSync(execString + path.resolve(process.cwd(), "node_modules", depen), {
                encoding: "utf8",
                cwd: process.cwd()
            });

            moduleTimes.dependencies[depen] = parseFloat(time);
        });
    }

    if(checkDevDependencies){
        Object.keys(packageJson.devDependencies).forEach(function(depen){
            var time = execSync(execString + path.resolve(process.cwd(), "node_modules", depen), {
                encoding: "utf8",
                cwd: process.cwd()
            });

            moduleTimes.devDependencies[depen] = parseFloat(time);
        });
    }

    return {
        moduleTimes: moduleTimes,
        loadTime: loadTime
    };
}
1190150
function(next) {
            core.allowPackages.forEach(function(pkg) {
                try {
                    var mod = path.dirname(require.resolve(pkg)).replace(/\/lib$/, "");
                    core.packages[pkg] = { path: mod };
                    if (lib.statSync(mod + "/etc").isDirectory()) {
                        core.packages[pkg].etc = 1;
                        var cfg = lib.readFileSync(mod + "/etc/config");
                        if (cfg) {
                            config = cfg + "\n" + config;
                            core.packages[pkg].config = 1;
                            core.parseConfig(cfg, 1);
                        }
                    }
                    ["modules","locales","views","web"].forEach(function(x) {
                        if (lib.statSync(mod + "/" + x).isDirectory()) {
                            core.path[x].unshift(mod + "/" + x);
                            core.packages[pkg][x] = 1;
                        }
                    });
                    logger.debug("init:", "npm package:", pkg, core.packages[pkg]);
                } catch(e) {
                    logger.error("init:", "npm package:", pkg, e);
                }
            });
            next();
        }
604962
function _indexJsContent() {
  Meteor.npmRequire = function(moduleName) {
    var module = Npm.require(moduleName);
    return module;
  };

  Meteor.require = function(moduleName) {
    console.warn('Meteor.require is deprecated. Please use Meteor.npmRequire instead!');
    return Meteor.npmRequire(moduleName);
  };
}
71953
function thinkrequire(file) {
    try {
        let obj = require(file);
        obj = (obj && obj.__esModule && obj.default) ? obj.default : obj;
        if (lodash.isFunction(obj)) {
            obj.prototype.__filename = file;
        }
        return obj;
    } catch (e) {
        throw Error(e);
    }
}
311470
def check(*args)
      raise_authentication_error unless authenticated?
      params = arguments(args, required: [:client_id, :access_token]).params

      if arguments.client_id
        begin
          get_request("/applications/#{arguments.client_id}/tokens/#{arguments.access_token}", params)
        rescue Github::Error::NotFound
          nil
        end
      else
        raise raise_app_authentication_error
      end
    end
393777
function requirePath(fromPath, require) {
  // console.log('requirePath:fromPath: ' + fromPath);
  // console.log('requirePath:require: ' + require);
  if (fromPath === null || fromPath === undefined
    || require === null || require === undefined) {
    return null;
  }
  var filePath = path.resolve(path.dirname(fromPath), require);
  return realRequirPath(filePath);
}