def extends(*args, **kwargs):
 def decorator(func):
  func.wsgi_extends = (func.__name__, kwargs.get('action'))
  return func
 if args:
  return decorator(*args)
 return decorator

def extends ( * args , ** kwargs ) : def decorator ( func ) : func . wsgi_extends = ( func . __name__ , kwargs . get ( 'action' ) ) return func if args : return decorator ( * args ) return decorator
indicate a function extends an operation .