#NEWLINE# def get_transform( self , start , end ) : #NEWLINE# #INDENT# check_concrete_node ( start ) #NEWLINE# check_concrete_node ( end ) #NEWLINE# if ( start == end ) : #NEWLINE# #INDENT# return Transform ( [ start ] , [ ] , [ ] ) #NEWLINE# #UNINDENT# start_name = start [ 'name' ] #NEWLINE# end_name = end [ 'name' ] #NEWLINE# best_path = None #NEWLINE# for path in self . _shortest_paths . get ( ( start_name , end_name ) , [ ] ) : #NEWLINE# #INDENT# if path_matches ( path , start , end ) : #NEWLINE# #INDENT# if ( ( best_path is None ) or ( len ( best_path . nodes ) > len ( path . nodes ) ) ) : #NEWLINE# #INDENT# best_path = path #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( best_path is None ) : #NEWLINE# #INDENT# raise ValueError ( ( 'No path found from %r -> %r' % ( start , end ) ) ) #NEWLINE# #UNINDENT# concrete_nodes = [ ] #NEWLINE# for path_node in best_path . nodes : #NEWLINE# #INDENT# concrete_nodes . append ( concretize_path_node ( path_node , start , end ) ) #NEWLINE# #UNINDENT# kwargses = [ ] #NEWLINE# for i in range ( ( len ( concrete_nodes ) - 1 ) ) : #NEWLINE# #INDENT# kwargs = transform_kwargs ( concrete_nodes [ i ] , concrete_nodes [ ( i + 1 ) ] ) #NEWLINE# kwargses . append ( kwargs ) #NEWLINE# #UNINDENT# return Transform ( concrete_nodes , best_path . transforms , kwargses )