code: def test_switch_mixture_measurable_cond_fails():
      """Test that logprob inference fails when the switch condition is an unvalued measurable variable.
  
      Otherwise, the logp function would have to marginalize over this variable.
  
      NOTE: This could be supported in the future, in which case this test can be removed/adapted
      """
      cond_var = 1 - pt.random.bernoulli(p=0.5)
      true_branch = pt.random.normal()
      false_branch = pt.random.normal()
  
      switch = pt.switch(cond_var, true_branch, false_branch)
      with pytest.raises(
          NotImplementedError,
          match="Logprob method not implemented for",
      ):
          logp(switch, switch.type())
  
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 12 for calling a global function with example usage: test_switch_mixture_measurable_cond_fails() without return types