def _repeat(api_call, *args, **kwargs):
 marker = None
 _delay = kwargs.pop('_delay', None)
 while True:
  if _delay:
   time.sleep(_delay)
  resp = api_call(marker=marker, *args, **kwargs)
  (yield resp)
  marker = getattr(resp, 'marker', None)
  if (not marker):
   return

def _repeat ( api_call , * args , ** kwargs ) : marker = None _delay = kwargs . pop ( '_delay' , None ) while True : if _delay : time . sleep ( _delay ) resp = api_call ( marker = marker , * args , ** kwargs ) ( yield resp ) marker = getattr ( resp , 'marker' , None ) if ( not marker ) : return
make the same api call repeatedly until weve seen every page of the response .