code: def test_joint_logprob_incsubtensor(indices, size):
      """Make sure we can compute a joint log-probability for ``Y[idx] = data`` where ``Y`` is univariate."""
  
      rng = np.random.RandomState(232)
      mu = np.power(10, np.arange(np.prod(size))).reshape(size)
      sigma = 0.001
      data = rng.normal(mu[indices], 1.0)
      y_val = rng.normal(mu, sigma, size=size)
  
      Y_base_rv = pt.random.normal(mu, sigma, size=size)
      Y_rv = pt.set_subtensor(Y_base_rv[indices], data)
      Y_rv.name = "Y"
      y_value_var = Y_rv.clone()
      y_value_var.name = "y"
  
      assert isinstance(
          Y_rv.owner.op,
          (IncSubtensor, AdvancedIncSubtensor, AdvancedIncSubtensor1),
      )
  
      Y_rv_logp = conditional_logp({Y_rv: y_value_var})
      Y_rv_logp_combined = pt.add(*Y_rv_logp.values())
  
      obs_logps = Y_rv_logp_combined.eval({y_value_var: y_val})
  
      y_val_idx = y_val.copy()
      y_val_idx[indices] = data
      exp_obs_logps = sp.norm.logpdf(y_val_idx, mu, sigma)
  
      np.testing.assert_almost_equal(obs_logps, exp_obs_logps)
  
file_path: pymc/tests/logprob/test_rewriting.py
imports: import numpy
  import pytensor.tensor
  import pytest
  import scipy.stats.distributions
  from pytensor.graph import ancestors
  from pytensor.graph.rewriting.basic import in2out
  from pytensor.graph.rewriting.utils import rewrite_graph
  from pytensor.tensor.elemwise import DimShuffle, Elemwise
  from pytensor.tensor.subtensor import AdvancedIncSubtensor, AdvancedIncSubtensor1, IncSubtensor, Subtensor
  from pymc.distributions.transforms import logodds
  from pymc.logprob.basic import conditional_logp
  from pymc.logprob.rewriting import cleanup_ir, local_lift_DiracDelta
  from pymc.logprob.transform_value import TransformedValue, TransformValuesRewrite
  from pymc.logprob.utils import DiracDelta, dirac_delta
label_desc: Use image node_id 4 for calling a global function with example usage: test_joint_logprob_incsubtensor(indices, size) without return types