#NEWLINE# def increment_lineno( node , n = 1 ) : #NEWLINE# #INDENT# '\n    Increment the line number of each node in the tree starting at *node* by *n*.\n    This is useful to "move code" to a different location in a file.\n    ' #NEWLINE# if ( 'lineno' in node . _attributes ) : #NEWLINE# #INDENT# node . lineno = ( getattr ( node , 'lineno' , 0 ) + n ) #NEWLINE# #UNINDENT# for child in walk ( node ) : #NEWLINE# #INDENT# if ( 'lineno' in node . _attributes ) : #NEWLINE# #INDENT# child . lineno = ( getattr ( child , 'lineno' , 0 ) + n ) #NEWLINE# #UNINDENT# #UNINDENT# return node