code: def test_source_custom(self):
      input_file = open(JPEG_FILE, "rb")
  
      def read_handler(size):
          return input_file.read(size)
  
      def seek_handler(offset, whence):
          input_file.seek(offset, whence)
          return input_file.tell()
  
      source = pyvips.SourceCustom()
      source.on_read(read_handler)
      source.on_seek(seek_handler)
  
      image = pyvips.Image.new_from_source(
          source, "", access="sequential"
      )
      image2 = pyvips.Image.new_from_file(
          JPEG_FILE, access="sequential"
      )
  
      assert (image - image2).abs().max() == 0
  
file_path: pyvips/tests/test_connections.py
imports: import tempfile
  import pytest
  import pyvips
  from helpers import JPEG_FILE, WEBP_FILE, temp_filename, skip_if_no
label_desc: Use image node_id 4 for calling the TestConnections obj's underlying member method code with example usage: obj.test_source_custom() and returns: input_file, input_file