def METHOD_NAME(self, *args, **kwargs):
    if background_by_default:
        if not hasattr(self, "_nplab_background_action_threads"):
            self._nplab_background_action_threads = set([])
        t = threading.Thread()
        def worker_function():
            t.returned_value = function(self, *args, **kwargs)
            self._nplab_background_action_threads.remove(t)
        t.run=worker_function
        t.host_object = self
        self._nplab_background_action_threads.add(t)
        t.start()
        def join_and_return_result(self): #this gets added to a thread so we can extract the return value
            self.join()
            return self.returned_value
        t.join_and_return_result = functools.partial(join_and_return_result, t) #add method to the thread
        return t
    else:
        return function(self, *args, **kwargs)