code: def sampling(self, stan_init, stan_data, samples, **kwargs) -> dict:
      if "inits" not in kwargs and "init" in kwargs:
          stan_init = self.sanitize_custom_inits(
              stan_init, kwargs["init"]
          )
          del kwargs["init"]
  
      inits_list, data_list = self.prepare_data(stan_init, stan_data)
      args = dict(
          data=data_list,
          inits=inits_list,
      )
      if "chains" not in kwargs:
          kwargs["chains"] = 4
      iter_half = samples // 2
      kwargs["iter_sampling"] = iter_half
      if "iter_warmup" not in kwargs:
          kwargs["iter_warmup"] = iter_half
      args.update(kwargs)
  
      self.stan_fit = self.model.sample(**args)
      res = self.stan_fit.draws()
      (samples, c, columns) = res.shape
      res = res.reshape((samples * c, columns))
      params = self.stan_to_dict_numpy(self.stan_fit.column_names, res)
  
      for par in params:
          s = params[par].shape
          if s[1] == 1:
              params[par] = params[par].reshape((s[0],))
  
          if par in ["delta", "beta"] and len(s) < 2:
              params[par] = params[par].reshape((-1, 1))
  
      return params
  
imports: from __future__ import absolute_import, division, print_function
  from abc import abstractmethod, ABC
  from dataclasses import dataclass
  from typing import Sequence, Tuple
  from collections import OrderedDict
  from enum import Enum
  import importlib_resources
  import platform
  import logging
label_desc: Use image node_id 5 for calling the CmdStanPyBackend obj's underlying member method code with example usage: obj.sampling(stan_init, stan_data, samples) and returns: params