code: def move_file_to_file(old_path, new_path):
          
          try:
              os.rename(old_path, new_path)
          except:
              old_file = os.path.basename(old_path)
              target_directory, target_file = os.path.dirname(
                  os.path.abspath(new_path)), os.path.basename(new_path)
              Document.move_file_to_directory(
                  old_path,
                  target_directory
              )  # move old file to new directory, change name to new name
              os.rename(os.path.join(target_directory, old_file),
                        os.path.join(target_directory, target_file))
docs: Moves file from old location to new one
  
          :param old_path: path of file to move
          :param new_path: new path