code: def types(**requirements):
      
  
      def predicate(args):
          for name, kind in sorted(requirements.items()):
              assert hasattr(args, name), "missing required argument `%s`" % name
  
              if not isinstance(kind, tuple):
                  kind = (kind,)
  
              if not any(isinstance(getattr(args, name), k) for k in kind):
                  return False
  
          return True
  
      return condition("the types of arguments must be valid", predicate, True)
docs: Specify a precondition based on the types of the function's
      arguments.