Builds up a dependency graph for using a simple object structure containing the modules as keys and using arrays
as dependecy descriptors.
7420
function buildDependencyGraph(module, dependencies, graph) {
	if (module && !graph[module]) {
		graph[module] = [];
	}

	var dependencyNames = Object.keys(dependencies);
	dependencyNames.forEach(function(dependencyName) {
		var dependency = dependencies[dependencyName];

		if (module && graph[module].indexOf(dependencyName) === -1) {
			graph[module].push(dependencyName);
		}

		// Traverse down to this dependency dependencies:
		// Dependency-ception.
		if (dependency.dependencies) {
			buildDependencyGraph(dependencyName, dependency.dependencies, graph);
		}
	});
}
878854
private void addDependencyToGraph(final DbDependency dependency, final AbstractGraph graph, final int depth, final String parentId) {
        // In that case of Axway artifact we will add a module to the graph
        if (filters.getCorporateFilter().filter(dependency)) {
            final DbModule dbTarget = repoHandler.getModuleOf(dependency.getTarget());

            // if there is no module, add the artifact to the graph
            if(dbTarget == null){
                LOG.error("Got missing reference: " + dependency.getTarget());
                final DbArtifact dbArtifact = DataUtils.createDbArtifact(dependency.getTarget());
                final String targetElementId = graph.getId(dbArtifact);
                graph.addElement(targetElementId, dbArtifact.getVersion(), false);
                graph.addDependency(parentId, targetElementId, dependency.getScope());
                return;
            }

            // Add the element to the graph
            addModuleToGraph(dbTarget, graph, depth + 1);

            //Add the dependency to the graph
            final String moduleElementId = graph.getId(dbTarget);
            graph.addDependency(parentId, moduleElementId, dependency.getScope());
        }
        // In case a third-party we will add an artifact
        else {
            final DbArtifact dbTarget = repoHandler.getArtifact(dependency.getTarget());
            if(dbTarget == null){
                LOG.error("Got missing artifact: " + dependency.getTarget());
                return;
            }

            if(!graph.isTreated(graph.getId(dbTarget))){
                final ModelMapper modelMapper = new ModelMapper(repoHandler);
                final Artifact target = modelMapper.getArtifact(dbTarget);
                final String targetElementId = graph.getId(target);
                graph.addElement(targetElementId, target.getVersion(), false);
                graph.addDependency(parentId, targetElementId, dependency.getScope());
            }
        }
    }
1191651
function extractDependencyIds(options) {
  const dependencies = [];

  function extract(items) {
    // Invalid if not Array
    if (Array.isArray(items)) {
      items.reduce((dependencies, item) => {
        // Items can be Array with depedency as first param
        const dep = Array.isArray(item) ? item[0] : item;

        // Only gather string references, not functions/modules
        if ('string' == typeof dep) dependencies.push(dep);
        return dependencies;
      }, dependencies);
    }
  }

  if (options.plugins) extract(options.plugins);
  if (options.presets) extract(options.presets);

  return dependencies;
}
1277520
def make_dep_graph(depender):
	
	shutit_global.shutit_global_object.yield_to_draw()
	digraph = ''
	for dependee_id in depender.depends_on:
		digraph = (digraph + '"' + depender.module_id + '"->"' + dependee_id + '";\n')
	return digraph
112093
static ObjectGraph createWith(Loader loader, Object... modules) {
    return DaggerObjectGraph.makeGraph(null, loader, modules);
  }
677498
function (dependencies) {
            this._dependsOn = dependencies[this._name] || [];
            this._dependencyOf = [];
            Object.keys(dependencies).forEach(function (name) {
                var nameDependencies = dependencies[name];
                if (nameDependencies.indexOf(this._name) !== NOT_FOUND) {
                    this._dependencyOf.push(name);
                }
            }, this);
        }
1046994
public void rebuildDependencyGraph() {
        DependencyGraph graph = new DependencyGraph();
        graph.build();
        // volatile acts a as a memory barrier here and therefore guarantees
        // that graph is fully build, before it's visible to other threads
        dependencyGraph = graph;
        dependencyGraphDirty.set(false);
    }
650548
function dependencies(dependencyObject) {
    'use strict';

    function extractSpecificPath(depPath, loadType) {
        if (typeof depPath === 'object') {
            return depPath[loadType];
        }

        return depPath;
    }

    var depNames, depPaths;

    depNames = Object.keys(dependencyObject);
    depPaths = depNames.map(function (depName) {return dependencyObject[depName]; });

    function init(root, factory) {

        if (typeof module === 'object' && module.exports) {
            // Node/CommonJS
            console.log("NODE MODE");
            factory.apply(root, depPaths.map(function (depPath) {return require(extractSpecificPath(depPath, 'node')); }));
        } else if (typeof define === 'function' && define.amd) {
            // AMD
            console.log("AMD MODE");
            define(depPaths.map(function (depPath) { return extractSpecificPath(depPath, 'browser'); }), factory);
        } else {
            // Browser globals
            console.log("GLOBALS MODE");
            factory.apply(root, depNames.map(function (depName) {return root[depName]; }));
        }
    }

    return { init: init };
}
342024
void build(int nodeOffset, GraphMeshData graphData, List<int[]> connections) {
		for (int n = 0; n < connections.size(); n++) {
			int[] nodeConnections = connections.get(n);
			MeshData tile = graphData.getTile(n);
			Poly node = graphData.getNode(n);
			for (int connection : nodeConnections) {
				MeshData neighbourTile = graphData.getTile(connection - nodeOffset);
				if (neighbourTile != tile) {
					buildExternalLink(tile, node, neighbourTile);
				} else {
					Poly neighbour = graphData.getNode(connection - nodeOffset);
					buildInternalLink(tile, node, neighbourTile, neighbour);
				}
			}
		}
	}
144231
public ServiceGraphModule addDependency(Key<?> key, Key<?> keyDependency) {
		addedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency);
		return this;
	}
248511
def dependency_map(self):
        

        """
        dtree = self.dependency_graph()
        fig = nx.draw_spectral(dtree,
                               with_labels=True,
                               arrowsize=50,
                               node_size=2000,
                               edge_color='lightgrey',
                               width=3.0,
                               font_size=32,
                               font_weight='bold')
        return fig
222239
function createDependencyLinks (dep, pkg, cb) {
  var depdir = path.join(npm.dir, dep.name, dep.version)
    , depsOn = path.join( depdir
                        , "dependson"
                        , pkg.name+"@"+pkg.version
                        )
    , deps = path.join(depdir, "node_modules", pkg.name)
    , targetRoot = path.join(npm.dir, pkg.name, pkg.version)
    , dependentLink = path.join( npm.dir
                               , pkg.name
                               , pkg.version
                               , "dependents"
                               , dep.name + "@" + dep.version
                               )
  asyncMap
    ( [ [ link, targetRoot, depsOn ]
      , [ link, depdir, dependentLink ]
      , [ linkBins, pkg, path.join(depdir, "dep-bin"), false ]
      , [ linkModules, pkg, deps ]
      ]
    , function (c, cb) {
        c.shift().apply(null, c.concat(cb))
      }
    , cb
    )
}
798707
def build_current_graph():
    
    graph = SQLStateGraph()
    for app_name, config in apps.app_configs.items():
        try:
            module = import_module(
                '.'.join((config.module.__name__, SQL_CONFIG_MODULE)))
            sql_items = module.sql_items
        except (ImportError, AttributeError):
            continue
        for sql_item in sql_items:
            graph.add_node((app_name, sql_item.name), sql_item)

            for dep in sql_item.dependencies:
                graph.add_lazy_dependency((app_name, sql_item.name), dep)

    graph.build_graph()
    return graph
388428
def from_dict(cls, d):
        
        s = Structure.from_dict(d['structure'])
        return cls(s, d['graphs'])
719356
function orderByDependencies(packages) {
  const packageDependencyGraph = pkg =>
    R.pipe(
      allDeps,
      R.map(dependencyName => [dependencyName, pkg.name]),
    )(pkg)

  // :: Array<Package> -> Array<Array<string, string>>
  const dependencyGraph = R.chain(packageDependencyGraph)

  // :: Package -> bool
  const hasNoDependencies = ({ dependencies }) => dependencies.length === 0

  // :: Array<Package>
  const packagesWithNoDependencies = R.pipe(
    R.filter(hasNoDependencies),
    R.map(R.prop('name')),
  )(packages)

  // :: string -> Package
  const findPackageByName = R.map(name =>
    R.find(R.propEq('name', name), packages),
  )

  return R.pipe(
    dependencyGraph,
    toposort,
    R.without(packagesWithNoDependencies),
    R.concat(packagesWithNoDependencies),
    findPackageByName,
  )(packages)
}
229262
def dependency(self, node1, node2):
        ""
        self.graph.add_node(node1)
        self.graph.add_node(node2)
        self.graph.add_edge(node2, node1)
574674
function build(importsObj, tree) {
  const modules = {};

  const instantiate = filepath => {
    if (modules[filepath] != null) {
      return modules[filepath];
    }

    const mod = tree.modules[filepath];
    const promise = Promise.all(
      Object.entries(mod.deps).map(([key, dep]) => {
        return instantiate(dep.filepath).then(result => [key, result]);
      })
    )
      .then(importsMap => {
        const imports = importsMap.reduce((acc, [key, module]) => {
          acc[key] = module.instance.exports;
          return acc;
        }, {});

        return WebAssembly.instantiate(
          tree.opcodes[filepath],
          Object.assign({}, imports, importsObj)
        );
      })
      .catch(e => {
        // TODO: do some logging here
        throw e;
      });

    modules[filepath] = promise;

    return promise;
  };

  modules[tree.root.filepath] = instantiate(tree.root.filepath);

  return modules[tree.root.filepath];
}