code: def test_1d_group_specific():
      rng = np.random.default_rng(121195)
      data = pd.DataFrame(
          {
              "y": rng.normal(size=40),
              "x": rng.choice(["A", "B"], size=40),
              "g": ["A", "B", "C", "D"] * 10,
          }
      )
      # Since there's 1|g, there's only one column for x|g
      # We need to ensure x|g is of shape (40,) and not of shape (40, 1)
      # We do so by checking the mean is (40, ) because shape of x|g still returns (40, 1)
      # The difference is that we do .squeeze() on it after creation.
      model = bmb.Model("y ~ (x|g)", data)
      model.build()
      assert model.backend.components["y"].output.shape.eval() == (40,)
  
imports: import logging
  from functools import reduce
  from operator import add
  from os.path import dirname, join
  import arviz
  import numpy
  import pandas
  import pymc
  import pytest
  from formulae import design_matrices
  import bambi
  from bambi.terms import CommonTerm, GroupSpecificTerm
label_desc: Use image node_id 25 for calling a global function with example usage: test_1d_group_specific() without return types