@NotNull
  private static PsiElement getStubRetainedTypeHintContext(@NotNull PsiElement typeHintExpression) {
    // Values from PSI stubs and regular type comments
    PsiElement fragmentOwner = typeHintExpression.getContainingFile().getUserData(FRAGMENT_OWNER);
    if (fragmentOwner != null) {
      return fragmentOwner;
    }
    // Values from function type comments
    else if (typeHintExpression.getContainingFile() instanceof PyFunctionTypeAnnotationFile) {
      return PyPsiUtils.getRealContext(typeHintExpression);
    }
    else {
      return typeHintExpression;
    }
  }
@NotNull
  private static PsiElement getStubRetainedTypeHintContext(@NotNull PsiElement typeHintExpression)