code: def expand(args):
      
      p = OptionParser(expand.__doc__)
      p.add_option("--symlink", default=False, action="store_true",
                   help="Create symbolic link [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) < 1:
          sys.exit(not p.print_help())
  
      seen = set()
      for a in args:
          oa = a.replace("/", "_")
          if oa in seen:
              logging.debug("Name collision `{0}`, ignored.".format(oa))
              continue
  
          cmd = "cp -s" if opts.symlink else "mv"
          cmd += " {0} {1}".format(a, oa)
          sh(cmd)
          seen.add(oa)
docs: %prog expand */*
  
      Move files in subfolders into the current folder. Use --symlink to create a
      link instead.