code: def paginate(db_query, items_per_page, offset=0, start_page=1):
      
      return Paginator(db_query, items_per_page, offset=offset, start_page=start_page)
docs: Instantiates a Paginator instance for database queries.
  
      Args:
          db_query: The SQLAlchemy database query to paginate.
          items_per_page: The desired number of items per page.
          offset: The number of items to skip when paginating.
          start_page: The number of the first page when reporting on page numbers.