code: def to_cds(
      data,
      var_names=None,
      groups=None,
      dimensions=None,
      group_info=True,
      var_name_format=None,
      index_origin=None,
  ):
      """Transform data to ColumnDataSource (CDS) compatible with Bokeh.
  
      Uses `_ARVIZ_GROUP_` and `_ARVIZ_CDS_SELECTION_` to separate var_name
      from group and dimensions in CDS columns.
  
      Parameters
      ----------
      data : obj
          Any object that can be converted to an az.InferenceData object
          Refer to documentation of az.convert_to_inference_data for details
      var_names : str or list of str, optional
          Variables to be processed, if None all variables are processed.
      groups : str or list of str, optional
          Select groups for CDS. Default groups are {"posterior_groups", "prior_groups",
          "posterior_groups_warmup"}
  
          - posterior_groups: posterior, posterior_predictive, sample_stats
          - prior_groups: prior, prior_predictive, sample_stats_prior
          - posterior_groups_warmup: warmup_posterior, warmup_posterior_predictive,
            warmup_sample_stats
  
      ignore_groups : str or list of str, optional
          Ignore specific groups from CDS.
      dimension : str, or list of str, optional
          Select dimensions along to slice the data. By default uses ("chain", "draw").
      group_info : bool
          Add group info for `var_name_format`
      var_name_format : str or tuple of tuple of string, optional
          Select column name format for non-scalar input.
          Predefined options are {"brackets", "underscore", "cds"}
  
              "brackets":
                  - add_group_info == False: ``theta[0,0]``
                  - add_group_info == True: ``theta_posterior[0,0]``
              "underscore":
                  - add_group_info == False: ``theta_0_0``
                  - add_group_info == True: ``theta_posterior_0_0_``
              "cds":
                  - add_group_info == False: ``theta_ARVIZ_CDS_SELECTION_0_0``
                  - add_group_info == True: ``theta_ARVIZ_GROUP_posterior__ARVIZ_CDS_SELECTION_0_0``
              tuple:
                  Structure:
  
                      - tuple: (dim_info, group_info)
  
                          - dim_info: (str: `.join` separator,
                            str: dim_separator_start,
                            str: dim_separator_end)
                          - group_info: (str: group separator start, str: group separator end)
  
                  Example: ((",", "[", "]"), ("_", ""))
  
                      - add_group_info == False: ``theta[0,0]``
                      - add_group_info == True: ``theta_posterior[0,0]``
  
      index_origin : int, optional
          Start parameter indices from `index_origin`. Either 0 or 1.
  
      Returns
      -------
      bokeh.models.ColumnDataSource object
      """
      from ...utils import flatten_inference_data_to_dict
  
      if var_name_format is None:
          var_name_format = "cds"
  
      cds_dict = flatten_inference_data_to_dict(
          data=data,
          var_names=var_names,
          groups=groups,
          dimensions=dimensions,
          group_info=group_info,
          index_origin=index_origin,
          var_name_format=var_name_format,
      )
      cds_data = ColumnDataSource(
          DataFrame.from_dict(cds_dict, orient="columns")
      )
      return cds_data
  
file_path: arviz/arviz/plots/backends/__init__.py
imports: import re
  import numpy
  from pandas import DataFrame
  from ...rcparams import rcParams
label_desc: Use image node_id 1 for calling a global function with example usage: to_cds(data, var_names, groups, dimensions, group_info, var_name_format, index_origin) and returns: cds_data