code: def inject(self, func, **kwargs):
          
          args, varargs, keywords, defaults = self._get_argspec(func)
          if defaults:
              required_args = args[:-len(defaults)]
              optional_args = args[len(required_args):]
          else:
              required_args = args
              optional_args = []
          values = [
              kwargs[arg] if arg in kwargs else self[arg]
              for arg in required_args
          ]
          if defaults:
              values.extend(
                  kwargs[arg] if arg in kwargs else self.get(arg, default)
                  for arg, default in zip(optional_args, defaults)
              )
          return func(*values)
docs: Inject arguments from context into a callable.
  
          :param func: The callable to inject arguments into.
          :param \*\*kwargs: Specify values to override context items.