@register.filter(is_safe=False)<EOL>def to_data_string_with_default(value, arg='<STR_LIT>'):
if isinstance(value, bool):<EOL><INDENT>if value:<EOL><INDENT>return '<STR_LIT:true>'<EOL><DEDENT>return '<STR_LIT:false>'<EOL><DEDENT>return value or arg<EOL>
Given a Python boolean value converts it to string representation so
    we can use it in HTML data attributes. If value is None use given default
    or '' if default is not provided.

    -----       ------
    Value       Output
    -----       ------
    True        "true"
    False       "false"
    None        arg