code: def main():
      parser = ArgumentParser(
          description=__doc__,
          formatter_class=RawDescriptionHelpFormatter,
      )
      parser.add_argument(
          "globber", type=str, help="glob to search for build mpkgs"
      )
      parser.add_argument(
          "--out-path",
          type=str,
          default="mpkg-dist",
          help='path for output files (default="mpkg-dist")',
          metavar="OUTPATH",
      )
      parser.add_argument(
          "--clobber",
          action="store_true",
          help="Delete OUTPATH if exists",
      )
      args = parser.parse_args()
      globber = args.globber
      out_path = args.out_path
      address = "{0}:{1}{2}".format(
          BUILDBOT_LOGIN, BUILDBOT_HTML, globber
      )
      if isdir(out_path):
          if not args.clobber:
              raise RuntimeError(
                  'Path {0} exists and "clobber" not set'.format(
                      out_path
                  )
              )
          shutil.rmtree(out_path)
      os.mkdir(out_path)
      cwd = os.path.abspath(os.getcwd())
      os.chdir(out_path)
      try:
          my_call("scp -r {0} .".format(address))
          found_mpkgs = sorted(glob("*.mpkg"))
          for mpkg in found_mpkgs:
              pkg_name, ext = os.path.splitext(mpkg)
              assert ext == ".mpkg"
              my_call("sudo reown_mpkg {0} root admin".format(mpkg))
              os.mkdir(pkg_name)
              pkg_moved = pjoin(pkg_name, mpkg)
              os.rename(mpkg, pkg_moved)
              readme = pjoin(
                  pkg_moved, "Contents", "Resources", "ReadMe.txt"
              )
              if isfile(readme):
                  shutil.copy(readme, pkg_name)
              else:
                  warnings.warn("Could not find readme with " + readme)
              my_call(
                  "sudo hdiutil create {0}.dmg -srcfolder ./{0}/ -ov".format(
                      pkg_name
                  )
              )
      finally:
          os.chdir(cwd)
  
file_path: dipy/tools/build_dmgs.py
imports: import os
  from os.path import join, isfile, isdir
  import shutil
  from glob import glob
  from functools import partial
  from subprocess import check_call
  import warnings
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types