def exclude_if_local(target_function):
    """A member function of Engine wrapped with this function will not execute if the Engine is in "local" mode."""
    def _wrapper(self, *args, **kwargs):
        if self.is_local:
            return None

        return target_function(self, *args, **kwargs)

    return _wrapper