def html_visit_bokeh_plot(self, node):
    env = self.builder.env
    dest_dir = join(self.builder.outdir, node["relpath"])

    if settings.docs_cdn() == "local":
        resources = Resources(mode="server", root_url="/en/latest/")
    else:
        resources = Resources(mode="cdn")

    try:
        if "path" in node:
            path = node['path']
            filename = hashlib.md5(path.encode('utf-8')).hexdigest() % "bokeh-plot-%s.js"
            dest_path = join(dest_dir, filename)
            tmpdir = join(env.bokeh_plot_tmpdir, node["relpath"])
            if not exists(tmpdir): makedirs(tmpdir)
            cached_path = join(tmpdir, filename)

            if out_of_date(path, cached_path) or not exists(cached_path+".script"):
                self.builder.app.verbose("generating new plot for '%s'" % path)
                plot = _render_plot(node['source'], node.get('symbol'))
                js, script = autoload_static(plot, resources, filename)
                with open(cached_path, "w") as f:
                    f.write(js)
                with open(cached_path+".script", "w") as f:
                    f.write(script)
            else:
                self.builder.app.verbose("using cached plot for '%s'" % path)
                script = open(cached_path+".script", "r").read()

            if not exists(dest_dir): makedirs(dest_dir)
            copy(cached_path, dest_path)
        else:
            filename = node['target_id'] + ".js"
            if not exists(dest_dir): makedirs(dest_dir)
            dest_path = join(dest_dir, filename)
            plot = _render_plot(node['source'], None)
            js, script = autoload_static(plot, resources, filename)
            self.builder.app.verbose("saving inline plot at: %s" % dest_path)
            with open(dest_path, "w") as f:
                f.write(js)

        html = SCRIPT_TEMPLATE.render(script=script)
        self.body.append(html)
    except Exception:
        err_node = nodes.error(None,
                               nodes.paragraph(text="Unable to generate Bokeh plot at %s:%d:" % (node['rst_source'], node['rst_lineno'])),
                               nodes.paragraph(text=str(sys.exc_info()[1])))
        node.children.append(err_node)
        raise nodes.SkipDeparture
    else:
        raise nodes.SkipNode
dataset/ETHPy150Open bokeh/bokeh/bokeh/sphinxext/bokeh_plot.py/html_visit_bokeh_plot/swapped operands of `%`