code: def do_run(controller, buffer_output=True):
      """Setup and run a test controller.
  
      If buffer_output is True, no output is displayed, to avoid it appearing
      interleaved. In this case, the caller is responsible for displaying test
      output on failure.
  
      Returns
      -------
      controller : TestController
        The same controller as passed in, as a convenience for using map() type
        APIs.
      exitcode : int
        The exit code of the test subprocess. Non-zero indicates failure.
      """
      try:
          try:
              controller.setup()
              if not buffer_output:
                  controller.print_extra_info()
              controller.launch(buffer_output=buffer_output)
          except Exception:
              import traceback
  
              traceback.print_exc()
              return controller, 1  # signal failure
  
          exitcode = controller.wait()
          return controller, exitcode
  
      except KeyboardInterrupt:
          return controller, -signal.SIGINT
      finally:
          controller.cleanup()
  
imports: from __future__ import print_function
  import argparse
  import json
  import multiprocessing.pool
  import os
  import stat
  import re
  import requests
  import shutil
  import signal
  import sys
  import subprocess
  import time
  from .iptest import have, test_group_names, test_sections, StreamCapturer, test_for
  from IPython.utils.path import compress_user
  from IPython.utils.py3compat import bytes_to_str
  from IPython.utils.sysinfo import get_sys_info
  from IPython.utils.tempdir import TemporaryDirectory
  from IPython.utils.text import strip_ansi
label_desc: Use image node_id 2 for calling a global function with example usage: do_run(controller, buffer_output) and returns: controller,  exitcode, controller,  unknown, controller,  int