<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_statements(lines):
 """Return a generator of statements Args: A list of strings that can contain one or more statements. Statements are separated using ';' at the end of a line Everything after the last ';' will be treated as the last statement. ['select * from\\nt1', 'select name'] ['select * from t1'] """

    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 '\n'.join(parts)
            parts[:] = []
    if parts:
        yield '\n'.join(parts)