def backup_dir(dir, ext='.bak'):
    n = 1
    extension = ext
    while os.path.exists(dir + extension):
        n += 1
        extension = ext + str(n)
    return dir + extension
Figure out the name of a directory to back up the given dir to
dataset/ETHPy150Open anzev/hedwig/build/pip/pip/utils/__init__.py/backup_dir