def optional(run, deco):
    """This is a decorator which applies another decorator only if the
    condition is true."""
    if run:
        return deco
    else:
        def do_nothing(func):
            return func
        return do_nothing