docs: def copy_r(src, dst):
      """
      Implements a recursive copy function similar to Unix's "cp -r" command.
      Surprisingly, python does not have a real equivalent. shutil.copytree
      only works if the destination directory is not present.
  
      Args:
          src (str): Source folder to copy.
          dst (str): Destination folder.
      """
  
      abssrc = os.path.abspath(src)
      absdst = os.path.abspath(dst)
      try:
          os.makedirs(absdst)
      except OSError:
          # If absdst exists, an OSError is raised. We ignore this error.
          pass
      for f in os.listdir(abssrc):
          fpath = os.path.join(abssrc, f)
          if os.path.isfile(fpath):
              shutil.copy(fpath, absdst)
          elif not absdst.startswith(fpath):
              copy_r(fpath, os.path.join(absdst, f))
          else:
              warnings.warn("Cannot copy %s to itself" % fpath)