def extract_relationships(self):
for obj in self.classes():<EOL><INDENT>node = obj.node<EOL>obj.attrs = self.get_attrs(node)<EOL>obj.methods = self.get_methods(node)<EOL>if is_interface(node):<EOL><INDENT>obj.shape = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>obj.shape = "<STR_LIT:class>"<EOL><DEDENT>for par_node in node.ancestors(recurs=False):<EOL><INDENT>try:<EOL><INDENT>par_obj = self.object_from_node(par_node)<EOL>self.add_relationship(obj, par_obj, "<STR_LIT>")<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>for impl_node in node.implements:<EOL><INDENT>try:<EOL><INDENT>impl_obj = self.object_from_node(impl_node)<EOL>self.add_relationship(obj, impl_obj, "<STR_LIT>")<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>for name, values in list(node.instance_attrs_type.items()) + list(<EOL>node.locals_type.items()<EOL>):<EOL><INDENT>for value in values:<EOL><INDENT>if value is astroid.Uninferable:<EOL><INDENT>continue<EOL><DEDENT>if isinstance(value, astroid.Instance):<EOL><INDENT>value = value._proxied<EOL><DEDENT>try:<EOL><INDENT>associated_obj = self.object_from_node(value)<EOL>self.add_relationship(associated_obj, obj, "<STR_LIT>", name)<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
extract relation ships between nodes in the diagram