def imitate_pydoc(string):
    # str needed because of possible unicode stuff in py2k (pydoc doesn't work
    # with unicode strings)
    string = str(string)
    h = pydoc.help
    with common.ignored(KeyError):
        # try to access symbols
        string = h.symbols[string]
        string, _, related = string.partition(' ')

    get_target = lambda s: h.topics.get(s, h.keywords.get(s))
    while isinstance(string, str):
        string = get_target(string)

    try:
        # is a tuple now
        label, related = string
    except TypeError:
        return ''

    try:
        return pydoc_topics.topics[label] if pydoc_topics else ''
    except KeyError:
        return ''
Subcommand of alter_column that modifies column definitions beyond
dataset/ETHPy150Open JulianEberius/SublimePythonIDE/server/lib/python_all/jedi/api/keywords.py/imitate_pydoc--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/South-1.0.2/south/db/generic.py/DatabaseOperations._alter_add_column_mods