We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Dropping scikit-learn dependency < 0.14.1
It makes easier to set base for decoder object in nilearn which actually requires lot of backports for versions. #1148 

I don't have great justifications though. Let me know if I miss something important in nilearn which we need to take into account dropping 0.13.

FYI: https://packages.debian.org/jessie/python-sklearn

Discussions are welcome.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `nilearn/version.py`
Content:
```
1 # *- encoding: utf-8 -*-
2 """
3 nilearn version, required package versions, and utilities for checking
4 """
5 # Author: Loïc Estève, Ben Cipollini
6 # License: simplified BSD
7 
8 # PEP0440 compatible formatted version, see:
9 # https://www.python.org/dev/peps/pep-0440/
10 #
11 # Generic release markers:
12 # X.Y
13 # X.Y.Z # For bugfix releases
14 #
15 # Admissible pre-release markers:
16 # X.YaN # Alpha release
17 # X.YbN # Beta release
18 # X.YrcN # Release Candidate
19 # X.Y # Final release
20 #
21 # Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
22 # 'X.Y.dev0' is the canonical version of 'X.Y.dev'
23 #
24 __version__ = '0.2.5'
25 
26 _NILEARN_INSTALL_MSG = 'See %s for installation information.' % (
27     'http://nilearn.github.io/introduction.html#installation')
28 
29 # This is a tuple to preserve order, so that dependencies are checked
30 #   in some meaningful order (more => less 'core').  We avoid using
31 #   collections.OrderedDict to preserve Python 2.6 compatibility.
32 REQUIRED_MODULE_METADATA = (
33     ('numpy', {
34         'min_version': '1.6.1',
35         'required_at_installation': True,
36         'install_info': _NILEARN_INSTALL_MSG}),
37     ('scipy', {
38         'min_version': '0.9.0',
39         'required_at_installation': True,
40         'install_info': _NILEARN_INSTALL_MSG}),
41     ('sklearn', {
42         'min_version': '0.13',
43         'required_at_installation': True,
44         'install_info': _NILEARN_INSTALL_MSG}),
45     ('nibabel', {
46         'min_version': '1.1.0',
47         'required_at_installation': False}))
48 
49 OPTIONAL_MATPLOTLIB_MIN_VERSION = '1.1.1'
50 
51 
52 def _import_module_with_version_check(
53         module_name,
54         minimum_version,
55         install_info=None):
56     """Check that module is installed with a recent enough version
57     """
58     from distutils.version import LooseVersion
59 
60     try:
61         module = __import__(module_name)
62     except ImportError as exc:
63         user_friendly_info = ('Module "{0}" could not be found. {1}').format(
64             module_name,
65             install_info or 'Please install it properly to use nilearn.')
66         exc.args += (user_friendly_info,)
67         raise
68 
69     # Avoid choking on modules with no __version__ attribute
70     module_version = getattr(module, '__version__', '0.0.0')
71 
72     version_too_old = (not LooseVersion(module_version) >=
73                        LooseVersion(minimum_version))
74 
75     if version_too_old:
76         message = (
77             'A {module_name} version of at least {minimum_version} '
78             'is required to use nilearn. {module_version} was found. '
79             'Please upgrade {module_name}').format(
80                 module_name=module_name,
81                 minimum_version=minimum_version,
82                 module_version=module_version)
83 
84         raise ImportError(message)
85 
86     return module
87 
88 
89 def _check_module_dependencies(is_nilearn_installing=False):
90     """Throw an exception if nilearn dependencies are not installed.
91 
92     Parameters
93     ----------
94     is_nilearn_installing: boolean
95         if True, only error on missing packages that cannot be auto-installed.
96         if False, error on any missing package.
97 
98     Throws
99     -------
100     ImportError
101     """
102 
103     for (module_name, module_metadata) in REQUIRED_MODULE_METADATA:
104         if not (is_nilearn_installing and
105                 not module_metadata['required_at_installation']):
106             # Skip check only when installing and it's a module that
107             # will be auto-installed.
108             _import_module_with_version_check(
109                 module_name=module_name,
110                 minimum_version=module_metadata['min_version'],
111                 install_info=module_metadata.get('install_info'))
112
```
--- 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/nilearn/version.py b/nilearn/version.py
--- a/nilearn/version.py
+++ b/nilearn/version.py
@@ -39,7 +39,7 @@
         'required_at_installation': True,
         'install_info': _NILEARN_INSTALL_MSG}),
     ('sklearn', {
-        'min_version': '0.13',
+        'min_version': '0.14.1',
         'required_at_installation': True,
         'install_info': _NILEARN_INSTALL_MSG}),
     ('nibabel', {

{"golden_diff": "diff --git a/nilearn/version.py b/nilearn/version.py\n--- a/nilearn/version.py\n+++ b/nilearn/version.py\n@@ -39,7 +39,7 @@\n         'required_at_installation': True,\n         'install_info': _NILEARN_INSTALL_MSG}),\n     ('sklearn', {\n-        'min_version': '0.13',\n+        'min_version': '0.14.1',\n         'required_at_installation': True,\n         'install_info': _NILEARN_INSTALL_MSG}),\n     ('nibabel', {\n", "issue": "Dropping scikit-learn dependency < 0.14.1\nIt makes easier to set base for decoder object in nilearn which actually requires lot of backports for versions. #1148 \n\nI don't have great justifications though. Let me know if I miss something important in nilearn which we need to take into account dropping 0.13.\n\nFYI: https://packages.debian.org/jessie/python-sklearn\n\nDiscussions are welcome.\n\n", "before_files": [{"content": "# *- encoding: utf-8 -*-\n\"\"\"\nnilearn version, required package versions, and utilities for checking\n\"\"\"\n# Author: Lo\u00efc Est\u00e8ve, Ben Cipollini\n# License: simplified BSD\n\n# PEP0440 compatible formatted version, see:\n# https://www.python.org/dev/peps/pep-0440/\n#\n# Generic release markers:\n# X.Y\n# X.Y.Z # For bugfix releases\n#\n# Admissible pre-release markers:\n# X.YaN # Alpha release\n# X.YbN # Beta release\n# X.YrcN # Release Candidate\n# X.Y # Final release\n#\n# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.\n# 'X.Y.dev0' is the canonical version of 'X.Y.dev'\n#\n__version__ = '0.2.5'\n\n_NILEARN_INSTALL_MSG = 'See %s for installation information.' % (\n    'http://nilearn.github.io/introduction.html#installation')\n\n# This is a tuple to preserve order, so that dependencies are checked\n#   in some meaningful order (more => less 'core').  We avoid using\n#   collections.OrderedDict to preserve Python 2.6 compatibility.\nREQUIRED_MODULE_METADATA = (\n    ('numpy', {\n        'min_version': '1.6.1',\n        'required_at_installation': True,\n        'install_info': _NILEARN_INSTALL_MSG}),\n    ('scipy', {\n        'min_version': '0.9.0',\n        'required_at_installation': True,\n        'install_info': _NILEARN_INSTALL_MSG}),\n    ('sklearn', {\n        'min_version': '0.13',\n        'required_at_installation': True,\n        'install_info': _NILEARN_INSTALL_MSG}),\n    ('nibabel', {\n        'min_version': '1.1.0',\n        'required_at_installation': False}))\n\nOPTIONAL_MATPLOTLIB_MIN_VERSION = '1.1.1'\n\n\ndef _import_module_with_version_check(\n        module_name,\n        minimum_version,\n        install_info=None):\n    \"\"\"Check that module is installed with a recent enough version\n    \"\"\"\n    from distutils.version import LooseVersion\n\n    try:\n        module = __import__(module_name)\n    except ImportError as exc:\n        user_friendly_info = ('Module \"{0}\" could not be found. {1}').format(\n            module_name,\n            install_info or 'Please install it properly to use nilearn.')\n        exc.args += (user_friendly_info,)\n        raise\n\n    # Avoid choking on modules with no __version__ attribute\n    module_version = getattr(module, '__version__', '0.0.0')\n\n    version_too_old = (not LooseVersion(module_version) >=\n                       LooseVersion(minimum_version))\n\n    if version_too_old:\n        message = (\n            'A {module_name} version of at least {minimum_version} '\n            'is required to use nilearn. {module_version} was found. '\n            'Please upgrade {module_name}').format(\n                module_name=module_name,\n                minimum_version=minimum_version,\n                module_version=module_version)\n\n        raise ImportError(message)\n\n    return module\n\n\ndef _check_module_dependencies(is_nilearn_installing=False):\n    \"\"\"Throw an exception if nilearn dependencies are not installed.\n\n    Parameters\n    ----------\n    is_nilearn_installing: boolean\n        if True, only error on missing packages that cannot be auto-installed.\n        if False, error on any missing package.\n\n    Throws\n    -------\n    ImportError\n    \"\"\"\n\n    for (module_name, module_metadata) in REQUIRED_MODULE_METADATA:\n        if not (is_nilearn_installing and\n                not module_metadata['required_at_installation']):\n            # Skip check only when installing and it's a module that\n            # will be auto-installed.\n            _import_module_with_version_check(\n                module_name=module_name,\n                minimum_version=module_metadata['min_version'],\n                install_info=module_metadata.get('install_info'))\n", "path": "nilearn/version.py"}], "after_files": [{"content": "# *- encoding: utf-8 -*-\n\"\"\"\nnilearn version, required package versions, and utilities for checking\n\"\"\"\n# Author: Lo\u00efc Est\u00e8ve, Ben Cipollini\n# License: simplified BSD\n\n# PEP0440 compatible formatted version, see:\n# https://www.python.org/dev/peps/pep-0440/\n#\n# Generic release markers:\n# X.Y\n# X.Y.Z # For bugfix releases\n#\n# Admissible pre-release markers:\n# X.YaN # Alpha release\n# X.YbN # Beta release\n# X.YrcN # Release Candidate\n# X.Y # Final release\n#\n# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.\n# 'X.Y.dev0' is the canonical version of 'X.Y.dev'\n#\n__version__ = '0.2.5'\n\n_NILEARN_INSTALL_MSG = 'See %s for installation information.' % (\n    'http://nilearn.github.io/introduction.html#installation')\n\n# This is a tuple to preserve order, so that dependencies are checked\n#   in some meaningful order (more => less 'core').  We avoid using\n#   collections.OrderedDict to preserve Python 2.6 compatibility.\nREQUIRED_MODULE_METADATA = (\n    ('numpy', {\n        'min_version': '1.6.1',\n        'required_at_installation': True,\n        'install_info': _NILEARN_INSTALL_MSG}),\n    ('scipy', {\n        'min_version': '0.9.0',\n        'required_at_installation': True,\n        'install_info': _NILEARN_INSTALL_MSG}),\n    ('sklearn', {\n        'min_version': '0.14.1',\n        'required_at_installation': True,\n        'install_info': _NILEARN_INSTALL_MSG}),\n    ('nibabel', {\n        'min_version': '1.1.0',\n        'required_at_installation': False}))\n\nOPTIONAL_MATPLOTLIB_MIN_VERSION = '1.1.1'\n\n\ndef _import_module_with_version_check(\n        module_name,\n        minimum_version,\n        install_info=None):\n    \"\"\"Check that module is installed with a recent enough version\n    \"\"\"\n    from distutils.version import LooseVersion\n\n    try:\n        module = __import__(module_name)\n    except ImportError as exc:\n        user_friendly_info = ('Module \"{0}\" could not be found. {1}').format(\n            module_name,\n            install_info or 'Please install it properly to use nilearn.')\n        exc.args += (user_friendly_info,)\n        raise\n\n    # Avoid choking on modules with no __version__ attribute\n    module_version = getattr(module, '__version__', '0.0.0')\n\n    version_too_old = (not LooseVersion(module_version) >=\n                       LooseVersion(minimum_version))\n\n    if version_too_old:\n        message = (\n            'A {module_name} version of at least {minimum_version} '\n            'is required to use nilearn. {module_version} was found. '\n            'Please upgrade {module_name}').format(\n                module_name=module_name,\n                minimum_version=minimum_version,\n                module_version=module_version)\n\n        raise ImportError(message)\n\n    return module\n\n\ndef _check_module_dependencies(is_nilearn_installing=False):\n    \"\"\"Throw an exception if nilearn dependencies are not installed.\n\n    Parameters\n    ----------\n    is_nilearn_installing: boolean\n        if True, only error on missing packages that cannot be auto-installed.\n        if False, error on any missing package.\n\n    Throws\n    -------\n    ImportError\n    \"\"\"\n\n    for (module_name, module_metadata) in REQUIRED_MODULE_METADATA:\n        if not (is_nilearn_installing and\n                not module_metadata['required_at_installation']):\n            # Skip check only when installing and it's a module that\n            # will be auto-installed.\n            _import_module_with_version_check(\n                module_name=module_name,\n                minimum_version=module_metadata['min_version'],\n                install_info=module_metadata.get('install_info'))\n", "path": "nilearn/version.py"}]}