code: def mixture_model(random_seed=1234):
      """Sample mixture model to use in benchmarks"""
      np.random.seed(1234)
      size = 1000
      w_true = np.array([0.35, 0.4, 0.25])
      mu_true = np.array([0.0, 2.0, 5.0])
      sigma = np.array([0.5, 0.5, 1.0])
      component = np.random.choice(mu_true.size, size=size, p=w_true)
      x = np.random.normal(
          mu_true[component], sigma[component], size=size
      )
  
      with pm.Model() as model:
          w = pm.Dirichlet("w", a=np.ones_like(w_true))
          mu = pm.Normal("mu", mu=0.0, sigma=10.0, shape=w_true.shape)
          enforce_order = pm.Potential(
              "enforce_order",
              pt.switch(mu[0] - mu[1] <= 0, 0.0, -np.inf)
              + pt.switch(mu[1] - mu[2] <= 0, 0.0, -np.inf),
          )
          tau = pm.Gamma("tau", alpha=1.0, beta=1.0, shape=w_true.shape)
          pm.NormalMixture("x_obs", w=w, mu=mu, tau=tau, observed=x)
  
      # Initialization can be poorly specified, this is a hack to make it work
      start = {
          "mu": mu_true.copy(),
          "tau_log__": np.log(1.0 / sigma**2),
          "w_stickbreaking__": np.array([-0.03, 0.44]),
      }
      return model, start
  
imports: import time
  import timeit
  import arviz
  import numpy
  import pandas
  import pytensor
  import pytensor.tensor
  import pymc
label_desc: Use image node_id 2 for calling a global function with example usage: mixture_model(random_seed) and returns: model,  start