code: def test_switch_mixture_vector(switch_cond_scalar):
      if switch_cond_scalar:
          switch_cond = pt.scalar("switch_cond", dtype=bool)
      else:
          switch_cond = pt.vector("switch_cond", dtype=bool)
      true_branch = pt.exp(pt.random.normal(size=(4,)))
      false_branch = pt.abs(pt.random.normal(size=(4,)))
  
      switch = pt.switch(switch_cond, true_branch, false_branch)
      switch.name = "switch_mix"
      switch_value = switch.clone()
      switch_logp = logp(switch, switch_value)
  
      if switch_cond_scalar:
          test_switch_cond = np.array(0, dtype=bool)
      else:
          test_switch_cond = np.array([0, 1, 0, 1], dtype=bool)
      test_switch_value = np.linspace(0.1, 2.5, 4)
      np.testing.assert_allclose(
          switch_logp.eval(
              {
                  switch_cond: test_switch_cond,
                  switch_value: test_switch_value,
              }
          ),
          np.where(
              test_switch_cond,
              logp(true_branch, test_switch_value).eval(),
              logp(false_branch, test_switch_value).eval(),
          ),
      )
  
imports: import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  import scipy.stats.distributions
  from pytensor import function
  from pytensor.graph.basic import Variable
  from pytensor.ifelse import ifelse
  from pytensor.tensor.random.basic import CategoricalRV
  from pytensor.tensor.shape import shape_tuple
  from pytensor.tensor.subtensor import AdvancedSubtensor, AdvancedSubtensor1, Subtensor, as_index_constant
  from pymc.logprob.abstract import MeasurableVariable
  from pymc.logprob.basic import conditional_logp, logp
  from pymc.logprob.mixture import MeasurableSwitchMixture, expand_indices
  from pymc.logprob.rewriting import construct_ir_fgraph
  from pymc.logprob.utils import dirac_delta
  from pymc.testing import assert_no_rvs
  from tests.logprob.utils import scipy_logprob
label_desc: Use image node_id 11 for calling a global function with example usage: test_switch_mixture_vector(switch_cond_scalar) without return types