docstr: Test constant_data group behaviour.
docstr_tok: ["Test","constant_data","group","behaviour","."]
code: def test_constant_data(self, use_context):
      """Test constant_data group behaviour."""
      with pm.Model() as model:
          x = pm.ConstantData("x", [1.0, 2.0, 3.0])
          y = pm.MutableData("y", [1.0, 2.0, 3.0])
          beta_sigma = pm.MutableData("beta_sigma", 1)
          beta = pm.Normal("beta", 0, beta_sigma)
          obs = pm.Normal("obs", x * beta, 1, observed=y)
          trace = pm.sample(
              100, chains=2, tune=100, return_inferencedata=False
          )
          if use_context:
              inference_data = to_inference_data(
                  trace=trace, log_likelihood=True
              )
  
      if not use_context:
          inference_data = to_inference_data(
              trace=trace, model=model, log_likelihood=True
          )
      test_dict = {
          "posterior": ["beta"],
          "observed_data": ["obs"],
          "constant_data": ["x", "y", "beta_sigma"],
      }
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails
      assert inference_data.log_likelihood["obs"].shape == (2, 100, 3)
      # test that scalars are dimensionless in constant_data (issue #6755)
      assert inference_data.constant_data["beta_sigma"].ndim == 0
  
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 17 for calling the TestDataPyMC obj's underlying member method code with example usage: obj.test_constant_data(use_context) without return types