def get_line_token(lines, startswith):
    """Consumes iterator until it finds a line starting with startswith,
    and returns that line."""
    while lines:
        line = next(lines)
        if line.startswith(startswith):
            return line[len(startswith):].strip()