code: def shellcmd(cmd, verbose=True):
      """Call a shell command."""
      if verbose:
          print(cmd)
      try:
          subprocess.check_call(cmd, shell=True)
      except subprocess.CalledProcessError as err:
          msg = f"""
          Error while executing a shell command.
          {err}
          """
          raise Exception(msg)
  
file_path: dipy/tools/osxbuild.py
imports: import os
  import sys
  import shutil
  import subprocess
  from optparse import OptionParser
  from getpass import getuser
label_desc: Use image node_id 6 for calling a global function with example usage: shellcmd(cmd, verbose) without return types