def METHOD_NAME(*sub_keys):
    """This decorator marks the following function as a deferred variable. It
    can optionally be given sub_keys for the variable as positional
    arguments.
    :param list(str) sub_keys: The variable sub-keys.
    """
    # The deferred variable class expects a list.
    sub_keys = list(sub_keys)
    # You can use this decorator without arguments. In that case it will
    # still get a first argument that is the function to decorate.
    given_func = None
    if sub_keys and callable(sub_keys[0]):
        given_func = sub_keys[0]
    # This is the actual decorator that will be used.
    def _dfr_var(func):
        # The scheduler plugin class will search for these.
        # pylint: disable=W0212
        func._is_var_method = True
        func._is_deferable = True
        @wraps(func)
        def defer(self):
            """Return a deferred variable if we aren't on a node."""
            if self._deferred:
                return DeferredVariable()
            else:
                value = func(self)
                norm_val = normalize_value(value)
                if norm_val is None:
                    raise ValueError(
                        "Invalid variable value returned by {}: {}."
                        .format(func.__name__, value))
                return norm_val
        return defer
    if given_func is not None:
        return _dfr_var(given_func)
    else:
        return _dfr_var