# Path: betago/model.py
# class HTTPFrontend(object):
# class GoModel(object):
# class KerasBot(GoModel):
# class RandomizedKerasBot(GoModel):
# class IdiotBot(GoModel):
#     def __init__(self, bot, graph, port=8080):
#     def start_server(self):
#     def stop_server(self):
#     def run(self):
#         def static_file_dist(path):
#         def static_file_large(path):
#         def home():
#         def exportJSON():
#         def next_move():
#     def __init__(self, model, processor):
#     def set_board(self, board):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
#     def __init__(self, model, processor, top_n=10):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
#     def _move_generator(self, bot_color):
#     def _model_moves(self, bot_color):
#     def __init__(self, model, processor):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
#     def _move_generator(self, bot_color):
#     def _model_moves(self, bot_color):
#     def __init__(self, model=None, processor=ThreePlaneProcessor()):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
# def get_first_valid_move(board, color, move_generator):
# def generate_in_random_order(point_list):
# def all_empty_points(board):
# def fill_dame(board):
#         X = X.reshape((1, X.shape[0], X.shape[1], X.shape[2]))
#         X = X.reshape((1, X.shape[0], X.shape[1], X.shape[2]))
# 
# Path: betago/dataloader/goboard.py
# class GoBoard(object):
# class BoardSequence(object):
# class GoString(object):
#     def __init__(self, board_size=19):
#     def fold_go_strings(self, target, source, join_position):
#     def add_adjacent_liberty(self, pos, go_string):
#     def is_move_on_board(self, move):
#     def is_move_suicide(self, color, pos):
#     def is_move_legal(self, color, pos):
#     def create_go_string(self, color, pos):
#     def other_color(self, color):
#     def is_simple_ko(self, play_color, pos):
#     def check_enemy_liberty(self, play_color, enemy_pos, our_pos):
#     def apply_move(self, play_color, pos):
#     def add_liberty_to_adjacent_string(self, string_pos, liberty_pos, color):
#     def fold_our_moves(self, first_string, color, pos, join_position):
#     def __str__(self):
#     def __init__(self, board_size=19):
#     def insert(self, combo):
#     def erase(self, combo):
#     def exists(self, combo):
#     def size(self):
#     def __getitem__(self, iid):
#     def __str__(self):
#     def __init__(self, board_size, color):
#     def get_stone(self, index):
#     def get_liberty(self, index):
#     def insert_stone(self, combo):
#     def get_num_stones(self):
#     def remove_liberty(self, combo):
#     def get_num_liberties(self):
#     def insert_liberty(self, combo):
#     def copy_liberties_from(self, source):
#     def __str__(self):
# def from_string(board_string):
# def to_string(board):


import unittest
import six
from betago import model
from betago.dataloader import goboard




class ModelTestCase(unittest.TestCase):
    def test_all_empty_points(self):
        board = goboard.from_string('''
            .b.
            bb.
            .ww
        ''')

        empty_points = model.all_empty_points(board)

        six.assertCountEqual(
            self,
            [(0, 0), (1, 2), (2, 0), (2, 2)],
            empty_points)

    def test_get_first_valid_move(self):

# Path: betago/model.py
# class HTTPFrontend(object):
# class GoModel(object):
# class KerasBot(GoModel):
# class RandomizedKerasBot(GoModel):
# class IdiotBot(GoModel):
#     def __init__(self, bot, graph, port=8080):
#     def start_server(self):
#     def stop_server(self):
#     def run(self):
#         def static_file_dist(path):
#         def static_file_large(path):
#         def home():
#         def exportJSON():
#         def next_move():
#     def __init__(self, model, processor):
#     def set_board(self, board):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
#     def __init__(self, model, processor, top_n=10):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
#     def _move_generator(self, bot_color):
#     def _model_moves(self, bot_color):
#     def __init__(self, model, processor):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
#     def _move_generator(self, bot_color):
#     def _model_moves(self, bot_color):
#     def __init__(self, model=None, processor=ThreePlaneProcessor()):
#     def apply_move(self, color, move):
#     def select_move(self, bot_color):
# def get_first_valid_move(board, color, move_generator):
# def generate_in_random_order(point_list):
# def all_empty_points(board):
# def fill_dame(board):
#         X = X.reshape((1, X.shape[0], X.shape[1], X.shape[2]))
#         X = X.reshape((1, X.shape[0], X.shape[1], X.shape[2]))
# 
# Path: betago/dataloader/goboard.py
# class GoBoard(object):
# class BoardSequence(object):
# class GoString(object):
#     def __init__(self, board_size=19):
#     def fold_go_strings(self, target, source, join_position):
#     def add_adjacent_liberty(self, pos, go_string):
#     def is_move_on_board(self, move):
#     def is_move_suicide(self, color, pos):
#     def is_move_legal(self, color, pos):
#     def create_go_string(self, color, pos):
#     def other_color(self, color):
#     def is_simple_ko(self, play_color, pos):
#     def check_enemy_liberty(self, play_color, enemy_pos, our_pos):
#     def apply_move(self, play_color, pos):
#     def add_liberty_to_adjacent_string(self, string_pos, liberty_pos, color):
#     def fold_our_moves(self, first_string, color, pos, join_position):
#     def __str__(self):
#     def __init__(self, board_size=19):
#     def insert(self, combo):
#     def erase(self, combo):
#     def exists(self, combo):
#     def size(self):
#     def __getitem__(self, iid):
#     def __str__(self):
#     def __init__(self, board_size, color):
#     def get_stone(self, index):
#     def get_liberty(self, index):
#     def insert_stone(self, combo):
#     def get_num_stones(self):
#     def remove_liberty(self, combo):
#     def get_num_liberties(self):
#     def insert_liberty(self, combo):
#     def copy_liberties_from(self, source):
#     def __str__(self):
# def from_string(board_string):
# def to_string(board):


# Path: tests/model_test.py
import unittest
import six
from betago import model
from betago.dataloader import goboard





class ModelTestCase(unittest.TestCase):
    def test_all_empty_points(self):
        board = goboard.from_string('''
            .b.
            bb.
            .ww
        ''')

        empty_points = model.all_empty_points(board)

        six.assertCountEqual(
            self,
            [(0, 0), (1, 2), (2, 0), (2, 2)],
            empty_points)

    def test_get_first_valid_move(self):

        board = goboard.from_string('''