human
Complete this python program:
def if_notifications_enabled(f):
assistant
#Here is the Python code you requested.

    """Calls decorated method only if versioned notifications are enabled.
    """
    @functools.wraps(f)
    def wrapped(*args, **kwargs):
        if (NOTIFIER.is_enabled() and (CONF.notifications.notification_format in ('both', 'versioned'))):
            return f(*args, **kwargs)
        else:
            return None
    return wrapped