code: def _plot_chains_bokeh(
      ax_density,
      ax_trace,
      data,
      x_name,
      y_name,
      chain_prop,
      combined,
      rug,
      kind,
      legend,
      trace_kwargs,
      hist_kwargs,
      plot_kwargs,
      fill_kwargs,
      rug_kwargs,
      rank_kwargs,
  ):
      marker = trace_kwargs.pop("marker", True)
      for chain_idx, cds in data.items():
          if kind == "trace":
              if legend:
                  trace_kwargs["legend_label"] = f"chain {chain_idx}"
              ax_trace.line(
                  x=x_name,
                  y=y_name,
                  source=cds,
                  **dealiase_sel_kwargs(
                      trace_kwargs, chain_prop, chain_idx
                  ),
              )
              if marker:
                  ax_trace.circle(
                      x=x_name,
                      y=y_name,
                      source=cds,
                      radius=0.30,
                      alpha=0.5,
                      **dealiase_sel_kwargs({}, chain_prop, chain_idx),
                  )
          if not combined:
              rug_kwargs["cds"] = cds
              if legend:
                  plot_kwargs["legend_label"] = f"chain {chain_idx}"
              plot_dist(
                  cds.data[y_name],
                  ax=ax_density,
                  rug=rug,
                  hist_kwargs=hist_kwargs,
                  plot_kwargs=dealiase_sel_kwargs(
                      plot_kwargs, chain_prop, chain_idx
                  ),
                  fill_kwargs=fill_kwargs,
                  rug_kwargs=rug_kwargs,
                  backend="bokeh",
                  backend_kwargs={},
                  show=False,
              )
  
      if kind == "rank_bars":
          value = np.array(
              [item.data[y_name] for item in data.values()]
          )
          plot_rank(
              value,
              kind="bars",
              ax=ax_trace,
              backend="bokeh",
              show=False,
              **rank_kwargs,
          )
      elif kind == "rank_vlines":
          value = np.array(
              [item.data[y_name] for item in data.values()]
          )
          plot_rank(
              value,
              kind="vlines",
              ax=ax_trace,
              backend="bokeh",
              show=False,
              **rank_kwargs,
          )
  
      if combined:
          rug_kwargs["cds"] = data
          if legend:
              plot_kwargs["legend_label"] = "combined chains"
          plot_dist(
              np.concatenate(
                  [item.data[y_name] for item in data.values()]
              ).flatten(),
              ax=ax_density,
              rug=rug,
              hist_kwargs=hist_kwargs,
              plot_kwargs=dealiase_sel_kwargs(
                  plot_kwargs, chain_prop, -1
              ),
              fill_kwargs=fill_kwargs,
              rug_kwargs=rug_kwargs,
              backend="bokeh",
              backend_kwargs={},
              show=False,
          )
  
file_path: arviz/arviz/plots/backends/bokeh/traceplot.py
imports: import warnings
  from collections.abc import Iterable
  from itertools import cycle
  import bokeh.plotting
  import matplotlib.pyplot
  import numpy
  from bokeh.models import ColumnDataSource, DataRange1d, Span
  from bokeh.models.glyphs import Scatter
  from bokeh.models.annotations import Title
  from ...distplot import plot_dist
  from ...plot_utils import _scale_fig_size
  from ...rankplot import plot_rank
  from ..None import show_layout
  from .None import backend_kwarg_defaults, dealiase_sel_kwargs
  from ....sel_utils import xarray_var_iter
label_desc: Use image node_id 2 for calling a global function with example usage: _plot_chains_bokeh(ax_density, ax_trace, data, x_name, y_name, chain_prop, combined, rug, kind, legend, trace_kwargs, hist_kwargs, plot_kwargs, fill_kwargs, rug_kwargs, rank_kwargs) without return types