human
Complete this python program:
def cache_required(func):
assistant
#Here is the Python program you requested.

    """Decorator for ensuring cached data into db.
    If not a synchronize will be launched
    :param func:
    :return:
    """
    def wrapper(self, *args, **kwargs):
        if (not self.has_cached_criterias()):
            log.debug(u'None    cached    data.    Synchronizing...')
            self.synchronize_database()
        return func(self, *args, **kwargs)
    return wrapper