We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Branch `master` is failing
<!-- commit 9134634f43bc858a32b4d6a9c3edf352e2f58873@master -->
Trying to build `master` at commit 9134634f43bc858a32b4d6a9c3edf352e2f58873 failed.
More info at: https://travis-ci.com/Qiskit/qiskit-terra/jobs/253757284

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `qiskit/tools/monitor/backend_overview.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 # This code is part of Qiskit.
4 #
5 # (C) Copyright IBM 2017, 2018.
6 #
7 # This code is licensed under the Apache License, Version 2.0. You may
8 # obtain a copy of this license in the LICENSE.txt file in the root directory
9 # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
10 #
11 # Any modifications or derivative works of this code must retain this
12 # copyright notice, and modified files need to carry a notice indicating
13 # that they have been altered from the originals.
14 # pylint: disable=invalid-name
15 
16 """ A module for viewing the details of all available devices.
17 """
18 
19 import math
20 from qiskit.exceptions import QiskitError
21 
22 try:
23     # pylint: disable=import-error,no-name-in-module
24     from qiskit.providers.ibmq import IBMQ, IBMQBackend
25 except ImportError:
26     pass
27 
28 
29 def get_unique_backends():
30     """Gets the unique backends that are available.
31 
32     Returns:
33         list: Unique available backends.
34 
35     Raises:
36         QiskitError: No backends available.
37     """
38     backends = []
39     for provider in IBMQ.providers():
40         for backend in provider.backends():
41             backends.append(backend)
42     unique_hardware_backends = []
43     unique_names = []
44     for back in backends:
45         if back.name() not in unique_names and not back.configuration().simulator:
46             unique_hardware_backends.append(back)
47             unique_names.append(back.name())
48     if not unique_hardware_backends:
49         raise QiskitError('No backends available.')
50     return unique_hardware_backends
51 
52 
53 def backend_monitor(backend):
54     """Monitor a single IBMQ backend.
55 
56     Args:
57         backend (IBMQBackend): Backend to monitor.
58     Raises:
59         QiskitError: Input is not a IBMQ backend.
60     """
61     if not isinstance(backend, IBMQBackend):
62         raise QiskitError('Input variable is not of type IBMQBackend.')
63     config = backend.configuration().to_dict()
64     status = backend.status().to_dict()
65     config_dict = {**status, **config}
66     if not config['simulator']:
67         props = backend.properties().to_dict()
68 
69     print(backend.name())
70     print('='*len(backend.name()))
71     print('Configuration')
72     print('-'*13)
73     offset = '    '
74 
75     upper_list = ['n_qubits', 'operational',
76                   'status_msg', 'pending_jobs',
77                   'backend_version', 'basis_gates',
78                   'local', 'simulator']
79 
80     lower_list = list(set(config_dict.keys()).difference(upper_list))
81     # Remove gates because they are in a different tab
82     lower_list.remove('gates')
83     for item in upper_list+lower_list:
84         print(offset+item+':', config_dict[item])
85 
86     # Stop here if simulator
87     if config['simulator']:
88         return
89 
90     print()
91     qubit_header = 'Qubits [Name / Freq / T1 / T2 / U1 err / U2 err / U3 err / Readout err]'
92     print(qubit_header)
93     print('-'*len(qubit_header))
94 
95     sep = ' / '
96     for qub in range(len(props['qubits'])):
97         name = 'Q%s' % qub
98         qubit_data = props['qubits'][qub]
99         gate_data = [g for g in props['gates'] if g['qubits'] == [qub]]
100         t1_info = qubit_data[0]
101         t2_info = qubit_data[1]
102         freq_info = qubit_data[2]
103         readout_info = qubit_data[3]
104 
105         freq = str(round(freq_info['value'], 5))+' '+freq_info['unit']
106         T1 = str(round(t1_info['value'],
107                        5))+' ' + t1_info['unit']
108         T2 = str(round(t2_info['value'],
109                        5))+' ' + t2_info['unit']
110         for gd in gate_data:
111             if gd['gate'] == 'u1':
112                 U1 = str(round(gd['parameters'][0]['value'], 5))
113                 break
114 
115         for gd in gate_data:
116             if gd['gate'] == 'u2':
117                 U2 = str(round(gd['parameters'][0]['value'], 5))
118                 break
119         for gd in gate_data:
120             if gd['gate'] == 'u3':
121                 U3 = str(round(gd['parameters'][0]['value'], 5))
122                 break
123 
124         readout_error = str(round(readout_info['value'], 5))
125 
126         qstr = sep.join([name, freq, T1, T2, U1, U2, U3, readout_error])
127         print(offset+qstr)
128 
129     print()
130     multi_qubit_gates = [g for g in props['gates'] if len(g['qubits']) > 1]
131     multi_header = 'Multi-Qubit Gates [Name / Type / Gate Error]'
132     print(multi_header)
133     print('-'*len(multi_header))
134 
135     for qub, gate in enumerate(multi_qubit_gates):
136         gate = multi_qubit_gates[qub]
137         qubits = gate['qubits']
138         ttype = gate['gate']
139         error = round(gate['parameters'][0]['value'], 5)
140         mstr = sep.join(["{}{}_{}".format(ttype, qubits[0], qubits[1]), ttype, str(error)])
141         print(offset+mstr)
142 
143 
144 def backend_overview():
145     """Gives overview information on all the IBMQ
146     backends that are available.
147     """
148     unique_hardware_backends = get_unique_backends()
149     _backends = []
150     # Sort backends by operational or not
151     for idx, back in enumerate(unique_hardware_backends):
152         if back.status().operational:
153             _backends = [back] + _backends
154         else:
155             _backends = _backends + [back]
156 
157     stati = [back.status() for back in _backends]
158     idx = list(range(len(_backends)))
159     pending = [s.pending_jobs for s in stati]
160     _, least_idx = zip(*sorted(zip(pending, idx)))
161 
162     # Make sure least pending is operational
163     for ind in least_idx:
164         if stati[ind].operational:
165             least_pending_idx = ind
166             break
167 
168     num_rows = math.ceil(len(_backends)/3)
169 
170     count = 0
171     num_backends = len(_backends)
172     for _ in range(num_rows):
173         max_len = 0
174         str_list = ['']*8
175         for idx in range(3):
176             offset = ' ' * 10 if idx else ''
177             config = _backends[count].configuration().to_dict()
178             props = _backends[count].properties().to_dict()
179             n_qubits = config['n_qubits']
180             str_list[0] += (' '*(max_len-len(str_list[0]))+offset)
181             str_list[0] += _backends[count].name()
182 
183             str_list[1] += (' '*(max_len-len(str_list[1]))+offset)
184             str_list[1] += '-'*len(_backends[count].name())
185 
186             str_list[2] += (' '*(max_len-len(str_list[2]))+offset)
187             str_list[2] += 'Num. Qubits:  %s' % config['n_qubits']
188 
189             str_list[3] += (' '*(max_len-len(str_list[3]))+offset)
190             str_list[3] += 'Pending Jobs: %s' % stati[count].pending_jobs
191 
192             str_list[4] += (' '*(max_len-len(str_list[4]))+offset)
193             str_list[4] += 'Least busy:   %s' % (count == least_pending_idx)
194 
195             str_list[5] += (' '*(max_len-len(str_list[5]))+offset)
196             str_list[5] += 'Operational:  %s' % stati[count].operational
197 
198             str_list[6] += (' '*(max_len-len(str_list[6]))+offset)
199             str_list[6] += 'Avg. T1:      %s' % round(sum([q[0]['value']
200                                                            for q in props['qubits']])/n_qubits, 1)
201             str_list[7] += (' '*(max_len-len(str_list[7]))+offset)
202             str_list[7] += 'Avg. T2:      %s' % round(sum([q[1]['value']
203                                                            for q in props['qubits']])/n_qubits, 1)
204             count += 1
205             if count == num_backends:
206                 break
207             max_len = max([len(s) for s in str_list])
208 
209         print("\n".join(str_list))
210         print('\n'*2)
211
```
--- 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/qiskit/tools/monitor/backend_overview.py b/qiskit/tools/monitor/backend_overview.py
--- a/qiskit/tools/monitor/backend_overview.py
+++ b/qiskit/tools/monitor/backend_overview.py
@@ -19,12 +19,6 @@
 import math
 from qiskit.exceptions import QiskitError
 
-try:
-    # pylint: disable=import-error,no-name-in-module
-    from qiskit.providers.ibmq import IBMQ, IBMQBackend
-except ImportError:
-    pass
-
 
 def get_unique_backends():
     """Gets the unique backends that are available.
@@ -34,7 +28,14 @@
 
     Raises:
         QiskitError: No backends available.
+        ImportError: If qiskit-ibmq-provider is not installed
     """
+    try:
+        from qiskit.providers.ibmq import IBMQ
+    except ImportError:
+        raise ImportError("The IBMQ provider is necessary for this function "
+                          " to work. Please ensure it's installed before "
+                          "using this function")
     backends = []
     for provider in IBMQ.providers():
         for backend in provider.backends():
@@ -57,7 +58,16 @@
         backend (IBMQBackend): Backend to monitor.
     Raises:
         QiskitError: Input is not a IBMQ backend.
+        ImportError: If qiskit-ibmq-provider is not installed
     """
+    try:
+        # pylint: disable=import-error,no-name-in-module
+        from qiskit.providers.ibmq import IBMQBackend
+    except ImportError:
+        raise ImportError("The IBMQ provider is necessary for this function "
+                          " to work. Please ensure it's installed before "
+                          "using this function")
+
     if not isinstance(backend, IBMQBackend):
         raise QiskitError('Input variable is not of type IBMQBackend.')
     config = backend.configuration().to_dict()

{"golden_diff": "diff --git a/qiskit/tools/monitor/backend_overview.py b/qiskit/tools/monitor/backend_overview.py\n--- a/qiskit/tools/monitor/backend_overview.py\n+++ b/qiskit/tools/monitor/backend_overview.py\n@@ -19,12 +19,6 @@\n import math\n from qiskit.exceptions import QiskitError\n \n-try:\n-    # pylint: disable=import-error,no-name-in-module\n-    from qiskit.providers.ibmq import IBMQ, IBMQBackend\n-except ImportError:\n-    pass\n-\n \n def get_unique_backends():\n     \"\"\"Gets the unique backends that are available.\n@@ -34,7 +28,14 @@\n \n     Raises:\n         QiskitError: No backends available.\n+        ImportError: If qiskit-ibmq-provider is not installed\n     \"\"\"\n+    try:\n+        from qiskit.providers.ibmq import IBMQ\n+    except ImportError:\n+        raise ImportError(\"The IBMQ provider is necessary for this function \"\n+                          \" to work. Please ensure it's installed before \"\n+                          \"using this function\")\n     backends = []\n     for provider in IBMQ.providers():\n         for backend in provider.backends():\n@@ -57,7 +58,16 @@\n         backend (IBMQBackend): Backend to monitor.\n     Raises:\n         QiskitError: Input is not a IBMQ backend.\n+        ImportError: If qiskit-ibmq-provider is not installed\n     \"\"\"\n+    try:\n+        # pylint: disable=import-error,no-name-in-module\n+        from qiskit.providers.ibmq import IBMQBackend\n+    except ImportError:\n+        raise ImportError(\"The IBMQ provider is necessary for this function \"\n+                          \" to work. Please ensure it's installed before \"\n+                          \"using this function\")\n+\n     if not isinstance(backend, IBMQBackend):\n         raise QiskitError('Input variable is not of type IBMQBackend.')\n     config = backend.configuration().to_dict()\n", "issue": "Branch `master` is failing\n<!-- commit 9134634f43bc858a32b4d6a9c3edf352e2f58873@master -->\nTrying to build `master` at commit 9134634f43bc858a32b4d6a9c3edf352e2f58873 failed.\nMore info at: https://travis-ci.com/Qiskit/qiskit-terra/jobs/253757284\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2018.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or derivative works of this code must retain this\n# copyright notice, and modified files need to carry a notice indicating\n# that they have been altered from the originals.\n# pylint: disable=invalid-name\n\n\"\"\" A module for viewing the details of all available devices.\n\"\"\"\n\nimport math\nfrom qiskit.exceptions import QiskitError\n\ntry:\n    # pylint: disable=import-error,no-name-in-module\n    from qiskit.providers.ibmq import IBMQ, IBMQBackend\nexcept ImportError:\n    pass\n\n\ndef get_unique_backends():\n    \"\"\"Gets the unique backends that are available.\n\n    Returns:\n        list: Unique available backends.\n\n    Raises:\n        QiskitError: No backends available.\n    \"\"\"\n    backends = []\n    for provider in IBMQ.providers():\n        for backend in provider.backends():\n            backends.append(backend)\n    unique_hardware_backends = []\n    unique_names = []\n    for back in backends:\n        if back.name() not in unique_names and not back.configuration().simulator:\n            unique_hardware_backends.append(back)\n            unique_names.append(back.name())\n    if not unique_hardware_backends:\n        raise QiskitError('No backends available.')\n    return unique_hardware_backends\n\n\ndef backend_monitor(backend):\n    \"\"\"Monitor a single IBMQ backend.\n\n    Args:\n        backend (IBMQBackend): Backend to monitor.\n    Raises:\n        QiskitError: Input is not a IBMQ backend.\n    \"\"\"\n    if not isinstance(backend, IBMQBackend):\n        raise QiskitError('Input variable is not of type IBMQBackend.')\n    config = backend.configuration().to_dict()\n    status = backend.status().to_dict()\n    config_dict = {**status, **config}\n    if not config['simulator']:\n        props = backend.properties().to_dict()\n\n    print(backend.name())\n    print('='*len(backend.name()))\n    print('Configuration')\n    print('-'*13)\n    offset = '    '\n\n    upper_list = ['n_qubits', 'operational',\n                  'status_msg', 'pending_jobs',\n                  'backend_version', 'basis_gates',\n                  'local', 'simulator']\n\n    lower_list = list(set(config_dict.keys()).difference(upper_list))\n    # Remove gates because they are in a different tab\n    lower_list.remove('gates')\n    for item in upper_list+lower_list:\n        print(offset+item+':', config_dict[item])\n\n    # Stop here if simulator\n    if config['simulator']:\n        return\n\n    print()\n    qubit_header = 'Qubits [Name / Freq / T1 / T2 / U1 err / U2 err / U3 err / Readout err]'\n    print(qubit_header)\n    print('-'*len(qubit_header))\n\n    sep = ' / '\n    for qub in range(len(props['qubits'])):\n        name = 'Q%s' % qub\n        qubit_data = props['qubits'][qub]\n        gate_data = [g for g in props['gates'] if g['qubits'] == [qub]]\n        t1_info = qubit_data[0]\n        t2_info = qubit_data[1]\n        freq_info = qubit_data[2]\n        readout_info = qubit_data[3]\n\n        freq = str(round(freq_info['value'], 5))+' '+freq_info['unit']\n        T1 = str(round(t1_info['value'],\n                       5))+' ' + t1_info['unit']\n        T2 = str(round(t2_info['value'],\n                       5))+' ' + t2_info['unit']\n        for gd in gate_data:\n            if gd['gate'] == 'u1':\n                U1 = str(round(gd['parameters'][0]['value'], 5))\n                break\n\n        for gd in gate_data:\n            if gd['gate'] == 'u2':\n                U2 = str(round(gd['parameters'][0]['value'], 5))\n                break\n        for gd in gate_data:\n            if gd['gate'] == 'u3':\n                U3 = str(round(gd['parameters'][0]['value'], 5))\n                break\n\n        readout_error = str(round(readout_info['value'], 5))\n\n        qstr = sep.join([name, freq, T1, T2, U1, U2, U3, readout_error])\n        print(offset+qstr)\n\n    print()\n    multi_qubit_gates = [g for g in props['gates'] if len(g['qubits']) > 1]\n    multi_header = 'Multi-Qubit Gates [Name / Type / Gate Error]'\n    print(multi_header)\n    print('-'*len(multi_header))\n\n    for qub, gate in enumerate(multi_qubit_gates):\n        gate = multi_qubit_gates[qub]\n        qubits = gate['qubits']\n        ttype = gate['gate']\n        error = round(gate['parameters'][0]['value'], 5)\n        mstr = sep.join([\"{}{}_{}\".format(ttype, qubits[0], qubits[1]), ttype, str(error)])\n        print(offset+mstr)\n\n\ndef backend_overview():\n    \"\"\"Gives overview information on all the IBMQ\n    backends that are available.\n    \"\"\"\n    unique_hardware_backends = get_unique_backends()\n    _backends = []\n    # Sort backends by operational or not\n    for idx, back in enumerate(unique_hardware_backends):\n        if back.status().operational:\n            _backends = [back] + _backends\n        else:\n            _backends = _backends + [back]\n\n    stati = [back.status() for back in _backends]\n    idx = list(range(len(_backends)))\n    pending = [s.pending_jobs for s in stati]\n    _, least_idx = zip(*sorted(zip(pending, idx)))\n\n    # Make sure least pending is operational\n    for ind in least_idx:\n        if stati[ind].operational:\n            least_pending_idx = ind\n            break\n\n    num_rows = math.ceil(len(_backends)/3)\n\n    count = 0\n    num_backends = len(_backends)\n    for _ in range(num_rows):\n        max_len = 0\n        str_list = ['']*8\n        for idx in range(3):\n            offset = ' ' * 10 if idx else ''\n            config = _backends[count].configuration().to_dict()\n            props = _backends[count].properties().to_dict()\n            n_qubits = config['n_qubits']\n            str_list[0] += (' '*(max_len-len(str_list[0]))+offset)\n            str_list[0] += _backends[count].name()\n\n            str_list[1] += (' '*(max_len-len(str_list[1]))+offset)\n            str_list[1] += '-'*len(_backends[count].name())\n\n            str_list[2] += (' '*(max_len-len(str_list[2]))+offset)\n            str_list[2] += 'Num. Qubits:  %s' % config['n_qubits']\n\n            str_list[3] += (' '*(max_len-len(str_list[3]))+offset)\n            str_list[3] += 'Pending Jobs: %s' % stati[count].pending_jobs\n\n            str_list[4] += (' '*(max_len-len(str_list[4]))+offset)\n            str_list[4] += 'Least busy:   %s' % (count == least_pending_idx)\n\n            str_list[5] += (' '*(max_len-len(str_list[5]))+offset)\n            str_list[5] += 'Operational:  %s' % stati[count].operational\n\n            str_list[6] += (' '*(max_len-len(str_list[6]))+offset)\n            str_list[6] += 'Avg. T1:      %s' % round(sum([q[0]['value']\n                                                           for q in props['qubits']])/n_qubits, 1)\n            str_list[7] += (' '*(max_len-len(str_list[7]))+offset)\n            str_list[7] += 'Avg. T2:      %s' % round(sum([q[1]['value']\n                                                           for q in props['qubits']])/n_qubits, 1)\n            count += 1\n            if count == num_backends:\n                break\n            max_len = max([len(s) for s in str_list])\n\n        print(\"\\n\".join(str_list))\n        print('\\n'*2)\n", "path": "qiskit/tools/monitor/backend_overview.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2018.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or derivative works of this code must retain this\n# copyright notice, and modified files need to carry a notice indicating\n# that they have been altered from the originals.\n# pylint: disable=invalid-name\n\n\"\"\" A module for viewing the details of all available devices.\n\"\"\"\n\nimport math\nfrom qiskit.exceptions import QiskitError\n\n\ndef get_unique_backends():\n    \"\"\"Gets the unique backends that are available.\n\n    Returns:\n        list: Unique available backends.\n\n    Raises:\n        QiskitError: No backends available.\n        ImportError: If qiskit-ibmq-provider is not installed\n    \"\"\"\n    try:\n        from qiskit.providers.ibmq import IBMQ\n    except ImportError:\n        raise ImportError(\"The IBMQ provider is necessary for this function \"\n                          \" to work. Please ensure it's installed before \"\n                          \"using this function\")\n    backends = []\n    for provider in IBMQ.providers():\n        for backend in provider.backends():\n            backends.append(backend)\n    unique_hardware_backends = []\n    unique_names = []\n    for back in backends:\n        if back.name() not in unique_names and not back.configuration().simulator:\n            unique_hardware_backends.append(back)\n            unique_names.append(back.name())\n    if not unique_hardware_backends:\n        raise QiskitError('No backends available.')\n    return unique_hardware_backends\n\n\ndef backend_monitor(backend):\n    \"\"\"Monitor a single IBMQ backend.\n\n    Args:\n        backend (IBMQBackend): Backend to monitor.\n    Raises:\n        QiskitError: Input is not a IBMQ backend.\n        ImportError: If qiskit-ibmq-provider is not installed\n    \"\"\"\n    try:\n        # pylint: disable=import-error,no-name-in-module\n        from qiskit.providers.ibmq import IBMQBackend\n    except ImportError:\n        raise ImportError(\"The IBMQ provider is necessary for this function \"\n                          \" to work. Please ensure it's installed before \"\n                          \"using this function\")\n\n    if not isinstance(backend, IBMQBackend):\n        raise QiskitError('Input variable is not of type IBMQBackend.')\n    config = backend.configuration().to_dict()\n    status = backend.status().to_dict()\n    config_dict = {**status, **config}\n    if not config['simulator']:\n        props = backend.properties().to_dict()\n\n    print(backend.name())\n    print('='*len(backend.name()))\n    print('Configuration')\n    print('-'*13)\n    offset = '    '\n\n    upper_list = ['n_qubits', 'operational',\n                  'status_msg', 'pending_jobs',\n                  'backend_version', 'basis_gates',\n                  'local', 'simulator']\n\n    lower_list = list(set(config_dict.keys()).difference(upper_list))\n    # Remove gates because they are in a different tab\n    lower_list.remove('gates')\n    for item in upper_list+lower_list:\n        print(offset+item+':', config_dict[item])\n\n    # Stop here if simulator\n    if config['simulator']:\n        return\n\n    print()\n    qubit_header = 'Qubits [Name / Freq / T1 / T2 / U1 err / U2 err / U3 err / Readout err]'\n    print(qubit_header)\n    print('-'*len(qubit_header))\n\n    sep = ' / '\n    for qub in range(len(props['qubits'])):\n        name = 'Q%s' % qub\n        qubit_data = props['qubits'][qub]\n        gate_data = [g for g in props['gates'] if g['qubits'] == [qub]]\n        t1_info = qubit_data[0]\n        t2_info = qubit_data[1]\n        freq_info = qubit_data[2]\n        readout_info = qubit_data[3]\n\n        freq = str(round(freq_info['value'], 5))+' '+freq_info['unit']\n        T1 = str(round(t1_info['value'],\n                       5))+' ' + t1_info['unit']\n        T2 = str(round(t2_info['value'],\n                       5))+' ' + t2_info['unit']\n        for gd in gate_data:\n            if gd['gate'] == 'u1':\n                U1 = str(round(gd['parameters'][0]['value'], 5))\n                break\n\n        for gd in gate_data:\n            if gd['gate'] == 'u2':\n                U2 = str(round(gd['parameters'][0]['value'], 5))\n                break\n        for gd in gate_data:\n            if gd['gate'] == 'u3':\n                U3 = str(round(gd['parameters'][0]['value'], 5))\n                break\n\n        readout_error = str(round(readout_info['value'], 5))\n\n        qstr = sep.join([name, freq, T1, T2, U1, U2, U3, readout_error])\n        print(offset+qstr)\n\n    print()\n    multi_qubit_gates = [g for g in props['gates'] if len(g['qubits']) > 1]\n    multi_header = 'Multi-Qubit Gates [Name / Type / Gate Error]'\n    print(multi_header)\n    print('-'*len(multi_header))\n\n    for qub, gate in enumerate(multi_qubit_gates):\n        gate = multi_qubit_gates[qub]\n        qubits = gate['qubits']\n        ttype = gate['gate']\n        error = round(gate['parameters'][0]['value'], 5)\n        mstr = sep.join([\"{}{}_{}\".format(ttype, qubits[0], qubits[1]), ttype, str(error)])\n        print(offset+mstr)\n\n\ndef backend_overview():\n    \"\"\"Gives overview information on all the IBMQ\n    backends that are available.\n    \"\"\"\n    unique_hardware_backends = get_unique_backends()\n    _backends = []\n    # Sort backends by operational or not\n    for idx, back in enumerate(unique_hardware_backends):\n        if back.status().operational:\n            _backends = [back] + _backends\n        else:\n            _backends = _backends + [back]\n\n    stati = [back.status() for back in _backends]\n    idx = list(range(len(_backends)))\n    pending = [s.pending_jobs for s in stati]\n    _, least_idx = zip(*sorted(zip(pending, idx)))\n\n    # Make sure least pending is operational\n    for ind in least_idx:\n        if stati[ind].operational:\n            least_pending_idx = ind\n            break\n\n    num_rows = math.ceil(len(_backends)/3)\n\n    count = 0\n    num_backends = len(_backends)\n    for _ in range(num_rows):\n        max_len = 0\n        str_list = ['']*8\n        for idx in range(3):\n            offset = ' ' * 10 if idx else ''\n            config = _backends[count].configuration().to_dict()\n            props = _backends[count].properties().to_dict()\n            n_qubits = config['n_qubits']\n            str_list[0] += (' '*(max_len-len(str_list[0]))+offset)\n            str_list[0] += _backends[count].name()\n\n            str_list[1] += (' '*(max_len-len(str_list[1]))+offset)\n            str_list[1] += '-'*len(_backends[count].name())\n\n            str_list[2] += (' '*(max_len-len(str_list[2]))+offset)\n            str_list[2] += 'Num. Qubits:  %s' % config['n_qubits']\n\n            str_list[3] += (' '*(max_len-len(str_list[3]))+offset)\n            str_list[3] += 'Pending Jobs: %s' % stati[count].pending_jobs\n\n            str_list[4] += (' '*(max_len-len(str_list[4]))+offset)\n            str_list[4] += 'Least busy:   %s' % (count == least_pending_idx)\n\n            str_list[5] += (' '*(max_len-len(str_list[5]))+offset)\n            str_list[5] += 'Operational:  %s' % stati[count].operational\n\n            str_list[6] += (' '*(max_len-len(str_list[6]))+offset)\n            str_list[6] += 'Avg. T1:      %s' % round(sum([q[0]['value']\n                                                           for q in props['qubits']])/n_qubits, 1)\n            str_list[7] += (' '*(max_len-len(str_list[7]))+offset)\n            str_list[7] += 'Avg. T2:      %s' % round(sum([q[1]['value']\n                                                           for q in props['qubits']])/n_qubits, 1)\n            count += 1\n            if count == num_backends:\n                break\n            max_len = max([len(s) for s in str_list])\n\n        print(\"\\n\".join(str_list))\n        print('\\n'*2)\n", "path": "qiskit/tools/monitor/backend_overview.py"}]}