def _get_directory_stash(self, path):
        """Stashes a directory.

        Directories are stashed adjacent to their original location if
        possible, or else moved/copied into the user's temp dir."""

        try:
            save_dir = AdjacentTempDirectory(path)
            save_dir.create()
        except OSError:
            save_dir = TempDirectory(kind="uninstall")
            save_dir.create()
        self._save_dirs[os.path.normcase(path)] = save_dir

        return save_dir.path
Stashes a directory.

        Directories are stashed adjacent to their original location if
        possible, or else moved/copied into the user's temp dir.
stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/req/req_uninstall.py