def max_retry(count):
    """
    Set the maximum number of time a task can be retried before being disabled
    as per Luigi retry policy.
    """
    def wrapper(cls):
        cls.retry_count = count
        return cls
    return wrapper