code: def _pagenumbering(lines):
      BEGINDOC = "\\begin{document}"
      FRONTNUMS = [
          "\\pagenumbering{roman}",
          "\\pagestyle{empty}",
          "\\halftitle",
          "\\cleardoublepage",
      ]
      INTRONUMS = [
          "\\mainmatter",
          "\\pagenumbering{arabic}",
          "\\setcounter{page}{1}",
      ]
      CHAPINTRO = "\\chapter{Introduction}"
      chapintro_i = -1
      for i, l in enumerate(lines):
          if l.startswith(BEGINDOC):
              frontnums_i = i + 1
          elif l.startswith(CHAPINTRO):
              chapintro_i = i
              break
      for i, v in enumerate(FRONTNUMS):
          lines.insert(frontnums_i + i, v)
      for i, v in enumerate(INTRONUMS):
          if chapintro_i > 0:
              lines.insert(chapintro_i + len(FRONTNUMS) + i, v)
  
file_path: d2l-en/static/post_latex/main.py
imports: import os
  import re
  import regex
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: _pagenumbering(lines) without return types