<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def use_contextual_arguments(**kw_only_args_defaults):
 """Decorator function which allows the wrapped function to accept arguments not specified in the call from the context. Arguments whose default value is set to the Required sentinel must be supplied either by the context or the caller and a TypeError is raised if not. .. warning:: Due to a limitation in the Python 2 version of the introspection library, this decorator only works with functions which do not have any keyword-only arguments. For example this function cannot be handled:: def f(*args, kw_only_arg=123) Note, however, that the decorated function *can* accept and pass-on keyword-only arguments specified via `**kw_only_args_defaults`. Parameters Specifies the set of keyword-only arguments (and their default values) accepted by the underlying function. These will be passed via the kwargs to the underlying function, e.g.:: @ContextMixin.use_contextual_arguments(kw_only_arg=123) def f(self, **kwargs):
 kw_only_arg = kwargs.pop("kw_only_arg") # Wrapped function can be called with keyword-only-arguments: spam.f(*[], kw_only_arg=12) Keyword-only arguments can be made mandatory by setting their default value to the Required sentinel. """

        def decorator(f):
            # Extract any positional and positional-and-key-word arguments
            # which may be set.
            arg_names, varargs, keywords, defaults = inspect.getargspec(f)

            # Sanity check: non-keyword-only arguments should't be present in
            # the keyword-only-arguments list.
            assert set(keywords or {}).isdisjoint(set(kw_only_args_defaults))

            # Fully populate the default argument values list, setting the
            # default for mandatory arguments to the 'Required' sentinel.
            if defaults is None:
                defaults = []
            defaults = (([Required] * (len(arg_names) - len(defaults))) +
                        list(defaults))

            # Update the docstring signature to include the specified arguments
            @add_signature_to_docstring(f, kw_only_args=kw_only_args_defaults)
            @functools.wraps(f)
            def f_(self, *args, **kwargs):
                # Construct a dictionary of arguments (and their default
                # values) which may potentially be set by the context. This
                # includes any non-supplied positional arguments and any
                # keyword-only arguments.
                new_kwargs = dict(zip(arg_names[1 + len(args):],
                                      defaults[1 + len(args):]))
                new_kwargs.update(kw_only_args_defaults)

                # Values from the context take priority over default argument
                # values.
                context = self.get_context_arguments()
                for name, val in iteritems(context):
                    if name in new_kwargs:
                        new_kwargs[name] = val

                # Finally, the values actually pased to the function call take
                # ultimate priority.
                new_kwargs.update(kwargs)

                # Raise a TypeError if any `Required` sentinels remain
                for k, v in iteritems(new_kwargs):
                    if v is Required:
                        raise TypeError(
                            "{!s}: missing argument {}".format(f.__name__, k))

                return f(self, *args, **new_kwargs)
            return f_

        return decorator