def is_context_variable(context, variable_name):
    """
    Returns true if the given variable name is in the template context.

    Usage::

        {% is_context_variable "variable_name" as variable_exists %}
        {% if variable_exists %}
            ...
        {% endif %}

    """
    return variable_name in context