public static @Nullable @Nls String createDoc(final PsiElement element, final PsiElement originalElement) {
    PyReferenceExpression expression = PsiTreeUtil.getNonStrictParentOfType(originalElement, PyReferenceExpression.class);
    if (expression == null){
      expression = PsiTreeUtil.getNonStrictParentOfType(element, PyReferenceExpression.class);
      if (expression == null) {
        return null;
      }
    }
    // Indicates that we are inside console, not a lookup element!
    PydevConsoleReference consoleRef = PyUtil.as(expression.getReference(), PydevConsoleReference.class);
    if (consoleRef == null) { //shouldn't really happen!
      return null;
    }
    PyElement documentationElement = consoleRef.getDocumentationElement();
    if (documentationElement == null) {
      return null;
    }

    return new PyDocumentationBuilder(documentationElement, null).build();
  }
public static @Nullable @Nls String createDoc(final PsiElement element, final PsiElement originalElement)