We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
run_wrapper() got an unexpected keyword argument 'pure'
While running a fitting on a classifier (*output[0]* with data *output[1]* to *output[4]*), I get the following error; I think it's packages issue;

   > output[0].fit(output[1], output[2], output[3], output[4])
   > File "/usr/local/lib/python3.8/dist-packages/autosklearn/estimators.py", line 1045, in fit
     super().fit(
   > File "/usr/local/lib/python3.8/dist-packages/autosklearn/estimators.py", line 375, in fit
     self.automl_.fit(load_models=self.load_models, **kwargs)
   > File "/usr/local/lib/python3.8/dist-packages/autosklearn/automl.py", line 2056, in fit
     return super().fit(
   > File "/usr/local/lib/python3.8/dist-packages/autosklearn/automl.py", line 931, in fit
     _proc_smac.run_smbo()
   > File "/usr/local/lib/python3.8/dist-packages/autosklearn/smbo.py", line 498, in run_smbo
     smac.optimize()
   > File "/usr/local/lib/python3.8/dist-packages/smac/facade/smac_ac_facade.py", line 720, in optimize
     incumbent = self.solver.run()
   > File "/usr/local/lib/python3.8/dist-packages/smac/optimizer/smbo.py", line 287, in run
     self.tae_runner.submit_run(run_info=run_info)
   > File "/usr/local/lib/python3.8/dist-packages/smac/tae/dask_runner.py", line 166, in submit_run
     self.client.submit(
   > File "/usr/local/lib/python3.8/dist-packages/autosklearn/util/single_thread_client.py", line 59, in submit
     return DummyFuture(func(*args, **kwargs))
 > **TypeError: run_wrapper() got an unexpected keyword argument 'pure'**

It seems like it's an error with Dask. Here are the installed packages on ubuntu 18.04

pandas==1.3.0
scikit-learn==0.24
dask==2021.12.0
auto-sklearn==0.14.5    #AutoML
tensorflow==2.8.0

I've tried all versions of dask from 2021.12.0 to 2022.02.0 (Current) and nothing seems to work. Downgrading to auto-sklearn 0.14.4 and lower didn't solve the problem.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `autosklearn/util/single_thread_client.py`
Content:
```
1 import typing
2 from pathlib import Path
3 
4 import dask.distributed
5 
6 
7 class DummyFuture(dask.distributed.Future):
8     """
9     A class that mimics a distributed Future, the outcome of
10     performing submit on a distributed client.
11     """
12     def __init__(self, result: typing.Any) -> None:
13         self._result = result  # type: typing.Any
14 
15     def result(self, timeout: typing.Optional[int] = None) -> typing.Any:
16         return self._result
17 
18     def cancel(self) -> None:
19         pass
20 
21     def done(self) -> bool:
22         return True
23 
24     def __repr__(self) -> str:
25         return "DummyFuture: {}".format(self._result)
26 
27     def __del__(self) -> None:
28         pass
29 
30 
31 class SingleThreadedClient(dask.distributed.Client):
32     """
33     A class to Mock the Distributed Client class, in case
34     Auto-Sklearn is meant to run in the current Thread.
35     """
36     def __init__(self) -> None:
37 
38         # Raise a not implemented error if using a method from Client
39         implemented_methods = ['submit', 'close', 'shutdown', 'write_scheduler_file',
40                                '_get_scheduler_info', 'nthreads']
41         method_list = [func for func in dir(dask.distributed.Client) if callable(
42             getattr(dask.distributed.Client, func)) and not func.startswith('__')]
43         for method in method_list:
44             if method in implemented_methods:
45                 continue
46             setattr(self, method, self._unsupported_method)
47         pass
48 
49     def _unsupported_method(self) -> None:
50         raise NotImplementedError()
51 
52     def submit(
53         self,
54         func: typing.Callable,
55         *args: typing.List,
56         priority: int = 0,
57         **kwargs: typing.Dict,
58     ) -> typing.Any:
59         return DummyFuture(func(*args, **kwargs))
60 
61     def close(self) -> None:
62         pass
63 
64     def shutdown(self) -> None:
65         pass
66 
67     def write_scheduler_file(self, scheduler_file: str) -> None:
68         Path(scheduler_file).touch()
69         return
70 
71     def _get_scheduler_info(self) -> typing.Dict:
72         return {
73             'workers': ['127.0.0.1'],
74             'type': 'Scheduler',
75         }
76 
77     def nthreads(self) -> typing.Dict:
78         return {
79             '127.0.0.1': 1,
80         }
81 
82     def __repr__(self) -> str:
83         return 'SingleThreadedClient()'
84 
85     def __del__(self) -> None:
86         pass
87
```

Path: `autosklearn/__version__.py`
Content:
```
1 """Version information."""
2 
3 # The following line *must* be the last in the module, exactly as formatted:
4 __version__ = "0.14.4"
5
```
--- 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/autosklearn/__version__.py b/autosklearn/__version__.py
--- a/autosklearn/__version__.py
+++ b/autosklearn/__version__.py
@@ -1,4 +1,4 @@
 """Version information."""
 
 # The following line *must* be the last in the module, exactly as formatted:
-__version__ = "0.14.4"
+__version__ = "0.14.6"
diff --git a/autosklearn/util/single_thread_client.py b/autosklearn/util/single_thread_client.py
--- a/autosklearn/util/single_thread_client.py
+++ b/autosklearn/util/single_thread_client.py
@@ -1,5 +1,6 @@
 import typing
 from pathlib import Path
+from typing import Any
 
 import dask.distributed
 
@@ -9,6 +10,7 @@
     A class that mimics a distributed Future, the outcome of
     performing submit on a distributed client.
     """
+
     def __init__(self, result: typing.Any) -> None:
         self._result = result  # type: typing.Any
 
@@ -33,13 +35,24 @@
     A class to Mock the Distributed Client class, in case
     Auto-Sklearn is meant to run in the current Thread.
     """
+
     def __init__(self) -> None:
 
         # Raise a not implemented error if using a method from Client
-        implemented_methods = ['submit', 'close', 'shutdown', 'write_scheduler_file',
-                               '_get_scheduler_info', 'nthreads']
-        method_list = [func for func in dir(dask.distributed.Client) if callable(
-            getattr(dask.distributed.Client, func)) and not func.startswith('__')]
+        implemented_methods = [
+            "submit",
+            "close",
+            "shutdown",
+            "write_scheduler_file",
+            "_get_scheduler_info",
+            "nthreads",
+        ]
+        method_list = [
+            func
+            for func in dir(dask.distributed.Client)
+            if callable(getattr(dask.distributed.Client, func))
+            and not func.startswith("__")
+        ]
         for method in method_list:
             if method in implemented_methods:
                 continue
@@ -54,8 +67,24 @@
         func: typing.Callable,
         *args: typing.List,
         priority: int = 0,
-        **kwargs: typing.Dict,
+        key: Any = None,
+        workers: Any = None,
+        resources: Any = None,
+        retries: Any = None,
+        fifo_timeout: Any = "100 ms",
+        allow_other_workers: Any = False,
+        actor: Any = False,
+        actors: Any = False,
+        pure: Any = None,
+        **kwargs: Any,
     ) -> typing.Any:
+        """
+        Note
+        ----
+        The keyword arguments caught in `dask.distributed.Client` need to
+        be specified here so they don't get passed in as ``**kwargs`` to the
+        ``func``.
+        """
         return DummyFuture(func(*args, **kwargs))
 
     def close(self) -> None:
@@ -70,17 +99,17 @@
 
     def _get_scheduler_info(self) -> typing.Dict:
         return {
-            'workers': ['127.0.0.1'],
-            'type': 'Scheduler',
+            "workers": ["127.0.0.1"],
+            "type": "Scheduler",
         }
 
     def nthreads(self) -> typing.Dict:
         return {
-            '127.0.0.1': 1,
+            "127.0.0.1": 1,
         }
 
     def __repr__(self) -> str:
-        return 'SingleThreadedClient()'
+        return "SingleThreadedClient()"
 
     def __del__(self) -> None:
         pass

{"golden_diff": "diff --git a/autosklearn/__version__.py b/autosklearn/__version__.py\n--- a/autosklearn/__version__.py\n+++ b/autosklearn/__version__.py\n@@ -1,4 +1,4 @@\n \"\"\"Version information.\"\"\"\n \n # The following line *must* be the last in the module, exactly as formatted:\n-__version__ = \"0.14.4\"\n+__version__ = \"0.14.6\"\ndiff --git a/autosklearn/util/single_thread_client.py b/autosklearn/util/single_thread_client.py\n--- a/autosklearn/util/single_thread_client.py\n+++ b/autosklearn/util/single_thread_client.py\n@@ -1,5 +1,6 @@\n import typing\n from pathlib import Path\n+from typing import Any\n \n import dask.distributed\n \n@@ -9,6 +10,7 @@\n     A class that mimics a distributed Future, the outcome of\n     performing submit on a distributed client.\n     \"\"\"\n+\n     def __init__(self, result: typing.Any) -> None:\n         self._result = result  # type: typing.Any\n \n@@ -33,13 +35,24 @@\n     A class to Mock the Distributed Client class, in case\n     Auto-Sklearn is meant to run in the current Thread.\n     \"\"\"\n+\n     def __init__(self) -> None:\n \n         # Raise a not implemented error if using a method from Client\n-        implemented_methods = ['submit', 'close', 'shutdown', 'write_scheduler_file',\n-                               '_get_scheduler_info', 'nthreads']\n-        method_list = [func for func in dir(dask.distributed.Client) if callable(\n-            getattr(dask.distributed.Client, func)) and not func.startswith('__')]\n+        implemented_methods = [\n+            \"submit\",\n+            \"close\",\n+            \"shutdown\",\n+            \"write_scheduler_file\",\n+            \"_get_scheduler_info\",\n+            \"nthreads\",\n+        ]\n+        method_list = [\n+            func\n+            for func in dir(dask.distributed.Client)\n+            if callable(getattr(dask.distributed.Client, func))\n+            and not func.startswith(\"__\")\n+        ]\n         for method in method_list:\n             if method in implemented_methods:\n                 continue\n@@ -54,8 +67,24 @@\n         func: typing.Callable,\n         *args: typing.List,\n         priority: int = 0,\n-        **kwargs: typing.Dict,\n+        key: Any = None,\n+        workers: Any = None,\n+        resources: Any = None,\n+        retries: Any = None,\n+        fifo_timeout: Any = \"100 ms\",\n+        allow_other_workers: Any = False,\n+        actor: Any = False,\n+        actors: Any = False,\n+        pure: Any = None,\n+        **kwargs: Any,\n     ) -> typing.Any:\n+        \"\"\"\n+        Note\n+        ----\n+        The keyword arguments caught in `dask.distributed.Client` need to\n+        be specified here so they don't get passed in as ``**kwargs`` to the\n+        ``func``.\n+        \"\"\"\n         return DummyFuture(func(*args, **kwargs))\n \n     def close(self) -> None:\n@@ -70,17 +99,17 @@\n \n     def _get_scheduler_info(self) -> typing.Dict:\n         return {\n-            'workers': ['127.0.0.1'],\n-            'type': 'Scheduler',\n+            \"workers\": [\"127.0.0.1\"],\n+            \"type\": \"Scheduler\",\n         }\n \n     def nthreads(self) -> typing.Dict:\n         return {\n-            '127.0.0.1': 1,\n+            \"127.0.0.1\": 1,\n         }\n \n     def __repr__(self) -> str:\n-        return 'SingleThreadedClient()'\n+        return \"SingleThreadedClient()\"\n \n     def __del__(self) -> None:\n         pass\n", "issue": "run_wrapper() got an unexpected keyword argument 'pure'\nWhile running a fitting on a classifier (*output[0]* with data *output[1]* to *output[4]*), I get the following error; I think it's packages issue;\r\n\r\n   > output[0].fit(output[1], output[2], output[3], output[4])\r\n   > File \"/usr/local/lib/python3.8/dist-packages/autosklearn/estimators.py\", line 1045, in fit\r\n     super().fit(\r\n   > File \"/usr/local/lib/python3.8/dist-packages/autosklearn/estimators.py\", line 375, in fit\r\n     self.automl_.fit(load_models=self.load_models, **kwargs)\r\n   > File \"/usr/local/lib/python3.8/dist-packages/autosklearn/automl.py\", line 2056, in fit\r\n     return super().fit(\r\n   > File \"/usr/local/lib/python3.8/dist-packages/autosklearn/automl.py\", line 931, in fit\r\n     _proc_smac.run_smbo()\r\n   > File \"/usr/local/lib/python3.8/dist-packages/autosklearn/smbo.py\", line 498, in run_smbo\r\n     smac.optimize()\r\n   > File \"/usr/local/lib/python3.8/dist-packages/smac/facade/smac_ac_facade.py\", line 720, in optimize\r\n     incumbent = self.solver.run()\r\n   > File \"/usr/local/lib/python3.8/dist-packages/smac/optimizer/smbo.py\", line 287, in run\r\n     self.tae_runner.submit_run(run_info=run_info)\r\n   > File \"/usr/local/lib/python3.8/dist-packages/smac/tae/dask_runner.py\", line 166, in submit_run\r\n     self.client.submit(\r\n   > File \"/usr/local/lib/python3.8/dist-packages/autosklearn/util/single_thread_client.py\", line 59, in submit\r\n     return DummyFuture(func(*args, **kwargs))\r\n > **TypeError: run_wrapper() got an unexpected keyword argument 'pure'**\r\n\r\nIt seems like it's an error with Dask. Here are the installed packages on ubuntu 18.04\r\n\r\npandas==1.3.0\r\nscikit-learn==0.24\r\ndask==2021.12.0\r\nauto-sklearn==0.14.5    #AutoML\r\ntensorflow==2.8.0\r\n\r\nI've tried all versions of dask from 2021.12.0 to 2022.02.0 (Current) and nothing seems to work. Downgrading to auto-sklearn 0.14.4 and lower didn't solve the problem.\n", "before_files": [{"content": "import typing\nfrom pathlib import Path\n\nimport dask.distributed\n\n\nclass DummyFuture(dask.distributed.Future):\n    \"\"\"\n    A class that mimics a distributed Future, the outcome of\n    performing submit on a distributed client.\n    \"\"\"\n    def __init__(self, result: typing.Any) -> None:\n        self._result = result  # type: typing.Any\n\n    def result(self, timeout: typing.Optional[int] = None) -> typing.Any:\n        return self._result\n\n    def cancel(self) -> None:\n        pass\n\n    def done(self) -> bool:\n        return True\n\n    def __repr__(self) -> str:\n        return \"DummyFuture: {}\".format(self._result)\n\n    def __del__(self) -> None:\n        pass\n\n\nclass SingleThreadedClient(dask.distributed.Client):\n    \"\"\"\n    A class to Mock the Distributed Client class, in case\n    Auto-Sklearn is meant to run in the current Thread.\n    \"\"\"\n    def __init__(self) -> None:\n\n        # Raise a not implemented error if using a method from Client\n        implemented_methods = ['submit', 'close', 'shutdown', 'write_scheduler_file',\n                               '_get_scheduler_info', 'nthreads']\n        method_list = [func for func in dir(dask.distributed.Client) if callable(\n            getattr(dask.distributed.Client, func)) and not func.startswith('__')]\n        for method in method_list:\n            if method in implemented_methods:\n                continue\n            setattr(self, method, self._unsupported_method)\n        pass\n\n    def _unsupported_method(self) -> None:\n        raise NotImplementedError()\n\n    def submit(\n        self,\n        func: typing.Callable,\n        *args: typing.List,\n        priority: int = 0,\n        **kwargs: typing.Dict,\n    ) -> typing.Any:\n        return DummyFuture(func(*args, **kwargs))\n\n    def close(self) -> None:\n        pass\n\n    def shutdown(self) -> None:\n        pass\n\n    def write_scheduler_file(self, scheduler_file: str) -> None:\n        Path(scheduler_file).touch()\n        return\n\n    def _get_scheduler_info(self) -> typing.Dict:\n        return {\n            'workers': ['127.0.0.1'],\n            'type': 'Scheduler',\n        }\n\n    def nthreads(self) -> typing.Dict:\n        return {\n            '127.0.0.1': 1,\n        }\n\n    def __repr__(self) -> str:\n        return 'SingleThreadedClient()'\n\n    def __del__(self) -> None:\n        pass\n", "path": "autosklearn/util/single_thread_client.py"}, {"content": "\"\"\"Version information.\"\"\"\n\n# The following line *must* be the last in the module, exactly as formatted:\n__version__ = \"0.14.4\"\n", "path": "autosklearn/__version__.py"}], "after_files": [{"content": "import typing\nfrom pathlib import Path\nfrom typing import Any\n\nimport dask.distributed\n\n\nclass DummyFuture(dask.distributed.Future):\n    \"\"\"\n    A class that mimics a distributed Future, the outcome of\n    performing submit on a distributed client.\n    \"\"\"\n\n    def __init__(self, result: typing.Any) -> None:\n        self._result = result  # type: typing.Any\n\n    def result(self, timeout: typing.Optional[int] = None) -> typing.Any:\n        return self._result\n\n    def cancel(self) -> None:\n        pass\n\n    def done(self) -> bool:\n        return True\n\n    def __repr__(self) -> str:\n        return \"DummyFuture: {}\".format(self._result)\n\n    def __del__(self) -> None:\n        pass\n\n\nclass SingleThreadedClient(dask.distributed.Client):\n    \"\"\"\n    A class to Mock the Distributed Client class, in case\n    Auto-Sklearn is meant to run in the current Thread.\n    \"\"\"\n\n    def __init__(self) -> None:\n\n        # Raise a not implemented error if using a method from Client\n        implemented_methods = [\n            \"submit\",\n            \"close\",\n            \"shutdown\",\n            \"write_scheduler_file\",\n            \"_get_scheduler_info\",\n            \"nthreads\",\n        ]\n        method_list = [\n            func\n            for func in dir(dask.distributed.Client)\n            if callable(getattr(dask.distributed.Client, func))\n            and not func.startswith(\"__\")\n        ]\n        for method in method_list:\n            if method in implemented_methods:\n                continue\n            setattr(self, method, self._unsupported_method)\n        pass\n\n    def _unsupported_method(self) -> None:\n        raise NotImplementedError()\n\n    def submit(\n        self,\n        func: typing.Callable,\n        *args: typing.List,\n        priority: int = 0,\n        key: Any = None,\n        workers: Any = None,\n        resources: Any = None,\n        retries: Any = None,\n        fifo_timeout: Any = \"100 ms\",\n        allow_other_workers: Any = False,\n        actor: Any = False,\n        actors: Any = False,\n        pure: Any = None,\n        **kwargs: Any,\n    ) -> typing.Any:\n        \"\"\"\n        Note\n        ----\n        The keyword arguments caught in `dask.distributed.Client` need to\n        be specified here so they don't get passed in as ``**kwargs`` to the\n        ``func``.\n        \"\"\"\n        return DummyFuture(func(*args, **kwargs))\n\n    def close(self) -> None:\n        pass\n\n    def shutdown(self) -> None:\n        pass\n\n    def write_scheduler_file(self, scheduler_file: str) -> None:\n        Path(scheduler_file).touch()\n        return\n\n    def _get_scheduler_info(self) -> typing.Dict:\n        return {\n            \"workers\": [\"127.0.0.1\"],\n            \"type\": \"Scheduler\",\n        }\n\n    def nthreads(self) -> typing.Dict:\n        return {\n            \"127.0.0.1\": 1,\n        }\n\n    def __repr__(self) -> str:\n        return \"SingleThreadedClient()\"\n\n    def __del__(self) -> None:\n        pass\n", "path": "autosklearn/util/single_thread_client.py"}, {"content": "\"\"\"Version information.\"\"\"\n\n# The following line *must* be the last in the module, exactly as formatted:\n__version__ = \"0.14.6\"\n", "path": "autosklearn/__version__.py"}]}