def browse(url, name='', icon=''):
    from PySide.QtGui import QApplication, QIcon
    from PySide.QtCore import QUrl
    from PySide.QtWebKit import QWebView

    for try_ in range(10):
        try:
            assert urllib2.urlopen(url).code == 200
        except (__HOLE__, urllib2.URLError):
            time.sleep(0.25)
        else:
            print "Started Qt Web View after %i ticks." % try_
            break
    else:
        sys.exit("Error initializing Qt Web View.")

    qtapp = QApplication(name)
    web = QWebView()
    web.load(QUrl(url))
    if icon:
        print "Setting Icon to", icon
        web.setWindowIcon(QIcon(icon))
    else:
        print "WARNING: No icon found in settings.py"
    web.setWindowTitle(name)
    web.show()
    qtapp.exec_()
dataset/ETHPy150Open ContinuumIO/ashiba/ashiba/main.py/browse