code: def conditioned_vars(varnames):
      """Decorator for validating attrs that are conditioned on."""
  
      def gp_wrapper(cls):
          def make_getter(name):
              def getter(self):
                  value = getattr(self, name, None)
                  if value is None:
                      raise AttributeError(
                          "'{}' not set.  Provide as argument "
                          "to condition, or call 'prior' "
                          "first".format(name.lstrip("_"))
                      )
                  else:
                      return value
                  return getattr(self, name)
  
              return getter
  
          def make_setter(name):
              def setter(self, val):
                  setattr(self, name, val)
  
              return setter
  
          for name in varnames:
              getter = make_getter("_" + name)
              setter = make_setter("_" + name)
              setattr(cls, name, property(getter, setter))
          return cls
  
      return gp_wrapper
  
file_path: pymc/pymc/gp/util.py
imports: import warnings
  import numpy
  import pytensor.tensor
  from pytensor.compile import SharedVariable
  from pytensor.graph import ancestors
  from pytensor.tensor.variable import TensorConstant
  from scipy.cluster.vq import kmeans
  from pymc.distributions.distribution import Distribution
  from pymc.model import modelcontext
  from pymc.pytensorf import compile_pymc
label_desc: Use image node_id 4 for calling a global function with example usage: conditioned_vars(varnames) and returns: gp_wrapper, cls, getter, setter, getattr, value