code: def test_paginate_endpoint(self):
      def some_function(page_size=8, page_offset=0):
          if page_offset > 3 * page_size:
              assert False  # should not happen
          elif page_offset > 2 * page_size:
              return (page_size - 1) * ["a"]
          else:
              return page_size * ["a"]
  
      page_size = 8
      some_iterator = paginate_endpoint(
          some_function, page_size=page_size
      )
      some_list = list(some_iterator)
      self.assertEqual((4 * page_size - 1) * ["a"], some_list)
      self.assertEqual(len(some_list), (4 * page_size - 1))
  
file_path: lightly/tests/api/test_utils.py
imports: import os
  import unittest
  from unittest import mock
  import pytest
  from PIL import Image
  from lightly.api.utils import DatasourceType, PIL_to_bytes, get_lightly_server_location_from_env, get_signed_url_destination, getenv, paginate_endpoint, retry
label_desc: Use image node_id 8 for calling the TestUtils obj's underlying member method code with example usage: obj.test_paginate_endpoint() and returns: unknown, unknown