(Internal) Loads an "isnode" module
@param {string} name - Name of the isnode module to load
@param {function} cb - Callback function once module is loaded
500947
function(name, cb){
		if(shuttingDown == true)
			return;
		if(!package.dependencies[name] && name != "isnode-mod-logger"){
			var error = { message: "Failed to load "+name+" Module - Module not referenced in node package file" };
			if(cb) { cb(error, null); }
			modules.logger.log("startup","ISNode System > " + error.message + ".");
			return; 
		}
		var modPresent = isModuleAvailable(name);
		if(modPresent){
			var nameSplit = name.split("-");
			if(nameSplit[0] != "isnode" && nameSplit[1] != "mod"){
				var error = { message: "Attempted to load a non 'ismod' or 'isnode' module with the isnode module loader" };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
				return;
			} else if (nameSplit[2] == "interface" && nameSplit[3]){
				try {
					modules.interfaces[nameSplit[3]] = require(name)(isnode);
					var output = {
						success: true,
						message: "Interface module ("+nameSplit[3]+") successfully loaded"
					}
					modules.logger.log("debug", "ISNode System > " + output.message);
					if(cb) { cb(null,output); }
					return;
				} catch (err) {
					var error = { message: "System Error. Attempted to load module that does not exist - " + name };
					modules.logger.log("error","ISNode System > " + error.message, err);
					if(cb) { cb(error, null); }
					return;					
				}
			} else if (nameSplit[2] != "interface" && !nameSplit[3]) {
				try {
					modules[nameSplit[2]] = require(name)(isnode);
					var output = {
						success: true,
						message: "Standard module ("+nameSplit[2]+") successfully loaded"
					}
					modules.logger.log("debug", output.message + ".");
					if(cb) { cb(null, output); }
					return;
				} catch (err) {
					var error = { message: "System Error. Attempted to load module that does not exist - " + name, error: err };
					modules.logger.log("error","ISNode System > " + error.message+".", err);
					if(cb) { cb(error, null); }
					return;					
				}
			} else {
				var error = { message: "Attempted to load an unsupported ismod module with the ismod module loader" };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
				return;
			}
		} else {
			if(name == "isnode-mod-logger"){
				modules.logger = {
					log: function(level,logMsg,attrObj){
						console.log("("+level+") "+logMsg);
					}
				}
				var error = { message: "Logger module not available. Polyfill method loaded in its place" };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
			} else {
				var error = { message: "Attempted to load an ismod module ("+name+") that does not exist. Try running 'npm install'." };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
			}
			return;
		}
	}
244923
public static function proxy($cb, $name = null)
    {
        static $i = 0;
        $n = ++$i;
        Daemon::log('Debug::proxy #' . $n . ': SPAWNED (' . json_encode($name) . ')');
        return function (...$args) use ($cb, $name, $n) {
            Daemon::log('Debug::proxy #' . $n . ': CALLED (' . json_encode($name) . ')');
            $cb(...$args);
        };
    }
211578
function loadBinary (file, callback) {
  if (isPlask) {
    loadBinaryPlask(file, callback)
  } else {
    loadBinaryBrowser(file, callback)
  }
}
1170895
function(exists, cb) {
          if(!exists) {
            fs.mkdir(rootDir + '/node_modules', function(error) {
              cb(error);
            });
          } else {
            cb(null);
          }
        }
215459
function (name) {
    // initialize module instance with default module configuration
    _.merge(this, defaultModuleConfig)
    // set app name
    this.name = name
    // set absolute path of base directory for module
    this.base = getBase()
    // store reference to global app
    this.immutableApp = immutableApp
}
175308
function(scripts, cb) {
			// Reduce the list to scripts that haven't been loaded
			var existingScripts = _findExistingScripts();
			var loadingScripts = Object.keys(_loadingScripts);
			scripts = jQuery.grep(scripts, function(url) {
				return url && (jQuery.inArray(url, existingScripts) === -1 || jQuery.inArray(url, loadingScripts) !== -1);
			});

			// Attempt to use the user provided method
			if (_config.loadScripts) {
				return _config.loadScripts(scripts, cb);
			}

			if (!scripts.length) {
				return cb();
			}

			var doc = window.document;
			var scriptCount = scripts.length;
			var scriptsLoaded = 0;
			//http://caniuse.com/#feat=script-async
			// var supportsAsync = 'async' in doc.createElement('script') || 'MozAppearance' in doc.documentElement.style || window.opera;
			var head = doc && (doc['head'] || doc.getElementsByTagName('head')[0]);
			// to keep IE from crying, we need to put scripts before any
			// <base> elements, but after any <meta>. this should do it:
			var insertBeforeEl = head && head.getElementsByTagName('base')[0] || null;
			// Check for IE10+ so that we don't rely on onreadystatechange, readyStates for IE6-9
			var readyStates = 'addEventListener' in window ? {} : { 'loaded': true, 'complete': true };

			// Log and emit event for the failed (400,500) scripts
			var _error = function(e) {
				setTimeout(function() {
					var evtData = {
						src: e.target.src,
						appId: appConfigs[0].appId
					};

					// Send error to console
					F2.log('Script defined in \'' + evtData.appId + '\' failed to load \'' + evtData.src + '\'');

					// TODO: deprecate, see #222
					F2.Events.emit(F2.Constants.Events.RESOURCE_FAILED_TO_LOAD, evtData);

					if (!_bUsesAppHandlers) {
						_appScriptLoadFailed(appConfigs[0], evtData.src);
					}
					else {
						F2.AppHandlers.__trigger(
							_sAppHandlerToken,
							F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED,
							appConfigs[0],
							evtData.src
						);
					}
				}, _config.scriptErrorTimeout); // Defaults to 7000
			};

			var _checkComplete = function() {
				// Are we done loading all scripts for this app?
				if (++scriptsLoaded === scriptCount) {
					// success
					cb();
				}
			};

			var _emptyWaitlist = function(resourceKey, errorEvt) {
				var waiting,
					waitlist = _loadingScripts[resourceKey];

				if (!waitlist) {
					return;
				}

				for (var i=0; i<waitlist.length; i++) {
					waiting = waitlist	[i];

					if (errorEvt) {
						waiting.error(errorEvt);
					} else {
						waiting.success();
					}
				}

				_loadingScripts[resourceKey] = null;
			};

			// Load scripts and eval inlines once complete
			jQuery.each(scripts, function(i, e) {
				var script = doc.createElement('script'),
					resourceUrl = e,
					resourceKey = resourceUrl.toLowerCase();

				// this script is actively loading, add this app to the wait list
				if (_loadingScripts[resourceKey]) {
					_loadingScripts[resourceKey].push({
						success: _checkComplete,
						error: _error
					});
					return;
				}

				// create the waitlist
				_loadingScripts[resourceKey] = [];

				// If in debugMode, add cache buster to each script URL
				if (_config.debugMode) {
					resourceUrl += '?cachebuster=' + new Date().getTime();
				}

				// Scripts are loaded asynchronously and executed in order
				// in supported browsers: http://caniuse.com/#feat=script-async
				script.async = false;
				script.type = 'text/javascript';
				script.charset = 'utf-8';

				script.onerror = function(e) {
					_error(e);
					_emptyWaitlist(resourceKey, e);
				};

				// Use a closure for the load event so that we can dereference the original script
				script.onload = script.onreadystatechange = function(e) {
					e = e || window.event; // For older IE

					// detect when it's done loading
					// ev.type == 'load' is for all browsers except IE6-9
					// IE6-9 need to use onreadystatechange and look for
					// el.readyState in {loaded, complete} (yes, we need both)
					if (e.type == 'load' || readyStates[script.readyState]) {
						// Done, cleanup
						script.onload = script.onreadystatechange = script.onerror = '';
						// increment and check if scripts are done
						_checkComplete();
						// empty wait list
						_emptyWaitlist(resourceKey);
						// Dereference script
						script = null;
					}
				};

				//set the src, start loading
				script.src = resourceUrl;

				//<head> really is the best
				head.insertBefore(script, insertBeforeEl);
			});
		}
492691
function (name, cb) {
                var cache = singles[slot] = singles[slot] || {};
                cache[name] = cache[name] || [];
                cache[name].push(cb);
            }
423741
protected function buildBasic($name, Closure $callback = null): void
    {
        if ($name instanceof Closure) {
            $callback = $name;
            $name = null;
        }

        ! empty($name) && $this->legend($name);

        $callback($this);
    }
44576
function loadBackend(config, name) {
  var backendmod = require(name);

  if (config.debug) {
    l.log("Loading backend: " + name, 'DEBUG');
  }

  var ret = backendmod.init(startup_time, config, backendEvents, l);
  if (!ret) {
    l.log("Failed to load backend: " + name, "ERROR");
    process.exit(1);
  }
}
768270
function require(name, jumped){
    if (cache[name]) return cache[name].exports;
    if (modules[name]) return call(name, require);
    throw new Error('cannot find module "' + name + '"');
  }
814031
function(parentModule, kbox, id, app, callback) {

  if (typeof callback === 'undefined' && typeof app === 'function') {
    callback = app;
    app = undefined;
  }

  // Try to load module from node_module directories.
  return requireFromNodeModules(parentModule, id)
  // If module was not found in node_module directories, try to load
  // from other directories.
  .then(function(mod) {
    if (mod) {
      return mod;
    } else {
      return requireFromOtherDirs(kbox, id, app);
    }
  })
  // Return.
  .nodeify(callback);

}
1166793
public static function on($name, callable $cb, $replace = false)
    {
        if ($replace || !isset(self::$_events[$name])) {
            self::$_events[$name] = $cb;
        }
    }
497124
public void read_attribute_asynch(String[] attnames, CallBack cb) throws DevFailed {
        deviceProxyDAO.read_attribute_asynch(this, attnames, cb);
    }
815152
function (name) { var self = this

        //console.log ('callChainMethod', this.constructor.$meta.name, name)

        const methods = _.filter2 (this.constructor.$traits || [], function (Trait) {

                                                                        var method = Trait.prototype[name]

                                                                        // if (method) {
                                                                        //     return (...args) => {
                                                                        //         console.log ('Calling', Trait.$meta.name, name)
                                                                        //         return method.call (self, ...args)
                                                                        //     }
                                                                        // }

                                                                        return (method && method.bind (self)) || false })

        return __.seq (methods) }
839023
function loadChild(node, cb){
        db.nodes.getByParent(node._id.toString()).then(
            function(data){
                payload = payload.concat(data);
                async.each(data, loadChild, cb);
            }).done();
    }
1121861
function findNodeModule(name) {
  return loadModules()
  .then(nodeModules => {
    const nodeModule = _.find(nodeModules, (nodeModule) => { return nodeModule.getName() === name; });
    if (!nodeModule) {
      throw new Error('The node module "' + name + '" does not exists in this Myrmex project');
    }
    return nodeModule;
  });
}
1307878
function cb () {
      var ref;
      if (typeof viewMethod === "function") {
        ref = viewMethod;
      } else {
        ref = self.view.get(viewMethod);
      }

      ref.apply(self.view, arguments);
    }