code: def spm_dot_old(X, x, dims_to_omit=None, obs_mode=False):
      """Dot product of a multidimensional array with `x`. The dimensions in `dims_to_omit`
      will not be summed across during the dot product
  
      #TODO: we should look for an alternative to obs_mode
  
      Parameters
      ----------
      - `x` [1D numpy.ndarray] - either vector or array of arrays
          The alternative array to perform the dot product with
      - `dims_to_omit` [list :: int] (optional)
          Which dimensions to omit
  
      Returns
      -------
      - `Y` [1D numpy.ndarray] - the result of the dot product
      """
  
      # Construct dims to perform dot product on
      if utils.is_obj_array(x):
          dims = (np.arange(0, len(x)) + X.ndim - len(x)).astype(int)
      else:
          if obs_mode is True:
              """
              @NOTE Case when you're getting the likelihood of an observation under
                    the generative model. Equivalent to something like self.values[np.where(x),:]
                    when `x` is a discrete 'one-hot' observation vector
              """
              dims = np.array([0], dtype=int)
          else:
              """
              @NOTE Case when `x` leading dimension matches the lagging dimension of `values`
                    E.g. a more 'classical' dot product of a likelihood with hidden states
              """
              dims = np.array([1], dtype=int)
  
          x = utils.to_obj_array(x)
  
      # delete ignored dims
      if dims_to_omit is not None:
          if not isinstance(dims_to_omit, list):
              raise ValueError(
                  "`dims_to_omit` must be a `list` of `int`"
              )
          dims = np.delete(dims, dims_to_omit)
          if len(x) == 1:
              x = np.empty([0], dtype=object)
          else:
              x = np.delete(x, dims_to_omit)
  
      # compute dot product
      for d in range(len(x)):
          s = np.ones(np.ndim(X), dtype=int)
          s[dims[d]] = np.shape(x[d])[0]
          X = X * x[d].reshape(tuple(s))
          # X = np.sum(X, axis=dims[d], keepdims=True)
  
      Y = np.sum(X, axis=tuple(dims.astype(int))).squeeze()
      # Y = np.squeeze(X)
  
      # check to see if `Y` is a scalar
      if np.prod(Y.shape) <= 1.0:
          Y = Y.item()
          Y = np.array([Y]).astype("float64")
  
      return Y
  
imports: import numpy
  from scipy import special
  from pymdp import utils
  from itertools import chain
label_desc: Use image node_id 3 for calling a global function with example usage: spm_dot_old(X, x, dims_to_omit, obs_mode) and returns: Y