@NotNull
  private static List<RatedResolveResult> updateRatedResults(@NotNull List<? extends RatedResolveResult> results) {
    if (results.isEmpty()) return Collections.emptyList();
    final ResolveResultList result = new ResolveResultList();

    for (RatedResolveResult resolveResult : results) {
      PsiElement element = resolveResult.getElement();
      if (element instanceof PsiDirectory) {
        element = PyUtil.getPackageElement((PsiDirectory)element, element);
      }

      if (element != null) {
        int delta = 0;
        for (PyResolveResultRater rater : PyResolveResultRater.EP_NAME.getExtensionList()) {
          delta += rater.getImportElementRate(element);
        }

        result.poke(element, resolveResult.getRate() + delta);
      }
    }

    return result;
  }
@NotNull
  private static List<RatedResolveResult> updateRatedResults(@NotNull List<? extends RatedResolveResult> results)