<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def boards(hwpack='arduino'):
 """read boards from boards.txt. :param core_package: 'all,'arduino',.. """

    bunch = read_properties(boards_txt(hwpack))

    bunch_items = list(bunch.items())

    # remove invalid boards
    for bid, board in bunch_items:
        if 'build' not in board.keys() or 'name' not in board.keys():
            log.debug('invalid board found: %s', bid)
            del bunch[bid]

    return bunch