Resolve a cyclic dependency between queued `Script`s.
515593
function() {
			var pending	= this.pending,
				script;

			for(var name in pending) {
				if (!pending.hasOwnProperty(name)) { continue; }
				var cycle = pending[name].cycle();
				if (cycle) {
					cycle[0].allow(cycle[1]);
					this.load(cycle[0]);
					return true;
				}
			}
		}
1019272
function resolveScripts(file, pathes) {
    var filePath = file.path,
        scriptsStr = '';

    for(var i = 0, len = pathes.length; i < len; i ++) {
        scriptsStr += '<script defer src="' + path.relative(path.dirname(filePath), pathes[i]) + '"></script>\r\n';
    }

    return scriptsStr;
}
322176
def has_resolved_dependencies(self):
        """"""
        for dependency in self.dependencies:
            if dependency.state != Task.State.DONE:
                return False

        return True
937964
private void notifyScriptChanged(ScriptWrapper script) {
		for (ScriptEventListener listener : this.listeners) {
			try {
				listener.scriptChanged(script);
			} catch (Exception e) {
				logScriptEventListenerException(listener, script, e);
			}
		}
	}
230689
def _check_queue(queue, kwargs):
    '''
    
    '''
    if queue:
        _wait(kwargs.get('__pub_jid'))
    else:
        conflict = running(concurrent=kwargs.get('concurrent', False))
        if conflict:
            __context__['retcode'] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR
            return conflict
1096021
def resolve_dependency(str)
      # Optimize for the most common scheme to
      # save 22k allocations on an average Spree app.
      scheme = if str.start_with?('file-digest:'.freeze)
        'file-digest'.freeze
      else
        str[/([^:]+)/, 1]
      end

      if resolver = config[:dependency_resolvers][scheme]
        resolver.call(self, str)
      else
        nil
      end
    end
778504
function resolveScriptEvent(resolver, evt) {
        /*jshint validthis:true */
        var script = this;

        // run only when ready
        // script.readyState is completed or loaded
        if (script.readyState &&
            !(/^c|loade/.test(script.readyState))
        ) return;

        // never rerun callback
        if (script.loadStatus) return;

        // unbind to avoid rerun
        script.onload = script.onreadystatechange = script.onerror = null;

        script.loadStatus = true;

        if (evt && evt.type === "error") {
            var src = script.src || "Resource",
                fails = " fails to load.";

            // custom error
            // TODO: create a more specific stack for this Error
            var error = {
                name: "ConnectionError",
                source: src,
                evt: evt,
                stack: src + fails,
                message: fails,
                toString: function() {
                    return this.source + this.message;
                }
            };
            throwLater(error);

            resolver.reject(error);
            return;
        }

        resolver.resolve();
    }
447586
private void processScript() {

        ScriptReaderBase scr = null;

        try {
            if (database.isFilesInJar()
                    || fa.isStreamElement(scriptFileName)) {
                scr = ScriptReaderBase.newScriptReader(database,
                                                       scriptFileName,
                                                       scriptFormat);

                Session session =
                    database.sessionManager.getSysSessionForScript(database);

                scr.readAll(session);
                scr.close();
            }
        } catch (Throwable e) {
            if (scr != null) {
                scr.close();

                if (cache != null) {
                    cache.close(false);
                }

                closeAllTextCaches(false);
            }

            database.logger.appLog.logContext(e, null);

            if (e instanceof HsqlException) {
                throw (HsqlException) e;
            } else if (e instanceof IOException) {
                throw Error.error(ErrorCode.FILE_IO_ERROR, e.toString());
            } else if (e instanceof OutOfMemoryError) {
                throw Error.error(ErrorCode.OUT_OF_MEMORY);
            } else {
                throw Error.error(ErrorCode.GENERAL_ERROR, e.toString());
            }
        }
    }
496923
async def resolve(self, client):
        """"""
        if self.resolved:
            return

        if not self._resolve_lock:
            self._resolve_lock = asyncio.Lock(loop=client.loop)

        async with self._resolve_lock:
            if not self.resolved:
                await self._resolve(client)
                self.resolved = True
889322
function checkDependencies(dependencies, callback) {
  var checkedDependencies = {};

  async.each(dependencies, function (dependency, callback) {
    zoologist.getServiceDiscovery().queryForInstances(dependency, function(err, instances) {
      checkedDependencies[dependency] = ((instances) ? instances.length : 0);
      callback(err);
    });
  }, function(err) {
    // Ignore error and just return zero'd counts
    callback(null, checkedDependencies);
  });
}
1141725
function resolveDependencies( binds, obj ){
            let slotset =  context[ context.length-1 ];
            for( let key in injections ){
                if( binds && injections[key] in binds ){
                    obj[key] = binds[ injections[key] ];
                    continue;
                }
                
                let slot = slotset[ injections[key] ];
                let policy = slot.getViable( key, tags[key], multiple[key] );
                if( !multiple[key] )
                    obj[key] = policy([]);
                else{
                    let out = obj[key] = [];
                    for( let i=0; i<policy.length; ++i )
                        out[i] = policy[i]([]);
                }
            }
        }
984196
function getInverseDependencies(resolutionResponse) {
  const cache = new Map();

  resolutionResponse.dependencies.forEach(module => {
    resolveModuleRequires(resolutionResponse, module).forEach(dependency => {
      getModuleDependents(cache, dependency).add(module);
    });
  });

  return cache;
}
99053
def script_exists(self, digest, *digests):
        """"""
        return self.execute(b'SCRIPT', b'EXISTS', digest, *digests)
906065
function(script) {
			script.module.uninstall();
			if (script.stopped || (!script.callback && Loader.loading !== script)) {
				script.loader.load(script);
				Loader.next();
				return;
			}
			this.loaded[script.id] = script;
			delete this.pending[script.id];
			Loader.loading = null;
			Loader.next();
		}
173705
def dependency_closure(self, tkn: str, seen: Optional[Set[str]]=None) -> Set[str]:
        
        if seen is None:
            seen = set()
        for k in self.dependencies(tkn):
            if k not in seen:
                seen.add(k)
                self.dependency_closure(k, seen)
        return seen
943216
def check_dependencies(self):
        """"""
        deadlocks = []

        for task in self.iflat_tasks():
            for dep in task.deps:
                if dep.node.depends_on(task):
                    deadlocks.append((task, dep.node))

        if deadlocks:
            lines = ["Detect wrong list of dependecies that will lead to a deadlock:"]
            lines.extend(["%s <--> %s" % nodes for nodes in deadlocks])
            raise RuntimeError("\n".join(lines))
393300
def consolidate_dependencies(needs_ipython, child_program,
                             requirement_files, manual_dependencies):
    """"""
    # We get the logger here because it's not defined at module level
    logger = logging.getLogger('fades')

    if needs_ipython:
        logger.debug("Adding ipython dependency because --ipython was detected")
        ipython_dep = parsing.parse_manual(['ipython'])
    else:
        ipython_dep = {}

    if child_program:
        srcfile_deps = parsing.parse_srcfile(child_program)
        logger.debug("Dependencies from source file: %s", srcfile_deps)
        docstring_deps = parsing.parse_docstring(child_program)
        logger.debug("Dependencies from docstrings: %s", docstring_deps)
    else:
        srcfile_deps = {}
        docstring_deps = {}

    all_dependencies = [ipython_dep, srcfile_deps, docstring_deps]

    if requirement_files is not None:
        for rf_path in requirement_files:
            rf_deps = parsing.parse_reqfile(rf_path)
            logger.debug('Dependencies from requirements file %r: %s', rf_path, rf_deps)
            all_dependencies.append(rf_deps)

    manual_deps = parsing.parse_manual(manual_dependencies)
    logger.debug("Dependencies from parameters: %s", manual_deps)
    all_dependencies.append(manual_deps)

    # Merge dependencies
    indicated_deps = {}
    for dep in all_dependencies:
        for repo, info in dep.items():
            indicated_deps.setdefault(repo, set()).update(info)

    return indicated_deps