def should_run(pid_dir, rule):
    last_run = Datefile(pid_dir, "%s.last_run" % rule.name)
    if not os.path.exists(get_pid_path(pid_dir, rule)):
        if last_run.is_older_than(rule.time_delta):
            return True
        elif rule.retry:
            if os.path.exists(os.path.join(pid_dir, "%s.next_retry" % rule.name)):
                next_retry = Datefile(pid_dir, "%s.next_retry" % rule.name)
                now = datetime.utcnow()
                if now > datetime.strptime(str(next_retry), '%Y-%m-%d %H:%M:%S'):
                    return True
    log.debug('Skipping job: %s (last: %s)', rule.name, last_run)
    return False
dataset/ETHPy150Open chango/inferno/inferno/lib/pid.py/should_run/original