def paginate(self, resource_url, params=None, values_key='values',
                 is_branches=False):
        url = self.url(resource_url, is_branches)

        more = True
        start = None
        while more:
            kw = {}
            if params:
                kw['params'] = params
            if start is not None:
                kw.setdefault('params', {})
                kw['params']['start'] = start

            response = self._client.get(url, **kw)
            maybe_throw(response)

            data = response.json()

            if not values_key in data:
                return
            for item in data[values_key]:
                yield item

            if data['isLastPage']:
                more = False
            else:
                more = True
                start = data['nextPageStart']
dataset/ETHPy150Open RisingOak/stashy/stashy/helpers.py/ResourceBase.paginate/original