def imitate_pydoc(string):
 if (pydoc_topics is None):
  return ''
 string = str(string)
 h = pydoc.help
 with common.ignored(KeyError):
  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:
  (label, related) = string
 except TypeError:
  return ''
 try:
  return (pydoc_topics.topics[label] if pydoc_topics else '')
 except KeyError:
  return ''

def imitate_pydoc ( string ) : if ( pydoc_topics is None ) : return '' string = str ( string ) h = pydoc . help with common . ignored ( KeyError ) : 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 : ( label , related ) = string except TypeError : return '' try : return ( pydoc_topics . topics [ label ] if pydoc_topics else '' ) except KeyError : return ''
its not possible to get the pydocs without starting the annoying pager stuff .