code: def get_log_prior(idata, var_names=None):
      """Retrieve the log prior dataarray of a given variable."""
      if not hasattr(idata, "log_prior"):
          raise TypeError(
              "log prior not found in inference data object"
          )
      if var_names is None:
          var_names = list(idata.log_prior.data_vars)
      return idata.log_prior[var_names]
  
imports: import warnings
  from collections.abc import Sequence
  from copy import copy
  from copy import deepcopy
  import numpy
  import pandas
  from scipy.fftpack import next_fast_len
  from scipy.interpolate import CubicSpline
  from scipy.stats.mstats import mquantiles
  from xarray import apply_ufunc
  from ..None import _log
  from ..utils import conditional_jit, conditional_vect, conditional_dask
  from .density_utils import histogram
label_desc: Use image node_id 17 for calling a global function with example usage: get_log_prior(idata, var_names) and returns: idata