def recentize_hots(hot_recalc_threshold = timedelta(hours = 1), hot_point_window = None, hot_eligible_age = None):

    count = 0
    def call_hot_average():
        if hot_point_window:
            calc_hot_average(hot_point_window)
        else:
            calc_hot_average()

    def get_hot_avg_time():
        hot_avg_timestamp = None

        try:
            hot_avg_timestamp = general.get_key_from_stat('hot_avg_timestamp', type = 'datetime')
        except sqlalchemy.orm.exc.NoResultFound:
            call_hot_average()

        if type(hot_avg_timestamp) == dict:
            return hot_avg_timestamp['value']
        else:
            return None

    hot_avg_timestamp = None

    while hot_avg_timestamp == None and count < 5:
        hot_avg_timestamp = get_hot_avg_time()
        count += 1

    if count >= 5:
        print("\t-----WARNING WARNING WARNING-----\n\tSomething has gone tragically wrong with the hotness: AVG.\n\t-----WARNING WARNING WARNING-----")

    hot_avg_timestamp = hot_avg_timestamp.replace(tzinfo=pytz.utc)

    if hot_avg_timestamp < (general.now_in_utc() - hot_recalc_threshold):
        call_hot_average()

    count = 0

    def call_all_hot_window_scores():
        if hot_eligible_age:
            calc_all_hot_window_scores(hot_eligible_age)
        else:
            calc_all_hot_window_scores()

    def get_mass_time():
        mass_timestamp = None

        try:
            mass_timestamp = general.get_key_from_stat('mass_hot_window_timestamp', type = 'datetime')
        except sqlalchemy.orm.exc.NoResultFound:
            call_all_hot_window_scores()

        if type(mass_timestamp) == dict:
            return mass_timestamp['value']
        else:
            return None

    mass_timestamp = None

    while mass_timestamp == None and count < 5:
        mass_timestamp = get_mass_time()
        count += 1

    if count >= 5:
        print("\t-----WARNING WARNING WARNING-----\n\tSomething has gone tragically wrong with the hotness: MASS.\n\t-----WARNING WARNING WARNING-----")

    mass_timestamp = mass_timestamp.replace(tzinfo=pytz.utc)

    if mass_timestamp < (general.now_in_utc() - hot_recalc_threshold):
        call_all_hot_window_scores()

    return 0
The property os_arch
dataset/ETHPy150Open sjuxax/raggregate/raggregate/queries/hotness.py/recentize_hots--crossover with--dataset/ETHPy150Open redhat-imaging/imagefactory/imgfac/Template.py/Template.os_arch