Wraps a function call with cache.

        Args:
            func (function): the function to call.
            key (str): the cache key for this call.
            timeout (int): the cache timeout for the key (the
                           unit of this parameter depends on
                           the cache class you use, for example,
                           if you use the classes from werkzeug,
                           then timeout is in seconds.)

        Returns:
            The return value of calling func

def call(self, func, key, timeout=None):
        '''Wraps a function call with cache.

        Args:
            func (function): the function to call.
            key (str): the cache key for this call.
            timeout (int): the cache timeout for the key (the
                           unit of this parameter depends on
                           the cache class you use, for example,
                           if you use the classes from werkzeug,
                           then timeout is in seconds.)

        Returns:
            The return value of calling func
        '''
        result = self.get(key)
        if result == NONE_RESULT:
            return None
        if result is None:
            result = func()
            self.set(
                key,
                result if result is not None else NONE_RESULT,
                timeout
            )
        return result