'helper function to normalize a distribution over the given list of moves
and return a list of (move, prob) tuples'

def _select_moves_and_normalize(self, nn_output, moves, size):

    if (len(moves) == 0):
        return []
    move_indices = [flatten_idx(m, size) for m in moves]
    distribution = nn_output[move_indices]
    distribution = (distribution / distribution.sum())
    return zip(moves, distribution)
