code: def move_to_backup(path, backup_suffix=BACKUP_SUFFIX):
    
    if backup_suffix and os.path.exists(path):
      backup_path = path + backup_suffix
      # Some messy corner cases need to be handled for existing backups.
      # TODO: Note if this is a directory, and we do this twice at once, there is a potential race
      # that could leave one backup inside the other.
      if os.path.islink(backup_path):
        os.unlink(backup_path)
      elif os.path.isdir(backup_path):
        shutil.rmtree(backup_path)
      shutil.move(path, backup_path)
docs: Move the given file or directory to the same name, with a backup suffix.
    If backup_suffix not supplied, move it to the extension ".bak".
    NB: If backup_suffix is supplied and is None, don't do anything.