def _chop_end_codes(line):
 return re.sub('\\s\\s\\s\\s+[\\w]{4}.\\s+\\d*\\Z', '', line)

def _chop_end_codes ( line ) : return re . sub ( '\\s\\s\\s\\s+[\\w]{4}.\\s+\\d*\\Z' , '' , line )
chops lines ending with 1csa 14 and the like .