code: def __init__(self, transform: Optional[Transform] = None):
      if transform is not None and not isinstance(transform, Transform):
          raise TypeError(
              f"transform must be None or RVTransform type, got {type(transform)}"
          )
      self.transform = transform
      super().__init__()
  
imports: from copy import copy
  from typing import Dict, Optional, Tuple
  import pytensor
  from pytensor import Variable, shared
  from pytensor.compile import SharedVariable
  from pytensor.graph import Apply, FunctionGraph, Op, node_rewriter
  from pytensor.graph.rewriting.basic import out2in
  from pytensor.scalar import Identity
  from pytensor.tensor.elemwise import Elemwise
  from pytensor.tensor.sharedvar import ScalarSharedVariable
  from pymc.logprob.transforms import Transform
  from pymc.model.core import Model
  from pymc.pytensorf import StringType, find_rng_nodes, toposort_replace
label_desc: Use image node_id 1 to create a new ModelValuedVar object from inherited base classes: ModelVar with example: obj = ModelValuedVar(transform)