from typing import List


def parse_board(data: str) -> List[List[bool]]:
    """Parse the board from data."""

    def on_or_off(token: str) -> bool:
        """Parse a token from data as a light turned on/off."""
        if token == '#':
            return True
        if token == '.':
            return False
        raise ValueError('Invalid token: {}'.format(token))

    def parse_line(line: str) -> List[bool]:
        """Parse a line from data as a row of the board."""
        return list(map(on_or_off, line))

    return list(map(parse_line, data.splitlines()))