code: def test_non_distributional_model_with_categories(anes):
      model = bmb.Model(
          "vote[clinton] ~ age + age:party_id", anes, family="bernoulli"
      )
      idata = model.fit(tune=100, draws=100)
      model.predict(idata)
      assert list(idata.posterior.coords) == [
          "chain",
          "draw",
          "age:party_id_dim",
          "vote_obs",
      ]
      assert set(idata.posterior.data_vars) == {
          "Intercept",
          "age",
          "age:party_id",
          "vote_mean",
      }
      assert list(idata.posterior["vote_mean"].coords) == [
          "chain",
          "draw",
          "vote_obs",
      ]
      assert list(idata.posterior["age:party_id"].coords) == [
          "chain",
          "draw",
          "age:party_id_dim",
      ]
      assert set(idata.posterior["age:party_id_dim"].values) == {
          "independent",
          "republican",
      }
  
      model.set_alias(
          {
              "age": "β",
              "Intercept": "α",
              "age:party_id": "γ",
              "vote": "y",
          }
      )
      idata = model.fit(tune=100, draws=100)
      model.predict(idata)
      assert list(idata.posterior.coords) == [
          "chain",
          "draw",
          "γ_dim",
          "y_obs",
      ]
      assert set(idata.posterior.data_vars) == {"α", "β", "γ", "y_mean"}
      assert list(idata.posterior["y_mean"].coords) == [
          "chain",
          "draw",
          "y_obs",
      ]
      assert list(idata.posterior["γ"].coords) == [
          "chain",
          "draw",
          "γ_dim",
      ]
      assert set(idata.posterior["γ_dim"].values) == {
          "independent",
          "republican",
      }
  
file_path: bambi/tests/test_aliases.py
imports: import pytest
  import bambi
  import numpy
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: test_non_distributional_model_with_categories(anes) without return types