code: def test_no_default_updates(self):
      x = shared(0)
      y = shared(1)
      x.default_update = x + 2
  
      # Test that the default update is taken into account in the right cases
      f1 = pfunc([], [x], no_default_updates=True)
      f1()
      assert x.get_value() == 0
  
      f2 = pfunc([], [x], no_default_updates=[x])
      f2()
      assert x.get_value() == 0
  
      f3 = pfunc([], [x], no_default_updates=[x, y])
      f3()
      assert x.get_value() == 0
  
      f4 = pfunc([], [x], no_default_updates=[y])
      f4()
      assert x.get_value() == 2
  
      f5 = pfunc([], [x], no_default_updates=[])
      f5()
      assert x.get_value() == 4
  
      f5 = pfunc([], [x], no_default_updates=False)
      f5()
      assert x.get_value() == 6
  
      with pytest.raises(TypeError):
          pfunc([], [x], no_default_updates=(x))
      with pytest.raises(TypeError):
          pfunc([], [x], no_default_updates=x)
      with pytest.raises(TypeError):
          pfunc([], [x], no_default_updates="canard")
  
      # Mix explicit updates and no_default_updates
      g1 = pfunc(
          [], [x], updates=[(x, (x - 1))], no_default_updates=True
      )
      g1()
      assert x.get_value() == 5
  
      g2 = pfunc(
          [], [x], updates=[(x, (x - 1))], no_default_updates=[x]
      )
      g2()
      assert x.get_value() == 4
  
      g3 = pfunc(
          [], [x], updates=[(x, (x - 1))], no_default_updates=[x, y]
      )
      g3()
      assert x.get_value() == 3
  
      g4 = pfunc(
          [], [x], updates=[(x, (x - 1))], no_default_updates=[y]
      )
      g4()
      assert x.get_value() == 2
  
      g5 = pfunc([], [x], updates=[(x, (x - 1))], no_default_updates=[])
      g5()
      assert x.get_value() == 1
  
      g5 = pfunc(
          [], [x], updates=[(x, (x - 1))], no_default_updates=False
      )
      g5()
      assert x.get_value() == 0
  
imports: import numpy
  import pytest
  import pytensor.tensor
  from pytensor.compile import UnusedInputError, get_mode
  from pytensor.compile.function import function, pfunc
  from pytensor.compile.function.pfunc import rebuild_collect_shared
  from pytensor.compile.io import In
  from pytensor.compile.sharedvalue import shared
  from pytensor.configdefaults import config
  from pytensor.graph.utils import MissingInputError
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.math import sum
  from pytensor.tensor.type import bscalar, bvector, dmatrices, dmatrix, dscalar, dvector, fscalar, fvector, imatrix, iscalar, ivector, ivectors, lscalar, wvector
  from pytensor.utils import PYTHON_INT_BITWIDTH
label_desc: Use image node_id 21 for calling the TestPfunc obj's underlying member method code with example usage: obj.test_no_default_updates() without return types