def nbviewer_link(url):
if six.PY2:<EOL><INDENT>from urlparse import urlparse as urlsplit<EOL><DEDENT>else:<EOL><INDENT>from urllib.parse import urlsplit<EOL><DEDENT>info = urlsplit(url)<EOL>domain = info.netloc<EOL>url_type = '<STR_LIT>' if domain == '<STR_LIT>' else '<STR_LIT:url>'<EOL>return '<STR_LIT>' % (url_type, info.path)<EOL>
Return the link to the Jupyter nbviewer for the given notebook url