def METHOD_NAME(fn):
    """
    A decorator for caching the result of a function
    """
    attr_name = '_fcache_' + fn.__name__
    def wrapper(self, *args, **kwargs):
        data = fn(self, *args, **kwargs)
        self.array.close_session()
        if self.hypermetrodomain:
            self.remote_array.close_session()
        return data
    return wrapper