code: def copy_files(filelist, destdir):
      
      for filename in filelist:
          destfile = os.path.join(destdir, filename)
          # filename should not be absolute, but let's double-check
          assert destfile.startswith(destdir + os.path.sep)
          destfiledir = os.path.dirname(destfile)
          if not os.path.isdir(destfiledir):
              os.makedirs(destfiledir)
          if os.path.isdir(filename):
              os.mkdir(destfile)
          else:
              shutil.copy2(filename, destfile)
docs: Copy a list of files to destdir, preserving directory structure.
  
      File names should be relative to the current working directory.