def get_compilation_dir(parent_dir: Path, name_hint: str) -> Path:
    for i in itertools.count():
        path = (parent_dir / (name_hint + str(i)))
        path.mkdir(parents=True, exist_ok=True)
        try:
            (path / 'compiling').touch(exist_ok=False)
        except FileExistsError:
            continue
        else:
            atexit.register((path / 'compiling').unlink)
            return path
    assert False
def get_compilation_dir(parent_dir: Path, name_hint: str) -> Path:
    for i in itertools.count():
        path = (parent_dir / (name_hint + str(i)))
        path.mkdir(parents=True, exist_ok=True)
        try:
            (path / 'compiling').touch(exist_ok=False)
        except FileExistsError:
            continue
        else:
            atexit.register((path / 'compiling').unlink)
            return path
    assert False