# Path: examples/utils.py
# def make_progressbar(prefix, data_size):
#     widgets = [prefix, ', processed ', _pb.Counter(), ' of ', str(data_size),
#                ' (', _pb.Percentage(), ')', ' ', _pb.Bar(), ' ', _pb.ETA()]
#     return _pb.ProgressBar(maxval=data_size, widgets=widgets)


import numpy as np
import theano as th
from examples.utils import make_progressbar


def validate(dataset_x, dataset_y, model, epoch, batch_size):
    progress = make_progressbar('Testing epoch #{}'.format(epoch), len(dataset_x))
    progress.start()

    nerrors = 0

# Path: examples/utils.py
# def make_progressbar(prefix, data_size):
#     widgets = [prefix, ', processed ', _pb.Counter(), ' of ', str(data_size),
#                ' (', _pb.Percentage(), ')', ' ', _pb.Bar(), ' ', _pb.ETA()]
#     return _pb.ProgressBar(maxval=data_size, widgets=widgets)


# Path: examples/MNIST/test.py
import numpy as np
import theano as th
from examples.utils import make_progressbar



def validate(dataset_x, dataset_y, model, epoch, batch_size):
    progress = make_progressbar('Testing epoch #{}'.format(epoch), len(dataset_x))
    progress.start()

    nerrors = 0

    for j in range((dataset_x.shape[0] + batch_size - 1) // batch_size):