code: def register(viewer, order=1):
      """
      The :py:func:`register` function is used to register additional viewers::
  
          from PIL import ImageShow
          ImageShow.register(MyViewer())  # MyViewer will be used as a last resort
          ImageShow.register(MySecondViewer(), 0)  # MySecondViewer will be prioritised
          ImageShow.register(ImageShow.XVViewer(), 0)  # XVViewer will be prioritised
  
      :param viewer: The viewer to be registered.
      :param order:
          Zero or a negative integer to prepend this viewer to the list,
          a positive integer to append it.
      """
      try:
          if issubclass(viewer, Viewer):
              viewer = viewer()
      except TypeError:
          pass  # raised if viewer wasn't a class
      if order > 0:
          _viewers.append(viewer)
      else:
          _viewers.insert(0, viewer)
  
imports: import os
  import shutil
  import subprocess
  import sys
  from shlex import quote
  from .None import Image
label_desc: Use image node_id 1 for calling a global function with example usage: register(viewer, order) without return types