code: def truth(f):
      
  
      @wraps(f)
      def check(v):
          t = f(v)
          if not t:
              raise ValueError
          return v
  
      return check
docs: Convenience decorator to convert truth functions into validators.
  
          >>> @truth
          ... def isdir(v):
          ...   return os.path.isdir(v)
          >>> validate = Schema(isdir)
          >>> validate('/')
          '/'
          >>> with raises(MultipleInvalid, 'not a valid value'):
          ...   validate('/notavaliddir')