def METHOD_NAME(next_page_function):
    """Loop through resources from a Google API.
    An iterator that returns all of the resources from a Google API 'list'
    operation paging through each set.
    Args:
        next_page_function: A function that when called will return the next
        page of results.
    Yields:
        A list if resources, which are typically dictionaries.
    """
    next_page_token = None
    more_results = True
    while more_results:
        resource_response = None
        try:
            resource_response = next_page_function(next_page_token).execute()
        except errors.HttpError:
            # Some projects throw a 403. (compute engine isn't enabled)
            # just ignore those resources.
            logging.debug('skipping resources.', exc_info=True)
            return
        for items_field in ['items', 'rrsets', 'managedZones']:
            items = resource_response.get(items_field, {})
            if items and (type(items) == dict):
                for item in items.iteritems():
                    yield item
            if items and (type(items) == list):
                for item in items:
                    yield item
        if 'nextPageToken' in resource_response:
            next_page_token = resource_response['nextPageToken']
        else:
            more_results = False