<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_function(parser, token):
 """ Performs a defined function on the passed arguments. Normally this returns the output of the function into the template. If the second to last argument is ``as``, the result of the function is stored in the context and is named whatever the last argument is. Syntax:: Examples:: {% search '^(\d{3})$' 800 as match %} {% map sha1 hello world %} """

    name, args, kwargs = get_signature(token, True, True)
    return FunctionNode(parser, name, *args, **kwargs)