code: def test_2d_response_no_shape():
      """
      This tests whether a model where there's a single linear predictor and a response with
      response.ndim > 1 works well, without Bambi causing any shape problems.
      See https://github.com/bambinos/bambi/pull/629
      Updated https://github.com/bambinos/bambi/pull/632
      """
  
      def fn(name, p, observed, **kwargs):
          y = observed[:, 0].flatten()
          n = observed[:, 1].flatten()
          # It's the users' responsibility to take only the first dim
          kwargs["dims"] = kwargs.get("dims")[0]
          return pm.Binomial(name, p=p, n=n, observed=y, **kwargs)
  
      likelihood = bmb.Likelihood(
          "CustomBinomial", params=["p"], parent="p", dist=fn
      )
      link = bmb.Link("logit")
      family = bmb.Family("custom-binomial", likelihood, link)
  
      data = pd.DataFrame(
          {
              "x": np.array(
                  [
                      1.6907,
                      1.7242,
                      1.7552,
                      1.7842,
                      1.8113,
                      1.8369,
                      1.8610,
                      1.8839,
                  ]
              ),
              "n": np.array([59, 60, 62, 56, 63, 59, 62, 60]),
              "y": np.array([6, 13, 18, 28, 52, 53, 61, 60]),
          }
      )
  
      model = bmb.Model("prop(y, n) ~ x", data, family=family)
      model.fit(draws=10, tune=10)
  
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 36 for calling a global function with example usage: test_2d_response_no_shape() and returns: pm