this is the require used by the module
434962
function(target) {
                // Only store the `module` in the local cache since `module.exports` may not be accurate
                // if there was a circular dependency
                var module = localCache[target] || (localCache[target] = requireModule(target, dirname));
                return module.exports;
            }
746271
function thisModule() {
    var self = this;

    /**
     * Loads iteratively all modules at given path, builds and returns a directory of modules as tree or as list
     *
     * Go through each object, include the code, and determine its identity.
     * Tolerates non-existent files/directories by ignoring them (if 'optional' is specified)
     *
     * @param {Object} options {
        dirname			:: the path to the source directory

        mode            :: options: {list, tree}
                           - list: generate a flat key-value map of modules
                           - tree: generate a full tree of modules

        injectIdentity	:: If disabled, (explicitly set to false) don't inject an identity into the module
                           default: true

        optional		:: if enabled, fail silently and return {} when source directory does not exist
                           or cannot be read (otherwise, exit w/ an error)
                           default: false

        depth			:: the level of recursion where modules will be included
                           default is to infinity

        useVersions  :: creates a sub grouping based on version property (only valid for list mode)
                           default: 'false'

        fileNameFilter	:: only include modules whose FILENAME matches this regex,
                           if 'undefined' - include all, default 'undefined'

        relativePathFilter	:: only include modules whose RELATIVE PATH (path with filename) matches this regex
                           (relative from the entry point directory), if 'undefined' - include all,
                           default 'undefined'

        excludeDirs	    :: regex to exclude directories

        dontLoad		:: if `dontLoad` is set to true, don't run the module w/ V8 or load it into memory--
                           instead, return a tree representing the directory structure
                           (all extant file leaves are included as keys, with their value = `true`)
     }
     * @returns dictionary of modules as list or as tree
     */
    self.requireAll = function (options) {

        //================
        // check options and extend default values
        options.replaceVal = options.replaceVal || '';

        if (!options.mode) {
            options.mode = 'list';
        }

        // exclude source control directories
        if (!options.excludeDirs) {
            options.excludeDirs = /^\.(git|svn)$/;
        }

        // default for 'fileNameFilter' option
        if (!options.fileNameFilter) {
            options.fileNameFilter = /(.*)/;
        }

        var iterationInfo = {
            currentDepth: 0,
            dirName: options.dirName,
            initialDirName: options.dirName
        };


        if (options.moduleDir) {
            return  checkModuleDir(options, iterationInfo);
        }
        else {
            return doInterations(options, iterationInfo);
        }
    };

    /**
     * Parses a directory and searches for options.module subdir. If found subdir is searched for required files
     * @param options
     * @param iterationInfo
     * @returns {{}}
     */
    var checkModuleDir = function (options, iterationInfo) {
        var files;
        var modules = {};
        var result = {};

        // remember the starting directory
        try {
            files = fs.readdirSync(iterationInfo.dirName);
        } catch (e) {
            if (options.optional)
                return {};
            else
                throw new Error('Directory not found: ' + iterationInfo.dirName);
        }

        // iterate through files in the current directory
        files.forEach(function (fileName) {
            iterationInfo.dirName = iterationInfo.initialDirName + '/' + fileName + '/' + options.moduleDir;
            iterationInfo.projectDir = iterationInfo.initialDirName + '/' + fileName;
            result = _.assign(doInterations(options, iterationInfo), result);
        });

        return result;
    };

    /**
     * Parses a directory (will be then iteratively called for all subdirectories) or loads a file.
     * @param options
     * @param iterationInfo
     * @returns {{}}
     */
    var doInterations = function (options, iterationInfo) {
        var files;
        var modules = {};

        // check if the counter has reached the desired depth indicated in options.depth
        if (typeof options.depth !== 'undefined' &&
            iterationInfo.currentDepth >= options.depth) {
            return;
        }

        // remember the starting directory
        try {
            files = fs.readdirSync(iterationInfo.dirName);
        } catch (e) {
            if (options.optional)
                return {};
            else
                throw new Error('Directory not found: ' + iterationInfo.dirName);
        }

        // iterate through files in the current directory
        files.forEach(function (fileName) {
            iterationInfo.fileName = fileName;
            //get absolute path
            iterationInfo.absolutePath = rtrim(iterationInfo.dirName, '/');
            iterationInfo.absoluteFullPath = iterationInfo.absolutePath + '/' + fileName;
            //get relative path
            iterationInfo.relativePath = iterationInfo.absolutePath.replace(iterationInfo.initialDirName, '');
            iterationInfo.relativeFullPath = iterationInfo.absoluteFullPath.replace(iterationInfo.initialDirName, '');
            // make sure a slash exists on the left side of relative paths
            iterationInfo.relativePath = '/' + ltrim(iterationInfo.relativePath, '/');
            iterationInfo.relativeFullPath = '/' + ltrim(iterationInfo.relativeFullPath, '/');

            if (fs.statSync(iterationInfo.absoluteFullPath).isDirectory()) {
                processDirectory(options, iterationInfo, modules)
            }
            else {
                processFile(options, iterationInfo, modules);
            }
        });

        return modules;
    };

    /**
     * Process single file to module dictionary
     * @param options
     * @param fileName
     * @param modules
     */
    var processFile = function (options, iterationInfo, modules) {
        // filename filter
        if (options.fileNameFilter) {
            var match = iterationInfo.fileName.match(options.fileNameFilter);
            if (!match) {
                return;
            }
        }

        // Filter spec.js files
        var match = iterationInfo.fileName.match(/.spec.js/i);
        if (match) {
            return;
        }

        // relative path filter
        if (options.relativePathFilter) {
            var pathMatch = iterationInfo.relativeFullPath.match(options.relativePathFilter);
            if (!pathMatch)
                return;
        }

        //load module
        loadModule(modules, options, iterationInfo);
    };

    /**
     * Load single module
     * @param modules
     * @param options
     * @param iterationInfo
     */
    var loadModule = function (modules, options, iterationInfo) {
        // load module into memory (unless `dontLoad` is true)

        var module = true;

        //default is options.dontLoad === false
        if (options.dontLoad !== true) {
            //if module is to be loaded
            module = require(iterationInfo.absoluteFullPath);

            // If a module is found but was loaded as 'undefined', don't include it (since it's probably unusable)
            if (typeof module === 'undefined') {
                throw new Error('Invalid module:' + iterationInfo.absoluteFullPath);
            }

            var identity;
            //var name;
            var version;

            if (options.useVersions === true) {
                if (module.version) {
                    version = module.version;
                }
                else {
                    version = '1.0';
                }
            }

            if (module.identity) {
                identity = module.identity;
                //name = identity;
            }
            else {
                identity = generateIdentity(options, iterationInfo);
                //name = identity;
            }

            //consider default options.injectIdentity === true
            if (options.injectIdentity !== false) {
                module.fileName = iterationInfo.fileName;
                module.projectDir = iterationInfo.projectDir;
                module.relativePath = iterationInfo.relativePath;
                module.relativeFullPath = iterationInfo.relativeFullPath;
                module.absolutePath = iterationInfo.absolutePath;
                module.absoluteFullPath = iterationInfo.absoluteFullPath;
                module.identity = identity;
                //module.name = name;
                if (options.useVersions === true) {
                    module.version = version;
                }
            }
            else {
                identity = generateIdentity(options, iterationInfo);
            }

            //check if identity is unique within the collection and add to dictionary
            if (options.useVersions === true) {
                if (modules[identity] && modules[identity][version]) {
                    var anotherModule = modules[identity][version];
                    throw new Error("Identity '" + identity + "' with version '" + version + "' is already registered by module at '" + anotherModule.absoluteFullPath + "'");
                }
                modules[identity] = modules[identity] || {};
                modules[identity][version] = module;
            }
            else {
                var anotherModule = modules[identity];
                if (anotherModule) {
                    throw new Error("Identity '" + identity + "' is already registered by module at '" + anotherModule.absoluteFullPath + "'");
                }
                modules[identity] = module;
            }
        }
    };

    /**
     * Generates identity for a module
     * @param options
     * @param iterationInfo
     * @returns {string}
     */
    var generateIdentity = function (options, iterationInfo) {
        // Use the identity for the key name
        var identity;
        if (options.mode === 'list') {
            identity = iterationInfo.relativeFullPath;
            //identity = identity.toLowerCase();
            //find and replace all containments of '/', ':' and '\' within the string
            identity = identity.replace(/\/|\\|:/g, '');
        }
        else if (options.mode === 'tree') {
            identity = iterationInfo.fileName;
            //identity = identity.toLowerCase();
        }
        else
            throw new Error('Unknown mode');

        //remove extention
        identity = identity.substr(0, identity.lastIndexOf('.')) || identity;

        return identity;
    };

    /**
     * Processes one directory level
     * @param options :: general options
     * @param iterationInfo :: iteration options
     * @param modules :: object in which output will be loaded
     */
    var processDirectory = function (options, iterationInfo, modules) {

        // Ignore explicitly excluded directories
        if (options.excludeDirs) {
            var match = iterationInfo.fileName.match(options.excludeDirs);
            if (match)
                return;
        }

        // Recursively call requireAll on each child directory
        var subIterationInfo = _.clone(iterationInfo);
        ++subIterationInfo.depth;
        subIterationInfo.dirName = iterationInfo.absoluteFullPath;

        //process subtree recursively
        var subTreeResult = doInterations(options, subIterationInfo);

        //omit empty dirs
        if (_.isEmpty(subTreeResult))
            return;

        //add to the list or to the subtree
        if (options.mode === 'list') {
            //check uniqueness
            _.forEach(subTreeResult, function (value, index) {
                if (options.useVersions === true) {
                    modules[index] = modules[index] || {};
                    _.forEach(value, function (versionValue, versionIndex) {
                        if (modules[index][versionIndex])
                            throw new Error("Identity '" + index + "' with version '" + versionIndex + "' is already registered by module at '" + modules[index][versionIndex].absoluteFullPath + "'");
                        modules[index][versionIndex] = versionValue;
                    });
                }
                else {
                    if (modules[index])
                        throw new Error("Identity '" + index + "' is already registered by module at '" + modules[index].absoluteFullPath + "'");
                    modules[index] = value;
                }
            })
        }
        else if (options.mode === 'tree') {
            if (options.markDirectories !== false) {
                subTreeResult.isDirectory = true;
            }

            var identity = generateIdentity(options, iterationInfo);
            modules[identity] = subTreeResult;
        }
        else
            throw new Error('Unknown mode');
    };

    return self;
}
1191387
function (options, callback) {
        options = extend({}, MODULE_LOADER_DEFAULTS, options)
        var modulesFolder = options.uri

        iterateFiles(modulesFolder, loadModule, callback, isJsFile)

        function loadModule(fileName) {
            if (options.skip && options.skip.test(fileName)) {
                return
            }
            var module = require(fileName)
            var name = path.relative(options.uri, fileName)
            options.core.add(name, module)
        }
    }
155235
function makeRequireFunction() {
    const Module = this.constructor;
    const self = this;

    function require(path) {
        try {
            exports.requireDepth += 1;
            return self.require(path);
        } finally {
            exports.requireDepth -= 1;
        }
    }

    function resolve(request) {
        return Module._resolveFilename(request, self);
    }

    require.resolve = resolve;

    require.main = process.mainModule;

    // Enable support to add extra extension types.
    require.extensions = Module._extensions;

    require.cache = Module._cache;

    return require;
}
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');
    }
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
}
193476
function makeRequire(module) {
		var mrequire = function(id, fn) { return require(module, id, fn); };
		mrequire.resolve = function(id) { return getModule(module, id).uri; };
		mrequire.toUrl = function(id) {
			return getModule(module, id.replace(/\.[^.\\\/]+$/, ''))
				.uri.replace(/\.js$/i, id.match(/\.[^.\\\/]+$/));
		};
		mrequire.cache = modules;
		mrequire.main = main;
		mrequire.map = mapUrlToIds; // allow mapping multiple module ids to a url
		return mrequire;
	}
157320
function addRequireModule( id ) {
            if ( modModules[ id ] || requireModulesIndex[ id ] ) {
                return;
            }

            requireModules.push( id );
            requireModulesIndex[ id ] = 1;
        }
601515
function require_override(p){
  var path = require.resolve(p)
    , mod = require.modules[path];
  if (!mod) {
    var exports;
    $.ajax({ 
      type: "GET",
      url: path + '.js',   
      async: false,
      success : function(text) {
        exports = {};
        eval(text);
        require.modules[path + '.js'] = { exports: exports };
      }
    });
    if (exports != null) {
      return exports;
    }
    throw new Error('failed to require "' + p + '"');
  }
  if (!mod.exports) {
    mod.exports = {};
    mod.call(mod.exports, mod, mod.exports, require.relative(path));
  }
  return mod.exports;
}
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);
}
1107835
function require(parent, id, fn) {
		if (fn) { return ensure(parent, id, fn); }
		var module = getModule(parent, id);
		if (!module.loaded) { throw new Error(id + ' not found'); }
		if (!('exports' in module)) {
			module.parent = parent; // first module to actually require this one is parent

			// if define was passed a non-function, just assign it to exports
			if ('function' !== typeof factories[id = module.id]) { module.exports = factories[id]; }
			else {
				module.exports = {};
				fn = map(module.children.slice(0, factories[id].length), // don't require prematurely on wrapped commonjs
						function(child) { return require(module, child.id); });
				if ((fn = factories[id].apply(global, fn))) { module.exports = fn; } // if something was returned, export it instead
			}
		}
		return module.exports;
	}
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
  }
}
648524
function(module) {
		var name = module.$modname;
		if (!this.$hasModule(name)) {
			this._modules.push(module);
			if (gui.Type.isFunction(module.oncontextinitialize)) {
				module.oncontextinitialize(window);
			}
			if (gui.Type.isFunction(module.onrun)) {
				module.onrun();
			}
		} else {
			throw new Error(name + ' loaded twice?');
		}
		return module;
	}
524447
function _compile(str, filename) {
    var parent = this;
    try {
      var requires = detective(str);
    } catch (ex) {
      ex.toString = function() {
        return filename + ':' + this.loc.line + '\n ' + ex.message;
      }
      throw ex;
    }
    requires.forEach(function(req) {
      if (modules.isRelative(req)) {
        Module._load(req, parent);
      } else {
        if (!modules.isCore(req)) {
          dependencies.push(modules.name(req));
        }
      }
    });
  }
796522
function Module(id, parent) {
  this.id = id
  this.parent = parent;
  if (parent && parent.children) {
    parent.children.push(this);
  }
  this.children = [];
  
  this.filename = null;
  this.format = undefined;
  this.loaded = false;
}
1122185
public Stream<Module> requiresTransitive(Module m) {
        // find requires transitive
        return m.descriptor()
                .requires().stream()
                .filter(req -> req.modifiers().contains(TRANSITIVE))
                .map(ModuleDescriptor.Requires::name)
                .map(config::findModule)
                .flatMap(Optional::stream);
    }
487089
def module_include(base, mod)
      old_methods = {}

      mod.instance_methods.each do |sym|
        old_methods[sym] = base.instance_method(sym) if base.method_defined?(sym)
      end

      mod.instance_methods.each do |sym|
        method = mod.instance_method(sym)
        base.send(:define_method, sym, method)
      end

      yield
    ensure
      mod.instance_methods.each do |sym|
        base.send(:undef_method, sym) if base.method_defined?(sym)
      end
      old_methods.each do |sym, method|
        base.send(:define_method, sym, method)
      end
    end