#NEWLINE# def copy_location( new_node , old_node ) : #NEWLINE# #INDENT# '\n    Copy source location (`lineno` and `col_offset` attributes) from\n    *old_node* to *new_node* if possible, and return *new_node*.\n    ' #NEWLINE# for attr in ( 'lineno' , 'col_offset' ) : #NEWLINE# #INDENT# if ( ( attr in old_node . _attributes ) and ( attr in new_node . _attributes ) and hasattr ( old_node , attr ) ) : #NEWLINE# #INDENT# setattr ( new_node , attr , getattr ( old_node , attr ) ) #NEWLINE# #UNINDENT# #UNINDENT# return new_node