def get_doc_links():
 tadoc_homepage = 'http://www.tadoc.org/'
 html_file_path = os.path.join(INPUT_DIR, '.tadoc.org.html')
 if os.path.exists(html_file_path):
  with open(html_file_path, 'r') as f:
   html = f.read()
 else:
  if (sys.version_info < (2, 8)):
   from urllib2 import urlopen
  else:
   from urllib.request import urlopen
  html = urlopen(tadoc_homepage).read()
  with open(html_file_path, 'w') as f:
   f.write(html)
 soup = BeautifulSoup(html, 'html.parser')
 links = [a for a in soup.findAll('a') if ('indicator' in a['href'])]
 ret = {}
 for a in links:
  url = ''.join([tadoc_homepage, a['href']])
  func = url[(url.rfind('/') + 1):url.rfind('.')]
  ret[func] = url
 return ret

def get_doc_links ( ) : tadoc_homepage = 'http://www.tadoc.org/' html_file_path = os . path . join ( INPUT_DIR , '.tadoc.org.html' ) if os . path . exists ( html_file_path ) : with open ( html_file_path , 'r' ) as f : html = f . read ( ) else : if ( sys . version_info < ( 2 , 8 ) ) : from urllib2 import urlopen else : from urllib . request import urlopen html = urlopen ( tadoc_homepage ) . read ( ) with open ( html_file_path , 'w' ) as f : f . write ( html ) soup = BeautifulSoup ( html , 'html.parser' ) links = [ a for a in soup . findAll ( 'a' ) if ( 'indicator' in a [ 'href' ] ) ] ret = { } for a in links : url = '' . join ( [ tadoc_homepage , a [ 'href' ] ] ) func = url [ ( url . rfind ( '/' ) + 1 ) : url . rfind ( '.' ) ] ret [ func ] = url return ret
returns a dictionary of function names -> upstream documentation link .