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