code: def test_prior_shape():
      rng = np.random.default_rng(121195)
      data = pd.DataFrame(
          {
              "score": rng.normal(size=100),
              "q": rng.choice(["1", "2", "3", "4", "5"], size=100),
              "s": rng.choice(["a", "b", "c"], size=100),
              "g": rng.choice(["A", "B", "C"], size=100),
          }
      )
  
      model = bmb.Model("score ~ 0 + q", data)
      assert model.response_component.terms["q"].prior.args[
          "mu"
      ].shape == (5,)
      assert model.response_component.terms["q"].prior.args[
          "sigma"
      ].shape == (5,)
  
      model = bmb.Model("score ~ q", data)
      assert model.response_component.terms["q"].prior.args[
          "mu"
      ].shape == (4,)
      assert model.response_component.terms["q"].prior.args[
          "sigma"
      ].shape == (4,)
  
      model = bmb.Model("score ~ 0 + q:s", data)
      assert model.response_component.terms["q:s"].prior.args[
          "mu"
      ].shape == (15,)
      assert model.response_component.terms["q:s"].prior.args[
          "sigma"
      ].shape == (15,)
  
      # "s" is automatically added to ensure full rank matrix
      model = bmb.Model("score ~ q:s", data)
      assert (
          model.response_component.terms["Intercept"]
          .prior.args["mu"]
          .shape
          == ()
      )
      assert (
          model.response_component.terms["Intercept"]
          .prior.args["sigma"]
          .shape
          == ()
      )
  
      assert model.response_component.terms["s"].prior.args[
          "mu"
      ].shape == (2,)
      assert model.response_component.terms["s"].prior.args[
          "sigma"
      ].shape == (2,)
  
      assert model.response_component.terms["q:s"].prior.args[
          "mu"
      ].shape == (12,)
      assert model.response_component.terms["q:s"].prior.args[
          "sigma"
      ].shape == (12,)
  
imports: from os.path import dirname, join
  import pytest
  import numpy
  import pymc
  import pandas
  from scipy import special
  import bambi
label_desc: Use image node_id 18 for calling a global function with example usage: test_prior_shape() without return types