code: def test_paginate(self):
      def pag(seq):
          return psycopg2.extras._paginate(seq, 100)
  
      self.assertEqual(list(pag([])), [])
      self.assertEqual(list(pag([1])), [[1]])
      self.assertEqual(list(pag(range(99))), [list(range(99))])
      self.assertEqual(list(pag(range(100))), [list(range(100))])
      self.assertEqual(list(pag(range(101))), [list(range(100)), [100]])
      self.assertEqual(
          list(pag(range(200))),
          [list(range(100)), list(range(100, 200))],
      )
      self.assertEqual(
          list(pag(range(1000))),
          [list(range(i * 100, (i + 1) * 100)) for i in range(10)],
      )
  
imports: from datetime import date
  from .None import testutils
  import unittest
  import psycopg2
  import psycopg2.extras
  import psycopg2.extensions
  from psycopg2 import sql
label_desc: Use image node_id 1 for calling the TestPaginate obj's underlying member method code with example usage: obj.test_paginate() and returns: psycopg2