This depends on cogent. Can we substitute it by `shutil.rmtree`?