code: def guarded(meth):
      
  
      @functools.wraps(meth)
      def _check(self, *args, **kwargs):
          self._check_conn_validity(meth.__name__)
          return meth(self, *args, **kwargs)
  
      return _check
docs: A decorator to add a sanity check to ConnectionResource methods.