code: def decorator(target):
      
  
      def decorate(fn):
          spec = inspect.getargspec(fn)
          names = tuple(spec[0]) + spec[1:3] + (fn.__name__,)
          targ_name, fn_name = unique_symbols(names, 'target', 'fn')
  
          metadata = dict(target=targ_name, fn=fn_name)
          metadata.update(format_argspec_plus(spec, grouped=False))
  
          code = 'lambda %(args)s: %(target)s(%(fn)s, %(apply_kw)s)' % (
                  metadata)
          decorated = eval(code, {targ_name: target, fn_name: fn})
          decorated.__defaults__ = getattr(fn, 'im_func', fn).__defaults__
          return update_wrapper(decorated, fn)
      return update_wrapper(decorate, target)
docs: A signature-matching decorator factory.