def patch_transformer_repo_path(new_folder):
    """
    Temporarily patches the variables defines in `check_copies` to use a different location for the repo.
    """
    old_repo_path = check_copies.REPO_PATH
    old_doc_path = check_copies.PATH_TO_DOCS
    old_transformer_path = check_copies.TRANSFORMERS_PATH
    repo_path = Path(new_folder).resolve()
    check_copies.REPO_PATH = str(repo_path)
    check_copies.PATH_TO_DOCS = str(repo_path / "docs" / "source" / "en")
    check_copies.TRANSFORMERS_PATH = str(repo_path / "src" / "transformers")
    try:
        yield
    finally:
        check_copies.REPO_PATH = old_repo_path
        check_copies.PATH_TO_DOCS = old_doc_path
        check_copies.TRANSFORMERS_PATH = old_transformer_path

    Temporarily patches the variables defines in `check_copies` to use a different location for the repo.
    
dpkd/transformers/tests/repo_utils/test_check_copies.py