def get_js_from_html(html, root):
    parts = []
    i = 0
    while True:
        i = html.find('<script', i)
        if i < 0 or i > len(html) - 5:
            break
        i_end1 = html.find('>', i+6)
        i_end2 = html.find('/>', i+6)
        i_end3 = html.find('</script>', i+6)
        i_src = html.find('src=', i+6)
        ends = [j for j in (i_end2, i_end3) if j > 0]
        if not ends:
            break
        i_end = min(ends)
        i = i_end  # prepare for next round
        
        if i_src > 0 and i_src < i_end1:
            # Get filename
            i1 = i_src + 5
            quote = html[i1-1]
            if quote not in '"\'':
                continue
            i2 = html.find(quote, i1)
            fname = html[i1:i2]
            # Get JS
            for filename in (fname, root + '/' + fname):
                if filename.startswith('http'):
                    code = urlopen(filename, timeout=5.0).read().decode()
                    break
                elif os.path.isfile(filename):
                    code = open(filename, 'rb').read().decode()
                    break
            else:
                raise IOError('Could not get JS for file %r' % fname)
            parts.append(code)
        elif i_end == i_end3 and i_end > i_end1:
            i1 = i_end1 + 1
            i2 = i_end
            parts.append(html[i1:i2])
        else:
            pass  # malformed tags or empty script tag
    
    return '\n'.join(parts)
Returns the editor by name class_name in the backend package.
dataset/ETHPy150Open zoofIO/flexx/flexx/webruntime/nodejs.py/get_js_from_html--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/editor_factory.py/EditorFactory._get_toolkit_editor