#NEWLINE# def find_edge( self , from_node , to_node ) : #NEWLINE# #INDENT# 'Search for C{Edge} with its from_node, to_node, either nodes or ids.\n\n        :param from_node: C{Node} or C{str}\n        :param to_node: C{Node} or C{str}\n        :return: C{Edge} or None\n        ' #NEWLINE# if ( not isinstance ( from_node , Node ) ) : #NEWLINE# #INDENT# from_node = self . nodes [ from_node ] #NEWLINE# #UNINDENT# if ( not isinstance ( to_node , Node ) ) : #NEWLINE# #INDENT# to_node = edge . nodes [ to_node ] #NEWLINE# #UNINDENT# if ( len ( from_node . out_edges ) < len ( to_node . in_edges ) ) : #NEWLINE# #INDENT# for edge in from_node . out_edges : #NEWLINE# #INDENT# if ( edge . to_node == to_node ) : #NEWLINE# #INDENT# return edge #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for edge in to_node . in_edges : #NEWLINE# #INDENT# if ( edge . from_node == from_node ) : #NEWLINE# #INDENT# return edge #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return None