def visit_uiexample_html(self, node):
    global should_export_flexx_deps
    
    # Fix for rtd
    if not hasattr(node, 'code'):
        return
    
    # Get code
    code = ori_code = node.code.strip() + '\n'
    ori_code = '\n'.join([' '*8 + x for x in ori_code.splitlines()])  # for reporting
    
    # Is this a simple example?
    if 'import' not in code:
        code = SIMPLE_CODE_T + '\n        '.join([line for line in code.splitlines()])
    
    # Get id and filename
    this_id = hashlib.md5(code.encode('utf-8')).hexdigest()
    fname = 'example%s.html' % this_id
    filename_html = os.path.join(HTML_DIR, 'ui', 'examples', fname)
    filename_py = os.path.join(HTML_DIR, 'ui', 'examples', 'example%s.py' % this_id)
    
    # Compose code
    code += '\n\n'
    if 'class MyApp' in code:
        code += 'App = MyApp\n'
    elif 'class Example' in code:
        code += 'App = Example\n'
    if not 'app' in code:
        code += 'from flexx import app\n'
    code += 'app.export(App, %r, False)\n' % filename_html
    
    # Write filename so Python can find the source
    open(filename_py, 'wt', encoding='utf-8').write(code)
    
    try:
        __import__('example%s' % this_id)  # import to exec
    except __HOLE__ as err:
        err_text = str(err)
        msg = 'Example not generated. <pre>%s</pre>' % err_text
        if os.environ.get('READTHEDOCS', False):
            node.height = 60
            msg = 'This example is not build on read-the-docs. <pre>%s</pre>' % err_text
        open(filename_html, 'wt', encoding='utf-8').write(msg)
        warnings.warn('Ui example dependency not met: %s' % err_text)
    except Exception as err:
        err_text = str(err)
        msg = 'Example not generated. <pre>%s</pre>' % err_text
        open(filename_html, 'wt', encoding='utf-8').write(msg.replace('\\n', '<br />'))
        raise RuntimeError('Could not create ui example: %s\n%s' % (err_text, ori_code) )
        #print('Could not create ui example: %s\n%s' % (err_text, ori_code) )
    
    rel_path = '../ui/examples/' + fname
    
    # Styles
    astyle = 'font-size:small; float:right;'
    dstyle = 'width: 500px; height: %ipx; align: center; resize:both; overflow: hidden; box-shadow: 5px 5px 5px #777;'
    istyle = 'width: 100%; height: 100%; border: 2px solid #094;'
    
    # Show app in iframe, wrapped in a resizable div
    self.body.append("<a target='new' href='%s' style='%s'>open in new tab</a>" % (rel_path, astyle))
    self.body.append("<div style='%s'>" % dstyle % node.height)
    self.body.append("<iframe src='%s' style='%s'>iframe not supported</iframe>" % (rel_path, istyle))
    self.body.append("</div>")
    self.body.append("<br />")
dataset/ETHPy150Open zoofIO/flexx/docs/scripts/uiexample.py/visit_uiexample_html