<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def batch(sequence, callback, size=100, **kwargs):
 """Helper to setup batch requests. There are endpoints which support updating multiple resources at once, but they are often limited to 100 updates per request. This function helps with splitting bigger requests into sequence of smaller ones. Example: def add_organization_tag(organizations, tag):
 request = {'organizations': [ { 'id': org['id'], 'tags': org['tags'] + [tag], } for org in organizations ]} job = z.organizations_update_many(request)['job_status'] return job['id'] orgs = z.organizations_list(get_all_pages=True)['organizations'] job_ids = [job for job in batch(orgs, add_organization_tag, tag='new_tag')] Parameters: sequence - any sequence you want to split callback - function to call with slices of sequence, its return value is yielded on each slice size - size of chunks, combined with length of sequence determines how many times callback is called (defaults to 100) **kwargs - any additional keyword arguments are passed to callback """

    batch_len, rem = divmod(len(sequence), size)
    if rem > 0:
        batch_len += 1
    for i in range(batch_len):
        offset = i * size
        yield callback(sequence[offset:offset + size], **kwargs)