public static int getRate(@Nullable PsiElement elt, @NotNull TypeEvalContext context) {
    final int rate;
    if (elt instanceof PyTargetExpression && context.maySwitchToAST(elt)) {
      final PsiElement parent = elt.getParent();
      if (parent instanceof PyGlobalStatement || parent instanceof PyNonlocalStatement) {
        rate = RatedResolveResult.RATE_LOW;
      }
      else {
        rate = RatedResolveResult.RATE_NORMAL;
      }
    }
    else if (elt instanceof PyImportedNameDefiner ||
             elt instanceof PyReferenceExpression) {
      rate = RatedResolveResult.RATE_LOW;
    }
    else if (elt != null && !PyiUtil.isInsideStub(elt) && PyiUtil.isOverload(elt, context)) {
      rate = RatedResolveResult.RATE_PY_FILE_OVERLOAD;
    }
    else {
      rate = RatedResolveResult.RATE_NORMAL;
    }
    return rate;
  }
public static int getRate(@Nullable PsiElement elt, @NotNull TypeEvalContext context)