Create a new {@link ObjectGraph} based on the given module. The new graph will extend
the graph found in the parent scope (via {@link ObjectGraph#plus}), if there is one.
346035
public static ObjectGraph create(MortarScope parent, Object... daggerModules) {
    ObjectGraph parentGraph = getObjectGraph(parent);

    return parentGraph == null ? ObjectGraph.create(daggerModules)
        : parentGraph.plus(daggerModules);
  }
22501
function regenerate(moduleName, done){
		var cfg = clone(config, true);
		// if the moduleName is not in the graph, make it the main.
		if(moduleName && !cachedData.graph[moduleName]) {
			cfg.main = moduleName;
		}

		makeBundleGraph(cfg, options).then(function(data){
			var graph = data.graph;
			var oldGraph = cachedData ? cachedData.graph : {};
			for(var name in graph){
				if(name !== moduleName && oldGraph[name]) {
					graph[name].transforms = oldGraph[name].transforms;
				}
			}
			cachedData = cloneData(data);
			done(null, data);
		}, done);
	}
298156
function create(modulePath, moduleStack, options) {

        // first check the cache to see if we already loaded it
        if (this.cache[modulePath]) {
            return this.cache[modulePath];
        }

        var uipart = this.getUiPart(modulePath, options);

        // check if parent we want to merge with the parent
        if (uipart.parent) {
            var parts = modulePath.split(delim);
            parts[3] = uipart.parent + '.' + parts[2].substring(0, parts[2].length - 1);
            var parent = this.getUiPart(parts.join(delim), options);
            uipart = _.merge({}, parent, uipart);
            delete uipart.abstract;
        }

        this.cache[modulePath] = uipart;
        return uipart;
    }
1136624
public void addNode(RNode newNode) {
        graph.add(newNode);
        graphBitSet.set(graph.size() - 1);
    }
981723
public void addExtraModule(String moduleId) {
		if (extraModules == null) {
			extraModules = new LinkedList<String>();
		}
		extraModules.add(moduleId);
	}
17627
function _newGraphSONMapper() {
        return Tinkerpop.GraphSONMapper.buildP()
            .then(function (builder) {
            return builder.embedTypesP(true);
        })
            .then(function (builder) {
            return builder.createP();
        });
    }
1317283
public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) {
        for (Object o : this) {
            if (o instanceof DependencyDeclarer) {
                DependencyDeclarer dd = (DependencyDeclarer) o;
                try {
                    dd.buildDependencyGraph(owner,graph);
                } catch (RuntimeException e) {
                    LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + owner,e);
                }
            }
        }
    }
315101
public void create(MappingNode tree, List<Module> modules) {
        addRoot(tree, modules);
        check(tree, tree, "");
    }
495532
def add_module(  # noqa: C901
        self,
        module,
        module_or_package_name,
        local_names,
        import_alias_mapping,
        is_init=False,
        from_from=False,
        from_fdid=False
    ):
        
        module_path = module[1]

        parent_definitions = self.module_definitions_stack[-1]
        # Here, in `visit_Import` and in `visit_ImportFrom` are the only places the `import_alias_mapping` is updated
        parent_definitions.import_alias_mapping.update(import_alias_mapping)
        parent_definitions.import_names = local_names

        new_module_definitions = ModuleDefinitions(local_names, module_or_package_name)
        new_module_definitions.is_init = is_init
        self.module_definitions_stack.append(new_module_definitions)

        # Analyse the file
        self.filenames.append(module_path)
        self.local_modules = get_directory_modules(module_path) if self._allow_local_modules else []
        tree = generate_ast(module_path)

        # module[0] is None during e.g. "from . import foo", so we must str()
        self.nodes.append(EntryOrExitNode('Module Entry ' + str(module[0])))
        self.visit(tree)
        exit_node = self.append_node(EntryOrExitNode('Module Exit ' + str(module[0])))

        # Done analysing, pop the module off
        self.module_definitions_stack.pop()
        self.filenames.pop()

        if new_module_definitions.is_init:
            for def_ in new_module_definitions.definitions:
                module_def_alias = handle_aliases_in_init_files(
                    def_.name,
                    new_module_definitions.import_alias_mapping
                )
                parent_def_alias = handle_aliases_in_init_files(
                    def_.name,
                    parent_definitions.import_alias_mapping
                )
                # They should never both be set
                assert not (module_def_alias and parent_def_alias)

                def_name = def_.name
                if parent_def_alias:
                    def_name = parent_def_alias
                if module_def_alias:
                    def_name = module_def_alias

                local_definitions = self.module_definitions_stack[-1]
                if local_definitions != parent_definitions:
                    raise
                if not isinstance(module_or_package_name, str):
                    module_or_package_name = module_or_package_name.name

                if module_or_package_name:
                    if from_from:
                        qualified_name = def_name

                        if from_fdid:
                            alias = handle_fdid_aliases(module_or_package_name, import_alias_mapping)
                            if alias:
                                module_or_package_name = alias
                            parent_definition = ModuleDefinition(
                                parent_definitions,
                                qualified_name,
                                module_or_package_name,
                                self.filenames[-1]
                            )
                        else:
                            parent_definition = ModuleDefinition(
                                parent_definitions,
                                qualified_name,
                                None,
                                self.filenames[-1]
                            )
                    else:
                        qualified_name = module_or_package_name + '.' + def_name
                        parent_definition = ModuleDefinition(
                            parent_definitions,
                            qualified_name,
                            parent_definitions.module_name,
                            self.filenames[-1]
                        )
                    parent_definition.node = def_.node
                    parent_definitions.definitions.append(parent_definition)
                else:
                    parent_definition = ModuleDefinition(
                        parent_definitions,
                        def_name,
                        parent_definitions.module_name,
                        self.filenames[-1]
                    )
                    parent_definition.node = def_.node
                    parent_definitions.definitions.append(parent_definition)

        return exit_node
1149000
def add_subgraph(self, sgraph):
        

        if not isinstance(sgraph, Subgraph) and not isinstance(sgraph, Cluster):
            raise TypeError('add_subgraph() received a non subgraph class object:' + str(sgraph))
            
        if self.obj_dict['subgraphs'].has_key(sgraph.get_name()):
        
            sgraph_list = self.obj_dict['subgraphs'][ sgraph.get_name() ]
            sgraph_list.append( sgraph.obj_dict )
                
        else:
            self.obj_dict['subgraphs'][ sgraph.get_name() ] = [ sgraph.obj_dict ]
         
        sgraph.set_sequence( self.get_next_sequence_number() )
        
        sgraph.set_parent_graph( self.get_parent_graph() )
336503
def __addNode(self, name, cls):
        '''
        
        '''
        if name in self.nodes:
            raise Exception("A node by the name {} already exists.  Can't add a duplicate.".format(name))
        self.__nxgraph.add_node(name)
        self.__nxgraph.node[name]['label'] = name
        self.__nxgraph.node[name]['nodeobj'] = cls()
        self.__nxgraph.node[name]['type'] = cls.__name__
257603
def new_graph(self, name, data=None, **attr):
        
        self._init_graph(name, 'Graph')
        g = Graph(self, name, data, **attr)
        self._graph_objs[name] = g
        return g
556663
public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) {
        this.rootNode.addDependency(dependencyGraph.rootNode.key());
        Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable;
        Map<String, NodeT> targetNodeTable = this.nodeTable;
        this.merge(sourceNodeTable, targetNodeTable);
        dependencyGraph.parentDAGs.add(this);
        if (this.hasParents()) {
            this.bubbleUpNodeTable(this, new LinkedList<String>());
        }
    }
1278004
private static boolean isSetFromPrecedingModule(
      Ref originalRef, Ref set, JSModuleGraph moduleGraph) {
    return set.type == Ref.Type.SET_FROM_GLOBAL
        && (originalRef.getModule() == set.getModule()
            || moduleGraph.dependsOn(originalRef.getModule(), set.getModule()));
  }
663363
function ModuleGraph(moduleData) {
  var self = this;
  var modules = {};
  var moduleNameList = [];
  moduleData.forEach(function(info) {
    var m = new Module(info);
    modules[info.name] = m;
    moduleNameList.push(info.name);
  });

  /**
   * Get a list of all module names.
   * @return {Array.<string>} List of module names.
   */
  this.getAllModules = function() {
    return moduleNameList;
  };

  /**
   * Get transitive dependencies for a given module
   * @param {string} name Name of the module.
   * @return {Array.<string>} List of module names.
   */
  this.getTransitiveDependencies = function(name) {
    var m = getModule(name);
    return m.transitiveDeps || [];
  };

  function getModule(name) {
    var m = modules[name];
    if (!m) {
      throw new self.NotFoundException(name);
    }
    return m;
  }

  /**
   * Error object used when a requested module cannot be found.
   * @constructor
   */
  this.NotFoundException = function(name) {
    var msg = 'Unknown module: ' + name;
    this.name = name;
    this.message = msg;
    Error.call(this, msg);
  };
  this.NotFoundException.prototype = new Error();
  this.NotFoundException.prototype.statusCode = 404;

  /**
   * Gets the requested module names and their transitive deps minus the
   * transitive deps (and the) of the optional excluded names.
   * @param {Array.<string>} moduleNames List of module names.
   * @apram {Array.<string>} opt_excludeNames List of module names to exclude.
   * @return {Array.<string>} List of module names.
   */
  this.getModules = function(moduleNames, opt_excludeNames) {
    var list = [];
    var seen = {};
    var exclude = {};

    if (opt_excludeNames) {
      opt_excludeNames.forEach(function(name) {
        exclude[name] = true;
        var m = getModule(name);
        m.transitiveDeps.forEach(function(name) {
          exclude[name] = true;
        });
      });
    }

    function addModule(name) {
      if (!seen[name] && !exclude[name]) {
        seen[name] = true;
        list.push(name)
      }
    }
    moduleNames.forEach(function(name) {
      var m = getModule(name);
      m.transitiveDeps.forEach(addModule);
      addModule(m.name);
    });
    return list;
  };
}
433665
def add_child(graph, child_id, child_label, parent_id, colour):
    
    node = pydot.Node(child_id, style="filled", fillcolor=colour, label=child_label, shape="polygon", fontname=FONT)
    graph.add_node(node)
    graph.add_edge(pydot.Edge(parent_id, node))
363160
def _add_to_graph(self, term, parents):
        
        if self._frozen:
            raise ValueError(
                "Can't mutate %s after construction." % type(self).__name__
            )

        # If we've seen this node already as a parent of the current traversal,
        # it means we have an unsatisifiable dependency.  This should only be
        # possible if the term's inputs are mutated after construction.
        if term in parents:
            raise CyclicDependency(term)

        parents.add(term)

        self.graph.add_node(term)

        for dependency in term.dependencies:
            self._add_to_graph(dependency, parents)
            self.graph.add_edge(dependency, term)

        parents.remove(term)