private static <T extends PyTypeCommentOwner & PyAnnotationOwner> boolean typeHintedWithName(@NotNull T owner,
                                                                                               @NotNull TypeEvalContext context,
                                                                                               String... names) {
    var annotation = getAnnotationValue(owner, context);
    if (annotation instanceof PyStringLiteralExpression stringLiteralExpression) {
      final var annotationText = stringLiteralExpression.getStringValue();
      annotation = toExpression(annotationText, owner);
      if (annotation == null) return false;
    }

    if (annotation instanceof PySubscriptionExpression) {
      return resolvesToQualifiedNames(((PySubscriptionExpression)annotation).getOperand(), context, names);
    }
    else if (annotation instanceof PyReferenceExpression) {
      return resolvesToQualifiedNames(annotation, context, names);
    }

    final String typeCommentValue = owner.getTypeCommentAnnotation();
    final PyExpression typeComment = typeCommentValue == null ? null : toExpression(typeCommentValue, owner);
    if (typeComment instanceof PySubscriptionExpression) {
      return resolvesToQualifiedNames(((PySubscriptionExpression)typeComment).getOperand(), context, names);
    }
    else if (typeComment instanceof PyReferenceExpression) {
      return resolvesToQualifiedNames(typeComment, context, names);
    }

    return false;
  }
private static <T extends PyTypeCommentOwner & PyAnnotationOwner> boolean typeHintedWithName(@NotNull T owner,
                                                                                               @NotNull TypeEvalContext context,
                                                                                               String... names)