<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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]