<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _bulk_size_generator(num_records, bulk_size, active):
 """ Generate bulk_size until num_records is reached or active becomes false [50, 50, 50, 5] """

    while active and num_records > 0:
        req_size = min(num_records, bulk_size)
        num_records -= req_size
        yield req_size