code: def test_extract_image():
      doc = fitz.open(filename)
  
      image_count = 1
      for xref in range(1, doc.xref_length() - 1):
          if doc.xref_get_key(xref, "Subtype")[1] != "/Image":
              continue
          img = doc.extract_image(xref)
          if isinstance(img, dict):
              image_count += 1
  
      assert image_count == known_image_count
  
imports: import os
  import fitz
label_desc: Use image node_id 1 for calling a global function with example usage: test_extract_image() without return types