'For help builtin function emulation'

def help_replacement(self, text=None, interactive=False):

    if ((text is not None) and (not interactive)):
        return pydoc.help(text)
    elif (text is None):
        pyver = ('%d.%d' % (sys.version_info[0], sys.version_info[1]))
        self.write(('\nWelcome    to    Python    %s!        This    is    the    online    help    utility.\n\nIf    this    is    your    first    time    using    Python,    you    should    definitely    check    out\nthe    tutorial    on    the    Internet    at    http://www.python.org/doc/tut/.\n\nEnter    the    name    of    any    module,    keyword,    or    topic    to    get    help    on    writing\nPython    programs    and    using    Python    modules.        To    quit    this    help    utility    and\nreturn    to    the    interpreter,    just    type    "quit".\n\nTo    get    a    list    of    available    modules,    keywords,    or    topics,    type    "modules",\n"keywords",    or    "topics".        Each    module    also    comes    with    a    one-line    summary\nof    what    it    does;    to    list    the    modules    whose    summaries    contain    a    given    word\nsuch    as    "spam",    type    "modules    spam".\n' % pyver))
    else:
        text = text.strip()
        try:
            eval(('pydoc.help(%s)' % text))
        except (NameError, SyntaxError):
            print(("no    Python    documentation    found    for    '%r'" % text))
    self.write(os.linesep)
    self.widget_proxy.new_prompt('help>    ')
    inp = self.raw_input_replacement()
    if inp.strip():
        self.help_replacement(inp, interactive=True)
    else:
        self.write('\nYou    are    now    leaving    help    and    returning    to    the    Python    interpreter.\nIf    you    want    to    ask    for    help    on    a    particular    object    directly    from    the\ninterpreter,    you    can    type    "help(object)".        Executing    "help(\'string\')"\nhas    the    same    effect    as    typing    a    particular    string    at    the    help>    prompt.\n')
