code: def test_pages(pages, result):
      if isinstance(result, type):
          with pytest.raises(result):
              _pages_from_ranges(pages)
      else:
          assert _pages_from_ranges(pages) == result
  
file_path: OCRmyPDF/tests/test_page_numbers.py
imports: from __future__ import annotations
  import pytest
  import ocrmypdf
  from ocrmypdf._validation import _pages_from_ranges
  from ocrmypdf.exceptions import BadArgsError
  from ocrmypdf.pdfinfo import PdfInfo
label_desc: Use image node_id 1 for calling a global function with example usage: test_pages(pages, result) without return types