We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
pip un-vendored support is broken
* Pip version: 9.0.1-465-g841f5dfb
* Python version: 2.7.13
* Operating system: Arch Linux x86_64

### What I've run:

```python
> ./.tox/py27-novendor/bin/pip search test
Traceback (most recent call last):
  File "./.tox/py27-novendor/bin/pip", line 7, in <module>
    from pip import main
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/__init__.py", line 46, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/vcs/mercurial.py", line 8, in <module>
    from pip.download import path_to_url
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/download.py", line 28, in <module>
    from pip._vendor.six.moves.urllib.parse import unquote as urllib_unquote
ImportError: No module named parse
```

and after fixing that one:

```python
Traceback (most recent call last):
  File "./.tox/py27-novendor/bin/pip", line 7, in <module>
    from pip import main
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/__init__.py", line 46, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in <module>
    from pip.index import Link
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/index.py", line 39, in <module>
    from pip.wheel import Wheel, wheel_ext
  File ".tox/py27-novendor/lib/python2.7/site-packages/pip/wheel.py", line 21, in <module>
    from pip._vendor import pkg_resources, pytoml
ImportError: cannot import name pytoml
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/pip/_vendor/__init__.py`
Content:
```
1 """
2 pip._vendor is for vendoring dependencies of pip to prevent needing pip to
3 depend on something external.
4 
5 Files inside of pip._vendor should be considered immutable and should only be
6 updated to versions from upstream.
7 """
8 from __future__ import absolute_import
9 
10 import glob
11 import os.path
12 import sys
13 
14 # Downstream redistributors which have debundled our dependencies should also
15 # patch this value to be true. This will trigger the additional patching
16 # to cause things like "six" to be available as pip.
17 DEBUNDLED = False
18 
19 # By default, look in this directory for a bunch of .whl files which we will
20 # add to the beginning of sys.path before attempting to import anything. This
21 # is done to support downstream re-distributors like Debian and Fedora who
22 # wish to create their own Wheels for our dependencies to aid in debundling.
23 WHEEL_DIR = os.path.abspath(os.path.dirname(__file__))
24 
25 
26 # Define a small helper function to alias our vendored modules to the real ones
27 # if the vendored ones do not exist. This idea of this was taken from
28 # https://github.com/kennethreitz/requests/pull/2567.
29 def vendored(modulename):
30     vendored_name = "{0}.{1}".format(__name__, modulename)
31 
32     try:
33         __import__(vendored_name, globals(), locals(), level=0)
34     except ImportError:
35         try:
36             __import__(modulename, globals(), locals(), level=0)
37         except ImportError:
38             # We can just silently allow import failures to pass here. If we
39             # got to this point it means that ``import pip._vendor.whatever``
40             # failed and so did ``import whatever``. Since we're importing this
41             # upfront in an attempt to alias imports, not erroring here will
42             # just mean we get a regular import error whenever pip *actually*
43             # tries to import one of these modules to use it, which actually
44             # gives us a better error message than we would have otherwise
45             # gotten.
46             pass
47         else:
48             sys.modules[vendored_name] = sys.modules[modulename]
49             base, head = vendored_name.rsplit(".", 1)
50             setattr(sys.modules[base], head, sys.modules[modulename])
51 
52 
53 # If we're operating in a debundled setup, then we want to go ahead and trigger
54 # the aliasing of our vendored libraries as well as looking for wheels to add
55 # to our sys.path. This will cause all of this code to be a no-op typically
56 # however downstream redistributors can enable it in a consistent way across
57 # all platforms.
58 if DEBUNDLED:
59     # Actually look inside of WHEEL_DIR to find .whl files and add them to the
60     # front of our sys.path.
61     sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path
62 
63     # Actually alias all of our vendored dependencies.
64     vendored("cachecontrol")
65     vendored("colorama")
66     vendored("distlib")
67     vendored("distro")
68     vendored("html5lib")
69     vendored("lockfile")
70     vendored("six")
71     vendored("six.moves")
72     vendored("six.moves.urllib")
73     vendored("packaging")
74     vendored("packaging.version")
75     vendored("packaging.specifiers")
76     vendored("pkg_resources")
77     vendored("progress")
78     vendored("retrying")
79     vendored("requests")
80     vendored("requests.packages")
81     vendored("requests.packages.urllib3")
82     vendored("requests.packages.urllib3._collections")
83     vendored("requests.packages.urllib3.connection")
84     vendored("requests.packages.urllib3.connectionpool")
85     vendored("requests.packages.urllib3.contrib")
86     vendored("requests.packages.urllib3.contrib.ntlmpool")
87     vendored("requests.packages.urllib3.contrib.pyopenssl")
88     vendored("requests.packages.urllib3.exceptions")
89     vendored("requests.packages.urllib3.fields")
90     vendored("requests.packages.urllib3.filepost")
91     vendored("requests.packages.urllib3.packages")
92     vendored("requests.packages.urllib3.packages.ordered_dict")
93     vendored("requests.packages.urllib3.packages.six")
94     vendored("requests.packages.urllib3.packages.ssl_match_hostname")
95     vendored("requests.packages.urllib3.packages.ssl_match_hostname."
96              "_implementation")
97     vendored("requests.packages.urllib3.poolmanager")
98     vendored("requests.packages.urllib3.request")
99     vendored("requests.packages.urllib3.response")
100     vendored("requests.packages.urllib3.util")
101     vendored("requests.packages.urllib3.util.connection")
102     vendored("requests.packages.urllib3.util.request")
103     vendored("requests.packages.urllib3.util.response")
104     vendored("requests.packages.urllib3.util.retry")
105     vendored("requests.packages.urllib3.util.ssl_")
106     vendored("requests.packages.urllib3.util.timeout")
107     vendored("requests.packages.urllib3.util.url")
108
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/pip/_vendor/__init__.py b/src/pip/_vendor/__init__.py
--- a/src/pip/_vendor/__init__.py
+++ b/src/pip/_vendor/__init__.py
@@ -70,11 +70,13 @@
     vendored("six")
     vendored("six.moves")
     vendored("six.moves.urllib")
+    vendored("six.moves.urllib.parse")
     vendored("packaging")
     vendored("packaging.version")
     vendored("packaging.specifiers")
     vendored("pkg_resources")
     vendored("progress")
+    vendored("pytoml")
     vendored("retrying")
     vendored("requests")
     vendored("requests.packages")

{"golden_diff": "diff --git a/src/pip/_vendor/__init__.py b/src/pip/_vendor/__init__.py\n--- a/src/pip/_vendor/__init__.py\n+++ b/src/pip/_vendor/__init__.py\n@@ -70,11 +70,13 @@\n     vendored(\"six\")\n     vendored(\"six.moves\")\n     vendored(\"six.moves.urllib\")\n+    vendored(\"six.moves.urllib.parse\")\n     vendored(\"packaging\")\n     vendored(\"packaging.version\")\n     vendored(\"packaging.specifiers\")\n     vendored(\"pkg_resources\")\n     vendored(\"progress\")\n+    vendored(\"pytoml\")\n     vendored(\"retrying\")\n     vendored(\"requests\")\n     vendored(\"requests.packages\")\n", "issue": "pip un-vendored support is broken\n* Pip version: 9.0.1-465-g841f5dfb\r\n* Python version: 2.7.13\r\n* Operating system: Arch Linux x86_64\r\n\r\n### What I've run:\r\n\r\n```python\r\n> ./.tox/py27-novendor/bin/pip search test\r\nTraceback (most recent call last):\r\n  File \"./.tox/py27-novendor/bin/pip\", line 7, in <module>\r\n    from pip import main\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/__init__.py\", line 46, in <module>\r\n    from pip.vcs import git, mercurial, subversion, bazaar  # noqa\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/vcs/mercurial.py\", line 8, in <module>\r\n    from pip.download import path_to_url\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/download.py\", line 28, in <module>\r\n    from pip._vendor.six.moves.urllib.parse import unquote as urllib_unquote\r\nImportError: No module named parse\r\n```\r\n\r\nand after fixing that one:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"./.tox/py27-novendor/bin/pip\", line 7, in <module>\r\n    from pip import main\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/__init__.py\", line 46, in <module>\r\n    from pip.vcs import git, mercurial, subversion, bazaar  # noqa\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/vcs/subversion.py\", line 9, in <module>\r\n    from pip.index import Link\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/index.py\", line 39, in <module>\r\n    from pip.wheel import Wheel, wheel_ext\r\n  File \".tox/py27-novendor/lib/python2.7/site-packages/pip/wheel.py\", line 21, in <module>\r\n    from pip._vendor import pkg_resources, pytoml\r\nImportError: cannot import name pytoml\r\n```\r\n\n", "before_files": [{"content": "\"\"\"\npip._vendor is for vendoring dependencies of pip to prevent needing pip to\ndepend on something external.\n\nFiles inside of pip._vendor should be considered immutable and should only be\nupdated to versions from upstream.\n\"\"\"\nfrom __future__ import absolute_import\n\nimport glob\nimport os.path\nimport sys\n\n# Downstream redistributors which have debundled our dependencies should also\n# patch this value to be true. This will trigger the additional patching\n# to cause things like \"six\" to be available as pip.\nDEBUNDLED = False\n\n# By default, look in this directory for a bunch of .whl files which we will\n# add to the beginning of sys.path before attempting to import anything. This\n# is done to support downstream re-distributors like Debian and Fedora who\n# wish to create their own Wheels for our dependencies to aid in debundling.\nWHEEL_DIR = os.path.abspath(os.path.dirname(__file__))\n\n\n# Define a small helper function to alias our vendored modules to the real ones\n# if the vendored ones do not exist. This idea of this was taken from\n# https://github.com/kennethreitz/requests/pull/2567.\ndef vendored(modulename):\n    vendored_name = \"{0}.{1}\".format(__name__, modulename)\n\n    try:\n        __import__(vendored_name, globals(), locals(), level=0)\n    except ImportError:\n        try:\n            __import__(modulename, globals(), locals(), level=0)\n        except ImportError:\n            # We can just silently allow import failures to pass here. If we\n            # got to this point it means that ``import pip._vendor.whatever``\n            # failed and so did ``import whatever``. Since we're importing this\n            # upfront in an attempt to alias imports, not erroring here will\n            # just mean we get a regular import error whenever pip *actually*\n            # tries to import one of these modules to use it, which actually\n            # gives us a better error message than we would have otherwise\n            # gotten.\n            pass\n        else:\n            sys.modules[vendored_name] = sys.modules[modulename]\n            base, head = vendored_name.rsplit(\".\", 1)\n            setattr(sys.modules[base], head, sys.modules[modulename])\n\n\n# If we're operating in a debundled setup, then we want to go ahead and trigger\n# the aliasing of our vendored libraries as well as looking for wheels to add\n# to our sys.path. This will cause all of this code to be a no-op typically\n# however downstream redistributors can enable it in a consistent way across\n# all platforms.\nif DEBUNDLED:\n    # Actually look inside of WHEEL_DIR to find .whl files and add them to the\n    # front of our sys.path.\n    sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, \"*.whl\")) + sys.path\n\n    # Actually alias all of our vendored dependencies.\n    vendored(\"cachecontrol\")\n    vendored(\"colorama\")\n    vendored(\"distlib\")\n    vendored(\"distro\")\n    vendored(\"html5lib\")\n    vendored(\"lockfile\")\n    vendored(\"six\")\n    vendored(\"six.moves\")\n    vendored(\"six.moves.urllib\")\n    vendored(\"packaging\")\n    vendored(\"packaging.version\")\n    vendored(\"packaging.specifiers\")\n    vendored(\"pkg_resources\")\n    vendored(\"progress\")\n    vendored(\"retrying\")\n    vendored(\"requests\")\n    vendored(\"requests.packages\")\n    vendored(\"requests.packages.urllib3\")\n    vendored(\"requests.packages.urllib3._collections\")\n    vendored(\"requests.packages.urllib3.connection\")\n    vendored(\"requests.packages.urllib3.connectionpool\")\n    vendored(\"requests.packages.urllib3.contrib\")\n    vendored(\"requests.packages.urllib3.contrib.ntlmpool\")\n    vendored(\"requests.packages.urllib3.contrib.pyopenssl\")\n    vendored(\"requests.packages.urllib3.exceptions\")\n    vendored(\"requests.packages.urllib3.fields\")\n    vendored(\"requests.packages.urllib3.filepost\")\n    vendored(\"requests.packages.urllib3.packages\")\n    vendored(\"requests.packages.urllib3.packages.ordered_dict\")\n    vendored(\"requests.packages.urllib3.packages.six\")\n    vendored(\"requests.packages.urllib3.packages.ssl_match_hostname\")\n    vendored(\"requests.packages.urllib3.packages.ssl_match_hostname.\"\n             \"_implementation\")\n    vendored(\"requests.packages.urllib3.poolmanager\")\n    vendored(\"requests.packages.urllib3.request\")\n    vendored(\"requests.packages.urllib3.response\")\n    vendored(\"requests.packages.urllib3.util\")\n    vendored(\"requests.packages.urllib3.util.connection\")\n    vendored(\"requests.packages.urllib3.util.request\")\n    vendored(\"requests.packages.urllib3.util.response\")\n    vendored(\"requests.packages.urllib3.util.retry\")\n    vendored(\"requests.packages.urllib3.util.ssl_\")\n    vendored(\"requests.packages.urllib3.util.timeout\")\n    vendored(\"requests.packages.urllib3.util.url\")\n", "path": "src/pip/_vendor/__init__.py"}], "after_files": [{"content": "\"\"\"\npip._vendor is for vendoring dependencies of pip to prevent needing pip to\ndepend on something external.\n\nFiles inside of pip._vendor should be considered immutable and should only be\nupdated to versions from upstream.\n\"\"\"\nfrom __future__ import absolute_import\n\nimport glob\nimport os.path\nimport sys\n\n# Downstream redistributors which have debundled our dependencies should also\n# patch this value to be true. This will trigger the additional patching\n# to cause things like \"six\" to be available as pip.\nDEBUNDLED = False\n\n# By default, look in this directory for a bunch of .whl files which we will\n# add to the beginning of sys.path before attempting to import anything. This\n# is done to support downstream re-distributors like Debian and Fedora who\n# wish to create their own Wheels for our dependencies to aid in debundling.\nWHEEL_DIR = os.path.abspath(os.path.dirname(__file__))\n\n\n# Define a small helper function to alias our vendored modules to the real ones\n# if the vendored ones do not exist. This idea of this was taken from\n# https://github.com/kennethreitz/requests/pull/2567.\ndef vendored(modulename):\n    vendored_name = \"{0}.{1}\".format(__name__, modulename)\n\n    try:\n        __import__(vendored_name, globals(), locals(), level=0)\n    except ImportError:\n        try:\n            __import__(modulename, globals(), locals(), level=0)\n        except ImportError:\n            # We can just silently allow import failures to pass here. If we\n            # got to this point it means that ``import pip._vendor.whatever``\n            # failed and so did ``import whatever``. Since we're importing this\n            # upfront in an attempt to alias imports, not erroring here will\n            # just mean we get a regular import error whenever pip *actually*\n            # tries to import one of these modules to use it, which actually\n            # gives us a better error message than we would have otherwise\n            # gotten.\n            pass\n        else:\n            sys.modules[vendored_name] = sys.modules[modulename]\n            base, head = vendored_name.rsplit(\".\", 1)\n            setattr(sys.modules[base], head, sys.modules[modulename])\n\n\n# If we're operating in a debundled setup, then we want to go ahead and trigger\n# the aliasing of our vendored libraries as well as looking for wheels to add\n# to our sys.path. This will cause all of this code to be a no-op typically\n# however downstream redistributors can enable it in a consistent way across\n# all platforms.\nif DEBUNDLED:\n    # Actually look inside of WHEEL_DIR to find .whl files and add them to the\n    # front of our sys.path.\n    sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, \"*.whl\")) + sys.path\n\n    # Actually alias all of our vendored dependencies.\n    vendored(\"cachecontrol\")\n    vendored(\"colorama\")\n    vendored(\"distlib\")\n    vendored(\"distro\")\n    vendored(\"html5lib\")\n    vendored(\"lockfile\")\n    vendored(\"six\")\n    vendored(\"six.moves\")\n    vendored(\"six.moves.urllib\")\n    vendored(\"six.moves.urllib.parse\")\n    vendored(\"packaging\")\n    vendored(\"packaging.version\")\n    vendored(\"packaging.specifiers\")\n    vendored(\"pkg_resources\")\n    vendored(\"progress\")\n    vendored(\"pytoml\")\n    vendored(\"retrying\")\n    vendored(\"requests\")\n    vendored(\"requests.packages\")\n    vendored(\"requests.packages.urllib3\")\n    vendored(\"requests.packages.urllib3._collections\")\n    vendored(\"requests.packages.urllib3.connection\")\n    vendored(\"requests.packages.urllib3.connectionpool\")\n    vendored(\"requests.packages.urllib3.contrib\")\n    vendored(\"requests.packages.urllib3.contrib.ntlmpool\")\n    vendored(\"requests.packages.urllib3.contrib.pyopenssl\")\n    vendored(\"requests.packages.urllib3.exceptions\")\n    vendored(\"requests.packages.urllib3.fields\")\n    vendored(\"requests.packages.urllib3.filepost\")\n    vendored(\"requests.packages.urllib3.packages\")\n    vendored(\"requests.packages.urllib3.packages.ordered_dict\")\n    vendored(\"requests.packages.urllib3.packages.six\")\n    vendored(\"requests.packages.urllib3.packages.ssl_match_hostname\")\n    vendored(\"requests.packages.urllib3.packages.ssl_match_hostname.\"\n             \"_implementation\")\n    vendored(\"requests.packages.urllib3.poolmanager\")\n    vendored(\"requests.packages.urllib3.request\")\n    vendored(\"requests.packages.urllib3.response\")\n    vendored(\"requests.packages.urllib3.util\")\n    vendored(\"requests.packages.urllib3.util.connection\")\n    vendored(\"requests.packages.urllib3.util.request\")\n    vendored(\"requests.packages.urllib3.util.response\")\n    vendored(\"requests.packages.urllib3.util.retry\")\n    vendored(\"requests.packages.urllib3.util.ssl_\")\n    vendored(\"requests.packages.urllib3.util.timeout\")\n    vendored(\"requests.packages.urllib3.util.url\")\n", "path": "src/pip/_vendor/__init__.py"}]}