code: def as_method(self, docstring=""):
          
          method = lambda obj, *args, **kwargs: self(obj, *args, **kwargs)
          if docstring:
              method.__doc__ = docstring
          return method
docs: Converts this action to a function or method.
            An optional docstring may be passed.