private static boolean isUntypedDecorator(@NotNull PyDecorator decorator, @NotNull TypeEvalContext context) {
    QualifiedName qualifiedName = decorator.getQualifiedName();
    if (qualifiedName == null) return false;
    // Decorator is the only expression persisted in PSI stubs.
    // Calling getReference().resolve() will cause un-stubbing of the containing file
    List<PsiElement> resolved = PyResolveUtil.resolveQualifiedNameInScope(qualifiedName, (PyFile)decorator.getContainingFile(), context);
    for (PsiElement res : resolved) {
      if (res instanceof PyFunction function) {
        if (function.getTypeCommentAnnotation() != null || function.getAnnotation() != null) {
          return false;
        }
      }
      else if (res instanceof PyClass) {
        return false;
      }
    }
    return true;
  }
private static boolean isUntypedDecorator(@NotNull PyDecorator decorator, @NotNull TypeEvalContext context)