code: def prepare_output(d):
      
      outDir = os.path.join(d, 'inorder')
      if not os.path.exists(outDir):
          os.mkdir(outDir)
      for f in os.listdir(outDir):
          f = os.path.join(outDir, f)
          if os.path.islink(f):
              os.remove(f)
      return outDir
docs: Clean pre-existing links in output directory.