def _traverse_pagination(response, endpoint, querystring, no_data):
 results = response.get(u'results', no_data)
 page = 1
 next_page = response.get(u'next')
 while next_page:
  page += 1
  querystring[u'page'] = page
  response = endpoint.get(**querystring)
  results += response.get(u'results', no_data)
  next_page = response.get(u'next')
 return results

def _traverse_pagination ( response , endpoint , querystring , no_data ) : results = response . get ( u'results' , no_data ) page = 1 next_page = response . get ( u'next' ) while next_page : page += 1 querystring [ u'page' ] = page response = endpoint . get ( ** querystring ) results += response . get ( u'results' , no_data ) next_page = response . get ( u'next' ) return results
traverse a paginated api response .