@contextfilter
def else_filter(ctx, value, prefix=None, suffix=None):
    try:
        value = __resolve_options(ctx, value)

        if not isinstance(value, Option):
            if value:
                return value
            prefix = prefix if prefix is not None else ""
            suffix = suffix if suffix is not None else ""
            return (prefix, suffix) % "%s%s"

        if value.to_cmd() != "":
            return value

        v = value.get()
        prefix = prefix if prefix is not None else value.get_opt()
        suffix = suffix if suffix is not None else ""
        # we add a space between the prefix and the value iff the prefix is
        # not empty and does not end in space and the value is not empty
        space = "" if (prefix == "" or v == "" or prefix[-1] == " ") else " "
        return "%s%s%s%s" % (prefix, space, v, suffix)
    except:
        return value
dataset/ETHPy150Open thasso/pyjip/jip/templates.py/else_filter/swapped operands of `%`