code: def test_multivariate_observations(self):
      coords = {
          "direction": ["x", "y", "z"],
          "experiment": np.arange(20),
      }
      data = np.random.multinomial(20, [0.2, 0.3, 0.5], size=20)
      with pm.Model(coords=coords):
          p = pm.Beta("p", 1, 1, size=(3,))
          p = p / p.sum()
          pm.Multinomial(
              "y",
              20,
              p,
              dims=("experiment", "direction"),
              observed=data,
          )
          with warnings.catch_warnings():
              warnings.filterwarnings(
                  "ignore", ".*number of samples.*", UserWarning
              )
              idata = pm.sample(
                  draws=50,
                  chains=2,
                  tune=100,
                  return_inferencedata=True,
                  idata_kwargs=dict(log_likelihood=True),
              )
      test_dict = {
          "posterior": ["p"],
          "sample_stats": ["lp"],
          "log_likelihood": ["y"],
          "observed_data": ["y"],
      }
      fails = check_multiple_attrs(test_dict, idata)
      assert not fails
      assert "direction" not in idata.log_likelihood.dims
      assert "direction" in idata.observed_data.dims
      assert idata.log_likelihood["y"].shape == (2, 50, 20)
  
imports: import warnings
  from typing import Dict, Tuple
  import numpy
  import pytensor.tensor
  import pytest
  from arviz import InferenceData
  from arviz.tests.helpers import check_multiple_attrs
  from numpy import ma
  from pytensor.tensor.subtensor import AdvancedIncSubtensor, AdvancedIncSubtensor1
  import pymc
  from pymc.backends.arviz import InferenceDataConverter, predictions_to_inference_data, to_inference_data
  from pymc.exceptions import ImputationWarning
label_desc: Use image node_id 22 for calling the TestDataPyMC obj's underlying member method code with example usage: obj.test_multivariate_observations() without return types