code: def validate(**kwargs):
      
      def decorator(func):
          _VALIDATORS[kwargs.pop('name', func.__name__)] = func
          return func
  
      return decorator
docs: Defines a decorator to register a validator with a name for look-up.
  
      If name is not provided we use function name as name of the validator.