Auto-iterate over the paginated results of various methods of the API.
        Pass the GitLabAPI method as the first argument, followed by the
        other parameters as normal. Include `page` to determine first page to poll.
        Remaining kwargs are passed on to the called method, including `per_page`.

        :param fn: Actual method to call
        :param page: Optional, page number to start at, defaults to 1
        :param args: Positional arguments to actual method
        :param kwargs: Keyword arguments to actual method
        :return: Yields each item in the result until exhausted, and then implicit StopIteration; or no elements if error

def getall(fn, page=None, *args, **kwargs):
        """
        Auto-iterate over the paginated results of various methods of the API.
        Pass the GitLabAPI method as the first argument, followed by the
        other parameters as normal. Include `page` to determine first page to poll.
        Remaining kwargs are passed on to the called method, including `per_page`.

        :param fn: Actual method to call
        :param page: Optional, page number to start at, defaults to 1
        :param args: Positional arguments to actual method
        :param kwargs: Keyword arguments to actual method
        :return: Yields each item in the result until exhausted, and then implicit StopIteration; or no elements if error
        """
        if not page:
            page = 1

        while True:
            results = fn(*args, page=page, **kwargs)

            if not results:
                break
            for x in results:
                yield x

            page += 1