@register.filter<EOL>def mod(value, arg):
try:<EOL><INDENT>nvalue, narg = handle_float_decimal_combinations(<EOL>valid_numeric(value), valid_numeric(arg), '<STR_LIT:%>')<EOL>return nvalue % narg<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>try:<EOL><INDENT>return value % arg<EOL><DEDENT>except Exception:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT><DEDENT>
Return the modulo value.