We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
config entry misdisplayed in pip 10 help
* Pip version: 10.0.0.dev0 (94d186b)
* Python version: 3.6
* Operating system: Arch Linux

### Description:

see below

### What I've run:

```
$ pip -h

Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      
          Manage local and global configuration.
  
          Subcommands:
  
          list: List the active configuration (or from the file specified)
          edit: Edit the configuration file in an editor
          get: Get the value associated with name
          set: Set the name=value
          unset: Unset the value associated with name
  
          If none of --user, --global and --venv are passed, a virtual
          environment configuration file is used if one is active and the file
          exists. Otherwise, all modifications happen on the to the user file by
          default.
  
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.

<elided>
```

note how the config entry in the help displays way too much.

--- 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/_internal/commands/configuration.py`
Content:
```
1 import logging
2 import os
3 import subprocess
4 
5 from pip._internal.basecommand import Command
6 from pip._internal.configuration import Configuration, kinds
7 from pip._internal.exceptions import PipError
8 from pip._internal.locations import venv_config_file
9 from pip._internal.status_codes import ERROR, SUCCESS
10 from pip._internal.utils.misc import get_prog
11 
12 logger = logging.getLogger(__name__)
13 
14 
15 class ConfigurationCommand(Command):
16     """Manage local and global configuration."""
17     name = 'config'
18     usage = """
19         %prog [<file-option>] list
20         %prog [<file-option>] [--editor <editor-path>] edit
21 
22         %prog [<file-option>] get name
23         %prog [<file-option>] set name value
24         %prog [<file-option>] unset name
25     """
26 
27     summary = """
28         Manage local and global configuration.
29 
30         Subcommands:
31 
32         list: List the active configuration (or from the file specified)
33         edit: Edit the configuration file in an editor
34         get: Get the value associated with name
35         set: Set the name=value
36         unset: Unset the value associated with name
37 
38         If none of --user, --global and --venv are passed, a virtual
39         environment configuration file is used if one is active and the file
40         exists. Otherwise, all modifications happen on the to the user file by
41         default.
42     """
43 
44     def __init__(self, *args, **kwargs):
45         super(ConfigurationCommand, self).__init__(*args, **kwargs)
46 
47         self.configuration = None
48 
49         self.cmd_opts.add_option(
50             '--editor',
51             dest='editor',
52             action='store',
53             default=None,
54             help=(
55                 'Editor to use to edit the file. Uses VISUAL or EDITOR '
56                 'environment variables if not provided.'
57             )
58         )
59 
60         self.cmd_opts.add_option(
61             '--global',
62             dest='global_file',
63             action='store_true',
64             default=False,
65             help='Use the system-wide configuration file only'
66         )
67 
68         self.cmd_opts.add_option(
69             '--user',
70             dest='user_file',
71             action='store_true',
72             default=False,
73             help='Use the user configuration file only'
74         )
75 
76         self.cmd_opts.add_option(
77             '--venv',
78             dest='venv_file',
79             action='store_true',
80             default=False,
81             help='Use the virtualenv configuration file only'
82         )
83 
84         self.parser.insert_option_group(0, self.cmd_opts)
85 
86     def run(self, options, args):
87         handlers = {
88             "list": self.list_values,
89             "edit": self.open_in_editor,
90             "get": self.get_name,
91             "set": self.set_name_value,
92             "unset": self.unset_name
93         }
94 
95         # Determine action
96         if not args or args[0] not in handlers:
97             logger.error("Need an action ({}) to perform.".format(
98                 ", ".join(sorted(handlers)))
99             )
100             return ERROR
101 
102         action = args[0]
103 
104         # Determine which configuration files are to be loaded
105         #    Depends on whether the command is modifying.
106         try:
107             load_only = self._determine_file(
108                 options, need_value=(action in ["get", "set", "unset", "edit"])
109             )
110         except PipError as e:
111             logger.error(e.args[0])
112             return ERROR
113 
114         # Load a new configuration
115         self.configuration = Configuration(
116             isolated=options.isolated_mode, load_only=load_only
117         )
118         self.configuration.load()
119 
120         # Error handling happens here, not in the action-handlers.
121         try:
122             handlers[action](options, args[1:])
123         except PipError as e:
124             logger.error(e.args[0])
125             return ERROR
126 
127         return SUCCESS
128 
129     def _determine_file(self, options, need_value):
130         file_options = {
131             kinds.USER: options.user_file,
132             kinds.GLOBAL: options.global_file,
133             kinds.VENV: options.venv_file
134         }
135 
136         if sum(file_options.values()) == 0:
137             if not need_value:
138                 return None
139             # Default to user, unless there's a virtualenv file.
140             elif os.path.exists(venv_config_file):
141                 return kinds.VENV
142             else:
143                 return kinds.USER
144         elif sum(file_options.values()) == 1:
145             # There's probably a better expression for this.
146             return [key for key in file_options if file_options[key]][0]
147 
148         raise PipError(
149             "Need exactly one file to operate upon "
150             "(--user, --venv, --global) to perform."
151         )
152 
153     def list_values(self, options, args):
154         self._get_n_args(args, "list", n=0)
155 
156         for key, value in sorted(self.configuration.items()):
157             logger.info("%s=%r", key, value)
158 
159     def get_name(self, options, args):
160         key = self._get_n_args(args, "get [name]", n=1)
161         value = self.configuration.get_value(key)
162 
163         logger.info("%s", value)
164 
165     def set_name_value(self, options, args):
166         key, value = self._get_n_args(args, "set [name] [value]", n=2)
167         self.configuration.set_value(key, value)
168 
169         self._save_configuration()
170 
171     def unset_name(self, options, args):
172         key = self._get_n_args(args, "unset [name]", n=1)
173         self.configuration.unset_value(key)
174 
175         self._save_configuration()
176 
177     def open_in_editor(self, options, args):
178         editor = self._determine_editor(options)
179 
180         fname = self.configuration.get_file_to_edit()
181         if fname is None:
182             raise PipError("Could not determine appropriate file.")
183 
184         try:
185             subprocess.check_call([editor, fname])
186         except subprocess.CalledProcessError as e:
187             raise PipError(
188                 "Editor Subprocess exited with exit code {}"
189                 .format(e.returncode)
190             )
191 
192     def _get_n_args(self, args, example, n):
193         """Helper to make sure the command got the right number of arguments
194         """
195         if len(args) != n:
196             msg = (
197                 'Got unexpected number of arguments, expected {}. '
198                 '(example: "{} config {}")'
199             ).format(n, get_prog(), example)
200             raise PipError(msg)
201 
202         if n == 1:
203             return args[0]
204         else:
205             return args
206 
207     def _save_configuration(self):
208         # We successfully ran a modifying command. Need to save the
209         # configuration.
210         try:
211             self.configuration.save()
212         except Exception:
213             logger.error(
214                 "Unable to save configuration. Please report this as a bug.",
215                 exc_info=1
216             )
217             raise PipError("Internal Error.")
218 
219     def _determine_editor(self, options):
220         if options.editor is not None:
221             return options.editor
222         elif "VISUAL" in os.environ:
223             return os.environ["VISUAL"]
224         elif "EDITOR" in os.environ:
225             return os.environ["EDITOR"]
226         else:
227             raise PipError("Could not determine editor to use.")
228
```
--- 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/_internal/commands/configuration.py b/src/pip/_internal/commands/configuration.py
--- a/src/pip/_internal/commands/configuration.py
+++ b/src/pip/_internal/commands/configuration.py
@@ -13,19 +13,7 @@
 
 
 class ConfigurationCommand(Command):
-    """Manage local and global configuration."""
-    name = 'config'
-    usage = """
-        %prog [<file-option>] list
-        %prog [<file-option>] [--editor <editor-path>] edit
-
-        %prog [<file-option>] get name
-        %prog [<file-option>] set name value
-        %prog [<file-option>] unset name
-    """
-
-    summary = """
-        Manage local and global configuration.
+    """Manage local and global configuration.
 
         Subcommands:
 
@@ -41,6 +29,18 @@
         default.
     """
 
+    name = 'config'
+    usage = """
+        %prog [<file-option>] list
+        %prog [<file-option>] [--editor <editor-path>] edit
+
+        %prog [<file-option>] get name
+        %prog [<file-option>] set name value
+        %prog [<file-option>] unset name
+    """
+
+    summary = "Manage local and global configuration."
+
     def __init__(self, *args, **kwargs):
         super(ConfigurationCommand, self).__init__(*args, **kwargs)

{"golden_diff": "diff --git a/src/pip/_internal/commands/configuration.py b/src/pip/_internal/commands/configuration.py\n--- a/src/pip/_internal/commands/configuration.py\n+++ b/src/pip/_internal/commands/configuration.py\n@@ -13,19 +13,7 @@\n \n \n class ConfigurationCommand(Command):\n-    \"\"\"Manage local and global configuration.\"\"\"\n-    name = 'config'\n-    usage = \"\"\"\n-        %prog [<file-option>] list\n-        %prog [<file-option>] [--editor <editor-path>] edit\n-\n-        %prog [<file-option>] get name\n-        %prog [<file-option>] set name value\n-        %prog [<file-option>] unset name\n-    \"\"\"\n-\n-    summary = \"\"\"\n-        Manage local and global configuration.\n+    \"\"\"Manage local and global configuration.\n \n         Subcommands:\n \n@@ -41,6 +29,18 @@\n         default.\n     \"\"\"\n \n+    name = 'config'\n+    usage = \"\"\"\n+        %prog [<file-option>] list\n+        %prog [<file-option>] [--editor <editor-path>] edit\n+\n+        %prog [<file-option>] get name\n+        %prog [<file-option>] set name value\n+        %prog [<file-option>] unset name\n+    \"\"\"\n+\n+    summary = \"Manage local and global configuration.\"\n+\n     def __init__(self, *args, **kwargs):\n         super(ConfigurationCommand, self).__init__(*args, **kwargs)\n", "issue": "config entry misdisplayed in pip 10 help\n* Pip version: 10.0.0.dev0 (94d186b)\r\n* Python version: 3.6\r\n* Operating system: Arch Linux\r\n\r\n### Description:\r\n\r\nsee below\r\n\r\n### What I've run:\r\n\r\n```\r\n$ pip -h\r\n\r\nUsage:   \r\n  pip <command> [options]\r\n\r\nCommands:\r\n  install                     Install packages.\r\n  download                    Download packages.\r\n  uninstall                   Uninstall packages.\r\n  freeze                      Output installed packages in requirements format.\r\n  list                        List installed packages.\r\n  show                        Show information about installed packages.\r\n  check                       Verify installed packages have compatible dependencies.\r\n  config                      \r\n          Manage local and global configuration.\r\n  \r\n          Subcommands:\r\n  \r\n          list: List the active configuration (or from the file specified)\r\n          edit: Edit the configuration file in an editor\r\n          get: Get the value associated with name\r\n          set: Set the name=value\r\n          unset: Unset the value associated with name\r\n  \r\n          If none of --user, --global and --venv are passed, a virtual\r\n          environment configuration file is used if one is active and the file\r\n          exists. Otherwise, all modifications happen on the to the user file by\r\n          default.\r\n  \r\n  search                      Search PyPI for packages.\r\n  wheel                       Build wheels from your requirements.\r\n  hash                        Compute hashes of package archives.\r\n  completion                  A helper command used for command completion.\r\n  help                        Show help for commands.\r\n\r\n<elided>\r\n```\r\n\r\nnote how the config entry in the help displays way too much.\n", "before_files": [{"content": "import logging\nimport os\nimport subprocess\n\nfrom pip._internal.basecommand import Command\nfrom pip._internal.configuration import Configuration, kinds\nfrom pip._internal.exceptions import PipError\nfrom pip._internal.locations import venv_config_file\nfrom pip._internal.status_codes import ERROR, SUCCESS\nfrom pip._internal.utils.misc import get_prog\n\nlogger = logging.getLogger(__name__)\n\n\nclass ConfigurationCommand(Command):\n    \"\"\"Manage local and global configuration.\"\"\"\n    name = 'config'\n    usage = \"\"\"\n        %prog [<file-option>] list\n        %prog [<file-option>] [--editor <editor-path>] edit\n\n        %prog [<file-option>] get name\n        %prog [<file-option>] set name value\n        %prog [<file-option>] unset name\n    \"\"\"\n\n    summary = \"\"\"\n        Manage local and global configuration.\n\n        Subcommands:\n\n        list: List the active configuration (or from the file specified)\n        edit: Edit the configuration file in an editor\n        get: Get the value associated with name\n        set: Set the name=value\n        unset: Unset the value associated with name\n\n        If none of --user, --global and --venv are passed, a virtual\n        environment configuration file is used if one is active and the file\n        exists. Otherwise, all modifications happen on the to the user file by\n        default.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        super(ConfigurationCommand, self).__init__(*args, **kwargs)\n\n        self.configuration = None\n\n        self.cmd_opts.add_option(\n            '--editor',\n            dest='editor',\n            action='store',\n            default=None,\n            help=(\n                'Editor to use to edit the file. Uses VISUAL or EDITOR '\n                'environment variables if not provided.'\n            )\n        )\n\n        self.cmd_opts.add_option(\n            '--global',\n            dest='global_file',\n            action='store_true',\n            default=False,\n            help='Use the system-wide configuration file only'\n        )\n\n        self.cmd_opts.add_option(\n            '--user',\n            dest='user_file',\n            action='store_true',\n            default=False,\n            help='Use the user configuration file only'\n        )\n\n        self.cmd_opts.add_option(\n            '--venv',\n            dest='venv_file',\n            action='store_true',\n            default=False,\n            help='Use the virtualenv configuration file only'\n        )\n\n        self.parser.insert_option_group(0, self.cmd_opts)\n\n    def run(self, options, args):\n        handlers = {\n            \"list\": self.list_values,\n            \"edit\": self.open_in_editor,\n            \"get\": self.get_name,\n            \"set\": self.set_name_value,\n            \"unset\": self.unset_name\n        }\n\n        # Determine action\n        if not args or args[0] not in handlers:\n            logger.error(\"Need an action ({}) to perform.\".format(\n                \", \".join(sorted(handlers)))\n            )\n            return ERROR\n\n        action = args[0]\n\n        # Determine which configuration files are to be loaded\n        #    Depends on whether the command is modifying.\n        try:\n            load_only = self._determine_file(\n                options, need_value=(action in [\"get\", \"set\", \"unset\", \"edit\"])\n            )\n        except PipError as e:\n            logger.error(e.args[0])\n            return ERROR\n\n        # Load a new configuration\n        self.configuration = Configuration(\n            isolated=options.isolated_mode, load_only=load_only\n        )\n        self.configuration.load()\n\n        # Error handling happens here, not in the action-handlers.\n        try:\n            handlers[action](options, args[1:])\n        except PipError as e:\n            logger.error(e.args[0])\n            return ERROR\n\n        return SUCCESS\n\n    def _determine_file(self, options, need_value):\n        file_options = {\n            kinds.USER: options.user_file,\n            kinds.GLOBAL: options.global_file,\n            kinds.VENV: options.venv_file\n        }\n\n        if sum(file_options.values()) == 0:\n            if not need_value:\n                return None\n            # Default to user, unless there's a virtualenv file.\n            elif os.path.exists(venv_config_file):\n                return kinds.VENV\n            else:\n                return kinds.USER\n        elif sum(file_options.values()) == 1:\n            # There's probably a better expression for this.\n            return [key for key in file_options if file_options[key]][0]\n\n        raise PipError(\n            \"Need exactly one file to operate upon \"\n            \"(--user, --venv, --global) to perform.\"\n        )\n\n    def list_values(self, options, args):\n        self._get_n_args(args, \"list\", n=0)\n\n        for key, value in sorted(self.configuration.items()):\n            logger.info(\"%s=%r\", key, value)\n\n    def get_name(self, options, args):\n        key = self._get_n_args(args, \"get [name]\", n=1)\n        value = self.configuration.get_value(key)\n\n        logger.info(\"%s\", value)\n\n    def set_name_value(self, options, args):\n        key, value = self._get_n_args(args, \"set [name] [value]\", n=2)\n        self.configuration.set_value(key, value)\n\n        self._save_configuration()\n\n    def unset_name(self, options, args):\n        key = self._get_n_args(args, \"unset [name]\", n=1)\n        self.configuration.unset_value(key)\n\n        self._save_configuration()\n\n    def open_in_editor(self, options, args):\n        editor = self._determine_editor(options)\n\n        fname = self.configuration.get_file_to_edit()\n        if fname is None:\n            raise PipError(\"Could not determine appropriate file.\")\n\n        try:\n            subprocess.check_call([editor, fname])\n        except subprocess.CalledProcessError as e:\n            raise PipError(\n                \"Editor Subprocess exited with exit code {}\"\n                .format(e.returncode)\n            )\n\n    def _get_n_args(self, args, example, n):\n        \"\"\"Helper to make sure the command got the right number of arguments\n        \"\"\"\n        if len(args) != n:\n            msg = (\n                'Got unexpected number of arguments, expected {}. '\n                '(example: \"{} config {}\")'\n            ).format(n, get_prog(), example)\n            raise PipError(msg)\n\n        if n == 1:\n            return args[0]\n        else:\n            return args\n\n    def _save_configuration(self):\n        # We successfully ran a modifying command. Need to save the\n        # configuration.\n        try:\n            self.configuration.save()\n        except Exception:\n            logger.error(\n                \"Unable to save configuration. Please report this as a bug.\",\n                exc_info=1\n            )\n            raise PipError(\"Internal Error.\")\n\n    def _determine_editor(self, options):\n        if options.editor is not None:\n            return options.editor\n        elif \"VISUAL\" in os.environ:\n            return os.environ[\"VISUAL\"]\n        elif \"EDITOR\" in os.environ:\n            return os.environ[\"EDITOR\"]\n        else:\n            raise PipError(\"Could not determine editor to use.\")\n", "path": "src/pip/_internal/commands/configuration.py"}], "after_files": [{"content": "import logging\nimport os\nimport subprocess\n\nfrom pip._internal.basecommand import Command\nfrom pip._internal.configuration import Configuration, kinds\nfrom pip._internal.exceptions import PipError\nfrom pip._internal.locations import venv_config_file\nfrom pip._internal.status_codes import ERROR, SUCCESS\nfrom pip._internal.utils.misc import get_prog\n\nlogger = logging.getLogger(__name__)\n\n\nclass ConfigurationCommand(Command):\n    \"\"\"Manage local and global configuration.\n\n        Subcommands:\n\n        list: List the active configuration (or from the file specified)\n        edit: Edit the configuration file in an editor\n        get: Get the value associated with name\n        set: Set the name=value\n        unset: Unset the value associated with name\n\n        If none of --user, --global and --venv are passed, a virtual\n        environment configuration file is used if one is active and the file\n        exists. Otherwise, all modifications happen on the to the user file by\n        default.\n    \"\"\"\n\n    name = 'config'\n    usage = \"\"\"\n        %prog [<file-option>] list\n        %prog [<file-option>] [--editor <editor-path>] edit\n\n        %prog [<file-option>] get name\n        %prog [<file-option>] set name value\n        %prog [<file-option>] unset name\n    \"\"\"\n\n    summary = \"Manage local and global configuration.\"\n\n    def __init__(self, *args, **kwargs):\n        super(ConfigurationCommand, self).__init__(*args, **kwargs)\n\n        self.configuration = None\n\n        self.cmd_opts.add_option(\n            '--editor',\n            dest='editor',\n            action='store',\n            default=None,\n            help=(\n                'Editor to use to edit the file. Uses VISUAL or EDITOR '\n                'environment variables if not provided.'\n            )\n        )\n\n        self.cmd_opts.add_option(\n            '--global',\n            dest='global_file',\n            action='store_true',\n            default=False,\n            help='Use the system-wide configuration file only'\n        )\n\n        self.cmd_opts.add_option(\n            '--user',\n            dest='user_file',\n            action='store_true',\n            default=False,\n            help='Use the user configuration file only'\n        )\n\n        self.cmd_opts.add_option(\n            '--venv',\n            dest='venv_file',\n            action='store_true',\n            default=False,\n            help='Use the virtualenv configuration file only'\n        )\n\n        self.parser.insert_option_group(0, self.cmd_opts)\n\n    def run(self, options, args):\n        handlers = {\n            \"list\": self.list_values,\n            \"edit\": self.open_in_editor,\n            \"get\": self.get_name,\n            \"set\": self.set_name_value,\n            \"unset\": self.unset_name\n        }\n\n        # Determine action\n        if not args or args[0] not in handlers:\n            logger.error(\"Need an action ({}) to perform.\".format(\n                \", \".join(sorted(handlers)))\n            )\n            return ERROR\n\n        action = args[0]\n\n        # Determine which configuration files are to be loaded\n        #    Depends on whether the command is modifying.\n        try:\n            load_only = self._determine_file(\n                options, need_value=(action in [\"get\", \"set\", \"unset\", \"edit\"])\n            )\n        except PipError as e:\n            logger.error(e.args[0])\n            return ERROR\n\n        # Load a new configuration\n        self.configuration = Configuration(\n            isolated=options.isolated_mode, load_only=load_only\n        )\n        self.configuration.load()\n\n        # Error handling happens here, not in the action-handlers.\n        try:\n            handlers[action](options, args[1:])\n        except PipError as e:\n            logger.error(e.args[0])\n            return ERROR\n\n        return SUCCESS\n\n    def _determine_file(self, options, need_value):\n        file_options = {\n            kinds.USER: options.user_file,\n            kinds.GLOBAL: options.global_file,\n            kinds.VENV: options.venv_file\n        }\n\n        if sum(file_options.values()) == 0:\n            if not need_value:\n                return None\n            # Default to user, unless there's a virtualenv file.\n            elif os.path.exists(venv_config_file):\n                return kinds.VENV\n            else:\n                return kinds.USER\n        elif sum(file_options.values()) == 1:\n            # There's probably a better expression for this.\n            return [key for key in file_options if file_options[key]][0]\n\n        raise PipError(\n            \"Need exactly one file to operate upon \"\n            \"(--user, --venv, --global) to perform.\"\n        )\n\n    def list_values(self, options, args):\n        self._get_n_args(args, \"list\", n=0)\n\n        for key, value in sorted(self.configuration.items()):\n            logger.info(\"%s=%r\", key, value)\n\n    def get_name(self, options, args):\n        key = self._get_n_args(args, \"get [name]\", n=1)\n        value = self.configuration.get_value(key)\n\n        logger.info(\"%s\", value)\n\n    def set_name_value(self, options, args):\n        key, value = self._get_n_args(args, \"set [name] [value]\", n=2)\n        self.configuration.set_value(key, value)\n\n        self._save_configuration()\n\n    def unset_name(self, options, args):\n        key = self._get_n_args(args, \"unset [name]\", n=1)\n        self.configuration.unset_value(key)\n\n        self._save_configuration()\n\n    def open_in_editor(self, options, args):\n        editor = self._determine_editor(options)\n\n        fname = self.configuration.get_file_to_edit()\n        if fname is None:\n            raise PipError(\"Could not determine appropriate file.\")\n\n        try:\n            subprocess.check_call([editor, fname])\n        except subprocess.CalledProcessError as e:\n            raise PipError(\n                \"Editor Subprocess exited with exit code {}\"\n                .format(e.returncode)\n            )\n\n    def _get_n_args(self, args, example, n):\n        \"\"\"Helper to make sure the command got the right number of arguments\n        \"\"\"\n        if len(args) != n:\n            msg = (\n                'Got unexpected number of arguments, expected {}. '\n                '(example: \"{} config {}\")'\n            ).format(n, get_prog(), example)\n            raise PipError(msg)\n\n        if n == 1:\n            return args[0]\n        else:\n            return args\n\n    def _save_configuration(self):\n        # We successfully ran a modifying command. Need to save the\n        # configuration.\n        try:\n            self.configuration.save()\n        except Exception:\n            logger.error(\n                \"Unable to save configuration. Please report this as a bug.\",\n                exc_info=1\n            )\n            raise PipError(\"Internal Error.\")\n\n    def _determine_editor(self, options):\n        if options.editor is not None:\n            return options.editor\n        elif \"VISUAL\" in os.environ:\n            return os.environ[\"VISUAL\"]\n        elif \"EDITOR\" in os.environ:\n            return os.environ[\"EDITOR\"]\n        else:\n            raise PipError(\"Could not determine editor to use.\")\n", "path": "src/pip/_internal/commands/configuration.py"}]}