code: def test_local_lift_DiracDelta():
      c_at = pt.vector()
      dd_at = dirac_delta(c_at)
  
      Z_at = pt.cast(dd_at, "int64")
  
      res = rewrite_graph(
          Z_at,
          custom_rewrite=in2out(local_lift_DiracDelta),
          clone=False,
      )
      assert isinstance(res.owner.op, DiracDelta)
      assert isinstance(res.owner.inputs[0].owner.op, Elemwise)
  
      Z_at = dd_at.dimshuffle("x", 0)
  
      res = rewrite_graph(
          Z_at,
          custom_rewrite=in2out(local_lift_DiracDelta),
          clone=False,
      )
      assert isinstance(res.owner.op, DiracDelta)
      assert isinstance(res.owner.inputs[0].owner.op, DimShuffle)
  
      Z_at = dd_at[0]
  
      res = rewrite_graph(
          Z_at,
          custom_rewrite=in2out(local_lift_DiracDelta),
          clone=False,
      )
      assert isinstance(res.owner.op, DiracDelta)
      assert isinstance(res.owner.inputs[0].owner.op, Subtensor)
  
      # Don't lift multi-output `Op`s
      c_at = pt.matrix()
      dd_at = dirac_delta(c_at)
      Z_at = pt.nlinalg.svd(dd_at)[0]
  
      res = rewrite_graph(
          Z_at,
          custom_rewrite=in2out(local_lift_DiracDelta),
          clone=False,
      )
      assert res is Z_at
  
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 1 for calling a global function with example usage: test_local_lift_DiracDelta() without return types