prepare an ordered list (map) of dependencies
342378
function buildDependencyPaths(self, context) {
  var dependencies = {};

  context.__dependencyPaths__.forEach(function (p) {
    var dep = new DependencyFile(p, self.environment.stat(p).mtime,
                                 self.environment.getFileDigest(p));
    dependencies[JSON.stringify(dep)] = dep;
  });

  _.forEach(context.__dependencyAssets__, function (p) {
    var dep, asset;

    if (p === self.pathname) {
      dep = new DependencyFile(p, self.environment.stat(p).mtime,
                               self.environment.getFileDigest(p));
      dependencies[JSON.stringify(dep)] = dep;
      return;
    }

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

    if (asset) {
      asset.dependencyPaths.forEach(function (dep) {
        dependencies[JSON.stringify(dep)] = dep;
      });
    }
  });

  prop(self, '__dependencyPaths__', _.values(dependencies));
}
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;
}
924104
def order_module_dependencies(modules, parser):
    """"""
    result = []        
    for modk in modules:
        if modk not in result:
            result.append(modk)

    #We also need to look up the dependencies of each of these modules
    recursed = list(result)
    for i in range(len(result)):
        module = result[i]
        _process_module_order(parser, module, i, recursed)

    return recursed
348190
def dependency_tree(args = {}, &bl)
      dependencies = {}
      args = {:recursive    => true,
              :dev_deps     => true,
              :matching     => :latest,
              :dependencies => dependencies}.merge(args)

      process = []
      deps.each do |dep|
        resolved = nil
        begin
          resolved = Polisher::Gem.matching(dep, args[:matching])
        rescue
        end
        yield self, dep, resolved
        process << resolved unless resolved.nil?
      end

      process.each { |dep|
        dependencies.merge!(dep.dependency_tree(args, &bl))
      }

      dependencies
    end
704610
def _get_dep_to_dot_name_mapping(dependencies):
        
        dot_name_to_deps = {}
        for dep in dependencies:
            dot_name = dep.name

            if dot_name not in dot_name_to_deps:
                dot_name_to_deps[dot_name] = [dep]
            else:
                dot_name_to_deps[dot_name].append(dep)

        dep_to_dot_name = {}
        for dot_name, deps in dot_name_to_deps.items():
            if len(deps) == 1:
                dep_to_dot_name[deps[0]] = dot_name
                continue

            for idx, dep in enumerate(deps):
                dep_to_dot_name[dep] = dot_name + str(idx)

        return dep_to_dot_name
872102
def order_manually(sub_commands):
    """"""
    order = [
        "start",
        "projects",
    ]
    ordered = []
    commands = dict(zip([cmd for cmd in sub_commands], sub_commands))
    for k in order:
        ordered.append(commands.get(k, ""))
        if k in commands:
            del commands[k]

    # Add commands not present in `order` above
    for k in commands:
        ordered.append(commands[k])

    return ordered
313485
def pull_dependencies(self, nodes):
        """"""
        visitor = DependencyFinderVisitor()
        for node in nodes:
            visitor.visit(node)
        for dependency in 'filters', 'tests':
            mapping = getattr(self, dependency)
            for name in getattr(visitor, dependency):
                if name not in mapping:
                    mapping[name] = self.temporary_identifier()
                self.writeline('%s = environment.%s[%r]' %
                               (mapping[name], dependency, name))
383183
private List<CompilerInput> getDepthFirstDependenciesOf(
      CompilerInput rootInput,
      Set<CompilerInput> unreachedInputs,
      Map<String, CompilerInput> inputsByProvide) {
    List<CompilerInput> orderedInputs = new ArrayList<>();
    if (!unreachedInputs.remove(rootInput)) {
      return orderedInputs;
    }

    for (String importedNamespace : rootInput.getRequiredSymbols()) {
      CompilerInput dependency = null;
      if (inputsByProvide.containsKey(importedNamespace)
          && unreachedInputs.contains(inputsByProvide.get(importedNamespace))) {
        dependency = inputsByProvide.get(importedNamespace);
      }

      if (dependency != null) {
        orderedInputs.addAll(
            getDepthFirstDependenciesOf(dependency, unreachedInputs, inputsByProvide));
      }
    }

    orderedInputs.add(rootInput);
    return orderedInputs;
  }
242875
def format_pkg_list(packages, versions_as_list, attr):
    '''
    
    '''
    ret = copy.deepcopy(packages)
    if attr:
        requested_attr = {'epoch', 'version', 'release', 'arch', 'install_date', 'install_date_time_t'}

        if attr != 'all':
            requested_attr &= set(attr + ['version'])

        for name in ret:
            versions = []
            for all_attr in ret[name]:
                filtered_attr = {}
                for key in requested_attr:
                    if all_attr[key]:
                        filtered_attr[key] = all_attr[key]
                versions.append(filtered_attr)
            ret[name] = versions
        return ret

    for name in ret:
        ret[name] = [format_version(d['epoch'], d['version'], d['release'])
                     for d in ret[name]]
    if not versions_as_list:
        stringify(ret)
    return ret
888330
def _ordered_load(stream, Loader=yaml.Loader,
    object_pairs_hook=dict):
  '''

  '''

  class OrderedLoader(Loader): pass

  def construct_mapping(loader, node):
    loader.flatten_mapping(node)
    return object_pairs_hook(loader.construct_pairs(node))

  OrderedLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
      construct_mapping)

  return yaml.load(stream, OrderedLoader)
1149613
def copy_dependency_docs(tile):
    """"""

    env = Environment(tools=[])

    outputbase = os.path.join('build', 'output', 'doc')
    depbase = os.path.join('build', 'deps')
    for dep in tile.dependencies:
        depdir = os.path.join(depbase, dep['unique_id'], 'doc', dep['unique_id'])
        outputdir = os.path.join(outputbase, dep['unique_id'])

        if os.path.exists(depdir):
            env.Command([outputdir], [depdir], Copy("$TARGET", "$SOURCE"))
458898
def expand_dependencies_section(section, kwargs):
    """"""
    deps = []

    for dep in section:
        for dep_type, dep_list in dep.items():
            if dep_type in ['call', 'use']:
                deps.extend(Command(dep_type, dep_list, kwargs).run())
            elif dep_type.startswith('if ') or dep_type == 'else':
                deps.append({dep_type: expand_dependencies_section(dep_list, kwargs)})
            else:
                deps.append({dep_type: dep_list})

    return deps
937680
private OrderedMap<String, Pom> sortSubmodulesToReflectDependencies(Pom pom)
    {
        Set<MavenCoord> dependenciesMet = new HashSet();
        dependenciesMet.add(pom.coord);

        SortedSet<MavenCoord> dependenciesSatisfied = new TreeSet<>();

        for (Dependency dep : pom.dependencies)
        {
            // Traverse the tree, depth-first, take items at node exit.
        }

        throw new UnsupportedOperationException("Not implemented yet.");
    }
827439
function listDepsForBook(book) {
    var config = book.getConfig();
    var plugins = config.getPluginDependencies();

    return listDependencies(plugins);
}
1230862
def verify_dependencies(self):
        

        for i in range(1, len(self.deps)):
            assert(not (isinstance(self.deps[i], Transformation) and
                   isinstance(self.deps[i - 1], Analysis))
                   ), "invalid dep order for %s" % self
1240665
function buildDependencyTreeFromSources(filenames, sourcesObject) {
  const orgnizedFlat = {};

  // build tree object
  filenames.forEach(sourceFileName => {
    orgnizedFlat[sourceFileName] = {
      path: sourceFileName,
      source: sourcesObject[sourceFileName],
      dependencies: buildDependencyTreeFromSources(allImportPaths(sourcesObject[sourceFileName]), sourcesObject),
    };
  });

  // return organized object
  return orgnizedFlat;
}
114530
def _resolve_deps(self, depmap):
    """"""
    deps = defaultdict(lambda: OrderedSet())
    for category, depspecs in depmap.items():
      dependencies = deps[category]
      for depspec in depspecs:
        dep_address = Address.parse(depspec)
        try:
          self.context.build_graph.maybe_inject_address_closure(dep_address)
          dependencies.add(self.context.build_graph.get_target(dep_address))
        except AddressLookupError as e:
          raise AddressLookupError('{}\n  referenced from {} scope'.format(e, self.options_scope))
    return deps