Ref<PyType> (@NotNull PsiElement referenceTarget, @NotNull TypeEvalContext context, @Nullable PsiElement anchor) { if (referenceTarget instanceof PyFunction) { if (NumpyUfuncs.isUFunc(((PyFunction)referenceTarget).getName()) && isInsideNumPy(referenceTarget)) { // we intentionally looking here for the user stub class PyPsiFacade facade = PyPsiFacade.getInstance(referenceTarget.getProject()); final PyClass uFuncClass = facade.createClassByQName("numpy.core.ufunc", referenceTarget); if (uFuncClass != null) { return Ref.create(new PyClassTypeImpl(uFuncClass, false)); } } } return null; }