ast.copy_location()

ast.copy_location(new_node, old_node)[source]

Copy source location (lineno and col_offset attributes) from old_node to new_node if possible, and return new_node.