def decorator(wrapped_decorator):
  def helper(_func=None, **options):
    def outer_wrapper(func):
      @wrapping(func)
      def inner_wrapper(*args, **kwds):
        return wrapped_decorator(func, args, kwds, **options)
      return inner_wrapper

    if _func is None:
      # Form (2), with options.
      return outer_wrapper

    # Form (1), vanilla.
    if options:
      # Don't allow @decorator(foo, op1=5).
      raise TypeError('positional arguments not supported')
    return outer_wrapper(_func)
  helper.wrapped_decorator = wrapped_decorator
  return helper
This function gets called when a signal in ``self.rate_signals`` is
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/ndb/utils.py/decorator--crossover with--dataset/ETHPy150Open fcurella/django-recommends/recommends/providers/__init__.py/RecommendationProvider.pre_delete