def METHOD_NAME(context=None):
    """Return True if systemd is in offline mode
    .. versionadded:: 3004
    """
    contextkey = "salt.utils.systemd.offline"
    if isinstance(context, (dict, salt.loader.context.NamedLoaderContext)):
        if contextkey in context:
            return context[contextkey]
    elif context is not None:
        raise SaltInvocationError("context must be a dictionary if passed")
    # Note that there is a difference from SYSTEMD_OFFLINE=1.  Here we
    # assume that there is no PID 1 to talk with.
    ret = not booted(context) and salt.utils.path.which("systemctl")
    try:
        context[contextkey] = ret
    except TypeError:
        pass
    return ret