def next(self):
        """
        Return the next available item. If there are no more items in the
        local 'results' list, check if there is a 'next_uri' value. If so,
        use that to get the next page of results from the API, and return
        the first item from that query.
        """
        try:
            return self.results.pop(0)
        except IndexError:
            if self.next_uri is None:
                raise StopIteration()
            else:
                if not self.next_uri:
                    self.results = self.list_method(marker=self.marker,
                            limit=self.limit, prefix=self.prefix)
                else:
                    args = self.extra_args
                    self.results = self._list_method(self.next_uri, *args)
                if self.results:
                    last_res = self.results[-1]
                    self.marker = getattr(last_res, self.marker_att)
        # We should have more results.
        try:
            return self.results.pop(0)
        except IndexError:
            raise StopIteration()
def next ( self ) : try : return self . results . pop ( 0 ) except IndexError : if self . next_uri is None : raise StopIteration ( ) else : if not self . next_uri : self . results = self . list_method ( marker = self . marker , limit = self . limit , prefix = self . prefix ) else : args = self . extra_args self . results = self . _list_method ( self . next_uri , * args ) if self . results : last_res = self . results [ - 1 ] self . marker = getattr ( last_res , self . marker_att ) try : return self . results . pop ( 0 ) except IndexError : raise StopIteration ( )
Return the next available item. If there are no more items in the
        local 'results' list, check if there is a 'next_uri' value. If so,
        use that to get the next page of results from the API, and return
        the first item from that query.