code: def strip_units_from_lines(lines):
      
      for line in lines:
          for unit in ALL_UNITS:
              if line.endswith(" %s" % unit):
                  line = line[:-1-len(unit)]
          yield line
docs: Removes all units from the ends of the lines.