<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve(var, context):
 """ Resolve the variable, or return the value passed to it in the first place """

    try:
        return var.resolve(context)
    except template.VariableDoesNotExist:
        return var.var