def increment_retry_count(pid_dir, rule):
    path = os.path.join(pid_dir, "%s.retry_count" % rule.name)
    if os.path.exists(path):
        with open(path) as r:
            retry_count = int(r.readlines(1)[0]) + 1
        with open(path, 'w') as w:
            w.write(str(retry_count))
    else:
        with open(path, 'w') as w:
            w.write('1')
dataset/ETHPy150Open chango/inferno/inferno/lib/pid.py/increment_retry_count/original