private static void processFunctionDeclaration(@NotNull PyChangeInfo changeInfo, @NotNull PyFunction function) {
    if (changeInfo.isParameterNamesChanged()) {
      final PyParameter[] oldParameters = function.getParameterList().getParameters();
      final Map<PyParameter, String> paramRenames = StreamEx.of(changeInfo.getNewParameters())
                                                            .filter(info -> info.getOldIndex() >= 0 && info.isRenamed())
                                                            .toMap(info -> oldParameters[info.getOldIndex()],
                                                                   info -> StringUtil.trimLeading(info.getName(), '*').trim());
      final Map<PsiElement, String> allRenames = new HashMap<>(paramRenames);
      if (changeInfo.isNameChanged()) {
        allRenames.put(function, changeInfo.getNewName());
      }
      for (Map.Entry<PyParameter, String> entry : paramRenames.entrySet()) {
        final PyParameter oldParameter = entry.getKey();
        final String newName = entry.getValue();
        final UsageInfo[] usages = RenameUtil.findUsages(oldParameter, newName, true, false, allRenames);
        for (UsageInfo info : usages) {
          RenameUtil.rename(info, newName);
        }
      }
    }
    if (changeInfo.isParameterSetOrOrderChanged()) {
      fixDoc(changeInfo, function);
      updateParameterList(changeInfo, function);
    }
    if (changeInfo.isNameChanged()) {
      RenameUtil.doRenameGenericNamedElement(function, changeInfo.getNewName(), UsageInfo.EMPTY_ARRAY, null);
    }
  }
private static void processFunctionDeclaration(@NotNull PyChangeInfo changeInfo, @NotNull PyFunction function)