#NEWLINE# def inverse( self ) : #NEWLINE# #INDENT# '\n      Returns a copy of this graph where all edges have been reversed\n    ' #NEWLINE# new_g = DiGraph ( multiple_edges = self . multiple_edges ) #NEWLINE# for edge in new_g . edges : #NEWLINE# #INDENT# new_edge = copy . deepcopy ( edge ) #NEWLINE# new_edge . inverse ( ) #NEWLINE# new_g . add_edge ( new_edge ) #NEWLINE# #UNINDENT# return new_g