code: def change_truncated_size(op, dist, new_size, expand):
      *rv_inputs, lower, upper, rng = dist.owner.inputs
      # Recreate the original untruncated RV
      untruncated_rv = op.base_rv_op.make_node(
          rng, *rv_inputs
      ).default_output()
      if expand:
          new_size = to_tuple(new_size) + tuple(dist.shape)
  
      return Truncated.rv_op(
          untruncated_rv,
          lower=lower,
          upper=upper,
          size=new_size,
          max_n_steps=op.max_n_steps,
      )
  
imports: from functools import singledispatch
  import numpy
  import pytensor
  import pytensor.tensor
  from pytensor import scan
  from pytensor.graph import Op
  from pytensor.graph.basic import Node
  from pytensor.raise_op import CheckAndRaise
  from pytensor.scan import until
  from pytensor.tensor import TensorConstant, TensorVariable
  from pytensor.tensor.random.basic import NormalRV
  from pytensor.tensor.random.op import RandomVariable
  from pymc.distributions.continuous import TruncatedNormal, bounded_cont_transform
  from pymc.distributions.dist_math import check_parameters
  from pymc.distributions.distribution import Distribution, SymbolicRandomVariable, _moment, moment
  from pymc.distributions.shape_utils import _change_dist_size, change_dist_size, to_tuple
  from pymc.distributions.transforms import _default_transform
  from pymc.exceptions import TruncationError
  from pymc.logprob.abstract import _logcdf, _logprob
  from pymc.logprob.basic import icdf, logcdf
  from pymc.math import logdiffexp
  from pymc.util import check_dist_not_registered
label_desc: Use image node_id 2 for calling a global function with example usage: change_truncated_size(op, dist, new_size, expand) and returns: Truncated