code: def test_custom_likelihood_function():
      df = pd.DataFrame({"y": [1, 2, 3, 4, 5], "x": [1, 1, 2, 2, 3]})
  
      def CustomGaussian(*args, **kwargs):
          return pm.Normal(*args, **kwargs)
  
      sigma_prior = bmb.Prior("HalfNormal", sigma=1)
      likelihood = bmb.Likelihood(
          "CustomGaussian",
          params=["mu", "sigma"],
          parent="mu",
          dist=CustomGaussian,
      )
      family = bmb.Family("custom_gaussian", likelihood, "identity")
      model = bmb.Model(
          "y ~ x", df, family=family, priors={"sigma": sigma_prior}
      )
      _ = model.fit(tune=100, draws=100)
      assert (
          model.backend.model.observed_RVs[0].str_repr()
          == "y ~ Normal(f(Intercept, x), y_sigma)"
      )
  
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 29 for calling a global function with example usage: test_custom_likelihood_function() and returns: pm