We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Do not raise `NotImplemented`
In a few places we raise `NotImplemented`, which itself raises a `SyntaxError`; this should be `NotImplementedError`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `parsl/app/app.py`
Content:
```
1 '''
2 Parsl Apps
3 ==========
4 
5 Here lies the definitions for the @App decorator and the APP classes.
6 The APP class encapsulates a generic leaf task that can be executed asynchronously.
7 
8 '''
9 import logging
10 from inspect import signature, Parameter
11 
12 # Logging moved here in the PEP8 conformance fixes.
13 logger = logging.getLogger(__name__)
14 
15 
16 class AppBase (object):
17     """
18     This is the base class that defines the two external facing functions that an App must define.
19     The  __init__ () which is called when the interpretor sees the definition of the decorated
20     function, and the __call__ () which is invoked when a decorated function is called by the user.
21 
22     """
23 
24     def __init__(self, func, executor, walltime=60, sites='all', cache=False, exec_type="bash"):
25         ''' Constructor for the APP object.
26 
27         Args:
28              - func (function): Takes the function to be made into an App
29              - executor (executor): Executor for the execution resource
30 
31         Kwargs:
32              - walltime (int) : Walltime in seconds for the app execution
33              - sites (str|list) : List of site names that this app could execute over. default is 'all'
34              - exec_type (string) : App type (bash|python)
35              - cache (Bool) : Enable caching of this app ?
36 
37         Returns:
38              - APP object.
39 
40         '''
41         self.__name__ = func.__name__
42         self.func = func
43         self.executor = executor
44         self.exec_type = exec_type
45         self.status = 'created'
46         self.sites = sites
47         self.cache = cache
48 
49         sig = signature(func)
50         self.kwargs = {}
51         for s in sig.parameters:
52             if sig.parameters[s].default != Parameter.empty:
53                 self.kwargs[s] = sig.parameters[s].default
54 
55         self.stdout = sig.parameters['stdout'].default if 'stdout' in sig.parameters else None
56         self.stderr = sig.parameters['stderr'].default if 'stderr' in sig.parameters else None
57         self.inputs = sig.parameters['inputs'].default if 'inputs' in sig.parameters else []
58         self.outputs = sig.parameters['outputs'].default if 'outputs' in sig.parameters else []
59 
60     def __call__(self, *args, **kwargs):
61         ''' The __call__ function must be implemented in the subclasses
62         '''
63         raise NotImplemented
64 
65 
66 def app_wrapper(func):
67 
68     def wrapper(*args, **kwargs):
69         logger.debug("App wrapper begins")
70         x = func(*args, **kwargs)
71         logger.debug("App wrapper ends")
72         return x
73 
74     return wrapper
75 
76 
77 def App(apptype, executor, walltime=60, cache=False, sites='all'):
78     ''' The App decorator function
79 
80     Args:
81         - apptype (string) : Apptype can be bash|python
82         - executor (Executor) : Executor object wrapping threads/process pools etc.
83 
84     Kwargs:
85         - walltime (int) : Walltime for app in seconds,
86              default=60
87         - sites (str|List) : List of site names on which the app could execute
88              default='all'
89         - cache (Bool) : Enable caching of the app call
90              default=False
91 
92     Returns:
93          An AppFactory object, which when called runs the apps through the executor.
94     '''
95 
96     from parsl import APP_FACTORY_FACTORY
97 
98     def Exec(f):
99         return APP_FACTORY_FACTORY.make(apptype, executor, f,
100                                         sites=sites,
101                                         cache=cache,
102                                         walltime=walltime)
103 
104     return Exec
105
```

Path: `parsl/executors/threads.py`
Content:
```
1 import logging
2 import sys
3 import concurrent.futures as cf
4 from parsl.executors.base import ParslExecutor
5 
6 logger = logging.getLogger(__name__)
7 
8 
9 class ThreadPoolExecutor(ParslExecutor):
10     ''' The thread pool executor
11     '''
12 
13     def __init__(self, max_workers=2, thread_name_prefix='',
14                  execution_provider=None, config=None, **kwargs):
15         ''' Initialize the thread pool
16         Config options that are really used are :
17 
18         config.sites.site.execution.options = {"maxThreads" : <int>,
19                                                "threadNamePrefix" : <string>}
20 
21         Kwargs:
22            - max_workers (int) : Number of threads (Default=2) (keeping name workers/threads for backward compatibility)
23            - thread_name_prefix (string) : Thread name prefix (Only supported in python v3.6+
24            - execution_provider (ep object) : This is ignored here
25            - config (dict): The config dict object for the site:
26 
27 
28         '''
29 
30         self._scaling_enabled = False
31         if not config:
32             config = {"execution": {}}
33         if "maxThreads" not in config["execution"]:
34             config["execution"]["maxThreads"] = max_workers
35         if "threadNamePrefix" not in config["execution"]:
36             config["execution"]["threadNamePrefix"] = thread_name_prefix
37 
38         self.config = config
39 
40         if sys.version_info > (3, 6):
41             self.executor = cf.ThreadPoolExecutor(max_workers=config["execution"]["maxThreads"],
42                                                   thread_name_prefix=config["execution"]["threadNamePrefix"])
43         else:
44             self.executor = cf.ThreadPoolExecutor(max_workers=config["execution"]["maxThreads"])
45 
46     @property
47     def scaling_enabled(self):
48         return self._scaling_enabled
49 
50     def submit(self, *args, **kwargs):
51         ''' Submits work to the thread pool
52         This method is simply pass through and behaves like a submit call as described
53         here `Python docs: <https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor>`_
54 
55         Returns:
56               Future
57         '''
58 
59         return self.executor.submit(*args, **kwargs)
60 
61     def scale_out(self, workers=1):
62         ''' Scales out the number of active workers by 1
63         This method is notImplemented for threads and will raise the error if called.
64 
65         Raises:
66              NotImplemented exception
67         '''
68 
69         raise NotImplemented
70 
71     def scale_in(self, workers=1):
72         ''' Scale in the number of active workers by 1
73         This method is notImplemented for threads and will raise the error if called.
74 
75         Raises:
76              NotImplemented exception
77         '''
78 
79         raise NotImplemented
80 
81     def shutdown(self, block=False):
82         ''' Shutdown the ThreadPool
83         This method is notImplemented for threads and will raise the error if called.
84         The interface documentation for IPP is `here <http://ipyparallel.readthedocs.io/en/latest/api/ipyparallel.html#ipyparallel.Client.shutdown>`_
85 
86         Kwargs:
87             - block (Bool): To block for confirmations or not
88 
89         '''
90         x = self.executor.shutdown(wait=block)
91         logger.debug("Done with executor shutdown")
92         return x
93
```
--- 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/parsl/app/app.py b/parsl/app/app.py
--- a/parsl/app/app.py
+++ b/parsl/app/app.py
@@ -60,7 +60,7 @@
     def __call__(self, *args, **kwargs):
         ''' The __call__ function must be implemented in the subclasses
         '''
-        raise NotImplemented
+        raise NotImplementedError
 
 
 def app_wrapper(func):
diff --git a/parsl/executors/threads.py b/parsl/executors/threads.py
--- a/parsl/executors/threads.py
+++ b/parsl/executors/threads.py
@@ -66,7 +66,7 @@
              NotImplemented exception
         '''
 
-        raise NotImplemented
+        raise NotImplementedError
 
     def scale_in(self, workers=1):
         ''' Scale in the number of active workers by 1
@@ -76,7 +76,7 @@
              NotImplemented exception
         '''
 
-        raise NotImplemented
+        raise NotImplementedError
 
     def shutdown(self, block=False):
         ''' Shutdown the ThreadPool

{"golden_diff": "diff --git a/parsl/app/app.py b/parsl/app/app.py\n--- a/parsl/app/app.py\n+++ b/parsl/app/app.py\n@@ -60,7 +60,7 @@\n     def __call__(self, *args, **kwargs):\n         ''' The __call__ function must be implemented in the subclasses\n         '''\n-        raise NotImplemented\n+        raise NotImplementedError\n \n \n def app_wrapper(func):\ndiff --git a/parsl/executors/threads.py b/parsl/executors/threads.py\n--- a/parsl/executors/threads.py\n+++ b/parsl/executors/threads.py\n@@ -66,7 +66,7 @@\n              NotImplemented exception\n         '''\n \n-        raise NotImplemented\n+        raise NotImplementedError\n \n     def scale_in(self, workers=1):\n         ''' Scale in the number of active workers by 1\n@@ -76,7 +76,7 @@\n              NotImplemented exception\n         '''\n \n-        raise NotImplemented\n+        raise NotImplementedError\n \n     def shutdown(self, block=False):\n         ''' Shutdown the ThreadPool\n", "issue": "Do not raise `NotImplemented`\nIn a few places we raise `NotImplemented`, which itself raises a `SyntaxError`; this should be `NotImplementedError`.\n", "before_files": [{"content": "'''\nParsl Apps\n==========\n\nHere lies the definitions for the @App decorator and the APP classes.\nThe APP class encapsulates a generic leaf task that can be executed asynchronously.\n\n'''\nimport logging\nfrom inspect import signature, Parameter\n\n# Logging moved here in the PEP8 conformance fixes.\nlogger = logging.getLogger(__name__)\n\n\nclass AppBase (object):\n    \"\"\"\n    This is the base class that defines the two external facing functions that an App must define.\n    The  __init__ () which is called when the interpretor sees the definition of the decorated\n    function, and the __call__ () which is invoked when a decorated function is called by the user.\n\n    \"\"\"\n\n    def __init__(self, func, executor, walltime=60, sites='all', cache=False, exec_type=\"bash\"):\n        ''' Constructor for the APP object.\n\n        Args:\n             - func (function): Takes the function to be made into an App\n             - executor (executor): Executor for the execution resource\n\n        Kwargs:\n             - walltime (int) : Walltime in seconds for the app execution\n             - sites (str|list) : List of site names that this app could execute over. default is 'all'\n             - exec_type (string) : App type (bash|python)\n             - cache (Bool) : Enable caching of this app ?\n\n        Returns:\n             - APP object.\n\n        '''\n        self.__name__ = func.__name__\n        self.func = func\n        self.executor = executor\n        self.exec_type = exec_type\n        self.status = 'created'\n        self.sites = sites\n        self.cache = cache\n\n        sig = signature(func)\n        self.kwargs = {}\n        for s in sig.parameters:\n            if sig.parameters[s].default != Parameter.empty:\n                self.kwargs[s] = sig.parameters[s].default\n\n        self.stdout = sig.parameters['stdout'].default if 'stdout' in sig.parameters else None\n        self.stderr = sig.parameters['stderr'].default if 'stderr' in sig.parameters else None\n        self.inputs = sig.parameters['inputs'].default if 'inputs' in sig.parameters else []\n        self.outputs = sig.parameters['outputs'].default if 'outputs' in sig.parameters else []\n\n    def __call__(self, *args, **kwargs):\n        ''' The __call__ function must be implemented in the subclasses\n        '''\n        raise NotImplemented\n\n\ndef app_wrapper(func):\n\n    def wrapper(*args, **kwargs):\n        logger.debug(\"App wrapper begins\")\n        x = func(*args, **kwargs)\n        logger.debug(\"App wrapper ends\")\n        return x\n\n    return wrapper\n\n\ndef App(apptype, executor, walltime=60, cache=False, sites='all'):\n    ''' The App decorator function\n\n    Args:\n        - apptype (string) : Apptype can be bash|python\n        - executor (Executor) : Executor object wrapping threads/process pools etc.\n\n    Kwargs:\n        - walltime (int) : Walltime for app in seconds,\n             default=60\n        - sites (str|List) : List of site names on which the app could execute\n             default='all'\n        - cache (Bool) : Enable caching of the app call\n             default=False\n\n    Returns:\n         An AppFactory object, which when called runs the apps through the executor.\n    '''\n\n    from parsl import APP_FACTORY_FACTORY\n\n    def Exec(f):\n        return APP_FACTORY_FACTORY.make(apptype, executor, f,\n                                        sites=sites,\n                                        cache=cache,\n                                        walltime=walltime)\n\n    return Exec\n", "path": "parsl/app/app.py"}, {"content": "import logging\nimport sys\nimport concurrent.futures as cf\nfrom parsl.executors.base import ParslExecutor\n\nlogger = logging.getLogger(__name__)\n\n\nclass ThreadPoolExecutor(ParslExecutor):\n    ''' The thread pool executor\n    '''\n\n    def __init__(self, max_workers=2, thread_name_prefix='',\n                 execution_provider=None, config=None, **kwargs):\n        ''' Initialize the thread pool\n        Config options that are really used are :\n\n        config.sites.site.execution.options = {\"maxThreads\" : <int>,\n                                               \"threadNamePrefix\" : <string>}\n\n        Kwargs:\n           - max_workers (int) : Number of threads (Default=2) (keeping name workers/threads for backward compatibility)\n           - thread_name_prefix (string) : Thread name prefix (Only supported in python v3.6+\n           - execution_provider (ep object) : This is ignored here\n           - config (dict): The config dict object for the site:\n\n\n        '''\n\n        self._scaling_enabled = False\n        if not config:\n            config = {\"execution\": {}}\n        if \"maxThreads\" not in config[\"execution\"]:\n            config[\"execution\"][\"maxThreads\"] = max_workers\n        if \"threadNamePrefix\" not in config[\"execution\"]:\n            config[\"execution\"][\"threadNamePrefix\"] = thread_name_prefix\n\n        self.config = config\n\n        if sys.version_info > (3, 6):\n            self.executor = cf.ThreadPoolExecutor(max_workers=config[\"execution\"][\"maxThreads\"],\n                                                  thread_name_prefix=config[\"execution\"][\"threadNamePrefix\"])\n        else:\n            self.executor = cf.ThreadPoolExecutor(max_workers=config[\"execution\"][\"maxThreads\"])\n\n    @property\n    def scaling_enabled(self):\n        return self._scaling_enabled\n\n    def submit(self, *args, **kwargs):\n        ''' Submits work to the thread pool\n        This method is simply pass through and behaves like a submit call as described\n        here `Python docs: <https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor>`_\n\n        Returns:\n              Future\n        '''\n\n        return self.executor.submit(*args, **kwargs)\n\n    def scale_out(self, workers=1):\n        ''' Scales out the number of active workers by 1\n        This method is notImplemented for threads and will raise the error if called.\n\n        Raises:\n             NotImplemented exception\n        '''\n\n        raise NotImplemented\n\n    def scale_in(self, workers=1):\n        ''' Scale in the number of active workers by 1\n        This method is notImplemented for threads and will raise the error if called.\n\n        Raises:\n             NotImplemented exception\n        '''\n\n        raise NotImplemented\n\n    def shutdown(self, block=False):\n        ''' Shutdown the ThreadPool\n        This method is notImplemented for threads and will raise the error if called.\n        The interface documentation for IPP is `here <http://ipyparallel.readthedocs.io/en/latest/api/ipyparallel.html#ipyparallel.Client.shutdown>`_\n\n        Kwargs:\n            - block (Bool): To block for confirmations or not\n\n        '''\n        x = self.executor.shutdown(wait=block)\n        logger.debug(\"Done with executor shutdown\")\n        return x\n", "path": "parsl/executors/threads.py"}], "after_files": [{"content": "'''\nParsl Apps\n==========\n\nHere lies the definitions for the @App decorator and the APP classes.\nThe APP class encapsulates a generic leaf task that can be executed asynchronously.\n\n'''\nimport logging\nfrom inspect import signature, Parameter\n\n# Logging moved here in the PEP8 conformance fixes.\nlogger = logging.getLogger(__name__)\n\n\nclass AppBase (object):\n    \"\"\"\n    This is the base class that defines the two external facing functions that an App must define.\n    The  __init__ () which is called when the interpretor sees the definition of the decorated\n    function, and the __call__ () which is invoked when a decorated function is called by the user.\n\n    \"\"\"\n\n    def __init__(self, func, executor, walltime=60, sites='all', cache=False, exec_type=\"bash\"):\n        ''' Constructor for the APP object.\n\n        Args:\n             - func (function): Takes the function to be made into an App\n             - executor (executor): Executor for the execution resource\n\n        Kwargs:\n             - walltime (int) : Walltime in seconds for the app execution\n             - sites (str|list) : List of site names that this app could execute over. default is 'all'\n             - exec_type (string) : App type (bash|python)\n             - cache (Bool) : Enable caching of this app ?\n\n        Returns:\n             - APP object.\n\n        '''\n        self.__name__ = func.__name__\n        self.func = func\n        self.executor = executor\n        self.exec_type = exec_type\n        self.status = 'created'\n        self.sites = sites\n        self.cache = cache\n\n        sig = signature(func)\n        self.kwargs = {}\n        for s in sig.parameters:\n            if sig.parameters[s].default != Parameter.empty:\n                self.kwargs[s] = sig.parameters[s].default\n\n        self.stdout = sig.parameters['stdout'].default if 'stdout' in sig.parameters else None\n        self.stderr = sig.parameters['stderr'].default if 'stderr' in sig.parameters else None\n        self.inputs = sig.parameters['inputs'].default if 'inputs' in sig.parameters else []\n        self.outputs = sig.parameters['outputs'].default if 'outputs' in sig.parameters else []\n\n    def __call__(self, *args, **kwargs):\n        ''' The __call__ function must be implemented in the subclasses\n        '''\n        raise NotImplementedError\n\n\ndef app_wrapper(func):\n\n    def wrapper(*args, **kwargs):\n        logger.debug(\"App wrapper begins\")\n        x = func(*args, **kwargs)\n        logger.debug(\"App wrapper ends\")\n        return x\n\n    return wrapper\n\n\ndef App(apptype, executor, walltime=60, cache=False, sites='all'):\n    ''' The App decorator function\n\n    Args:\n        - apptype (string) : Apptype can be bash|python\n        - executor (Executor) : Executor object wrapping threads/process pools etc.\n\n    Kwargs:\n        - walltime (int) : Walltime for app in seconds,\n             default=60\n        - sites (str|List) : List of site names on which the app could execute\n             default='all'\n        - cache (Bool) : Enable caching of the app call\n             default=False\n\n    Returns:\n         An AppFactory object, which when called runs the apps through the executor.\n    '''\n\n    from parsl import APP_FACTORY_FACTORY\n\n    def Exec(f):\n        return APP_FACTORY_FACTORY.make(apptype, executor, f,\n                                        sites=sites,\n                                        cache=cache,\n                                        walltime=walltime)\n\n    return Exec\n", "path": "parsl/app/app.py"}, {"content": "import logging\nimport sys\nimport concurrent.futures as cf\nfrom parsl.executors.base import ParslExecutor\n\nlogger = logging.getLogger(__name__)\n\n\nclass ThreadPoolExecutor(ParslExecutor):\n    ''' The thread pool executor\n    '''\n\n    def __init__(self, max_workers=2, thread_name_prefix='',\n                 execution_provider=None, config=None, **kwargs):\n        ''' Initialize the thread pool\n        Config options that are really used are :\n\n        config.sites.site.execution.options = {\"maxThreads\" : <int>,\n                                               \"threadNamePrefix\" : <string>}\n\n        Kwargs:\n           - max_workers (int) : Number of threads (Default=2) (keeping name workers/threads for backward compatibility)\n           - thread_name_prefix (string) : Thread name prefix (Only supported in python v3.6+\n           - execution_provider (ep object) : This is ignored here\n           - config (dict): The config dict object for the site:\n\n\n        '''\n\n        self._scaling_enabled = False\n        if not config:\n            config = {\"execution\": {}}\n        if \"maxThreads\" not in config[\"execution\"]:\n            config[\"execution\"][\"maxThreads\"] = max_workers\n        if \"threadNamePrefix\" not in config[\"execution\"]:\n            config[\"execution\"][\"threadNamePrefix\"] = thread_name_prefix\n\n        self.config = config\n\n        if sys.version_info > (3, 6):\n            self.executor = cf.ThreadPoolExecutor(max_workers=config[\"execution\"][\"maxThreads\"],\n                                                  thread_name_prefix=config[\"execution\"][\"threadNamePrefix\"])\n        else:\n            self.executor = cf.ThreadPoolExecutor(max_workers=config[\"execution\"][\"maxThreads\"])\n\n    @property\n    def scaling_enabled(self):\n        return self._scaling_enabled\n\n    def submit(self, *args, **kwargs):\n        ''' Submits work to the thread pool\n        This method is simply pass through and behaves like a submit call as described\n        here `Python docs: <https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor>`_\n\n        Returns:\n              Future\n        '''\n\n        return self.executor.submit(*args, **kwargs)\n\n    def scale_out(self, workers=1):\n        ''' Scales out the number of active workers by 1\n        This method is notImplemented for threads and will raise the error if called.\n\n        Raises:\n             NotImplemented exception\n        '''\n\n        raise NotImplementedError\n\n    def scale_in(self, workers=1):\n        ''' Scale in the number of active workers by 1\n        This method is notImplemented for threads and will raise the error if called.\n\n        Raises:\n             NotImplemented exception\n        '''\n\n        raise NotImplementedError\n\n    def shutdown(self, block=False):\n        ''' Shutdown the ThreadPool\n        This method is notImplemented for threads and will raise the error if called.\n        The interface documentation for IPP is `here <http://ipyparallel.readthedocs.io/en/latest/api/ipyparallel.html#ipyparallel.Client.shutdown>`_\n\n        Kwargs:\n            - block (Bool): To block for confirmations or not\n\n        '''\n        x = self.executor.shutdown(wait=block)\n        logger.debug(\"Done with executor shutdown\")\n        return x\n", "path": "parsl/executors/threads.py"}]}