def show_tip(self, tip):
        # Attempt to find the cursor position at which to show the call tip.
        text_edit = self._text_edit
        document = text_edit.document()
        cursor = text_edit.textCursor()
        search_pos = cursor.position() - 1
        self._start_position, _ = self._find_parenthesis(search_pos, 
                                                         forward=False)
        if self._start_position == -1:
            return False

        # Set the text and resize the widget accordingly.
        self.setText(tip)
        self.resize(self.sizeHint())
    
        # Locate and show the widget. Place the tip below the current line
        # unless it would be off the screen. In that case, place it above
        # the current line.
        padding = 3 # Distance in pixels between cursor bounds and tip box.
        cursor_rect = text_edit.cursorRect(cursor)
        screen_rect = QtGui.QApplication.desktop().screenGeometry(text_edit)
        point = text_edit.mapToGlobal(cursor_rect.bottomRight())
        point.setY(point.y() + padding)
        tip_height = self.size().height()
        if point.y() + tip_height > screen_rect.height():
            point = text_edit.mapToGlobal(cursor_rect.topRight())
            point.setY(point.y() - tip_height - padding)
        self.move(point)
        self.show()
        return True
            
    #--------------------------------------------------------------------------
    # Protected interface
    #--------------------------------------------------------------------------
Returns how many documents the given term appears in.
dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/console/call_tip_widget.py/CallTipWidget.show_tip--crossover with--dataset/ETHPy150Open dokipen/whoosh/src/whoosh/reading.py/IndexReader.doc_frequency