code: def get_module(function):
      
      @functools.wraps(function)
      def call_wrapper(*args, **kwargs):
          stack = inspect.stack()
          caller_frame_info = stack[1]
          self = caller_frame_info[0].f_locals["self"]
          # not completly sure whether this is necessary
          # see note in Python docs about stack frames
          del stack
          function(self, *args, **kwargs)
      return call_wrapper
docs: Function decorator for retrieving the ``self`` argument from the stack.
  
      Intended for use with callbacks that need access to a modules variables, for example:
  
      .. code:: python
  
          from i3pystatus import Status, get_module
          from i3pystatus.core.command import execute
          status = Status(...)
          # other modules etc.
          @get_module
          def display_ip_verbose(module):
              execute('sh -c "ip addr show dev {dev} | xmessage -file -"'.format(dev=module.interface))
          status.register("network", interface="wlan1", on_leftclick=display_ip_verbose)