Resolve a single dependency with an collections
321036
private function lookupRecursive($item)
    {
        if (is_array($item)) {
            $collection = [];
            foreach ($item as $k => $v) {
                $collection[$k] = $this->lookupRecursive($v);
            }

            return $collection;
        }

        return $this->lookup($item);
    }
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]([]);
                }
            }
        }
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
1168676
def _load_dependency(cls, tile, dep, family):
        """"""

        depname = dep['unique_id']
        depdir = os.path.join(tile.folder, 'build', 'deps', depname)
        deppath = os.path.join(depdir, 'module_settings.json')

        if not os.path.exists(deppath):
            raise BuildError("Could not find dependency", dependency=dep)

        try:
            deptile = IOTile(depdir)
        except DataError as exc:
            raise BuildError("Could not find dependency", dependency=dep, error=exc)

        merge_dicts(family['architectures'], deptile.architectures.copy())
323656
private void reduceDependencies(Map<ResolvedFolder, AbstractDependencyResolver> topFolderResolverMap) {
        //reduce the dependencies and duplicates files
        Set<String> topFolders = new HashSet<>();
        topFolderResolverMap.entrySet().forEach((resolverEntry) -> topFolders.addAll(resolverEntry.getKey().getTopFoldersFound().keySet()));

        // Take all resolvers and their folders
        for (Map.Entry<ResolvedFolder, AbstractDependencyResolver> entry : topFolderResolverMap.entrySet()) {
            AbstractDependencyResolver resolver = entry.getValue();
            ResolvedFolder resolvedFolder = entry.getKey();
            if (resolver != null && resolvedFolder != null) {
                // All folders of the current resolver (top folders and sub folders)
                Set<String> foldersFound = resolvedFolder.getTopFoldersFound().keySet();
                // Get the relevant folders for the current resolver (can be all folders or top folders only ...)
                Collection<String> foldersForResolver = resolver.getRelevantScannedFolders(foldersFound);
                // Remove all the irrelevant folders
                resolvedFolder.getTopFoldersFound().keySet().removeIf(folder -> !foldersForResolver.contains(folder));
            }
        }

    }
255459
def resolve(spec, partial_manifests = [])
      manifests = implementation(spec).resolve(partial_manifests)
      manifests or return
      enforce_consistency!(spec.dependencies, manifests)
      enforce_acyclicity!(manifests) unless cyclic
      manifests = sort(manifests)
      Resolution.new(spec.dependencies, manifests)
    end
172541
function parseCollection (type, data, relations, options) {
  var result = []

  _.each(data, function (value) {
    result.push(parseResource(type, value, relations, options))
  })

  return result
}
768989
def resolve_dependency(dep):
  

  for dirname in os.getenv('PATH', '').split(os.pathsep):
    filename = os.path.join(dirname, dep.name)
    if os.path.isfile(filename):
      return _get_long_path_name(filename)
  return None
832425
private int getDependencies(JSONObject npmLsJson, List<String> linesOfNpmLs, int currentLineNumber, Collection<DependencyInfo> dependencies) {
        if (npmLsJson.has(Constants.DEPENDENCIES)) {
            JSONObject dependenciesJsonObject = npmLsJson.getJSONObject(Constants.DEPENDENCIES);
            if (dependenciesJsonObject != null) {
                for (int i = 0; i < dependenciesJsonObject.keySet().size(); i++) {
                    String currentLine = linesOfNpmLs.get(currentLineNumber);
                    // Examples:
                    // +-- UNMET DEPENDENCY @material-ui/core@1.5.0
                    // | +-- UNMET DEPENDENCY @babel/runtime@7.0.0-beta.42
                    // | | `-- UNMET DEPENDENCY regenerator-runtime@0.11.1
                    // |   | +-- UNMET OPTIONAL DEPENDENCY are-we-there-yet@1.1.4
                    // |   | | +-- UNMET OPTIONAL DEPENDENCY delegates@1.0.0
                    // |   | | `-- UNMET OPTIONAL DEPENDENCY readable-stream@2.3.6
                    if (currentLine.endsWith(DEDUPED) || currentLine.contains(UNMET_DEPENDENCY)) {
                        currentLineNumber++;
                        continue;
                    }
                    String dependencyAlias = getTheNextPackageNameFromNpmLs(currentLine);
                    try {
                        JSONObject dependencyJsonObject = dependenciesJsonObject.getJSONObject(dependencyAlias);
                        DependencyInfo dependency = getDependency(dependencyAlias, dependencyJsonObject);
                        if (dependency != null) {
                            dependencies.add(dependency);
                            logger.debug("Collect child dependencies of {}", dependencyAlias);
                            // collect child dependencies
                            Collection<DependencyInfo> childDependencies = new ArrayList<>();
                            currentLineNumber = getDependencies(dependencyJsonObject, linesOfNpmLs, currentLineNumber + 1, childDependencies);
                            dependency.getChildren().addAll(childDependencies);
                        } else {
                            // it can be only if was an error in 'npm ls'
                            if (dependencyJsonObject.has(REQUIRED)) {
                                Object requiredObject = dependencyJsonObject.get(REQUIRED);
                                if (requiredObject instanceof JSONObject) {
                                    currentLineNumber = getDependencies((JSONObject) requiredObject, linesOfNpmLs, currentLineNumber + 1, new ArrayList<>());
                                } else {
                                    currentLineNumber++;
                                }
                            } else {
                                currentLineNumber++;
                            }
                        }
                    } catch (JSONException e){
                        if (ignoreNpmLsErrors) {
                            logger.error(e.getMessage());
                            logger.debug("{}", e.getStackTrace());
                            currentLineNumber++;
                        } else {
                            throw e;
                        }
                    }
                }
            }
        }
        return currentLineNumber;
    }
947867
private List<Resolvable> resolve(List<Resolvable> images) {
        List<Resolvable> resolved = new ArrayList<>();
        // First pass: Pick all data images and all without dependencies
        for (Resolvable config : images) {
            List<String> volumesOrLinks = extractDependentImagesFor(config);
            if (volumesOrLinks == null) {
                // A data image only or no dependency. Add it to the list of data image which can be always
                // created first.
                updateProcessedImages(config);
                resolved.add(config);
            } else {
                secondPass.add(config);
            }
        }

        // Next passes: Those with dependencies are checked whether they already have been visited.
        return secondPass.size() > 0 ? resolveRemaining(resolved) : resolved;
    }
782233
function resolveDependencies(binds, obj) {
                var slotset = context[context.length - 1];
                for (var _key3 in injections) {
                    if (binds && injections[_key3] in binds) {
                        obj[_key3] = binds[injections[_key3]];
                        continue;
                    }

                    var slot = slotset[injections[_key3]];
                    var policy = slot.getViable(_key3, tags[_key3], multiple[_key3]);
                    if (!multiple[_key3]) obj[_key3] = policy([]);else {
                        var out = obj[_key3] = [];
                        for (var _i2 = 0; _i2 < policy.length; ++_i2) {
                            out[_i2] = policy[_i2]([]);
                        }
                    }
                }
            }
1097283
async function resolveDependencies(rootFolder) {
    const includeFile = path.join(rootFolder, constants.INCLUDE_FILE);
    const includeJson = fs.readJsonSync(includeFile, 'utf8');
    await recDependencies(includeJson.dependencies, true);
    return depencyList;
}
473504
private static void addDependency(List<Dependency> dependencies, MavenCoordinates requiredArtifact, Constants.ArtifactType type, String scope) {
		Dependency dependency = new Dependency();
		dependency.setGroupId(requiredArtifact.getGroupId());
		dependency.setArtifactId(requiredArtifact.getArtifactId());
		dependency.setVersion(requiredArtifact.getVersion());

		if(scope!=null){
			dependency.setScope(scope);
		}
		if (type != null) {
			dependency.setType(type.getType());
		}
		dependencies.add(dependency);
	}
535459
function resolveDependencies(self, paths) {
  var assets = [], cache = {};

  _.forEach(paths, function (p) {
    var asset;

    if (p === self.pathname) {
      if (!cache[p]) {
        cache[p] = true;
        assets.push(self);
      }
      return;
    }

    asset = self.environment.findAsset(p, { bundle: false });

    if (asset) {
      asset.__requiredAssets__.forEach(function (asset_dependency) {
        if (!cache[asset_dependency.pathname]) {
          cache[asset_dependency.pathname] = true;
          assets.push(asset_dependency);
        }
      });
    }
  });

  return assets;
}
246396
public void resolveDependencies(boolean downloadArtifacts, Map<String,String> properties) throws URLException, DependencyException {
        log.debug( "Resolving Dependencies" );
        
        log.debug("Local Repo Path: {}", localRepoPath);

        if ( log.isDebugEnabled() ) {
            log.debug("Remote Repositories:");
            for (RemoteRepository repo : getRemoteRepositories()) {
                log.debug("  {}", repo.toString());
            }
        }

        RepositoryClient repoClient = new RepositoryClient(this.getLocalRepoPath());
        if ( properties != null ) {
            repoClient.setProperties( properties );
        }
        
        // If there are local build artifacts, create a BuildWorkspaceReader to
        // override remote artifacts with the local build artifacts.
        if ( buildArtifacts.size() > 0 ) {
            repoClient.setBuildWorkspaceReader( buildArtifacts );
        }
        
        CollectRequest collectRequest = new CollectRequest();
        collectRequest.setDependencies( new ArrayList<Dependency>(getDependencies()));
        
        try {
            collectRequest.addRepository(RepoBuilder.remoteRepositoryFromUrl("file:" + this.getLocalRepoPath()));
        } catch (MalformedURLException e) {
            throw new URLException("Failed to add local repo to request", e);
        }

        for (RemoteRepository repo : getRemoteRepositories()) {
            collectRequest.addRepository(repo);
        }

        CollectResult collectResult;
        try {
            collectResult = repoClient.collectDependencies(collectRequest);
        } catch (DependencyCollectionException e) {
            throw new DependencyException(e);
        }

        preorderedNodeList = new PreorderNodeListGenerator();
        if (downloadArtifacts) {
            DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, null);

            log.debug("Resolving dependencies to files");
            DependencyResult dependencyResult;
            try {
                dependencyResult = repoClient.resolveDependencies(dependencyRequest);
            } catch (DependencyResolutionException e) {
                throw new DependencyException(e);
            }
            dependencyResult.getRoot().accept(preorderedNodeList);

        } else {
            collectResult.getRoot().accept(preorderedNodeList);
        }

        //this.setDependencies( new HashSet<Dependency>(preorderedNodeList.getDependencies(true)));
        log.debug("Setting resolved dependencies: {}", this.getDependencies());
    }
1115689
def resolve_dependencies(nodes):
    
    done = set()
    while True:
        if len(done) == len(nodes):
            break
        for node in nodes:
            if node.name not in done:
                match = done.intersection(node.requires)
                if len(match) == len(node.requires):
                    done.add(node.name)
                    yield node
                    break
        else:
            raise ConfigException('Invalid requirements in pipeline!')
1078150
def resolve_dependencies( download_artifacts = true, properties = nil )

      if properties
        # Convert to HashMap
        map = Naether::Java.create( "java.util.HashMap" )
        properties.each do |k,v|
          map.put( k, v )
        end
      end

      @resolver.resolveDependencies( download_artifacts, map );
      dependencies_notation
    end