code: def test_local_remove_DiracDelta():
      c_at = pt.vector()
      dd_at = dirac_delta(c_at) + dirac_delta(5)
      assert (
          sum(
              isinstance(v.owner.op, DiracDelta)
              for v in ancestors([dd_at])
              if v.owner
          )
          == 2
      )
  
      cleanup_ir([dd_at])
      assert not any(
          isinstance(v.owner.op, DiracDelta)
          for v in ancestors([dd_at])
          if v.owner
      )
  
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 2 for calling a global function with example usage: test_local_remove_DiracDelta() without return types