<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_statements(lines: Iterator[str]) -> Iterator[str]: """Create an iterator that transforms lines into sql statements. Statements within the lines must end with ";" The last statement will be included even if it does not end in ';' ['select * from t'] ['a', 'b c', 'd'] """

    lines = (l.strip() for l in lines if l)
    lines = (l for l in lines if l and not l.startswith('--'))
    parts = []
    for line in lines:
        parts.append(line.rstrip(';'))
        if line.endswith(';'):
            yield ' '.join(parts)
            parts.clear()
    if parts:
        yield ' '.join(parts)