human
Complete the below
def extends(*args, **kwargs):

    ''''Indicate a function extends an operation.
    Can be used as either::
    @extends
    def index(...):
    pass
    or as::
    @extends(action=\'resize\')
    def _action_resize(...):
    pass'
    '''
 ... Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def decorator(func):
        func.wsgi_extends = (func.__name__, kwargs.get('action'))
        return func
    if args:
        return decorator(*args)
    return decorator