code: def coords_and_dims_for_inferencedata(
      model: Model,
  ) -> Tuple[Dict[str, Any], Dict[str, Any]]:
      """Parse PyMC model coords and dims format to one accepted by InferenceData."""
      coords = {
          cname: np.array(cvals) if isinstance(cvals, tuple) else cvals
          for cname, cvals in model.coords.items()
          if cvals is not None
      }
      dims = {
          dname: list(dvals)
          for dname, dvals in model.named_vars_to_dims.items()
      }
  
      return coords, dims
  
imports: import logging
  import warnings
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  import numpy
  from arviz import InferenceData, concat, rcParams
  from arviz.data.base import CoordSpec, DimSpec, dict_to_dataset, requires
  from pytensor.graph.basic import Constant
  from pytensor.tensor.sharedvar import SharedVariable
  import pymc
  from pymc.model import Model, modelcontext
  from pymc.pytensorf import extract_obs_data
  from pymc.util import get_default_varnames
label_desc: Use image node_id 3 for calling a global function with example usage: coords_and_dims_for_inferencedata(model) and returns: coords,  dims