def gen_batches(data, batch_size):
    """Divide input data into batches.

    :param data: input data
    :param batch_size: size of each batch
    :return: data divided into batches
    """
    data = np.array(data)

    for i in range(0, data.shape[0], batch_size):
        yield data[i:i + batch_size]
Divide input data into batches.

    :param data: input data
    :param batch_size: size of each batch
    :return: data divided into batches
    
yadlt/utils/utilities.py