code: def get_wf_formats(config):
      default_dpi = {"png": 80, "hires.png": 200, "pdf": 200}
      formats = []
      wf_formats = config.wf_formats
      if isinstance(wf_formats, (str, bytes)):
          # String Sphinx < 1.3, Split on , to mimic
          # Sphinx 1.3 and later. Sphinx 1.3 always
          # returns a list.
          wf_formats = wf_formats.split(",")
      for fmt in wf_formats:
          if isinstance(fmt, (str, bytes)):
              if ":" in fmt:
                  suffix, dpi = fmt.split(":")
                  formats.append((str(suffix), int(dpi)))
              else:
                  formats.append((fmt, default_dpi.get(fmt, 80)))
          elif isinstance(fmt, (tuple, list)) and len(fmt) == 2:
              formats.append((str(fmt[0]), int(fmt[1])))
          else:
              raise GraphError(
                  'invalid image format "%r" in wf_formats' % fmt
              )
      return formats
  
imports: import sys
  import os
  import shutil
  import io
  import re
  import textwrap
  from os.path import relpath
  from errno import EEXIST
  import traceback
label_desc: Use image node_id 13 for calling a global function with example usage: get_wf_formats(config) and returns: formats