'A generator which yields pages of resource instances after
doing the appropriate service operation calls and handling
any pagination on your behalf. Non-paginated calls will
return a single page of items.
Page size, item limit, and filter parameters are applied
if they have previously been set.
>>> bucket = s3.Bucket(\'boto3\')
>>> for page in bucket.objects.pages():
...     for obj in page:
...         print(obj.key)
\'key1\'
\'key2\'
:rtype: list(:py:class:`~boto3.resources.base.ServiceResource`)
:return: List of resource instances'

def pages(self):

    client = self._parent.meta.client
    cleaned_params = self._params.copy()
    limit = cleaned_params.pop('limit', None)
    page_size = cleaned_params.pop('page_size', None)
    params = create_request_parameters(self._parent, self._model.request)
    merge_dicts(params, cleaned_params, append_lists=True)
    if client.can_paginate(self._py_operation_name):
        logger.info('Calling    paginated    %s:%s    with    %r', self._parent.meta.service_name, self._py_operation_name, params)
        paginator = client.get_paginator(self._py_operation_name)
        pages = paginator.paginate(PaginationConfig={'MaxItems': limit, 'PageSize': page_size}, **params)
    else:
        logger.info('Calling    %s:%s    with    %r', self._parent.meta.service_name, self._py_operation_name, params)
        pages = [getattr(client, self._py_operation_name)(**params)]
    count = 0
    for page in pages:
        page_items = []
        for item in self._handler(self._parent, params, page):
            page_items.append(item)
            count += 1
            if ((limit is not None) and (count >= limit)):
                break
        (yield page_items)
        if ((limit is not None) and (count >= limit)):
            break
