def batch_files(pool_size, limit):
    """ Create batches of files to process by a multiprocessing Pool """

    batch_size = limit // pool_size

    filenames = []

    for i in range(pool_size):
        batch = ['numbers/numbers_%d.txt' %
                 j for j in range(i*batch_size, (i+1)*batch_size)]
        filenames.append(batch)

    return filenames