def METHOD_NAME(path: Optional[str] = None) -> Iterator[None]:
    if path is None:
        yield
        return
    saved_dir = os.getcwd()
    os.METHOD_NAME(path)
    try:
        yield
    finally:
        os.METHOD_NAME(saved_dir)