def is_selected(context, name, value):
    """
    Return "selected" if current request URL has a matching value for the query parameter.

    Used to add the "selected" attribute to a `<select><option>` based on the URL e.g.

        <option value="member" {% is_selected "role" "member" %}>{% trans "I am a member" %}</option>
    """
    return "selected" if context["request"].GET.get(name) == value else ""