code: def paginate_endpoint(
      fn, page_size=5000, *args, **kwargs
  ) -> Iterator:
      """Paginates an API endpoint
  
      Args:
          fn:
              The endpoint which will be paginated until there is not any more data
          page_size:
              The size of the pages to pull
      """
      return Paginated(fn, page_size, *args, **kwargs)
  
imports: import io
  import os
  import random
  import threading
  import time
  from enum import Enum
  from typing import Iterator, List, Optional
  from PIL import JpegImagePlugin
  from lightly.openapi_generated.swagger_client.configuration import Configuration
label_desc: Use image node_id 2 for calling a global function with example usage: paginate_endpoint(fn, page_size) and returns: Paginated