def METHOD_NAME(self, owner=None):
    """
    returns the first available module (starting from the end of the list)
    :param owner: (string): name of the module that is reserving the
    resource leave None if the gui shouldn't be disabled. If no
    available module left, returns None.
    To make sure the module will be freed afterwards, use the context
    manager construct:
    with pyrpl.mod_mag.pop('owner') as mod:
        mod.do_something()
    # module automatically freed at this point
    """
    n = len(self.all_modules)
    for index in range(n):
        index = n - index - 1 # count backwards to reserve last module 1st
        if not index in self._reserved_modules:
            module = self.all_modules[index]
            if module.owner is None:
                module.owner = owner # this changes the module's visibility
                return module
    raise InsufficientResourceError('No more ' + self.name + ' left.')