We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
No module named 'vcr': requirement is missing (vcrpy) 
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: 0.10.1
- **Python version**: 3.7.3
- **Operating system**: windows 10

### What is the current behavior?
Fresh qiskit installation inside a new environment on windows 10. 
In one of the terra tutorial (using_the_transpiler) `from qiskit.test.mock import FakeTokyo` is failing 'ModuleNotFoundError: No module named vcr'

### Suggested solutions
'pip install vcrpy' 
'vcrpy' needs to be added in requirements.


--- 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/util.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # This code is part of Qiskit.
3 #
4 # (C) Copyright IBM 2017.
5 #
6 # This code is licensed under the Apache License, Version 2.0. You may
7 # obtain a copy of this license in the LICENSE.txt file in the root directory
8 # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
9 #
10 # Any modifications or derivative works of this code must retain this
11 # copyright notice, and modified files need to carry a notice indicating
12 # that they have been altered from the originals.
13 
14 """Common utilities for Qiskit."""
15 
16 import platform
17 import re
18 import socket
19 import sys
20 import warnings
21 
22 import psutil
23 from marshmallow.warnings import ChangedInMarshmallow3Warning
24 
25 
26 def _check_python_version():
27     """Check for Python version 3.5+."""
28     if sys.version_info < (3, 5):
29         raise Exception('Qiskit requires Python version 3.5 or greater.')
30 
31 
32 def _filter_deprecation_warnings():
33     """Apply filters to deprecation warnings.
34 
35     Force the `DeprecationWarning` warnings to be displayed for the qiskit
36     module, overriding the system configuration as they are ignored by default
37     [1] for end-users. Additionally, silence the `ChangedInMarshmallow3Warning`
38     messages.
39 
40     TODO: on Python 3.7, this might not be needed due to PEP-0565 [2].
41 
42     [1] https://docs.python.org/3/library/warnings.html#default-warning-filters
43     [2] https://www.python.org/dev/peps/pep-0565/
44     """
45     deprecation_filter = ('always', None, DeprecationWarning,
46                           re.compile(r'^qiskit\.*', re.UNICODE), 0)
47 
48     # Instead of using warnings.simple_filter() directly, the internal
49     # _add_filter() function is used for being able to match against the
50     # module.
51     try:
52         warnings._add_filter(*deprecation_filter, append=False)
53     except AttributeError:
54         # ._add_filter is internal and not available in some Python versions.
55         pass
56 
57     # Add a filter for ignoring ChangedInMarshmallow3Warning, as we depend on
58     # marhsmallow 2 explicitly. 2.17.0 introduced new deprecation warnings that
59     # are useful for eventually migrating, but too verbose for our purposes.
60     warnings.simplefilter('ignore', category=ChangedInMarshmallow3Warning)
61 
62 
63 _check_python_version()
64 _filter_deprecation_warnings()
65 
66 
67 def local_hardware_info():
68     """Basic hardware information about the local machine.
69 
70     Gives actual number of CPU's in the machine, even when hyperthreading is
71     turned on. CPU count defaults to 1 when true count can't be determined.
72 
73     Returns:
74         dict: The hardware information.
75     """
76     results = {
77         'os': platform.system(),
78         'memory': psutil.virtual_memory().total / (1024 ** 3),
79         'cpus': psutil.cpu_count(logical=False) or 1
80     }
81     return results
82 
83 
84 def _has_connection(hostname, port):
85     """Checks if internet connection exists to host via specified port.
86 
87     If any exception is raised while trying to open a socket this will return
88     false.
89 
90     Args:
91         hostname (str): Hostname to connect to.
92         port (int): Port to connect to
93 
94     Returns:
95         bool: Has connection or not
96 
97     """
98     try:
99         host = socket.gethostbyname(hostname)
100         socket.create_connection((host, port), 2)
101         return True
102     except Exception:  # pylint: disable=broad-except
103         return False
104
```
--- 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/util.py b/qiskit/util.py
--- a/qiskit/util.py
+++ b/qiskit/util.py
@@ -97,7 +97,7 @@
     """
     try:
         host = socket.gethostbyname(hostname)
-        socket.create_connection((host, port), 2)
+        socket.create_connection((host, port), 2).close()
         return True
     except Exception:  # pylint: disable=broad-except
         return False

{"golden_diff": "diff --git a/qiskit/util.py b/qiskit/util.py\n--- a/qiskit/util.py\n+++ b/qiskit/util.py\n@@ -97,7 +97,7 @@\n     \"\"\"\n     try:\n         host = socket.gethostbyname(hostname)\n-        socket.create_connection((host, port), 2)\n+        socket.create_connection((host, port), 2).close()\n         return True\n     except Exception:  # pylint: disable=broad-except\n         return False\n", "issue": "No module named 'vcr': requirement is missing (vcrpy) \n<!-- \u26a0\ufe0f If you do not respect this template, your issue will be closed -->\r\n<!-- \u26a0\ufe0f Make sure to browse the opened and closed issues -->\r\n\r\n### Information\r\n\r\n- **Qiskit Terra version**: 0.10.1\r\n- **Python version**: 3.7.3\r\n- **Operating system**: windows 10\r\n\r\n### What is the current behavior?\r\nFresh qiskit installation inside a new environment on windows 10. \r\nIn one of the terra tutorial (using_the_transpiler) `from qiskit.test.mock import FakeTokyo` is failing 'ModuleNotFoundError: No module named vcr'\r\n\r\n### Suggested solutions\r\n'pip install vcrpy' \r\n'vcrpy' needs to be added in requirements.\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\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\n\"\"\"Common utilities for Qiskit.\"\"\"\n\nimport platform\nimport re\nimport socket\nimport sys\nimport warnings\n\nimport psutil\nfrom marshmallow.warnings import ChangedInMarshmallow3Warning\n\n\ndef _check_python_version():\n    \"\"\"Check for Python version 3.5+.\"\"\"\n    if sys.version_info < (3, 5):\n        raise Exception('Qiskit requires Python version 3.5 or greater.')\n\n\ndef _filter_deprecation_warnings():\n    \"\"\"Apply filters to deprecation warnings.\n\n    Force the `DeprecationWarning` warnings to be displayed for the qiskit\n    module, overriding the system configuration as they are ignored by default\n    [1] for end-users. Additionally, silence the `ChangedInMarshmallow3Warning`\n    messages.\n\n    TODO: on Python 3.7, this might not be needed due to PEP-0565 [2].\n\n    [1] https://docs.python.org/3/library/warnings.html#default-warning-filters\n    [2] https://www.python.org/dev/peps/pep-0565/\n    \"\"\"\n    deprecation_filter = ('always', None, DeprecationWarning,\n                          re.compile(r'^qiskit\\.*', re.UNICODE), 0)\n\n    # Instead of using warnings.simple_filter() directly, the internal\n    # _add_filter() function is used for being able to match against the\n    # module.\n    try:\n        warnings._add_filter(*deprecation_filter, append=False)\n    except AttributeError:\n        # ._add_filter is internal and not available in some Python versions.\n        pass\n\n    # Add a filter for ignoring ChangedInMarshmallow3Warning, as we depend on\n    # marhsmallow 2 explicitly. 2.17.0 introduced new deprecation warnings that\n    # are useful for eventually migrating, but too verbose for our purposes.\n    warnings.simplefilter('ignore', category=ChangedInMarshmallow3Warning)\n\n\n_check_python_version()\n_filter_deprecation_warnings()\n\n\ndef local_hardware_info():\n    \"\"\"Basic hardware information about the local machine.\n\n    Gives actual number of CPU's in the machine, even when hyperthreading is\n    turned on. CPU count defaults to 1 when true count can't be determined.\n\n    Returns:\n        dict: The hardware information.\n    \"\"\"\n    results = {\n        'os': platform.system(),\n        'memory': psutil.virtual_memory().total / (1024 ** 3),\n        'cpus': psutil.cpu_count(logical=False) or 1\n    }\n    return results\n\n\ndef _has_connection(hostname, port):\n    \"\"\"Checks if internet connection exists to host via specified port.\n\n    If any exception is raised while trying to open a socket this will return\n    false.\n\n    Args:\n        hostname (str): Hostname to connect to.\n        port (int): Port to connect to\n\n    Returns:\n        bool: Has connection or not\n\n    \"\"\"\n    try:\n        host = socket.gethostbyname(hostname)\n        socket.create_connection((host, port), 2)\n        return True\n    except Exception:  # pylint: disable=broad-except\n        return False\n", "path": "qiskit/util.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\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\n\"\"\"Common utilities for Qiskit.\"\"\"\n\nimport platform\nimport re\nimport socket\nimport sys\nimport warnings\n\nimport psutil\nfrom marshmallow.warnings import ChangedInMarshmallow3Warning\n\n\ndef _check_python_version():\n    \"\"\"Check for Python version 3.5+.\"\"\"\n    if sys.version_info < (3, 5):\n        raise Exception('Qiskit requires Python version 3.5 or greater.')\n\n\ndef _filter_deprecation_warnings():\n    \"\"\"Apply filters to deprecation warnings.\n\n    Force the `DeprecationWarning` warnings to be displayed for the qiskit\n    module, overriding the system configuration as they are ignored by default\n    [1] for end-users. Additionally, silence the `ChangedInMarshmallow3Warning`\n    messages.\n\n    TODO: on Python 3.7, this might not be needed due to PEP-0565 [2].\n\n    [1] https://docs.python.org/3/library/warnings.html#default-warning-filters\n    [2] https://www.python.org/dev/peps/pep-0565/\n    \"\"\"\n    deprecation_filter = ('always', None, DeprecationWarning,\n                          re.compile(r'^qiskit\\.*', re.UNICODE), 0)\n\n    # Instead of using warnings.simple_filter() directly, the internal\n    # _add_filter() function is used for being able to match against the\n    # module.\n    try:\n        warnings._add_filter(*deprecation_filter, append=False)\n    except AttributeError:\n        # ._add_filter is internal and not available in some Python versions.\n        pass\n\n    # Add a filter for ignoring ChangedInMarshmallow3Warning, as we depend on\n    # marhsmallow 2 explicitly. 2.17.0 introduced new deprecation warnings that\n    # are useful for eventually migrating, but too verbose for our purposes.\n    warnings.simplefilter('ignore', category=ChangedInMarshmallow3Warning)\n\n\n_check_python_version()\n_filter_deprecation_warnings()\n\n\ndef local_hardware_info():\n    \"\"\"Basic hardware information about the local machine.\n\n    Gives actual number of CPU's in the machine, even when hyperthreading is\n    turned on. CPU count defaults to 1 when true count can't be determined.\n\n    Returns:\n        dict: The hardware information.\n    \"\"\"\n    results = {\n        'os': platform.system(),\n        'memory': psutil.virtual_memory().total / (1024 ** 3),\n        'cpus': psutil.cpu_count(logical=False) or 1\n    }\n    return results\n\n\ndef _has_connection(hostname, port):\n    \"\"\"Checks if internet connection exists to host via specified port.\n\n    If any exception is raised while trying to open a socket this will return\n    false.\n\n    Args:\n        hostname (str): Hostname to connect to.\n        port (int): Port to connect to\n\n    Returns:\n        bool: Has connection or not\n\n    \"\"\"\n    try:\n        host = socket.gethostbyname(hostname)\n        socket.create_connection((host, port), 2).close()\n        return True\n    except Exception:  # pylint: disable=broad-except\n        return False\n", "path": "qiskit/util.py"}]}