code: def main():
      parser = ArgumentParser(
          description=DESCRIP,
          epilog=EPILOG,
          formatter_class=RawDescriptionHelpFormatter,
      )
      parser.add_argument("test_path", type=str, help="Path to test")
      parser.add_argument(
          "--error-txt",
          type=str,
          help="regular expression for error of interest",
      )
      parser.add_argument(
          "--clean",
          action="store_true",
          help="Clean git tree before running tests",
      )
      parser.add_argument(
          "--build",
          action="store_true",
          help="Build git tree before running tests",
      )
      # parse the command line
      args = parser.parse_args()
      path = os.path.abspath(args.test_path)
      if args.clean:
          print("Cleaning")
          call_or_untestable("git clean -fxd")
      if args.build:
          print("Building")
          call_or_untestable("python setup.py build_ext -i")
      cwd = os.getcwd()
      tmpdir = tempfile.mkdtemp()
      try:
          os.chdir(tmpdir)
          print("Testing")
          proc = popener("nosetests " + path)
          stdout, stderr = proc.communicate()
      finally:
          os.chdir(cwd)
          shutil.rmtree(tmpdir)
      if args.error_txt:
          regex = re.compile(args.error_txt)
          if regex.search(stderr):
              sys.exit(BAD)
          sys.exit(GOOD)
      sys.exit(proc.returncode)
  
file_path: nibabel/tools/bisect_nose.py
imports: import os
  import re
  import shutil
  import sys
  import tempfile
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
  from functools import partial
  from subprocess import PIPE, CalledProcessError, Popen, check_call
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types