private static void annotateReturnType(Project project, PyFunction function) {
    if (!FileModificationService.getInstance().preparePsiElementForWrite(function)) return;
    WriteAction.run(() -> annotateReturnType(project, function, true));
  }
private static void annotateReturnType(Project project, PyFunction function)