Visit the dependencies of the given source.
If the requested level is SUMMARY, it will visit the required archives list.
163936
public void visitDependences(Archive source, Visitor v, Type level) {
        if (level == Type.SUMMARY) {
            final ArchiveDeps result = results.get(source);
            SortedMap<String, Archive> sorted = new TreeMap<>();
            for (Archive a : result.requires()) {
                sorted.put(a.getName(), a);
            }
            for (Archive archive : sorted.values()) {
                Profile profile = result.getTargetProfile(archive);
                v.visitDependence(source.getName(), source,
                                  profile != null ? profile.profileName() : archive.getName(), archive);
            }
        } else {
            ArchiveDeps result = results.get(source);
            if (level != type) {
                // requesting different level of analysis
                result = new ArchiveDeps(source, level);
                source.visitDependences(result);
            }
            SortedSet<Dep> sorted = new TreeSet<>(result.dependencies());
            for (Dep d : sorted) {
                v.visitDependence(d.origin(), d.originArchive(), d.target(), d.targetArchive());
            }
        }
    }
20795
def _loadOneSource(self, sourceFName):
        
        sourceLines = open(sourceFName).readlines()
        del sourceLines[0]
        if len(sourceLines[0].split("\t"))==2:
            self._loadTwoPartSource(sourceFName, sourceLines)
        elif len(sourceLines[0].split("\t"))==3:
            self._loadThreePartSource(sourceFName, sourceLines)
        else:
            raise Error, "%s does not appear to be a source authority file"
1115198
def get_dependencies(requirement, sources):
    
    getters = [
        _get_dependencies_from_cache,
        _cached(_get_dependencies_from_json, sources=sources),
        _cached(_get_dependencies_from_pip, sources=sources),
    ]
    ireq = requirement.as_ireq()
    last_exc = None
    for getter in getters:
        try:
            result = getter(ireq)
        except Exception as e:
            last_exc = sys.exc_info()
            continue
        if result is not None:
            deps, pyreq = result
            reqs = [requirementslib.Requirement.from_line(d) for d in deps]
            return reqs, pyreq
    if last_exc:
        six.reraise(*last_exc)
    raise RuntimeError("failed to get dependencies for {}".format(
        requirement.as_line(),
    ))
654370
function findPartials(source, source_path, options, deps) {
  var reg = /({>\s?")([^"{}]+)("[\s\S]*?\/})/g, // matches dust partial syntax
    result = null, partial,
    dep, name, replace;

  // search source & add a dependency for each match
  while ((result = reg.exec(source)) !== null) {
    partial = {
      prefix: result[1],
      name: result[2],
      suffix: result[3]
    };

    // add to dependencies
    name = addDustDependency(partial.name, source_path, options, deps);

    // retrieve newest dependency
    dep = deps[deps.length - 1];

    // log
    log(options, 'found partial dependency "' + partial.name + '"');

    // if the partial has been renamed, update the name in the template
    if (name != partial.name) {
      log(options, 'renaming partial "' + partial.name + '" to "' + name + '"')

      // build replacement for partial tag
      replace = partial.prefix + name + partial.suffix;

      // replace the original partial path with the new "absolute" path (relative to root)
      source = source.substring(0, result.index) + replace + source.substring(result.index + result[0].length);

      // update regex index
      reg.lastIndex += (replace.length - result[0].length);
    }
  }

  return source;
}
738177
def check(projects):
    """"""
    log = logging.getLogger('ciu')
    log.info('{0} top-level projects to check'.format(len(projects)))
    print('Finding and checking dependencies ...')
    blockers = dependencies.blockers(projects)

    print('')
    for line in message(blockers):
        print(line)

    print('')
    for line in pprint_blockers(blockers):
        print(' ', line)

    return len(blockers) == 0
1239196
def get_package_dependencies(package,
                             recursive=False,
                             verbose=False,
                             include_build_requirements=False):
    
    packages_processed = set()
    package_queue = [package]
    reqs = set()
    reqs_as_names = set()
    while len(package_queue) > 0:
        current_queue = package_queue
        package_queue = []
        for package_dep in current_queue:
            new_reqs = set()
            if verbose:
                print("get_package_dependencies: resolving dependecy "
                      "to package name: ".format(package_dep))
            package = get_package_name(package_dep)
            if package.lower() in packages_processed:
                continue
            if verbose:
                print("get_package_dependencies: "
                      "processing package: {}".format(package))
                print("get_package_dependencies: "
                      "Packages seen so far: {}".format(
                          packages_processed
                      ))
            packages_processed.add(package.lower())

            # Use our regular folder processing to examine:
            new_reqs = new_reqs.union(_extract_info_from_package(
                package_dep, extract_type="dependencies",
                debug=verbose,
                include_build_requirements=include_build_requirements,
            ))

            # Process new requirements:
            if verbose:
                print('get_package_dependencies: collected '
                      "deps of '{}': {}".format(
                          package_dep, str(new_reqs),
                      ))
            for new_req in new_reqs:
                try:
                    req_name = get_package_name(new_req)
                except ValueError as e:
                    if new_req.find(";") >= 0:
                        # Conditional dep where condition isn't met?
                        # --> ignore it
                        continue
                    if verbose:
                        print("get_package_dependencies: " +
                              "unexpected failure to get name " +
                              "of '" + str(new_req) + "': " +
                              str(e))
                    raise RuntimeError(
                        "failed to get " +
                        "name of dependency: " + str(e)
                    )
                if req_name.lower() in reqs_as_names:
                    continue
                if req_name.lower() not in packages_processed:
                    package_queue.append(new_req)
                reqs.add(new_req)
                reqs_as_names.add(req_name.lower())

            # Bail out here if we're not scanning recursively:
            if not recursive:
                package_queue[:] = []  # wipe queue
                break
    if verbose:
        print("get_package_dependencies: returning result: {}".format(reqs))
    return reqs
46565
def read_dependencies(filename):
    
    dependencies = []
    filepath = os.path.join('requirements', filename)
    with open(filepath, 'r') as stream:
        for line in stream:
            package = line.strip().split('#')[0].strip()
            if package and package.split(' ')[0] != '-r':
                dependencies.append(package)
    return dependencies
540262
def check_dependencies(req, indent=1, history=None):
    
    # keep a history to avoid infinite loops
    if history is None:
        history = set()
    if req in history:
        return
    history.add(req)
    d = pkg_resources.get_distribution(req)
    extras = parse_extras(req)
    if indent == 1:
        print_package(req, 0)
    for r in d.requires(extras=extras):
        print_package(r, indent)
        check_dependencies(r, indent + 1, history)
1275338
Stream<Archive> requires(Archive source) {
        if (!results.containsKey(source)) {
            return Stream.empty();
        }
        return results.get(source).requires()
                      .stream();
    }
1358530
def check_requirements(dist, attr, value):
    """"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
            "containing valid project/version requirement specifiers" % (attr,)
        )
655900
def set_dependencies(ctx, archive_name, dependency=None):
    '''
    
    '''

    _generate_api(ctx)
    kwargs = _parse_dependencies(dependency)

    var = ctx.obj.api.get_archive(archive_name)

    var.set_dependencies(dependencies=kwargs)
1120788
def check_requirements():
    
    if not os.path.exists(REQUIREMENTS):
        sys.exit(
            ansi.error() + ' %s is missing. Please check it in.' % ansi.underline(REQUIREMENTS)
        )

    with open(REQUIREMENTS, 'r', encoding='utf-8') as f:
        dependencies = f.readlines()

    vcs = [d for d in dependencies if re.match(r'^(-e )?(git|svn|hg|bzr).*', d)]

    dependencies = list(set(dependencies) - set(vcs))

    missing = []
    try:
        pkg_resources.require(dependencies)
    except (
        pkg_resources.ContextualVersionConflict,
        pkg_resources.DistributionNotFound,
        pkg_resources.VersionConflict
    ) as error:
        missing.append(str(error))
    except pkg_resources.RequirementParseError:
        pass

    if missing:
        missing = ' missing requirement:\n  ' + os.linesep.join(missing)
        if '--env-checked' in sys.argv:
            sys.exit(ansi.error() + missing + '\nRequirement installation failure, please check for errors in:\n $ lore install\n')
        else:
            print(ansi.warning() + missing)
            import lore.__main__
            lore.__main__.install_requirements(None)
            reboot('--env-checked')
873046
def get_dependencies(self):
        
        all_deps = OrderedSet()
        for key, _ in list(self.__config.items()):
            if key in self.__cli:
                continue

            if key.endswith('sources'):
                all_deps |= self.get_sources(key[:len('sources') * -1 - 1])

        for key, _ in list(self.__cli.items()):
            if key.endswith('sources'):
                all_deps |= self.get_sources(key[:len('sources') * -1 - 1])

        if self.conf_file is not None:
            all_deps.add(self.conf_file)

        all_deps.add(self.get_path("sitemap", rel_to_cwd=True))

        cwd = os.getcwd()
        return [os.path.relpath(fname, cwd) for fname in all_deps if fname]
1261536
def needs(self):
        """"""
        result = []
        for dep in self.dependencies:
            module = dep.split(".")[0].lower()
            if module not in result:
                result.append(module)

        return result
476378
function (err, res) {
      if (err) {
        cb(err)
      } else {
        res.stats.includedFiles.forEach(function (file) {
          compiler.emit('dependency', file)
        })
        cb(null, res.css.toString())
      }
    }
548160
function requireDependencies(dependencies) {
    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

    var promise = new _es6Promise.Promise(function (succeed, fail) {
        var requirements = {};

        // no requirements
        if (!(dependencies instanceof Array)) {
            return succeed(requirements);
        }

        // check if succeeded
        function checkStatus() {
            if (Object.keys(requirements).length === dependencies.length) {
                succeed(requirements);
            }
        }

        dependencies.forEach(function (dependency) {
            if (packages.has(dependency)) {
                requirements[dependency] = packages.get(dependency);
            } else {
                events.once("load:" + dependency, function (requirement) {
                    requirements[dependency] = requirement;
                    checkStatus();
                });
            }
        });

        // First check
        checkStatus();
    });

    return typeof callback === "function" ? promise.then(callback) : promise;
}
706072
def GetArtifactsDependenciesClosure(name_list, os_name=None):
  """"""

  artifacts = set(REGISTRY.GetArtifacts(os_name=os_name, name_list=name_list))

  dependencies = set()
  for art in artifacts:
    dependencies.update(GetArtifactDependencies(art, recursive=True))
  if dependencies:
    artifacts.update(
        set(
            REGISTRY.GetArtifacts(
                os_name=os_name, name_list=list(dependencies))))

  return artifacts