class_docstr: Apply an offset and limit to the query based on the current page and number of
  items per page.
  
  Don't create pagination objects manually. They are created by
  :meth:`.SQLAlchemy.paginate` and :meth:`.Query.paginate`.
  
  This is a base class, a subclass must implement :meth:`_query_items` and
  :meth:`_query_count`. Those methods will use arguments passed as ``kwargs`` to
  perform the queries.
  
  :param page: The current page, used to calculate the offset. Defaults to the
      ``page`` query arg during a request, or 1 otherwise.
  :param per_page: The maximum number of items on a page, used to calculate the
      offset and limit. Defaults to the ``per_page`` query arg during a request,
      or 20 otherwise.
  :param max_per_page: The maximum allowed value for ``per_page``, to limit a
      user-provided value. Use ``None`` for no limit. Defaults to 100.
  :param error_out: Abort with a ``404 Not Found`` error if no items are returned
      and ``page`` is not 1, or if ``page`` or ``per_page`` is less than 1, or if
      either are not ints.
  :param count: Calculate the total number of values by issuing an extra count
      query. For very complex queries this may be inaccurate or slow, so it can be
      disabled and set manually if necessary.
  :param kwargs: Information about the query to paginate. Different subclasses will
      require different arguments.
  
  .. versionchanged:: 3.0
      Iterating over a pagination object iterates over its items.
  
  .. versionchanged:: 3.0
      Creating instances manually is not a public API.
docstr: Yield page numbers for a pagination widget. Skipped pages between the edges
  and middle are represented by a ``None``.
  
  For example, if there are 20 pages and the current page is 7, the following
  values are yielded.
  
  .. code-block:: python
  
      1, 2, None, 5, 6, 7, 8, 9, 10, 11, None, 19, 20
  
  :param left_edge: How many pages to show from the first page.
  :param left_current: How many pages to show left of the current page.
  :param right_current: How many pages to show right of the current page.
  :param right_edge: How many pages to show from the last page.
  
  .. versionchanged:: 3.0
      Improved efficiency of calculating what to yield.
  
  .. versionchanged:: 3.0
      ``right_current`` boundary is inclusive.
  
  .. versionchanged:: 3.0
      All parameters are keyword-only.
docstr_tok: ["Yield","page","numbers","for","a","pagination","widget",".","Skipped","pages","between","the","edges","and","middle","are","represented","by","a","``","None","``",".","For","example",",","if","there","are","20","pages","and","the","current","page","is","7",",","the","following","values","are","yielded",".","..","code-block",":",":","python","1",",","2",",","None",",","5",",","6",",","7",",","8",",","9",",","10",",","11",",","None",",","19",",","20",":","param","left_edge",":","How","many","pages","to","show","from","the","first","page",".",":","param","left_current",":","How","many","pages","to","show","left","of","the","current","page",".",":","param","right_current",":","How","many","pages","to","show","right","of","the","current","page",".",":","param","right_edge",":","How","many","pages","to","show","from","the","last","page",".","..","versionchanged",":",":","3.0","Improved","efficiency","of","calculating","what","to","yield",".","..","versionchanged",":",":","3.0","``","right_current","``","boundary","is","inclusive",".","..","versionchanged",":",":","3.0","All","parameters","are","keyword-only","."]
code: def iter_pages(
      self,
      *,
      left_edge: int = 2,
      left_current: int = 2,
      right_current: int = 4,
      right_edge: int = 2,
  ) -> t.Iterator[int | None]:
      """Yield page numbers for a pagination widget. Skipped pages between the edges
      and middle are represented by a ``None``.
  
      For example, if there are 20 pages and the current page is 7, the following
      values are yielded.
  
      .. code-block:: python
  
          1, 2, None, 5, 6, 7, 8, 9, 10, 11, None, 19, 20
  
      :param left_edge: How many pages to show from the first page.
      :param left_current: How many pages to show left of the current page.
      :param right_current: How many pages to show right of the current page.
      :param right_edge: How many pages to show from the last page.
  
      .. versionchanged:: 3.0
          Improved efficiency of calculating what to yield.
  
      .. versionchanged:: 3.0
          ``right_current`` boundary is inclusive.
  
      .. versionchanged:: 3.0
          All parameters are keyword-only.
      """
      pages_end = self.pages + 1
  
      if pages_end == 1:
          return
  
      left_end = min(1 + left_edge, pages_end)
      yield from range(1, left_end)
  
      if left_end == pages_end:
          return
  
      mid_start = max(left_end, self.page - left_current)
      mid_end = min(self.page + right_current + 1, pages_end)
  
      if mid_start - left_end > 0:
          yield None
  
      yield from range(mid_start, mid_end)
  
      if mid_end == pages_end:
          return
  
      right_start = max(mid_end, pages_end - right_edge)
  
      if right_start - mid_end > 0:
          yield None
  
      yield from range(right_start, pages_end)
  
imports: from __future__ import annotations
  import typing
  from math import ceil
  import sqlalchemy
  import sqlalchemy.orm
  from flask import abort
  from flask import request
label_desc: Use image node_id 15 for calling the Pagination obj's underlying member method code with example usage: obj.iter_pages() without return types