def add_component(self, cname, obj, **kwargs):

        if has_interface(obj, IDriver):
            kwargs['driver'] = True
        if hasattr(obj, '_pseudo_type'):
            kwargs['pseudo'] = obj._pseudo_type
            if obj._pseudo_type == 'multi_var_expr':
                kwargs['srcexpr'] = obj._orig_src
                kwargs['destexpr'] = obj._orig_dest

        kwargs['comp'] = True
        self.add_node(cname, **kwargs)

        inputs  = ['.'.join((cname, v)) for v in obj.list_inputs()]
        outputs = ['.'.join((cname, v)) for v in obj.list_outputs()]

        self.add_nodes_from(inputs, var=True, iotype='in')
        self.add_nodes_from(outputs, var=True, iotype='out')

        self.add_edges_from([(v, cname) for v in inputs])
        self.add_edges_from([(cname, v) for v in outputs])

        if has_interface(obj, IImplicitComponent):
            states = ['.'.join((cname, v)) for v in obj.list_states()]
            resids = ['.'.join((cname, v)) for v in obj.list_residuals()]
            self.add_nodes_from(states, var=True, iotype='state')
            self.add_nodes_from(resids, var=True, iotype='residual')
            self.add_edges_from([(cname, v) for v in chain(states, resids)])
            self.add_edges_from([(v, cname) for v in states])

        self._update_graph_metadata(obj, cname,
                                    obj.list_inputs()+obj.list_outputs())
Create nodes in the graph for the component and all of
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/depgraph.py/DependencyGraph.add_component