NumpyDocString (@NotNull PyFunction function, @Nullable PsiElement reference, @Nullable String knownSignature) { String docString = function.getDocStringValue(); if (docString == null) { // Docstring for constructor can be found in the docstring of class PyClass cls = PyUtil.turnConstructorIntoClass(function); if (cls != null) { docString = cls.getDocStringValue(); } } if (docString != null) { final NumpyDocString parsed = (NumpyDocString)DocStringUtil.parseDocStringContent(DocStringFormat.NUMPY, docString); if (parsed.getReturnFields().isEmpty() && parsed.getParameterFields().isEmpty()) { return null; } String signature = parsed.getSignature(); String redirect = findRedirect(parsed.getLines()); if (redirect != null && reference != null) { PyFunction resolvedFunction = resolveRedirectToFunction(redirect, reference); if (resolvedFunction != null) { return forFunction(resolvedFunction, reference, knownSignature != null ? knownSignature : signature); } } return parsed; } return null; }