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