We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Python 3.5 deprecation FutureWarning in Nilearn 0.6.0
Python 3.5 will be EOL'd in September 2020. I will add a FutureWarning before release of Nilearn 0.6.0 stable, and we can drop support for it for Nilearn 0.8.0 stable.
@GaelVaroquaux 

--- 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/__init__.py`
Content:
```
1 """
2 Machine Learning module for NeuroImaging in python
3 --------------------------------------------------
4 
5 Documentation is available in the docstrings and online at
6 http://nilearn.github.io.
7 
8 Contents
9 --------
10 Nilearn aims at simplifying the use of the scikit-learn package in the context of
11 neuroimaging. It provides specific input/output functions, algorithms and
12 visualization tools.
13 
14 Submodules
15 ---------
16 datasets                --- Utilities to download NeuroImaging datasets
17 decoding                --- Decoding tools and algorithms
18 decomposition           --- Includes a subject level variant of the ICA
19                             algorithm called Canonical ICA
20 connectome              --- Set of tools for computing functional connectivity matrices
21                             and for sparse multi-subjects learning of Gaussian graphical models
22 image                   --- Set of functions defining mathematical operations
23                             working on Niimg-like objects
24 input_data              --- includes scikit-learn tranformers and tools to
25                             preprocess neuro-imaging data
26 masking                 --- Utilities to compute and operate on brain masks
27 mass_univariate         --- Defines a Massively Univariate Linear Model
28                             estimated with OLS and permutation test
29 plotting                --- Plotting code for nilearn
30 region                  --- Set of functions for extracting region-defined
31                             signals, clustering methods, connected regions extraction
32 signal                  --- Set of preprocessing functions for time series
33 """
34 
35 import gzip
36 import sys
37 import warnings
38 import os
39 
40 from distutils.version import LooseVersion
41 
42 from .version import _check_module_dependencies, __version__
43 
44 # Workaround issue discovered in intel-openmp 2019.5:
45 # https://github.com/ContinuumIO/anaconda-issues/issues/11294
46 #
47 # see also https://github.com/scikit-learn/scikit-learn/pull/15020
48 os.environ.setdefault("KMP_INIT_AT_FORK", "FALSE")
49 
50 def _py2_deprecation_warning():
51     py2_warning = ('Python2 support is deprecated and will be removed in '
52                    'the next release. Consider switching to Python 3.6 or 3.7.'
53                    )
54     warnings.filterwarnings('once', message=py2_warning)
55     warnings.warn(message=py2_warning,
56                   category=DeprecationWarning,
57                   stacklevel=3,
58                   )
59 
60 def _py34_deprecation_warning():
61     py34_warning = ('Python 3.4 support is deprecated and will be removed in '
62                    'the next release. Consider switching to Python 3.6 or 3.7.'
63                    )
64     warnings.filterwarnings('once', message=py34_warning)
65     warnings.warn(message=py34_warning,
66                   category=DeprecationWarning,
67                   stacklevel=3,
68                   )
69 
70 
71 def _python_deprecation_warnings():
72     if sys.version_info.major == 2:
73         _py2_deprecation_warning()
74     elif sys.version_info.major == 3 and sys.version_info.minor == 4:
75         _py34_deprecation_warning()
76 
77 
78 _check_module_dependencies()
79 _python_deprecation_warnings()
80 
81 # Temporary work around to address formatting issues in doc tests
82 # with NumPy 1.14. NumPy had made more consistent str/repr formatting
83 # of numpy arrays. Hence we print the options to old versions.
84 import numpy as np
85 if LooseVersion(np.__version__) >= LooseVersion("1.14"):
86     # See issue #1600 in nilearn for reason to add try and except
87     try:
88         from ._utils.testing import is_nose_running
89         if is_nose_running():
90             np.set_printoptions(legacy='1.13')
91     except ImportError:
92         pass
93 
94 # Monkey-patch gzip to have faster reads on large gzip files
95 if hasattr(gzip.GzipFile, 'max_read_chunk'):
96     gzip.GzipFile.max_read_chunk = 100 * 1024 * 1024  # 100Mb
97 
98 # Boolean controlling the default globbing technique when using check_niimg
99 # and the os.path.expanduser usage in CacheMixin.
100 # Default value it True, set it to False to completely deactivate this
101 # behavior.
102 EXPAND_PATH_WILDCARDS = True
103 
104 # Boolean controlling whether the joblib caches should be
105 # flushed if the version of certain modules changes (eg nibabel, as it
106 # does not respect the backward compatibility in some of its internal
107 # structures
108 # This  is used in nilearn._utils.cache_mixin
109 CHECK_CACHE_VERSION = True
110 
111 # list all submodules available in nilearn and version
112 __all__ = ['datasets', 'decoding', 'decomposition', 'connectome',
113            'image', 'input_data', 'masking', 'mass_univariate', 'plotting',
114            'region', 'signal', 'surface', 'parcellations', '__version__']
115 
116
```
--- 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/__init__.py b/nilearn/__init__.py
--- a/nilearn/__init__.py
+++ b/nilearn/__init__.py
@@ -47,32 +47,21 @@
 # see also https://github.com/scikit-learn/scikit-learn/pull/15020
 os.environ.setdefault("KMP_INIT_AT_FORK", "FALSE")
 
-def _py2_deprecation_warning():
-    py2_warning = ('Python2 support is deprecated and will be removed in '
-                   'the next release. Consider switching to Python 3.6 or 3.7.'
-                   )
-    warnings.filterwarnings('once', message=py2_warning)
-    warnings.warn(message=py2_warning,
-                  category=DeprecationWarning,
-                  stacklevel=3,
-                  )
 
-def _py34_deprecation_warning():
-    py34_warning = ('Python 3.4 support is deprecated and will be removed in '
-                   'the next release. Consider switching to Python 3.6 or 3.7.'
-                   )
-    warnings.filterwarnings('once', message=py34_warning)
-    warnings.warn(message=py34_warning,
-                  category=DeprecationWarning,
+def _py35_deprecation_warning():
+    py35_warning = ('Python 3.5 support is deprecated and will be removed in '
+                    'a future release. Consider switching to Python 3.6 or 3.7'
+                    )
+    warnings.filterwarnings('once', message=py35_warning)
+    warnings.warn(message=py35_warning,
+                  category=FutureWarning,
                   stacklevel=3,
                   )
 
 
 def _python_deprecation_warnings():
-    if sys.version_info.major == 2:
-        _py2_deprecation_warning()
-    elif sys.version_info.major == 3 and sys.version_info.minor == 4:
-        _py34_deprecation_warning()
+    if sys.version_info.major == 3 and sys.version_info.minor == 5:
+        _py35_deprecation_warning()
 
 
 _check_module_dependencies()

{"golden_diff": "diff --git a/nilearn/__init__.py b/nilearn/__init__.py\n--- a/nilearn/__init__.py\n+++ b/nilearn/__init__.py\n@@ -47,32 +47,21 @@\n # see also https://github.com/scikit-learn/scikit-learn/pull/15020\n os.environ.setdefault(\"KMP_INIT_AT_FORK\", \"FALSE\")\n \n-def _py2_deprecation_warning():\n-    py2_warning = ('Python2 support is deprecated and will be removed in '\n-                   'the next release. Consider switching to Python 3.6 or 3.7.'\n-                   )\n-    warnings.filterwarnings('once', message=py2_warning)\n-    warnings.warn(message=py2_warning,\n-                  category=DeprecationWarning,\n-                  stacklevel=3,\n-                  )\n \n-def _py34_deprecation_warning():\n-    py34_warning = ('Python 3.4 support is deprecated and will be removed in '\n-                   'the next release. Consider switching to Python 3.6 or 3.7.'\n-                   )\n-    warnings.filterwarnings('once', message=py34_warning)\n-    warnings.warn(message=py34_warning,\n-                  category=DeprecationWarning,\n+def _py35_deprecation_warning():\n+    py35_warning = ('Python 3.5 support is deprecated and will be removed in '\n+                    'a future release. Consider switching to Python 3.6 or 3.7'\n+                    )\n+    warnings.filterwarnings('once', message=py35_warning)\n+    warnings.warn(message=py35_warning,\n+                  category=FutureWarning,\n                   stacklevel=3,\n                   )\n \n \n def _python_deprecation_warnings():\n-    if sys.version_info.major == 2:\n-        _py2_deprecation_warning()\n-    elif sys.version_info.major == 3 and sys.version_info.minor == 4:\n-        _py34_deprecation_warning()\n+    if sys.version_info.major == 3 and sys.version_info.minor == 5:\n+        _py35_deprecation_warning()\n \n \n _check_module_dependencies()\n", "issue": "Python 3.5 deprecation FutureWarning in Nilearn 0.6.0\nPython 3.5 will be EOL'd in September 2020. I will add a FutureWarning before release of Nilearn 0.6.0 stable, and we can drop support for it for Nilearn 0.8.0 stable.\r\n@GaelVaroquaux \n", "before_files": [{"content": "\"\"\"\nMachine Learning module for NeuroImaging in python\n--------------------------------------------------\n\nDocumentation is available in the docstrings and online at\nhttp://nilearn.github.io.\n\nContents\n--------\nNilearn aims at simplifying the use of the scikit-learn package in the context of\nneuroimaging. It provides specific input/output functions, algorithms and\nvisualization tools.\n\nSubmodules\n---------\ndatasets                --- Utilities to download NeuroImaging datasets\ndecoding                --- Decoding tools and algorithms\ndecomposition           --- Includes a subject level variant of the ICA\n                            algorithm called Canonical ICA\nconnectome              --- Set of tools for computing functional connectivity matrices\n                            and for sparse multi-subjects learning of Gaussian graphical models\nimage                   --- Set of functions defining mathematical operations\n                            working on Niimg-like objects\ninput_data              --- includes scikit-learn tranformers and tools to\n                            preprocess neuro-imaging data\nmasking                 --- Utilities to compute and operate on brain masks\nmass_univariate         --- Defines a Massively Univariate Linear Model\n                            estimated with OLS and permutation test\nplotting                --- Plotting code for nilearn\nregion                  --- Set of functions for extracting region-defined\n                            signals, clustering methods, connected regions extraction\nsignal                  --- Set of preprocessing functions for time series\n\"\"\"\n\nimport gzip\nimport sys\nimport warnings\nimport os\n\nfrom distutils.version import LooseVersion\n\nfrom .version import _check_module_dependencies, __version__\n\n# Workaround issue discovered in intel-openmp 2019.5:\n# https://github.com/ContinuumIO/anaconda-issues/issues/11294\n#\n# see also https://github.com/scikit-learn/scikit-learn/pull/15020\nos.environ.setdefault(\"KMP_INIT_AT_FORK\", \"FALSE\")\n\ndef _py2_deprecation_warning():\n    py2_warning = ('Python2 support is deprecated and will be removed in '\n                   'the next release. Consider switching to Python 3.6 or 3.7.'\n                   )\n    warnings.filterwarnings('once', message=py2_warning)\n    warnings.warn(message=py2_warning,\n                  category=DeprecationWarning,\n                  stacklevel=3,\n                  )\n\ndef _py34_deprecation_warning():\n    py34_warning = ('Python 3.4 support is deprecated and will be removed in '\n                   'the next release. Consider switching to Python 3.6 or 3.7.'\n                   )\n    warnings.filterwarnings('once', message=py34_warning)\n    warnings.warn(message=py34_warning,\n                  category=DeprecationWarning,\n                  stacklevel=3,\n                  )\n\n\ndef _python_deprecation_warnings():\n    if sys.version_info.major == 2:\n        _py2_deprecation_warning()\n    elif sys.version_info.major == 3 and sys.version_info.minor == 4:\n        _py34_deprecation_warning()\n\n\n_check_module_dependencies()\n_python_deprecation_warnings()\n\n# Temporary work around to address formatting issues in doc tests\n# with NumPy 1.14. NumPy had made more consistent str/repr formatting\n# of numpy arrays. Hence we print the options to old versions.\nimport numpy as np\nif LooseVersion(np.__version__) >= LooseVersion(\"1.14\"):\n    # See issue #1600 in nilearn for reason to add try and except\n    try:\n        from ._utils.testing import is_nose_running\n        if is_nose_running():\n            np.set_printoptions(legacy='1.13')\n    except ImportError:\n        pass\n\n# Monkey-patch gzip to have faster reads on large gzip files\nif hasattr(gzip.GzipFile, 'max_read_chunk'):\n    gzip.GzipFile.max_read_chunk = 100 * 1024 * 1024  # 100Mb\n\n# Boolean controlling the default globbing technique when using check_niimg\n# and the os.path.expanduser usage in CacheMixin.\n# Default value it True, set it to False to completely deactivate this\n# behavior.\nEXPAND_PATH_WILDCARDS = True\n\n# Boolean controlling whether the joblib caches should be\n# flushed if the version of certain modules changes (eg nibabel, as it\n# does not respect the backward compatibility in some of its internal\n# structures\n# This  is used in nilearn._utils.cache_mixin\nCHECK_CACHE_VERSION = True\n\n# list all submodules available in nilearn and version\n__all__ = ['datasets', 'decoding', 'decomposition', 'connectome',\n           'image', 'input_data', 'masking', 'mass_univariate', 'plotting',\n           'region', 'signal', 'surface', 'parcellations', '__version__']\n\n", "path": "nilearn/__init__.py"}], "after_files": [{"content": "\"\"\"\nMachine Learning module for NeuroImaging in python\n--------------------------------------------------\n\nDocumentation is available in the docstrings and online at\nhttp://nilearn.github.io.\n\nContents\n--------\nNilearn aims at simplifying the use of the scikit-learn package in the context of\nneuroimaging. It provides specific input/output functions, algorithms and\nvisualization tools.\n\nSubmodules\n---------\ndatasets                --- Utilities to download NeuroImaging datasets\ndecoding                --- Decoding tools and algorithms\ndecomposition           --- Includes a subject level variant of the ICA\n                            algorithm called Canonical ICA\nconnectome              --- Set of tools for computing functional connectivity matrices\n                            and for sparse multi-subjects learning of Gaussian graphical models\nimage                   --- Set of functions defining mathematical operations\n                            working on Niimg-like objects\ninput_data              --- includes scikit-learn tranformers and tools to\n                            preprocess neuro-imaging data\nmasking                 --- Utilities to compute and operate on brain masks\nmass_univariate         --- Defines a Massively Univariate Linear Model\n                            estimated with OLS and permutation test\nplotting                --- Plotting code for nilearn\nregion                  --- Set of functions for extracting region-defined\n                            signals, clustering methods, connected regions extraction\nsignal                  --- Set of preprocessing functions for time series\n\"\"\"\n\nimport gzip\nimport sys\nimport warnings\nimport os\n\nfrom distutils.version import LooseVersion\n\nfrom .version import _check_module_dependencies, __version__\n\n# Workaround issue discovered in intel-openmp 2019.5:\n# https://github.com/ContinuumIO/anaconda-issues/issues/11294\n#\n# see also https://github.com/scikit-learn/scikit-learn/pull/15020\nos.environ.setdefault(\"KMP_INIT_AT_FORK\", \"FALSE\")\n\n\ndef _py35_deprecation_warning():\n    py35_warning = ('Python 3.5 support is deprecated and will be removed in '\n                    'a future release. Consider switching to Python 3.6 or 3.7'\n                    )\n    warnings.filterwarnings('once', message=py35_warning)\n    warnings.warn(message=py35_warning,\n                  category=FutureWarning,\n                  stacklevel=3,\n                  )\n\n\ndef _python_deprecation_warnings():\n    if sys.version_info.major == 3 and sys.version_info.minor == 5:\n        _py35_deprecation_warning()\n\n\n_check_module_dependencies()\n_python_deprecation_warnings()\n\n# Temporary work around to address formatting issues in doc tests\n# with NumPy 1.14. NumPy had made more consistent str/repr formatting\n# of numpy arrays. Hence we print the options to old versions.\nimport numpy as np\nif LooseVersion(np.__version__) >= LooseVersion(\"1.14\"):\n    # See issue #1600 in nilearn for reason to add try and except\n    try:\n        from ._utils.testing import is_nose_running\n        if is_nose_running():\n            np.set_printoptions(legacy='1.13')\n    except ImportError:\n        pass\n\n# Monkey-patch gzip to have faster reads on large gzip files\nif hasattr(gzip.GzipFile, 'max_read_chunk'):\n    gzip.GzipFile.max_read_chunk = 100 * 1024 * 1024  # 100Mb\n\n# Boolean controlling the default globbing technique when using check_niimg\n# and the os.path.expanduser usage in CacheMixin.\n# Default value it True, set it to False to completely deactivate this\n# behavior.\nEXPAND_PATH_WILDCARDS = True\n\n# Boolean controlling whether the joblib caches should be\n# flushed if the version of certain modules changes (eg nibabel, as it\n# does not respect the backward compatibility in some of its internal\n# structures\n# This  is used in nilearn._utils.cache_mixin\nCHECK_CACHE_VERSION = True\n\n# list all submodules available in nilearn and version\n__all__ = ['datasets', 'decoding', 'decomposition', 'connectome',\n           'image', 'input_data', 'masking', 'mass_univariate', 'plotting',\n           'region', 'signal', 'surface', 'parcellations', '__version__']\n\n", "path": "nilearn/__init__.py"}]}