code: def test_to_idata(self, data, eight_schools_params, chains, draws):
      inference_data = self.get_inference_data(
          data, eight_schools_params
      )
      test_dict = {
          "posterior": ["mu", "tau", "eta", "theta"],
          "sample_stats": ["diverging", "lp", "~log_likelihood"],
          "log_likelihood": ["obs"],
          "posterior_predictive": ["obs"],
          "prior": ["mu", "tau", "eta", "theta"],
          "prior_predictive": ["obs"],
          "observed_data": ["obs"],
      }
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails
      chains = inference_data.posterior.sizes["chain"]
      draws = inference_data.posterior.sizes["draw"]
      obs = inference_data.observed_data["obs"]
      assert (
          inference_data.log_likelihood["obs"].shape
          == (chains, draws) + obs.shape
      )
  
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 5 for calling the TestDataPyMC obj's underlying member method code with example usage: obj.test_to_idata(data, eight_schools_params, chains, draws) without return types